Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
huang.tao
/
jmai-platform
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
67052241
authored
Dec 26, 2025
by
zhu.zewen
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
新增查询药品列表接口
parent
f22834e0
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
213 additions
and
28 deletions
jmai-physic/src/main/java/com/jmai/physic/controller/PhysicAmpouleController.java
jmai-physic/src/main/java/com/jmai/physic/controller/PhysicApplyController.java
jmai-physic/src/main/java/com/jmai/physic/controller/PhysicStorageAmpouleController.java
jmai-physic/src/main/java/com/jmai/physic/service/PhysicAmpouleService.java
jmai-physic/src/main/java/com/jmai/physic/service/PhysicApplyService.java
jmai-physic/src/main/java/com/jmai/physic/service/PhysicStorageAmpouleService.java
jmai-physic/src/main/java/com/jmai/physic/service/impl/PhysicAmpouleServiceImpl.java
jmai-physic/src/main/java/com/jmai/physic/service/impl/PhysicApplyServiceImpl.java
jmai-physic/src/main/java/com/jmai/physic/service/impl/PhysicRecordServiceImpl.java
jmai-physic/src/main/java/com/jmai/physic/service/impl/PhysicStorageAmpouleServiceImpl.java
jmai-physic/src/main/java/com/jmai/physic/service/impl/PhysicWarehouseServiceImpl.java
jmai-physic/src/main/java/com/jmai/physic/vo/PhysicApplyVO.java
jmai-physic/src/main/java/com/jmai/physic/controller/PhysicAmpouleController.java
View file @
67052241
package
com
.
jmai
.
physic
.
controller
;
package
com
.
jmai
.
physic
.
controller
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.jmai.physic.dto.PhysicAmpouleCreateReq
;
import
com.jmai.physic.dto.PhysicAmpouleCreateReq
;
import
com.jmai.physic.dto.PhysicAmpouleQueryReq
;
import
com.jmai.physic.dto.PhysicAmpouleQueryReq
;
import
com.jmai.physic.dto.PhysicAmpouleSignReq
;
import
com.jmai.physic.dto.PhysicAmpouleSignReq
;
import
com.jmai.physic.dto.Physic
StorageAmpouleSign
Req
;
import
com.jmai.physic.dto.Physic
Query
Req
;
import
com.jmai.physic.entity.PhysicAmpoule
;
import
com.jmai.physic.entity.PhysicAmpoule
;
import
com.jmai.physic.entity.PhysicStorageAmpoule
;
import
com.jmai.physic.service.PhysicAmpouleService
;
import
com.jmai.physic.service.PhysicAmpouleService
;
import
com.jmai.physic.vo.PhysicAmpouleUseVO
;
import
com.jmai.physic.vo.PhysicAmpouleUseVO
;
import
com.jmai.physic.vo.PhysicAmpouleVO
;
import
com.jmai.physic.vo.PhysicAmpouleVO
;
import
com.jmai.physic.vo.PhysicVO
;
import
com.jmai.sys.aop.Auth
;
import
com.jmai.sys.aop.Auth
;
import
com.jmai.sys.dto.ResponseData
;
import
com.jmai.sys.dto.ResponseData
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -22,7 +23,6 @@ import org.springframework.web.bind.annotation.*;
...
@@ -22,7 +23,6 @@ import org.springframework.web.bind.annotation.*;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.validation.Valid
;
import
javax.validation.Valid
;
import
javax.xml.transform.Result
;
import
java.util.List
;
import
java.util.List
;
@Slf4j
@Slf4j
...
@@ -65,4 +65,11 @@ public class PhysicAmpouleController {
...
@@ -65,4 +65,11 @@ public class PhysicAmpouleController {
PhysicAmpoule
ampoule
=
physicAmpouleService
.
sign
(
physicAmpouleSignReq
);
PhysicAmpoule
ampoule
=
physicAmpouleService
.
sign
(
physicAmpouleSignReq
);
return
ResponseData
.
ok
(
ampoule
);
return
ResponseData
.
ok
(
ampoule
);
}
}
@PostMapping
(
"/listPhysic"
)
@ApiOperation
(
value
=
"查询药品列表"
)
public
ResponseData
<
IPage
<
PhysicVO
>>
listPhysic
(
@RequestBody
PhysicQueryReq
req
)
{
IPage
<
PhysicVO
>
page
=
physicAmpouleService
.
listPhysic
(
req
);
return
ResponseData
.
ok
(
page
);
}
}
}
jmai-physic/src/main/java/com/jmai/physic/controller/PhysicApplyController.java
View file @
67052241
...
@@ -2,16 +2,13 @@ package com.jmai.physic.controller;
...
@@ -2,16 +2,13 @@ package com.jmai.physic.controller;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.jmai.physic.dto.PhysicApplyCreateReq
;
import
com.jmai.physic.dto.PhysicApplyCreateReq
;
import
com.jmai.physic.dto.PhysicApplyQueryReq
;
import
com.jmai.physic.dto.PhysicApplyQueryReq
;
import
com.jmai.physic.dto.PhysicApplySignReq
;
import
com.jmai.physic.dto.PhysicApplySignReq
;
import
com.jmai.physic.dto.PhysicWarehouseQueryReq
;
import
com.jmai.physic.dto.PhysicQueryReq
;
import
com.jmai.physic.entity.PhysicApply
;
import
com.jmai.physic.entity.PhysicWarehouse
;
import
com.jmai.physic.service.PhysicApplyService
;
import
com.jmai.physic.service.PhysicApplyService
;
import
com.jmai.physic.vo.PhysicApplyVO
;
import
com.jmai.physic.vo.PhysicApplyVO
;
import
com.jmai.physic.vo.Physic
Warehouse
VO
;
import
com.jmai.physic.vo.PhysicVO
;
import
com.jmai.sys.AbstractService
;
import
com.jmai.sys.AbstractService
;
import
com.jmai.sys.aop.Auth
;
import
com.jmai.sys.aop.Auth
;
import
com.jmai.sys.dto.ResponseData
;
import
com.jmai.sys.dto.ResponseData
;
...
@@ -77,4 +74,11 @@ public class PhysicApplyController extends AbstractService {
...
@@ -77,4 +74,11 @@ public class PhysicApplyController extends AbstractService {
public
IPage
<
PhysicApplyVO
>
listPage
(
@RequestBody
PhysicApplyQueryReq
req
)
{
public
IPage
<
PhysicApplyVO
>
listPage
(
@RequestBody
PhysicApplyQueryReq
req
)
{
return
physicApplyService
.
listPage
(
req
);
return
physicApplyService
.
listPage
(
req
);
}
}
@PostMapping
(
"/listPhysic"
)
@ApiOperation
(
value
=
"查询药品列表"
)
public
ResponseData
<
IPage
<
PhysicVO
>>
listPhysic
(
@RequestBody
PhysicQueryReq
req
)
{
IPage
<
PhysicVO
>
page
=
physicApplyService
.
listPhysic
(
req
);
return
ResponseData
.
ok
(
page
);
}
}
}
jmai-physic/src/main/java/com/jmai/physic/controller/PhysicStorageAmpouleController.java
View file @
67052241
package
com
.
jmai
.
physic
.
controller
;
package
com
.
jmai
.
physic
.
controller
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.jmai.physic.dto.*
;
import
com.jmai.physic.dto.*
;
import
com.jmai.physic.entity.PhysicStorageAmpoule
;
import
com.jmai.physic.entity.PhysicStorageAmpoule
;
import
com.jmai.physic.service.PhysicStorageAmpouleService
;
import
com.jmai.physic.service.PhysicStorageAmpouleService
;
import
com.jmai.physic.vo.PhysicStorageAmpouleVO
;
import
com.jmai.physic.vo.PhysicStorageAmpouleVO
;
import
com.jmai.physic.vo.PhysicVO
;
import
com.jmai.sys.AbstractService
;
import
com.jmai.sys.AbstractService
;
import
com.jmai.sys.aop.Auth
;
import
com.jmai.sys.aop.Auth
;
import
com.jmai.sys.ctx.SpringContextUtils
;
import
com.jmai.sys.ctx.SpringContextUtils
;
...
@@ -15,10 +17,7 @@ import io.swagger.annotations.ApiImplicitParam;
...
@@ -15,10 +17,7 @@ import io.swagger.annotations.ApiImplicitParam;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.validation.Valid
;
import
javax.validation.Valid
;
...
@@ -55,4 +54,11 @@ public class PhysicStorageAmpouleController extends AbstractService {
...
@@ -55,4 +54,11 @@ public class PhysicStorageAmpouleController extends AbstractService {
PhysicStorageAmpoule
ampoule
=
physicStorageAmpouleService
.
sign
(
physicStorageAmpouleSignReq
);
PhysicStorageAmpoule
ampoule
=
physicStorageAmpouleService
.
sign
(
physicStorageAmpouleSignReq
);
return
ResponseData
.
ok
(
ampoule
);
return
ResponseData
.
ok
(
ampoule
);
}
}
@PostMapping
(
"/listPhysic"
)
@ApiOperation
(
value
=
"查询药品列表"
)
public
ResponseData
<
IPage
<
PhysicVO
>>
listPhysic
(
@RequestBody
PhysicQueryReq
req
)
{
IPage
<
PhysicVO
>
page
=
physicStorageAmpouleService
.
listPhysic
(
req
);
return
ResponseData
.
ok
(
page
);
}
}
}
jmai-physic/src/main/java/com/jmai/physic/service/PhysicAmpouleService.java
View file @
67052241
package
com
.
jmai
.
physic
.
service
;
package
com
.
jmai
.
physic
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.jmai.physic.dto.PhysicAmpouleCreateReq
;
import
com.jmai.physic.dto.PhysicAmpouleCreateReq
;
import
com.jmai.physic.dto.PhysicAmpouleQueryReq
;
import
com.jmai.physic.dto.PhysicAmpouleQueryReq
;
import
com.jmai.physic.dto.PhysicAmpouleSignReq
;
import
com.jmai.physic.dto.PhysicAmpouleSignReq
;
import
com.jmai.physic.dto.PhysicQueryReq
;
import
com.jmai.physic.entity.PhysicAmpoule
;
import
com.jmai.physic.entity.PhysicAmpoule
;
import
com.jmai.physic.entity.PhysicStorageAmpoule
;
import
com.jmai.physic.vo.PhysicAmpouleUseVO
;
import
com.jmai.physic.vo.PhysicAmpouleUseVO
;
import
com.jmai.physic.vo.PhysicAmpouleVO
;
import
com.jmai.physic.vo.PhysicAmpouleVO
;
import
com.jmai.physic.vo.PhysicVO
;
import
java.util.List
;
import
java.util.List
;
...
@@ -21,4 +23,6 @@ public interface PhysicAmpouleService {
...
@@ -21,4 +23,6 @@ public interface PhysicAmpouleService {
PhysicAmpoule
sign
(
PhysicAmpouleSignReq
physicAmpouleSignReq
);
PhysicAmpoule
sign
(
PhysicAmpouleSignReq
physicAmpouleSignReq
);
PhysicAmpoule
getInfo
(
Long
id
);
PhysicAmpoule
getInfo
(
Long
id
);
IPage
<
PhysicVO
>
listPhysic
(
PhysicQueryReq
req
);
}
}
jmai-physic/src/main/java/com/jmai/physic/service/PhysicApplyService.java
View file @
67052241
package
com
.
jmai
.
physic
.
service
;
package
com
.
jmai
.
physic
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.jmai.physic.dto.PhysicApplyCreateReq
;
import
com.jmai.physic.dto.PhysicApplyCreateReq
;
import
com.jmai.physic.dto.PhysicApplyQueryReq
;
import
com.jmai.physic.dto.PhysicApplyQueryReq
;
import
com.jmai.physic.dto.PhysicQueryReq
;
import
com.jmai.physic.dto.PhysicApplySignReq
;
import
com.jmai.physic.dto.PhysicApplySignReq
;
import
com.jmai.physic.dto.PhysicWarehouseCreateReq
;
import
com.jmai.physic.entity.PhysicApply
;
import
com.jmai.physic.vo.PhysicApplyVO
;
import
com.jmai.physic.vo.PhysicApplyVO
;
import
com.jmai.physic.vo.Physic
Warehouse
VO
;
import
com.jmai.physic.vo.PhysicVO
;
import
java.util.List
;
import
java.util.List
;
...
@@ -26,4 +24,6 @@ public interface PhysicApplyService {
...
@@ -26,4 +24,6 @@ public interface PhysicApplyService {
IPage
<
PhysicApplyVO
>
listPage
(
PhysicApplyQueryReq
req
);
IPage
<
PhysicApplyVO
>
listPage
(
PhysicApplyQueryReq
req
);
IPage
<
PhysicVO
>
listPhysic
(
PhysicQueryReq
req
);
}
}
jmai-physic/src/main/java/com/jmai/physic/service/PhysicStorageAmpouleService.java
View file @
67052241
package
com
.
jmai
.
physic
.
service
;
package
com
.
jmai
.
physic
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.jmai.physic.dto.PhysicAmpouleQueryReq
;
import
com.jmai.physic.dto.PhysicAmpouleQueryReq
;
import
com.jmai.physic.dto.PhysicQueryReq
;
import
com.jmai.physic.dto.PhysicStorageAmpouleCreateReq
;
import
com.jmai.physic.dto.PhysicStorageAmpouleCreateReq
;
import
com.jmai.physic.dto.PhysicStorageAmpouleSignReq
;
import
com.jmai.physic.dto.PhysicStorageAmpouleSignReq
;
import
com.jmai.physic.entity.PhysicRecord
;
import
com.jmai.physic.entity.PhysicStorageAmpoule
;
import
com.jmai.physic.entity.PhysicStorageAmpoule
;
import
com.jmai.physic.vo.PhysicStorageAmpouleVO
;
import
com.jmai.physic.vo.PhysicStorageAmpouleVO
;
import
com.jmai.physic.vo.PhysicVO
;
public
interface
PhysicStorageAmpouleService
{
public
interface
PhysicStorageAmpouleService
{
void
create
(
PhysicStorageAmpouleCreateReq
req
);
void
create
(
PhysicStorageAmpouleCreateReq
req
);
...
@@ -17,4 +19,5 @@ public interface PhysicStorageAmpouleService {
...
@@ -17,4 +19,5 @@ public interface PhysicStorageAmpouleService {
PhysicStorageAmpoule
getInfo
(
Long
id
);
PhysicStorageAmpoule
getInfo
(
Long
id
);
IPage
<
PhysicVO
>
listPhysic
(
PhysicQueryReq
req
);
}
}
jmai-physic/src/main/java/com/jmai/physic/service/impl/PhysicAmpouleServiceImpl.java
View file @
67052241
...
@@ -2,18 +2,22 @@ package com.jmai.physic.service.impl;
...
@@ -2,18 +2,22 @@ package com.jmai.physic.service.impl;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.jmai.api.exception.ServiceException
;
import
com.jmai.api.exception.ServiceException
;
import
com.jmai.physic.cloudsign.CloudsignService
;
import
com.jmai.physic.cloudsign.CloudsignService
;
import
com.jmai.physic.dto.*
;
import
com.jmai.physic.dto.*
;
import
com.jmai.physic.entity.PhysicAmpoule
;
import
com.jmai.physic.entity.PhysicAmpoule
;
import
com.jmai.physic.entity.PhysicStorageAmpoule
;
import
com.jmai.physic.mapper.PhysicAmpouleMapper
;
import
com.jmai.physic.mapper.PhysicAmpouleMapper
;
import
com.jmai.physic.service.PhysicAmpouleService
;
import
com.jmai.physic.service.PhysicAmpouleService
;
import
com.jmai.physic.service.PhysicBillService
;
import
com.jmai.physic.service.PhysicBillService
;
import
com.jmai.physic.vo.PhysicAmpouleUseVO
;
import
com.jmai.physic.vo.PhysicAmpouleUseVO
;
import
com.jmai.physic.vo.PhysicAmpouleVO
;
import
com.jmai.physic.vo.PhysicAmpouleVO
;
import
com.jmai.physic.vo.PhysicVO
;
import
com.jmai.sys.AbstractService
;
import
com.jmai.sys.AbstractService
;
import
com.jmai.sys.consts.enums.RoleTypeEum
;
import
com.jmai.sys.consts.enums.RoleTypeEum
;
import
com.jmai.sys.ctx.SpringContextUtils
;
import
com.jmai.sys.ctx.SpringContextUtils
;
...
@@ -118,6 +122,56 @@ public class PhysicAmpouleServiceImpl extends AbstractService implements PhysicA
...
@@ -118,6 +122,56 @@ public class PhysicAmpouleServiceImpl extends AbstractService implements PhysicA
return
ampoule
;
return
ampoule
;
}
}
@Override
public
IPage
<
PhysicVO
>
listPhysic
(
PhysicQueryReq
req
)
{
LambdaQueryWrapper
<
PhysicAmpoule
>
query
=
Wrappers
.
lambdaQuery
(
PhysicAmpoule
.
class
)
.
like
(
ObjectUtil
.
isNotEmpty
(
req
.
getPhysicName
()),
PhysicAmpoule:
:
getPhysicName
,
req
.
getPhysicName
())
.
like
(
ObjectUtil
.
isNotEmpty
(
req
.
getPhysicType
()),
PhysicAmpoule:
:
getPhysicType
,
req
.
getPhysicType
())
.
like
(
ObjectUtil
.
isNotEmpty
(
req
.
getPhysicSpec
()),
PhysicAmpoule:
:
getPhysicSpec
,
req
.
getPhysicSpec
())
.
like
(
ObjectUtil
.
isNotEmpty
(
req
.
getFactoryName
()),
PhysicAmpoule:
:
getFactoryName
,
req
.
getFactoryName
())
.
like
(
ObjectUtil
.
isNotEmpty
(
req
.
getExpireDate
()),
PhysicAmpoule:
:
getExpireDate
,
req
.
getExpireDate
())
.
like
(
ObjectUtil
.
isNotEmpty
(
req
.
getBatchNo
()),
PhysicAmpoule:
:
getBatchNo
,
req
.
getBatchNo
())
.
eq
(
ObjectUtil
.
isNotEmpty
(
req
.
getStatus
()),
PhysicAmpoule:
:
getStatus
,
req
.
getStatus
());
// 关键字模糊查询
if
(
ObjectUtil
.
isNotEmpty
(
req
.
getKeyword
()))
{
query
.
and
(
wrapper
->
wrapper
.
like
(
PhysicAmpoule:
:
getPhysicName
,
req
.
getKeyword
())
.
or
().
like
(
PhysicAmpoule:
:
getPhysicType
,
req
.
getKeyword
())
.
or
().
like
(
PhysicAmpoule:
:
getPhysicSpec
,
req
.
getKeyword
())
.
or
().
like
(
PhysicAmpoule:
:
getFactoryName
,
req
.
getKeyword
())
.
or
().
like
(
PhysicAmpoule:
:
getExpireDate
,
req
.
getKeyword
())
.
or
().
like
(
PhysicAmpoule:
:
getBatchNo
,
req
.
getKeyword
())
);
}
query
.
orderByAsc
(
PhysicAmpoule:
:
getFactoryName
);
query
.
orderByAsc
(
PhysicAmpoule:
:
getPhysicName
);
query
.
orderByAsc
(
PhysicAmpoule:
:
getPhysicSpec
);
query
.
orderByDesc
(
PhysicAmpoule:
:
getExpireDate
);
query
.
orderByAsc
(
PhysicAmpoule:
:
getBatchNo
);
IPage
<
PhysicAmpoule
>
page
=
buildEmptyPage
(
req
);
page
=
physicAmpouleMapper
.
selectPage
(
page
,
query
);
return
convertTo
(
page
,
this
::
convertToPhysicVO
);
}
private
PhysicVO
convertToPhysicVO
(
PhysicAmpoule
bo
)
{
PhysicVO
vo
=
new
PhysicVO
();
vo
.
setPhysicName
(
bo
.
getPhysicName
());
vo
.
setPhysicSpec
(
bo
.
getPhysicSpec
());
vo
.
setPhysicType
(
bo
.
getPhysicType
());
vo
.
setUnit
(
bo
.
getUnit
());
vo
.
setFactoryName
(
bo
.
getFactoryName
());
vo
.
setExpireDate
(
bo
.
getExpireDate
());
vo
.
setBatchNo
(
bo
.
getBatchNo
());
// 注意:PhysicAmpoule实体类没有voucherNo、supplyName等字段
// 根据实际业务需求,这些字段可能需要从其他地方获取或留空
return
vo
;
}
private
String
getRate
(
BigDecimal
num1
,
BigDecimal
num2
){
private
String
getRate
(
BigDecimal
num1
,
BigDecimal
num2
){
return
num1
.
divide
(
num2
,
4
,
RoundingMode
.
HALF_UP
)
return
num1
.
divide
(
num2
,
4
,
RoundingMode
.
HALF_UP
)
.
multiply
(
new
BigDecimal
(
100
))
.
multiply
(
new
BigDecimal
(
100
))
...
...
jmai-physic/src/main/java/com/jmai/physic/service/impl/PhysicApplyServiceImpl.java
View file @
67052241
package
com
.
jmai
.
physic
.
service
.
impl
;
package
com
.
jmai
.
physic
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.jmai.api.exception.ServiceException
;
import
com.jmai.api.exception.ServiceException
;
import
com.jmai.physic.cloudsign.CloudsignService
;
import
com.jmai.physic.cloudsign.CloudsignService
;
import
com.jmai.physic.dto.*
;
import
com.jmai.physic.dto.*
;
import
com.jmai.physic.entity.PhysicApply
;
import
com.jmai.physic.entity.PhysicApply
;
import
com.jmai.physic.entity.PhysicWarehouse
;
import
com.jmai.physic.mapper.PhysicApplyMapper
;
import
com.jmai.physic.mapper.PhysicApplyMapper
;
import
com.jmai.physic.mapper.PhysicWarehouseMapper
;
import
com.jmai.physic.service.PhysicApplyService
;
import
com.jmai.physic.service.PhysicApplyService
;
import
com.jmai.physic.service.PhysicBillService
;
import
com.jmai.physic.service.PhysicBillService
;
import
com.jmai.physic.service.PhysicWarehouseService
;
import
com.jmai.physic.vo.PhysicApplyVO
;
import
com.jmai.physic.vo.PhysicApplyVO
;
import
com.jmai.physic.vo.Physic
Warehouse
VO
;
import
com.jmai.physic.vo.PhysicVO
;
import
com.jmai.sys.AbstractService
;
import
com.jmai.sys.AbstractService
;
import
com.jmai.sys.consts.enums.RoleTypeEum
;
import
com.jmai.sys.consts.enums.RoleTypeEum
;
import
com.jmai.sys.ctx.SpringContextUtils
;
import
com.jmai.sys.ctx.SpringContextUtils
;
...
@@ -224,6 +223,54 @@ public class PhysicApplyServiceImpl extends AbstractService implements PhysicApp
...
@@ -224,6 +223,54 @@ public class PhysicApplyServiceImpl extends AbstractService implements PhysicApp
return
physicApplyVOIPage
;
return
physicApplyVOIPage
;
}
}
@Override
public
IPage
<
PhysicVO
>
listPhysic
(
PhysicQueryReq
req
)
{
LambdaQueryWrapper
<
PhysicApply
>
query
=
Wrappers
.
lambdaQuery
(
PhysicApply
.
class
)
.
like
(
ObjectUtil
.
isNotEmpty
(
req
.
getPhysicName
()),
PhysicApply:
:
getPhysicName
,
req
.
getPhysicName
())
.
like
(
ObjectUtil
.
isNotEmpty
(
req
.
getPhysicType
()),
PhysicApply:
:
getPhysicType
,
req
.
getPhysicType
())
.
like
(
ObjectUtil
.
isNotEmpty
(
req
.
getPhysicSpec
()),
PhysicApply:
:
getPhysicSpec
,
req
.
getPhysicSpec
())
.
like
(
ObjectUtil
.
isNotEmpty
(
req
.
getFactoryName
()),
PhysicApply:
:
getFactoryName
,
req
.
getFactoryName
())
.
like
(
ObjectUtil
.
isNotEmpty
(
req
.
getExpireDate
()),
PhysicApply:
:
getExpireDate
,
req
.
getExpireDate
())
.
like
(
ObjectUtil
.
isNotEmpty
(
req
.
getBatchNo
()),
PhysicApply:
:
getBatchNo
,
req
.
getBatchNo
())
.
eq
(
ObjectUtil
.
isNotEmpty
(
req
.
getStatus
()),
PhysicApply:
:
getStatus
,
req
.
getStatus
());
// 关键字模糊查询
if
(
ObjectUtil
.
isNotEmpty
(
req
.
getKeyword
()))
{
query
.
and
(
wrapper
->
wrapper
.
like
(
PhysicApply:
:
getPhysicName
,
req
.
getKeyword
())
.
or
().
like
(
PhysicApply:
:
getPhysicType
,
req
.
getKeyword
())
.
or
().
like
(
PhysicApply:
:
getPhysicSpec
,
req
.
getKeyword
())
.
or
().
like
(
PhysicApply:
:
getFactoryName
,
req
.
getKeyword
())
.
or
().
like
(
PhysicApply:
:
getExpireDate
,
req
.
getKeyword
())
.
or
().
like
(
PhysicApply:
:
getBatchNo
,
req
.
getKeyword
())
);
}
query
.
orderByAsc
(
PhysicApply:
:
getFactoryName
);
query
.
orderByAsc
(
PhysicApply:
:
getPhysicName
);
query
.
orderByAsc
(
PhysicApply:
:
getPhysicSpec
);
query
.
orderByDesc
(
PhysicApply:
:
getExpireDate
);
query
.
orderByAsc
(
PhysicApply:
:
getBatchNo
);
IPage
<
PhysicApply
>
page
=
buildEmptyPage
(
req
);
page
=
physicApplyMapper
.
selectPage
(
page
,
query
);
return
convertTo
(
page
,
this
::
convertToPhysicVO
);
}
private
PhysicVO
convertToPhysicVO
(
PhysicApply
bo
)
{
PhysicVO
vo
=
new
PhysicVO
();
vo
.
setPhysicName
(
bo
.
getPhysicName
());
vo
.
setPhysicSpec
(
bo
.
getPhysicSpec
());
vo
.
setPhysicType
(
bo
.
getPhysicType
());
vo
.
setUnit
(
bo
.
getUnit
());
vo
.
setFactoryName
(
bo
.
getFactoryName
());
vo
.
setExpireDate
(
bo
.
getExpireDate
());
vo
.
setBatchNo
(
bo
.
getBatchNo
());
// 注意:PhysicApply实体类没有voucherNo、supplyName等字段
// 根据实际业务需求,这些字段可能需要从其他地方获取或留空
return
vo
;
}
}
}
jmai-physic/src/main/java/com/jmai/physic/service/impl/PhysicRecordServiceImpl.java
View file @
67052241
...
@@ -12,7 +12,6 @@ import com.jmai.api.exception.ServiceException;
...
@@ -12,7 +12,6 @@ import com.jmai.api.exception.ServiceException;
import
com.jmai.physic.cloudsign.CloudsignService
;
import
com.jmai.physic.cloudsign.CloudsignService
;
import
com.jmai.physic.dto.*
;
import
com.jmai.physic.dto.*
;
import
com.jmai.physic.entity.PhysicRecord
;
import
com.jmai.physic.entity.PhysicRecord
;
import
com.jmai.physic.entity.PhysicWarehouse
;
import
com.jmai.physic.mapper.PhysicRecordMapper
;
import
com.jmai.physic.mapper.PhysicRecordMapper
;
import
com.jmai.physic.service.PhysicBillService
;
import
com.jmai.physic.service.PhysicBillService
;
import
com.jmai.physic.service.PhysicRecordService
;
import
com.jmai.physic.service.PhysicRecordService
;
...
@@ -162,6 +161,12 @@ public class PhysicRecordServiceImpl extends AbstractService implements PhysicRe
...
@@ -162,6 +161,12 @@ public class PhysicRecordServiceImpl extends AbstractService implements PhysicRe
);
);
}
}
query
.
orderByAsc
(
PhysicRecord:
:
getFactoryName
);
query
.
orderByAsc
(
PhysicRecord:
:
getPhysicName
);
query
.
orderByAsc
(
PhysicRecord:
:
getPhysicSpec
);
query
.
orderByDesc
(
PhysicRecord:
:
getExpireDate
);
query
.
orderByAsc
(
PhysicRecord:
:
getBatchNo
);
IPage
<
PhysicRecord
>
page
=
buildEmptyPage
(
req
);
IPage
<
PhysicRecord
>
page
=
buildEmptyPage
(
req
);
page
=
physicRecordMapper
.
selectPage
(
page
,
query
);
page
=
physicRecordMapper
.
selectPage
(
page
,
query
);
...
...
jmai-physic/src/main/java/com/jmai/physic/service/impl/PhysicStorageAmpouleServiceImpl.java
View file @
67052241
...
@@ -2,17 +2,21 @@ package com.jmai.physic.service.impl;
...
@@ -2,17 +2,21 @@ package com.jmai.physic.service.impl;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.jmai.api.exception.ServiceException
;
import
com.jmai.api.exception.ServiceException
;
import
com.jmai.physic.cloudsign.CloudsignService
;
import
com.jmai.physic.cloudsign.CloudsignService
;
import
com.jmai.physic.dto.*
;
import
com.jmai.physic.dto.*
;
import
com.jmai.physic.entity.PhysicRecord
;
import
com.jmai.physic.entity.PhysicStorageAmpoule
;
import
com.jmai.physic.entity.PhysicStorageAmpoule
;
import
com.jmai.physic.mapper.PhysicStorageAmpouleMapper
;
import
com.jmai.physic.mapper.PhysicStorageAmpouleMapper
;
import
com.jmai.physic.service.PhysicBillService
;
import
com.jmai.physic.service.PhysicBillService
;
import
com.jmai.physic.service.PhysicStorageAmpouleService
;
import
com.jmai.physic.service.PhysicStorageAmpouleService
;
import
com.jmai.physic.vo.PhysicStorageAmpouleVO
;
import
com.jmai.physic.vo.PhysicStorageAmpouleVO
;
import
com.jmai.physic.vo.PhysicVO
;
import
com.jmai.sys.AbstractService
;
import
com.jmai.sys.AbstractService
;
import
com.jmai.sys.consts.enums.RoleTypeEum
;
import
com.jmai.sys.consts.enums.RoleTypeEum
;
import
com.jmai.sys.ctx.SpringContextUtils
;
import
com.jmai.sys.ctx.SpringContextUtils
;
...
@@ -149,4 +153,50 @@ public class PhysicStorageAmpouleServiceImpl extends AbstractService implements
...
@@ -149,4 +153,50 @@ public class PhysicStorageAmpouleServiceImpl extends AbstractService implements
PhysicStorageAmpoule
ampoule
=
physicStorageAmpouleMapper
.
selectById
(
id
);
PhysicStorageAmpoule
ampoule
=
physicStorageAmpouleMapper
.
selectById
(
id
);
return
ampoule
;
return
ampoule
;
}
}
@Override
public
IPage
<
PhysicVO
>
listPhysic
(
PhysicQueryReq
req
)
{
LambdaQueryWrapper
<
PhysicStorageAmpoule
>
query
=
Wrappers
.
lambdaQuery
(
PhysicStorageAmpoule
.
class
)
.
like
(
ObjectUtil
.
isNotEmpty
(
req
.
getPhysicName
()),
PhysicStorageAmpoule:
:
getPhysicName
,
req
.
getPhysicName
())
.
like
(
ObjectUtil
.
isNotEmpty
(
req
.
getPhysicType
()),
PhysicStorageAmpoule:
:
getPhysicType
,
req
.
getPhysicType
())
.
like
(
ObjectUtil
.
isNotEmpty
(
req
.
getPhysicSpec
()),
PhysicStorageAmpoule:
:
getPhysicSpec
,
req
.
getPhysicSpec
())
.
like
(
ObjectUtil
.
isNotEmpty
(
req
.
getFactoryName
()),
PhysicStorageAmpoule:
:
getFactoryName
,
req
.
getFactoryName
())
.
like
(
ObjectUtil
.
isNotEmpty
(
req
.
getBatchNo
()),
PhysicStorageAmpoule:
:
getBatchNo
,
req
.
getBatchNo
())
.
eq
(
ObjectUtil
.
isNotEmpty
(
req
.
getStatus
()),
PhysicStorageAmpoule:
:
getStatus
,
req
.
getStatus
());
// 关键字模糊查询
if
(
ObjectUtil
.
isNotEmpty
(
req
.
getKeyword
()))
{
query
.
and
(
wrapper
->
wrapper
.
like
(
PhysicStorageAmpoule:
:
getPhysicName
,
req
.
getKeyword
())
.
or
().
like
(
PhysicStorageAmpoule:
:
getPhysicType
,
req
.
getKeyword
())
.
or
().
like
(
PhysicStorageAmpoule:
:
getPhysicSpec
,
req
.
getKeyword
())
.
or
().
like
(
PhysicStorageAmpoule:
:
getFactoryName
,
req
.
getKeyword
())
.
or
().
like
(
PhysicStorageAmpoule:
:
getBatchNo
,
req
.
getKeyword
())
);
}
query
.
orderByAsc
(
PhysicStorageAmpoule:
:
getFactoryName
);
query
.
orderByAsc
(
PhysicStorageAmpoule:
:
getPhysicName
);
query
.
orderByAsc
(
PhysicStorageAmpoule:
:
getPhysicSpec
);
query
.
orderByAsc
(
PhysicStorageAmpoule:
:
getBatchNo
);
IPage
<
PhysicStorageAmpoule
>
page
=
buildEmptyPage
(
req
);
page
=
physicStorageAmpouleMapper
.
selectPage
(
page
,
query
);
return
convertTo
(
page
,
this
::
convertToPhysicVO
);
}
private
PhysicVO
convertToPhysicVO
(
PhysicStorageAmpoule
bo
)
{
PhysicVO
vo
=
new
PhysicVO
();
vo
.
setPhysicName
(
bo
.
getPhysicName
());
vo
.
setPhysicSpec
(
bo
.
getPhysicSpec
());
vo
.
setPhysicType
(
bo
.
getPhysicType
());
vo
.
setUnit
(
bo
.
getUnit
());
vo
.
setFactoryName
(
bo
.
getFactoryName
());
vo
.
setBatchNo
(
bo
.
getBatchNo
());
// 注意:PhysicStorageAmpoule实体类没有expireDate、voucherNo、supplyName等字段
// 根据实际业务需求,这些字段可能需要从其他地方获取或留空
return
vo
;
}
}
}
jmai-physic/src/main/java/com/jmai/physic/service/impl/PhysicWarehouseServiceImpl.java
View file @
67052241
...
@@ -238,6 +238,12 @@ public class PhysicWarehouseServiceImpl extends AbstractService implements Phys
...
@@ -238,6 +238,12 @@ public class PhysicWarehouseServiceImpl extends AbstractService implements Phys
);
);
}
}
query
.
orderByAsc
(
PhysicWarehouse:
:
getFactoryName
);
query
.
orderByAsc
(
PhysicWarehouse:
:
getPhysicName
);
query
.
orderByAsc
(
PhysicWarehouse:
:
getPhysicSpec
);
query
.
orderByDesc
(
PhysicWarehouse:
:
getExpireDate
);
query
.
orderByAsc
(
PhysicWarehouse:
:
getBatchNo
);
IPage
<
PhysicWarehouse
>
page
=
buildEmptyPage
(
req
);
IPage
<
PhysicWarehouse
>
page
=
buildEmptyPage
(
req
);
page
=
physicWarehouseMapper
.
selectPage
(
page
,
query
);
page
=
physicWarehouseMapper
.
selectPage
(
page
,
query
);
...
...
jmai-physic/src/main/java/com/jmai/physic/vo/PhysicApplyVO.java
View file @
67052241
package
com
.
jmai
.
physic
.
vo
;
package
com
.
jmai
.
physic
.
vo
;
import
com.jmai.physic.entity.PhysicApply
;
import
com.jmai.physic.entity.PhysicApply
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.time.LocalDateTime
;
@Data
@Data
public
class
PhysicApplyVO
extends
PhysicApply
{
public
class
PhysicApplyVO
extends
PhysicApply
{
private
Long
physicApplyId
;
private
String
createName
;
private
String
createName
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment