Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
patzn-cloud-service-hmhj
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangweidong
patzn-cloud-service-hmhj
Commits
c73c9c9c
Commit
c73c9c9c
authored
Jul 17, 2021
by
ghxdhr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
中心成本相关
parent
e08c1388
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
732 additions
and
5 deletions
+732
-5
LmsPropertyController.java
...d/service/lims/base/controller/LmsPropertyController.java
+130
-0
LmsPropertyMapper.java
...tzn/cloud/service/lims/base/mapper/LmsPropertyMapper.java
+28
-0
ILmsPropertyService.java
.../cloud/service/lims/base/service/ILmsPropertyService.java
+46
-0
LmsPropertyServiceImpl.java
...ervice/lims/base/service/impl/LmsPropertyServiceImpl.java
+182
-0
CenterCostController.java
...ud/service/lims/hmhj/controller/CenterCostController.java
+75
-0
CenterCostRecordController.java
...vice/lims/hmhj/controller/CenterCostRecordController.java
+75
-0
EntrustController.java
...cloud/service/lims/hmhj/controller/EntrustController.java
+2
-2
CenterCostMapper.java
...atzn/cloud/service/lims/hmhj/mapper/CenterCostMapper.java
+16
-0
CenterCostRecordMapper.java
...loud/service/lims/hmhj/mapper/CenterCostRecordMapper.java
+16
-0
ICenterCostRecordService.java
...d/service/lims/hmhj/service/ICenterCostRecordService.java
+20
-0
ICenterCostService.java
...n/cloud/service/lims/hmhj/service/ICenterCostService.java
+22
-0
IEntrustService.java
...atzn/cloud/service/lims/hmhj/service/IEntrustService.java
+1
-1
CenterCostRecordServiceImpl.java
...e/lims/hmhj/service/impl/CenterCostRecordServiceImpl.java
+34
-0
CenterCostServiceImpl.java
...service/lims/hmhj/service/impl/CenterCostServiceImpl.java
+63
-0
EntrustServiceImpl.java
...ud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
+3
-2
LmsPropertyMapper.xml
src/main/resources/mapper/base/LmsPropertyMapper.xml
+9
-0
CenterCostMapper.xml
src/main/resources/mapper/hmhj/CenterCostMapper.xml
+5
-0
CenterCostRecordMapper.xml
src/main/resources/mapper/hmhj/CenterCostRecordMapper.xml
+5
-0
No files found.
src/main/java/com/patzn/cloud/service/lims/base/controller/LmsPropertyController.java
0 → 100644
View file @
c73c9c9c
package
com
.
patzn
.
cloud
.
service
.
lims
.
base
.
controller
;
import
com.baomidou.mybatisplus.mapper.Condition
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.patzn.cloud.commons.api.RestConstants
;
import
com.patzn.cloud.commons.api.RestResult
;
import
com.patzn.cloud.commons.controller.ServiceController
;
import
com.patzn.cloud.feign.lims.base.client.LmsPropertyClient
;
import
com.patzn.cloud.service.lims.base.dto.LmsCompareDifferentDTO
;
import
com.patzn.cloud.service.lims.base.entity.LmsProperty
;
import
com.patzn.cloud.service.lims.base.service.ILmsPropertyService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* 字段数据对比表 前端控制器
*
* @author patzn
* @since 2021-07-16
*/
@Api
(
tags
=
"字段数据对比表"
)
@RestController
@RequestMapping
(
"/v1/property"
)
public
class
LmsPropertyController
extends
ServiceController
implements
LmsPropertyClient
{
@Autowired
private
ILmsPropertyService
lmsPropertyService
;
@ApiOperation
(
value
=
"分页列表"
,
notes
=
"分页查询数据列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_ROWS
,
value
=
"每页条数"
,
required
=
true
,
paramType
=
"query"
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_SIDX
,
value
=
"排序字段"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_SORD
,
value
=
"排序方式"
,
paramType
=
"query"
,
dataType
=
"String"
),
})
@PostMapping
(
"/page"
)
@Override
public
RestResult
<
Page
<
LmsProperty
>>
getPage
(
LmsProperty
lmsProperty
)
{
return
success
(
lmsPropertyService
.
page
(
getPage
(),
lmsProperty
));
}
@ApiOperation
(
value
=
"查询列表"
,
notes
=
"查询数据列表"
)
@PostMapping
(
"/list"
)
@Override
public
RestResult
<
List
<
LmsProperty
>>
getList
(
LmsProperty
lmsProperty
)
{
return
success
(
lmsPropertyService
.
list
(
lmsProperty
));
}
@PostMapping
(
"/list_by_type"
)
@Override
public
RestResult
<
List
<
LmsProperty
>>
getListByType
(
@RequestParam
(
"typeList"
)
List
<
String
>
typeList
)
{
if
(
CollectionUtils
.
isEmpty
(
typeList
))
{
return
null
;
}
return
success
(
lmsPropertyService
.
getListByType
(
typeList
));
}
@PostMapping
(
"/list_by_type_companyId"
)
public
RestResult
<
List
<
LmsProperty
>>
getListByTypeCompanyId
(
@RequestParam
(
"companyId"
)
Long
companyId
,
@RequestParam
(
"typeList"
)
List
<
String
>
typeList
)
{
if
(
CollectionUtils
.
isEmpty
(
typeList
)
||
null
==
companyId
)
{
return
null
;
}
return
success
(
lmsPropertyService
.
getListByTypeCompanyId
(
typeList
,
companyId
));
}
@ApiOperation
(
value
=
"查询 id 信息"
,
notes
=
"查询指定 id 的数据内容"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"long"
),
})
@GetMapping
(
"/{id}"
)
@Override
public
RestResult
<
LmsProperty
>
get
(
@PathVariable
(
"id"
)
Long
id
)
{
return
success
(
lmsPropertyService
.
getById
(
id
));
}
@ApiOperation
(
value
=
"根据 id 修改信息"
,
notes
=
"根据指定 id 修改该条数据内容"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"long"
),
})
@PutMapping
(
"/{id}"
)
@Override
public
RestResult
<
Boolean
>
edit
(
@PathVariable
(
"id"
)
Long
id
,
LmsProperty
lmsProperty
)
{
lmsProperty
.
setId
(
id
);
return
success
(
lmsPropertyService
.
updateById
(
lmsProperty
));
}
@ApiOperation
(
value
=
"添加"
,
notes
=
"添加一条数据"
)
@PostMapping
(
"/"
)
@Override
public
RestResult
<
Boolean
>
add
(
LmsProperty
lmsProperty
)
{
return
success
(
lmsPropertyService
.
save
(
lmsProperty
));
}
@ApiOperation
(
value
=
"根据 ids 删除"
,
notes
=
"根据 id 数组删除指定的数据内容"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"ids"
,
value
=
"主键数组"
,
required
=
true
,
paramType
=
"query"
,
dataType
=
"array"
),
})
@DeleteMapping
(
"/"
)
@Override
public
RestResult
<
Boolean
>
delete
(
@RequestParam
(
"ids"
)
Long
[]
ids
)
{
return
success
(
lmsPropertyService
.
remove
(
Condition
.
create
().
in
(
"id"
,
ids
)));
}
@ApiOperation
(
value
=
"对象信息对比"
,
notes
=
"对象信息对比"
)
@PostMapping
(
"/obj_compare"
)
@Override
public
RestResult
<
String
>
getCompareDifferent
(
@RequestBody
LmsCompareDifferentDTO
dto
)
{
return
success
(
lmsPropertyService
.
getCompareDifferent
(
dto
.
getView
(),
dto
.
getOld
(),
dto
.
getType
(),
dto
.
getTitle
()));
}
@ApiOperation
(
value
=
"对象信息对比"
,
notes
=
"对象信息对比"
)
@PostMapping
(
"/copy"
)
public
RestResult
<
Boolean
>
copy
(
@RequestParam
(
"fromType"
)
String
fromType
,
@RequestParam
(
"toType"
)
String
toType
)
{
return
success
(
lmsPropertyService
.
copy
(
fromType
,
toType
));
}
}
\ No newline at end of file
src/main/java/com/patzn/cloud/service/lims/base/mapper/LmsPropertyMapper.java
0 → 100644
View file @
c73c9c9c
package
com
.
patzn
.
cloud
.
service
.
lims
.
base
.
mapper
;
import
com.baomidou.mybatisplus.annotations.SqlParser
;
import
com.patzn.cloud.commons.mapper.BatchMapper
;
import
com.patzn.cloud.service.lims.base.entity.LmsProperty
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* <p>
* 字段数据对比表 Mapper 接口
* </p>
*
* @author patzn
* @since 2021-07-16
*/
public
interface
LmsPropertyMapper
extends
BatchMapper
<
LmsProperty
>
{
@SqlParser
(
filter
=
true
)
List
<
LmsProperty
>
selectLmsPropertyList
(
@Param
(
"type"
)
String
type
);
@SqlParser
(
filter
=
true
)
List
<
LmsProperty
>
selectLmsPropertyLists
(
@Param
(
"types"
)
List
<
String
>
typeList
);
@SqlParser
(
filter
=
true
)
List
<
LmsProperty
>
selectLmsPropertyCompanyIdLists
(
@Param
(
"types"
)
List
<
String
>
typeList
,
@Param
(
"companyId"
)
Long
companyId
);
}
src/main/java/com/patzn/cloud/service/lims/base/service/ILmsPropertyService.java
0 → 100644
View file @
c73c9c9c
package
com
.
patzn
.
cloud
.
service
.
lims
.
base
.
service
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.patzn.cloud.commons.service.IBaseService
;
import
com.patzn.cloud.service.lims.base.entity.LmsProperty
;
import
java.util.List
;
import
java.util.Map
;
/**
* 字段数据对比表 服务类
*
* @author patzn
* @since 2021-07-16
*/
public
interface
ILmsPropertyService
extends
IBaseService
<
LmsProperty
>
{
Page
<
LmsProperty
>
page
(
Page
<
LmsProperty
>
page
,
LmsProperty
lmsProperty
);
List
<
LmsProperty
>
list
(
LmsProperty
lmsProperty
);
Map
<
String
,
Object
>
getPropertyDetailData
(
String
type
);
String
getObjectCompareDifferent
(
Object
one
,
Object
old
,
String
type
,
String
title
);
String
getCompareDifferent
(
Object
one
,
Object
old
,
String
type
,
String
title
);
String
getCompareTimeFormatDifferent
(
Object
one
,
Object
old
,
String
type
,
String
title
);
String
getObjectCompareDifferent
(
Map
<
String
,
List
<
Object
>>
map
,
String
title
);
List
<
LmsProperty
>
listPropertyDetailData
(
String
type
);
boolean
copy
(
String
fromType
,
String
toType
);
List
<
LmsProperty
>
getListByType
(
List
<
String
>
typeList
);
List
<
LmsProperty
>
getListByTypeCompanyId
(
List
<
String
>
typeList
,
Long
companyId
);
}
src/main/java/com/patzn/cloud/service/lims/base/service/impl/LmsPropertyServiceImpl.java
0 → 100644
View file @
c73c9c9c
package
com
.
patzn
.
cloud
.
service
.
lims
.
base
.
service
.
impl
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.mapper.Wrapper
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.baomidou.mybatisplus.toolkit.IdWorker
;
import
com.github.benmanes.caffeine.cache.Cache
;
import
com.github.benmanes.caffeine.cache.Caffeine
;
import
com.patzn.cloud.commons.api.RestAssert
;
import
com.patzn.cloud.commons.constant.CommonConstants
;
import
com.patzn.cloud.commons.controller.LoginHelper
;
import
com.patzn.cloud.commons.service.impl.BaseServiceImpl
;
import
com.patzn.cloud.commons.toolkit.ObjectUtils
;
import
com.patzn.cloud.service.lims.base.entity.LmsProperty
;
import
com.patzn.cloud.service.lims.base.mapper.LmsPropertyMapper
;
import
com.patzn.cloud.service.lims.base.service.ILmsPropertyService
;
import
com.patzn.cloud.service.lims.common.StringHandleUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
/**
* 字段数据对比表 服务实现类
*
* @author patzn
* @since 2021-07-16
*/
@Service
public
class
LmsPropertyServiceImpl
extends
BaseServiceImpl
<
LmsPropertyMapper
,
LmsProperty
>
implements
ILmsPropertyService
{
@Override
public
Page
<
LmsProperty
>
page
(
Page
<
LmsProperty
>
page
,
LmsProperty
lmsProperty
)
{
Wrapper
wrapper
=
new
EntityWrapper
<>(
lmsProperty
);
return
page
(
page
,
wrapper
);
}
@Override
public
List
<
LmsProperty
>
list
(
LmsProperty
lmsProperty
)
{
return
list
(
new
EntityWrapper
<>(
lmsProperty
));
}
@Override
public
Map
<
String
,
Object
>
getPropertyDetailData
(
String
type
)
{
List
<
LmsProperty
>
list
=
listPropertyDetailData
(
type
);
Map
<
String
,
String
>
propertyMap
=
new
HashMap
<>();
List
<
String
>
propertyList
=
new
ArrayList
<>();
for
(
LmsProperty
property
:
list
)
{
propertyList
.
add
(
property
.
getCode
());
propertyMap
.
put
(
property
.
getCode
(),
property
.
getName
());
}
Map
<
String
,
Object
>
objectMap
=
new
HashMap
<>();
objectMap
.
put
(
"property"
,
propertyList
);
objectMap
.
put
(
"propertyMap"
,
propertyMap
);
return
objectMap
;
}
@Override
public
String
getObjectCompareDifferent
(
Object
one
,
Object
old
,
String
type
,
String
title
)
{
Map
<
String
,
Object
>
map
=
getPropertyDetailData
(
type
);
List
<
String
>
propertyList
=
(
List
<
String
>)
map
.
get
(
"property"
);
Map
<
String
,
String
>
propertyValueMap
=
(
Map
<
String
,
String
>)
map
.
get
(
"propertyMap"
);
Map
<
String
,
List
<
Object
>>
returnMap
=
ObjectUtils
.
compareFields
(
one
,
old
,
propertyList
);
return
StringHandleUtils
.
getObjectDifferent
(
title
,
propertyValueMap
,
returnMap
);
}
@Override
public
String
getCompareDifferent
(
Object
one
,
Object
old
,
String
type
,
String
title
)
{
Map
<
String
,
Object
>
map
=
getPropertyDetail
(
type
);
List
<
String
>
propertyList
=
(
List
<
String
>)
map
.
get
(
"property"
);
Map
<
String
,
String
>
propertyValueMap
=
(
Map
<
String
,
String
>)
map
.
get
(
"propertyMap"
);
Map
<
String
,
List
<
Object
>>
returnMap
=
ObjectUtils
.
compareFields
(
one
,
old
,
propertyList
);
return
StringHandleUtils
.
getObjectDifferent
(
title
,
propertyValueMap
,
returnMap
);
}
@Override
public
String
getCompareTimeFormatDifferent
(
Object
one
,
Object
old
,
String
type
,
String
title
)
{
Map
<
String
,
Object
>
map
=
getPropertyDetail
(
type
);
List
<
String
>
propertyList
=
(
List
<
String
>)
map
.
get
(
"property"
);
Map
<
String
,
String
>
propertyValueMap
=
(
Map
<
String
,
String
>)
map
.
get
(
"propertyMap"
);
Map
<
String
,
List
<
Object
>>
returnMap
=
ObjectUtils
.
compareTimeFormatFields
(
one
,
old
,
propertyList
);
return
StringHandleUtils
.
getObjectDifferent
(
title
,
propertyValueMap
,
returnMap
);
}
private
Map
<
String
,
Object
>
getPropertyDetail
(
String
type
)
{
List
<
LmsProperty
>
list
=
baseMapper
.
selectLmsPropertyList
(
type
);
Map
<
String
,
String
>
propertyMap
=
new
HashMap
<>();
List
<
String
>
propertyList
=
new
ArrayList
<>();
for
(
LmsProperty
property
:
list
)
{
propertyList
.
add
(
property
.
getCode
());
propertyMap
.
put
(
property
.
getCode
(),
property
.
getName
());
}
Map
<
String
,
Object
>
objectMap
=
new
HashMap
<>();
objectMap
.
put
(
"property"
,
propertyList
);
objectMap
.
put
(
"propertyMap"
,
propertyMap
);
return
objectMap
;
}
@Override
public
String
getObjectCompareDifferent
(
Map
<
String
,
List
<
Object
>>
mapCompare
,
String
title
)
{
List
<
Map
<
String
,
List
<
Object
>>>
list
=
new
ArrayList
<>();
Map
<
String
,
String
>
allProperty
=
new
HashMap
<>();
for
(
Map
.
Entry
<
String
,
List
<
Object
>>
mapEntry
:
mapCompare
.
entrySet
())
{
Map
<
String
,
Object
>
map
=
getPropertyDetailData
(
mapEntry
.
getKey
());
List
<
String
>
propertyList
=
(
List
<
String
>)
map
.
get
(
"property"
);
Map
<
String
,
String
>
propertyValueMap
=
(
Map
<
String
,
String
>)
map
.
get
(
"propertyMap"
);
Map
<
String
,
List
<
Object
>>
returnMap
=
ObjectUtils
.
compareFields
(
mapEntry
.
getValue
().
get
(
0
),
mapEntry
.
getValue
().
get
(
1
),
propertyList
);
allProperty
.
putAll
(
propertyValueMap
);
list
.
add
(
returnMap
);
}
return
StringHandleUtils
.
getObjectDifferent
(
title
,
allProperty
,
list
);
}
private
final
Cache
<
String
,
List
<
LmsProperty
>>
LMSPROPERTY_FLOW_CACHE
=
Caffeine
.
newBuilder
()
.
expireAfterWrite
(
1
,
TimeUnit
.
HOURS
).
build
();
@Override
public
List
<
LmsProperty
>
listPropertyDetailData
(
String
type
)
{
StringBuilder
key
=
new
StringBuilder
();
key
.
append
(
LoginHelper
.
getAccount
().
getCompanyId
()).
append
(
CommonConstants
.
SYMBOL_JING
).
append
(
type
);
List
<
LmsProperty
>
cfList
=
LMSPROPERTY_FLOW_CACHE
.
getIfPresent
(
key
.
toString
());
if
(
CollectionUtils
.
isEmpty
(
cfList
))
{
List
<
LmsProperty
>
returnList
=
baseMapper
.
selectLmsPropertyList
(
type
);
LMSPROPERTY_FLOW_CACHE
.
put
(
key
.
toString
(),
returnList
);
cfList
=
returnList
;
}
return
cfList
;
}
@Override
public
boolean
copy
(
String
fromType
,
String
toType
)
{
RestAssert
.
fail
(
StringUtils
.
isBlank
(
fromType
)
||
StringUtils
.
isBlank
(
toType
),
"参数不能为空"
);
String
[]
froms
=
fromType
.
split
(
"、"
);
String
[]
tos
=
toType
.
split
(
"、"
);
RestAssert
.
fail
(
froms
.
length
!=
tos
.
length
,
"参数对应数量不等"
);
List
<
LmsProperty
>
saveList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
froms
.
length
;
i
++)
{
List
<
LmsProperty
>
dbs
=
baseMapper
.
selectLmsPropertyList
(
froms
[
i
]);
if
(
CollectionUtils
.
isNotEmpty
(
dbs
))
{
int
sort
=
1
;
for
(
LmsProperty
p
:
dbs
)
{
p
.
setId
(
IdWorker
.
getId
());
p
.
setType
(
tos
[
i
]);
p
.
setSort
(
sort
);
sort
++;
}
saveList
.
addAll
(
dbs
);
}
}
return
CollectionUtils
.
isEmpty
(
saveList
)
||
saveBatch
(
saveList
);
}
@Override
public
List
<
LmsProperty
>
getListByType
(
List
<
String
>
typeList
)
{
return
baseMapper
.
selectLmsPropertyLists
(
typeList
);
}
@Override
public
List
<
LmsProperty
>
getListByTypeCompanyId
(
List
<
String
>
typeList
,
Long
companyId
)
{
return
baseMapper
.
selectLmsPropertyCompanyIdLists
(
typeList
,
companyId
);
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/CenterCostController.java
0 → 100644
View file @
c73c9c9c
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
controller
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.patzn.cloud.commons.api.RestConstants
;
import
com.patzn.cloud.commons.api.RestResult
;
import
com.patzn.cloud.commons.controller.ServiceController
;
import
com.patzn.cloud.service.hmhj.entity.CenterCost
;
import
com.patzn.cloud.service.lims.hmhj.service.ICenterCostService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* 中心成本 前端控制器
*
* @author patzn
* @since 2021-07-16
*/
@Api
(
tags
=
"中心成本"
)
@RestController
@RequestMapping
(
"/v1/cost"
)
public
class
CenterCostController
extends
ServiceController
{
@Autowired
private
ICenterCostService
centerCostService
;
@ApiOperation
(
"分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_ROWS
,
value
=
"每页条数"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
})
@PostMapping
(
"/page"
)
public
RestResult
<
Page
<
CenterCost
>>
getPage
(
CenterCost
centerCost
)
{
return
success
(
centerCostService
.
page
(
getPage
(),
centerCost
));
}
@ApiOperation
(
"查询 id 信息"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
paramType
=
"path"
,
dataTypeClass
=
Long
.
class
),
})
@GetMapping
(
"/{id}"
)
public
RestResult
<
CenterCost
>
get
(
@PathVariable
(
"id"
)
Long
id
)
{
return
success
(
centerCostService
.
getById
(
id
));
}
@ApiOperation
(
"根据 id 修改信息"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
paramType
=
"path"
,
dataTypeClass
=
Long
.
class
),
})
@PutMapping
(
"/{id}"
)
public
RestResult
<
Boolean
>
edit
(
@PathVariable
(
"id"
)
Long
id
,
CenterCost
centerCost
)
{
centerCost
.
setId
(
id
);
return
success
(
centerCostService
.
update
(
centerCost
));
}
@ApiOperation
(
"添加"
)
@PostMapping
(
"/"
)
public
RestResult
<
Boolean
>
add
(
CenterCost
centerCost
)
{
return
success
(
centerCostService
.
save
(
centerCost
));
}
@ApiOperation
(
"根据 ids 删除"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"ids"
,
value
=
"主键列表"
,
required
=
true
,
paramType
=
"query"
,
allowMultiple
=
true
,
dataTypeClass
=
Long
.
class
),
})
@DeleteMapping
(
"/"
)
public
RestResult
<
Boolean
>
delete
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
)
{
return
success
(
centerCostService
.
removeByIds
(
ids
));
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/CenterCostRecordController.java
0 → 100644
View file @
c73c9c9c
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
controller
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.patzn.cloud.commons.api.RestConstants
;
import
com.patzn.cloud.commons.api.RestResult
;
import
com.patzn.cloud.commons.controller.ServiceController
;
import
com.patzn.cloud.service.hmhj.entity.CenterCostRecord
;
import
com.patzn.cloud.service.lims.hmhj.service.ICenterCostRecordService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* 中心成本操作日志 前端控制器
*
* @author patzn
* @since 2021-07-16
*/
@Api
(
tags
=
"中心成本操作日志"
)
@RestController
@RequestMapping
(
"/v1/cost_record"
)
public
class
CenterCostRecordController
extends
ServiceController
{
@Autowired
private
ICenterCostRecordService
centerCostRecordService
;
@ApiOperation
(
"分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_ROWS
,
value
=
"每页条数"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
})
@PostMapping
(
"/page"
)
public
RestResult
<
Page
<
CenterCostRecord
>>
getPage
(
CenterCostRecord
centerCostRecord
)
{
return
success
(
centerCostRecordService
.
page
(
getPage
(),
centerCostRecord
));
}
@ApiOperation
(
"查询 id 信息"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
paramType
=
"path"
,
dataTypeClass
=
Long
.
class
),
})
@GetMapping
(
"/{id}"
)
public
RestResult
<
CenterCostRecord
>
get
(
@PathVariable
(
"id"
)
Long
id
)
{
return
success
(
centerCostRecordService
.
getById
(
id
));
}
@ApiOperation
(
"根据 id 修改信息"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
paramType
=
"path"
,
dataTypeClass
=
Long
.
class
),
})
@PutMapping
(
"/{id}"
)
public
RestResult
<
Boolean
>
edit
(
@PathVariable
(
"id"
)
Long
id
,
CenterCostRecord
centerCostRecord
)
{
centerCostRecord
.
setId
(
id
);
return
success
(
centerCostRecordService
.
updateById
(
centerCostRecord
));
}
@ApiOperation
(
"添加"
)
@PostMapping
(
"/"
)
public
RestResult
<
Boolean
>
add
(
CenterCostRecord
centerCostRecord
)
{
return
success
(
centerCostRecordService
.
save
(
centerCostRecord
));
}
@ApiOperation
(
"根据 ids 删除"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"ids"
,
value
=
"主键列表"
,
required
=
true
,
paramType
=
"query"
,
allowMultiple
=
true
,
dataTypeClass
=
Long
.
class
),
})
@DeleteMapping
(
"/"
)
public
RestResult
<
Boolean
>
delete
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
)
{
return
success
(
centerCostRecordService
.
removeByIds
(
ids
));
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustController.java
View file @
c73c9c9c
...
...
@@ -858,7 +858,7 @@ public class EntrustController extends ServiceController {
@ApiOperation
(
"修改检测委托书打印状态"
)
@Login
(
action
=
Action
.
Skip
)
@PostMapping
(
"/update_print_status"
)
public
RestResult
<
Boolean
>
updatePrintStatus
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
)
{
return
success
(
entrustService
.
updatePrintStatus
(
ids
));
public
RestResult
<
Boolean
>
updatePrintStatus
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
,
@RequestParam
(
"userId"
)
Long
userId
)
{
return
success
(
entrustService
.
updatePrintStatus
(
ids
,
userId
));
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/mapper/CenterCostMapper.java
0 → 100644
View file @
c73c9c9c
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
mapper
;
import
com.patzn.cloud.service.hmhj.entity.CenterCost
;
import
com.patzn.cloud.commons.mapper.BatchMapper
;
/**
* <p>
* 中心成本 Mapper 接口
* </p>
*
* @author patzn
* @since 2021-07-16
*/
public
interface
CenterCostMapper
extends
BatchMapper
<
CenterCost
>
{
}
src/main/java/com/patzn/cloud/service/lims/hmhj/mapper/CenterCostRecordMapper.java
0 → 100644
View file @
c73c9c9c
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
mapper
;
import
com.patzn.cloud.service.hmhj.entity.CenterCostRecord
;
import
com.patzn.cloud.commons.mapper.BatchMapper
;
/**
* <p>
* 中心成本操作日志 Mapper 接口
* </p>
*
* @author patzn
* @since 2021-07-16
*/
public
interface
CenterCostRecordMapper
extends
BatchMapper
<
CenterCostRecord
>
{
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/ICenterCostRecordService.java
0 → 100644
View file @
c73c9c9c
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
service
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.patzn.cloud.commons.service.IBaseService
;
import
com.patzn.cloud.service.hmhj.entity.CenterCostRecord
;
import
java.util.List
;
/**
* 中心成本操作日志 服务类
*
* @author patzn
* @since 2021-07-16
*/
public
interface
ICenterCostRecordService
extends
IBaseService
<
CenterCostRecord
>
{
Page
<
CenterCostRecord
>
page
(
Page
<
CenterCostRecord
>
page
,
CenterCostRecord
centerCostRecord
);
boolean
removeByIds
(
List
<
Long
>
ids
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/ICenterCostService.java
0 → 100644
View file @
c73c9c9c
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
service
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.patzn.cloud.commons.service.IBaseService
;
import
com.patzn.cloud.service.hmhj.entity.CenterCost
;
import
java.util.List
;
/**
* 中心成本 服务类
*
* @author patzn
* @since 2021-07-16
*/
public
interface
ICenterCostService
extends
IBaseService
<
CenterCost
>
{
Page
<
CenterCost
>
page
(
Page
<
CenterCost
>
page
,
CenterCost
centerCost
);
boolean
removeByIds
(
List
<
Long
>
ids
);
boolean
update
(
CenterCost
centerCost
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustService.java
View file @
c73c9c9c
...
...
@@ -95,7 +95,7 @@ public interface IEntrustService extends IBaseService<Entrust> {
Boolean
exportEntrust
(
List
<
Long
>
ids
,
HttpServletResponse
response
);
/* 修改检测委托书的打印状态 */
Boolean
updatePrintStatus
(
List
<
Long
>
ids
);
Boolean
updatePrintStatus
(
List
<
Long
>
ids
,
Long
userId
);
Boolean
saveOutEntrust
(
EntrustDTO
dto
,
Account
account
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/CenterCostRecordServiceImpl.java
0 → 100644
View file @
c73c9c9c
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
service
.
impl
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.mapper.Wrapper
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.patzn.cloud.commons.service.impl.BaseServiceImpl
;
import
com.patzn.cloud.service.hmhj.entity.CenterCostRecord
;
import
com.patzn.cloud.service.lims.hmhj.mapper.CenterCostRecordMapper
;
import
com.patzn.cloud.service.lims.hmhj.service.ICenterCostRecordService
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* 中心成本操作日志 服务实现类
*
* @author patzn
* @since 2021-07-16
*/
@Service
public
class
CenterCostRecordServiceImpl
extends
BaseServiceImpl
<
CenterCostRecordMapper
,
CenterCostRecord
>
implements
ICenterCostRecordService
{
@Override
public
Page
<
CenterCostRecord
>
page
(
Page
<
CenterCostRecord
>
page
,
CenterCostRecord
centerCostRecord
)
{
Wrapper
wrapper
=
new
EntityWrapper
<>(
centerCostRecord
);
return
this
.
page
(
page
,
wrapper
);
}
@Override
public
boolean
removeByIds
(
List
<
Long
>
ids
)
{
return
baseMapper
.
deleteBatchIds
(
ids
)
>
0
;
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/CenterCostServiceImpl.java
0 → 100644
View file @
c73c9c9c
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
service
.
impl
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.mapper.Wrapper
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.patzn.cloud.commons.controller.LoginHelper
;
import
com.patzn.cloud.commons.service.impl.BaseServiceImpl
;
import
com.patzn.cloud.service.hmhj.entity.CenterCost
;
import
com.patzn.cloud.service.hmhj.entity.CenterCostRecord
;
import
com.patzn.cloud.service.lims.base.service.ILmsPropertyService
;
import
com.patzn.cloud.service.lims.hmhj.mapper.CenterCostMapper
;
import
com.patzn.cloud.service.lims.hmhj.service.ICenterCostRecordService
;
import
com.patzn.cloud.service.lims.hmhj.service.ICenterCostService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* 中心成本 服务实现类
*
* @author patzn
* @since 2021-07-16
*/
@Service
public
class
CenterCostServiceImpl
extends
BaseServiceImpl
<
CenterCostMapper
,
CenterCost
>
implements
ICenterCostService
{
@Autowired
private
ILmsPropertyService
lmsPropertyService
;
@Autowired
private
ICenterCostRecordService
centerCostRecordService
;
@Override
public
Page
<
CenterCost
>
page
(
Page
<
CenterCost
>
page
,
CenterCost
centerCost
)
{
Wrapper
wrapper
=
new
EntityWrapper
<>(
centerCost
);
return
this
.
page
(
page
,
wrapper
);
}
@Override
public
boolean
removeByIds
(
List
<
Long
>
ids
)
{
return
baseMapper
.
deleteBatchIds
(
ids
)
>
0
;
}
@Override
public
boolean
update
(
CenterCost
centerCost
)
{
/* 更新时添加对比信息 */
CenterCost
ccInDB
=
this
.
getById
(
centerCost
.
getId
());
String
remark
=
lmsPropertyService
.
getCompareDifferent
(
centerCost
,
ccInDB
,
"中心成本对比"
,
"修改信息:"
);
if
(
StringUtils
.
isNotEmpty
(
remark
))
{
CenterCostRecord
record
=
new
CenterCostRecord
();
record
.
setCenterCostId
(
centerCost
.
getId
());
record
.
setRemark
(
remark
);
record
.
setOperator
(
LoginHelper
.
getAccount
().
getUserName
());
record
.
setOperatorId
(
LoginHelper
.
getAccount
().
getUserId
());
centerCostRecordService
.
save
(
record
);
}
return
super
.
updateById
(
centerCost
);
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
View file @
c73c9c9c
...
...
@@ -1264,11 +1264,12 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
/* 修改检测委托书的状态 */
@Override
public
Boolean
updatePrintStatus
(
List
<
Long
>
ids
)
{
public
Boolean
updatePrintStatus
(
List
<
Long
>
ids
,
Long
userId
)
{
if
(
CollectionUtils
.
isNotEmpty
(
ids
))
{
List
<
Entrust
>
entrusts
=
ids
.
stream
().
map
(
id
->
{
Entrust
entrust
=
new
Entrust
();
entrust
.
setId
(
id
);
entrust
.
setLid
(
userId
);
entrust
.
setPrintStatus
(
1
);
return
entrust
;
}).
collect
(
Collectors
.
toList
());
...
...
@@ -1282,7 +1283,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
private
ByteArrayOutputStream
getEntrustBaos
()
{
InputStream
inputStream
=
this
.
getClass
().
getClassLoader
().
getResourceAsStream
(
"
\\templates\\word\\entrust\\
EntrustExportTemplate.docx"
);
InputStream
inputStream
=
this
.
getClass
().
getClassLoader
().
getResourceAsStream
(
"
templates/word/entrust/
EntrustExportTemplate.docx"
);
RestAssert
.
fail
(
null
==
inputStream
,
"委托检测书模板获取失败"
);
byte
[]
buffer
=
new
byte
[
1024
];
int
len
;
...
...
src/main/resources/mapper/base/LmsPropertyMapper.xml
0 → 100644
View file @
c73c9c9c
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.patzn.cloud.service.lims.base.mapper.LmsPropertyMapper"
>
<select
id=
"selectLmsPropertyList"
resultType=
"com.patzn.cloud.service.lims.base.entity.LmsProperty"
>
SELECT id,pid,name,code FROM lms_property WHERE type= #{type} and status=1
ORDER BY sort
</select>
</mapper>
src/main/resources/mapper/hmhj/CenterCostMapper.xml
0 → 100644
View file @
c73c9c9c
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.patzn.cloud.service.lims.hmhj.mapper.CenterCostMapper"
>
</mapper>
src/main/resources/mapper/hmhj/CenterCostRecordMapper.xml
0 → 100644
View file @
c73c9c9c
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.patzn.cloud.service.lims.hmhj.mapper.CenterCostRecordMapper"
>
</mapper>
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