Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
荆蔚杰
/
java.archive
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
bfc97dda
authored
2021-11-29 11:16:42 +0800
by
夏齐
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
档案销毁相关接口优化
1 parent
8af4d009
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
91 additions
and
57 deletions
src/main/java/com/pashanhoo/destroy/controller/DgArchivesDestructionController.java
src/main/java/com/pashanhoo/destroy/entity/DgArchivesDestructionDO.java
src/main/java/com/pashanhoo/destroy/mapper/DgArchivesDestructionMapper.java
src/main/java/com/pashanhoo/destroy/service/DgArchivesDestructionService.java
src/main/java/com/pashanhoo/destroy/service/impl/DgArchivesDestructionServiceImpl.java
src/main/java/com/pashanhoo/destroycatalog/controller/DgDestructionCatalogController.java
src/main/java/com/pashanhoo/destroycatalog/service/DgDestructionCatalogService.java
src/main/java/com/pashanhoo/destroycatalog/service/impl/DgDestructionCatalogServiceImpl.java
src/main/resources/mapper/DgArchivesDestructionMapper.xml
src/main/java/com/pashanhoo/destroy/controller/DgArchivesDestructionController.java
View file @
bfc97dd
...
...
@@ -41,32 +41,20 @@ public class DgArchivesDestructionController {
public
Result
deleteDgArchivesDestructionByIds
(
@ApiParam
(
"档案销毁ID"
)
@RequestParam
(
value
=
"bsm_destruction"
)
String
bsm_destruction
)
{
return
dgarchivesdestructionService
.
deleteDgArchivesDestruction
(
bsm_destruction
);
}
@PostMapping
(
"insertDgArchivesDestruction"
)
@ApiOperation
(
"新增档案销毁"
)
public
Result
insertDgArchivesDestruction
(
@RequestBody
AddDgArchivesDestructionRequest
request
)
{
return
dgarchivesdestructionService
.
insertDgArchivesDestruction
(
request
);
@GetMapping
(
"getDgArchivesDestructionDetailById"
)
@ApiOperation
(
value
=
"查询档案销毁信息"
)
public
Result
getDgArchivesDestructionDetailById
(
@ApiParam
(
"档案销毁ID"
)
@RequestParam
String
bsm_destruction
)
{
return
Result
.
ok
(
dgarchivesdestructionService
.
getDgArchivesDestructionDetailById
(
bsm_destruction
));
}
@PostMapping
(
"showArchivesForDestruction"
)
@ApiOperation
(
"展示可以选择销毁的列表"
)
public
Result
showArchivesForDestruction
(
@RequestBody
DgArchivesSearchRequest
request
)
{
return
dgarchivesdestructionService
.
showArchivesForDestruction
(
request
);
}
@PostMapping
(
"addDestructionArchivesInfo"
)
@ApiOperation
(
value
=
"选择销毁档案List"
)
public
Result
addDestructionArchivesInfo
(
@RequestBody
List
<
AddDgDestructionCatalogRequest
>
archivesList
)
{
return
dgarchivesdestructionService
.
addDestructionArchivesInfo
(
archivesList
);
}
@PostMapping
(
"queryArchivesInfo"
)
@ApiOperation
(
value
=
"档案列表信息展示"
)
public
Result
queryArchivesInfo
(
@ApiParam
(
"档案销毁记录ID"
)
@RequestParam
(
value
=
"bsm_destruction"
)
String
bsm_destruction
)
{
return
dgarchivesdestructionService
.
queryArchivesInfo
(
bsm_destruction
);
}
@GetMapping
(
"deleteArchivesInfo"
)
@ApiOperation
(
value
=
"删除档案列表中的档案信息"
)
public
Result
deleteArchivesInfo
(
@ApiParam
(
"档案ID"
)
@RequestParam
(
value
=
"bsmArchives"
)
String
bsmArchives
)
{
return
dgarchivesdestructionService
.
deleteDestructionArchivescataLog
(
bsmArchives
);
public
Result
addDestructionArchivesInfo
(
@ApiParam
(
"案卷基本信息ID列表"
)
@RequestParam
(
value
=
"idList"
)
List
<
String
>
idList
)
{
return
dgarchivesdestructionService
.
addDestructionArchivesInfo
(
idList
);
}
@PostMapping
(
"updateDgArchivesDestruction"
)
@ApiOperation
(
"修改档案销毁记录信息"
)
...
...
@@ -76,10 +64,10 @@ public class DgArchivesDestructionController {
}
return
Result
.
error
(
"修改失败"
);
}
@GetMapping
(
"
getDgArchivesDestructionDetailById
"
)
@ApiOperation
(
value
=
"
查询档案销毁
信息"
)
public
Result
getDgArchivesDestructionDetailById
(
@ApiParam
(
"档案销毁ID"
)
@RequestParam
String
bsm_destruction
)
{
return
Result
.
ok
(
dgarchivesdestructionService
.
getDgArchivesDestructionDetailById
(
bsm_destruction
)
);
@GetMapping
(
"
deleteArchivesInfo
"
)
@ApiOperation
(
value
=
"
删除档案列表中的档案
信息"
)
public
Result
deleteArchivesInfo
(
@ApiParam
(
"档案ID"
)
@RequestParam
(
value
=
"bsmArchives"
)
String
bsmArchives
)
{
return
dgarchivesdestructionService
.
deleteDestructionArchivescataLog
(
bsmArchives
);
}
@GetMapping
(
"getDestructionArchivescataLog"
)
@ApiOperation
(
value
=
"查询档案销毁目录信息"
)
...
...
@@ -91,17 +79,11 @@ public class DgArchivesDestructionController {
public
Result
deleteDestructionArchivescataLog
(
@ApiParam
(
"档案销毁ID"
)
@RequestParam
(
value
=
"bsm_destruction"
)
String
bsm_destruction
)
{
return
dgarchivesdestructionService
.
deleteDestructionArchivescataLog
(
bsm_destruction
);
}
@PostMapping
(
"updateStateByArchives"
)
@ApiOperation
(
value
=
"新增档案销毁列表中的档案销毁操作"
)
public
Result
updateStateByArchives
(
@ApiParam
(
"档案业务信息ID列表"
)
@RequestParam
(
value
=
"idList"
)
List
<
String
>
idList
)
{
return
dgarchivesdestructionService
.
updateStateByArchives
(
idList
);
}
@GetMapping
(
"updateArchivesStateByDestruction"
)
@ApiOperation
(
value
=
"
编辑中的
销毁操作"
)
@ApiOperation
(
value
=
"销毁操作"
)
public
Result
updateArchivesStateByDestruction
(
@ApiParam
(
"档案销毁记录ID"
)
@RequestParam
(
value
=
"bsm_destruction"
)
String
bsm_destruction
)
{
return
dgarchivesdestructionService
.
updateArchivesStateByDestruction
(
bsm_destruction
);
}
@GetMapping
(
"getDestroyLeftMenu"
)
@ApiOperation
(
value
=
"根据销毁清册编号获取左侧档案号菜单"
)
public
Result
getDestroyLeftMenu
(
@ApiParam
(
"销毁清册编号"
)
@RequestParam
String
xhqcbh
)
{
...
...
src/main/java/com/pashanhoo/destroy/entity/DgArchivesDestructionDO.java
View file @
bfc97dd
...
...
@@ -77,6 +77,10 @@ public class DgArchivesDestructionDO implements Serializable {
*/
@TableField
(
"XHRQ"
)
private
Date
xhrq
;
/**
* 状态 1:销毁中,2:已销毁
*/
@TableField
(
"STATE"
)
private
String
state
;
}
...
...
src/main/java/com/pashanhoo/destroy/mapper/DgArchivesDestructionMapper.java
View file @
bfc97dd
...
...
@@ -35,4 +35,7 @@ public interface DgArchivesDestructionMapper extends BaseMapper<DgArchivesDestru
List
<
DgArchivesListVO
>
queryArchivesInfo
(
@Param
(
"bsm_destruction"
)
String
bsm_destruction
);
boolean
updateArchivesStatusBatch
(
@Param
(
"idList"
)
List
<
String
>
idList
,
@Param
(
"dazt"
)
String
dazt
);
boolean
updateDestructionArchivesStatus
(
@Param
(
"bsm_destruction"
)
String
bsm_destruction
,
@Param
(
"dazt"
)
String
dazt
);
}
...
...
src/main/java/com/pashanhoo/destroy/service/DgArchivesDestructionService.java
View file @
bfc97dd
...
...
@@ -49,10 +49,10 @@ public interface DgArchivesDestructionService extends IService<DgArchivesDestruc
Result
deleteDestructionArchivescataLog
(
String
bsmArchives
);
/**
* 选择销毁档案List
* @param
archives
List
* @param
id
List
* @return
*/
Result
addDestructionArchivesInfo
(
List
<
AddDgDestructionCatalogRequest
>
archives
List
);
Result
addDestructionArchivesInfo
(
List
<
String
>
id
List
);
/**
* 销毁接口
* @param bsm_destruction
...
...
src/main/java/com/pashanhoo/destroy/service/impl/DgArchivesDestructionServiceImpl.java
View file @
bfc97dd
package
com
.
pashanhoo
.
destroy
.
service
.
impl
;
import
cn.hutool.core.date.DateUtil
;
import
com.baomidou.mybatisplus.core.toolkit.IdWorker
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.pashanhoo.archive.entity.DgArchivesDO
;
import
com.pashanhoo.archive.entity.vo.DgArchivesSearchRequest
;
import
com.pashanhoo.archive.service.DgArchivesService
;
import
com.pashanhoo.common.Result
;
import
com.pashanhoo.common.util.SysCode.SysCodeUtil
;
import
com.pashanhoo.common.util.SysCode.SysCodeVO
;
import
com.pashanhoo.destroy.entity.DgArchivesDestructionConverter
;
import
com.pashanhoo.destroy.entity.DgArchivesDestructionDO
;
import
com.pashanhoo.destroy.entity.vo.*
;
import
com.pashanhoo.archive.entity.DgArchivesDO
;
import
com.pashanhoo.destroy.entity.vo.AddDgArchivesDestructionRequest
;
import
com.pashanhoo.destroy.entity.vo.DgArchivesDestructionDetailVO
;
import
com.pashanhoo.destroy.entity.vo.DgArchivesDestructionSearchRequest
;
import
com.pashanhoo.destroy.entity.vo.UpdateDgArchivesDestructionRequest
;
import
com.pashanhoo.destroy.mapper.DgArchivesDestructionMapper
;
import
com.pashanhoo.destroy.service.DgArchivesDestructionService
;
import
com.pashanhoo.destroycatalog.entity.DgDestructionCatalogConverter
;
import
com.pashanhoo.destroycatalog.entity.DgDestructionCatalogDO
;
import
com.pashanhoo.destroycatalog.entity.vo.AddDgDestructionCatalogRequest
;
import
com.pashanhoo.destroycatalog.service.DgDestructionCatalogService
;
import
com.pashanhoo.lend.mapper.DgLendMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
...
...
@@ -51,6 +48,10 @@ public class DgArchivesDestructionServiceImpl extends ServiceImpl<DgArchivesDest
private
DgDestructionCatalogConverter
catalogConverter
;
@Autowired
private
DgArchivesService
archivesService
;
@Autowired
SysCodeUtil
sysCodeUtil
;
@Autowired
private
DgLendMapper
dglendMapper
;
/**
...
...
@@ -133,21 +134,43 @@ public class DgArchivesDestructionServiceImpl extends ServiceImpl<DgArchivesDest
}
@Override
public
Result
addDestructionArchivesInfo
(
List
<
AddDgDestructionCatalogRequest
>
archivesList
)
{
List
<
DgDestructionCatalogDO
>
list
=
catalogConverter
.
addRequestList2DO
(
archivesList
);
catalogService
.
saveBatch
(
list
);
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Result
addDestructionArchivesInfo
(
List
<
String
>
idList
)
{
//获取补录编号
SysCodeVO
sysCodeVO
=
new
SysCodeVO
();
sysCodeVO
.
setTaskno
(
"XH"
+
DateUtil
.
year
(
DateUtil
.
date
()));
sysCodeVO
.
setCtype
(
"sequence"
);
sysCodeVO
.
setTaskname
(
"补录序列号"
);
sysCodeVO
.
setTaskchild
(
5
);
String
xhbh
=
sysCodeUtil
.
getSequence
(
sysCodeVO
);
//1.新增销毁案卷信息表数据
String
archivesUuid
=
IdWorker
.
get32UUID
();
DgArchivesDestructionDO
destructionDO
=
new
DgArchivesDestructionDO
();
destructionDO
.
setBsmDestruction
(
archivesUuid
);
destructionDO
.
setXhqcbh
(
xhbh
);
destructionDO
.
setFqr
(
"admin"
);
destructionDO
.
setShyj
(
"同意"
);
destructionDO
.
setState
(
"1"
);
dgarchivesdestructionMapper
.
insert
(
destructionDO
);
//2.新增销毁目录信息表
catalogService
.
saveBatchDestructionCatalog
(
idList
,
archivesUuid
);
//3.档案信息修改状态为修改中
dglendMapper
.
updateArchivesStatusBatch
(
idList
,
"5"
);
return
Result
.
ok
();
}
@Override
public
Result
updateArchivesStateByDestruction
(
String
bsm_destruction
)
{
//修改档案信息表状态
//
1.
修改档案信息表状态
dgarchivesdestructionMapper
.
updateArchivesStatus
(
bsm_destruction
,
"6"
);
//2.修改档案销毁信息表中的状态
dgarchivesdestructionMapper
.
updateDestructionArchivesStatus
(
bsm_destruction
,
"2"
);
return
Result
.
ok
();
}
@Override
public
Result
updateStateByArchives
(
List
<
String
>
idList
)
{
//1.修改档案基本信息表中的状态
dgarchivesdestructionMapper
.
updateArchivesStatusBatch
(
idList
,
"6"
);
return
Result
.
ok
();
}
...
...
src/main/java/com/pashanhoo/destroycatalog/controller/DgDestructionCatalogController.java
View file @
bfc97dd
...
...
@@ -23,18 +23,19 @@ import java.util.List;
*/
@RestController
@RequestMapping
(
"/system/dgDestructionCatalog/"
)
@Api
(
tags
=
"档案销毁目录接口"
)
public
class
DgDestructionCatalogController
{
@Autowired
private
DgDestructionCatalogService
dgdestructioncatalogService
;
@PostMapping
(
"
insertDg
DestructionCatalog"
)
@PostMapping
(
"
saveBatch
DestructionCatalog"
)
@ApiOperation
(
"新增档案销毁目录"
)
public
Result
insertDgDestructionCatalog
(
@RequestBody
AddDgDestructionCatalogRequest
request
){
if
(
dgdestructioncatalogService
.
insertDgDestructionCatalog
(
request
)){
return
Result
.
ok
();
public
Result
saveBatchDestructionCatalog
(
@ApiParam
(
"档案销毁目录ID列表"
)
@RequestParam
(
value
=
"idList"
)
List
<
String
>
idList
,
@ApiParam
(
"档案销毁信息ID"
)
String
bsm_destruction
){
boolean
flag
=
dgdestructioncatalogService
.
saveBatchDestructionCatalog
(
idList
,
bsm_destruction
);
if
(
flag
){
return
Result
.
ok
(
"批量新增目录成功"
);
}
else
{
return
Result
.
error
(
"批量新增目录失败"
);
}
return
Result
.
error
(
"新增失败"
);
}
@DeleteMapping
(
"deleteDgDestructionCatalogByIds"
)
...
...
src/main/java/com/pashanhoo/destroycatalog/service/DgDestructionCatalogService.java
View file @
bfc97dd
...
...
@@ -8,6 +8,9 @@ import com.pashanhoo.destroycatalog.entity.vo.DgDestructionCatalogDetailVO;
import
com.pashanhoo.destroycatalog.entity.vo.UpdateDgDestructionCatalogRequest
;
import
com.pashanhoo.destroycatalog.entity.vo.DgDestructionCatalogSearchRequest
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.ApiParam
;
import
java.util.List
;
/**
* <p>
...
...
@@ -19,11 +22,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
*/
public
interface
DgDestructionCatalogService
extends
IService
<
DgDestructionCatalogDO
>
{
/**
* 新增记录
* @param
request
*
批量销毁目录
新增记录
* @param
idList,bsm_destruction
* @return
*/
boolean
insertDgDestructionCatalog
(
AddDgDestructionCatalogRequest
request
);
boolean
saveBatchDestructionCatalog
(
List
<
String
>
idList
,
String
bsm_destruction
);
/**
* 根据主键查询记录详情
...
...
src/main/java/com/pashanhoo/destroycatalog/service/impl/DgDestructionCatalogServiceImpl.java
View file @
bfc97dd
package
com
.
pashanhoo
.
destroycatalog
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.toolkit.IdWorker
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.pashanhoo.common.Result
;
import
com.pashanhoo.destroycatalog.entity.DgDestructionCatalogConverter
;
...
...
@@ -16,6 +17,9 @@ import org.springframework.stereotype.Service;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* <p>
* 档案销毁目录 服务实现类
...
...
@@ -35,13 +39,22 @@ public class DgDestructionCatalogServiceImpl extends ServiceImpl<DgDestructionCa
/**
* 新增记录
* @param
request
* @param
idList,bsm_destruction
* @return
*/
@Override
public
boolean
insertDgDestructionCatalog
(
AddDgDestructionCatalogRequest
request
)
{
DgDestructionCatalogDO
dgdestructioncatalogDO
=
dgdestructioncatalogConverter
.
addRequest2DO
(
request
);
return
this
.
save
(
dgdestructioncatalogDO
);
public
boolean
saveBatchDestructionCatalog
(
List
<
String
>
idList
,
String
bsm_destruction
)
{
List
<
DgDestructionCatalogDO
>
list
=
new
ArrayList
<
DgDestructionCatalogDO
>();
DgDestructionCatalogDO
catalogDO
=
null
;
for
(
int
i
=
0
;
i
<
idList
.
size
();
i
++)
{
catalogDO
=
new
DgDestructionCatalogDO
();
catalogDO
.
setBsmDestructioncatalog
(
IdWorker
.
get32UUID
());
catalogDO
.
setBsmDestruction
(
bsm_destruction
);
catalogDO
.
setBsmArchives
(
idList
.
get
(
i
));
list
.
add
(
catalogDO
);
}
return
this
.
saveBatch
(
list
);
}
/**
...
...
src/main/resources/mapper/DgArchivesDestructionMapper.xml
View file @
bfc97dd
...
...
@@ -80,6 +80,11 @@
#{item,jdbcType=VARCHAR}
</foreach>
</update>
<update
id=
"updateDestructionArchivesStatus"
>
update DG_DESTRUCTION b
set b.dazt = #{dazt,jdbcType=VARCHAR}
where bsm_destruction=#{bsm_destruction,jdbcType=VARCHAR}
</update>
<select
id=
"selectXhResult"
resultMap=
"ShowDestructionResultMap"
>
select a.BSM_DESTRUCTION,
a.XHQCBH,
...
...
Please
register
or
sign in
to post a comment