DgArchivesDestructionServiceImpl.java
6.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
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.destroy.mapper.DgArchivesDestructionMapper;
import com.pashanhoo.destroy.service.DgArchivesDestructionService;
import com.pashanhoo.destroycatalog.entity.DgDestructionCatalogConverter;
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.util.List;
/**
* <p>
* 档案销毁 服务实现类
* </p>
*
* @author
* @since 2021-11-05
*/
@Service
public class DgArchivesDestructionServiceImpl extends ServiceImpl<DgArchivesDestructionMapper, DgArchivesDestructionDO> implements DgArchivesDestructionService {
@Autowired
private DgArchivesDestructionConverter dgarchivesdestructionConverter;
@Autowired
private DgArchivesDestructionMapper dgarchivesdestructionMapper;
@Autowired
private DgDestructionCatalogService catalogService;
@Autowired
private DgDestructionCatalogConverter catalogConverter;
@Autowired
private DgArchivesService archivesService;
@Autowired
SysCodeUtil sysCodeUtil;
@Autowired
private DgLendMapper dglendMapper;
/**
* 新增记录
* @param request
* @return
*/
@Override
public Result insertDgArchivesDestruction(AddDgArchivesDestructionRequest request) {
DgArchivesDestructionDO dgarchivesdestructionDO = dgarchivesdestructionConverter.addRequest2DO(request);
String id= IdWorker.get32UUID();
dgarchivesdestructionDO.setBsmDestruction(id);
this.save(dgarchivesdestructionDO);
return Result.ok(id);
}
@Override
public Result showArchivesForDestruction(DgArchivesSearchRequest request) {
request.setDazt(4);
return Result.ok(archivesService.searchDgArchivesList(request));
}
/**
* 根据主键查询记录详情
* @param id
* @return
*/
@Override
public DgArchivesDestructionDetailVO getDgArchivesDestructionDetailById(String id) {
DgArchivesDestructionDO dgarchivesdestructionDO = this.getById(id);
return dgarchivesdestructionConverter.do2DetailVO(dgarchivesdestructionDO);
}
/**
* 修改单条记录
* @param request
* @return
*/
@Override
public boolean updateDgArchivesDestruction(UpdateDgArchivesDestructionRequest request) {
DgArchivesDestructionDO dgarchivesdestructionDO = dgarchivesdestructionConverter.updateRequest2DO(request);
return this.updateById(dgarchivesdestructionDO);
}
/**
* 根据条件进行列表查询
* @param request
* @return
*/
@Override
public Result searchDgArchivesDestructionList(DgArchivesDestructionSearchRequest request) {
PageHelper.startPage(request.getCurrentPage(), request.getPageSize());
List<DgArchivesDestructionListVO> jyListVOList = dgarchivesdestructionMapper.selectXhResult(request);
PageInfo<DgArchivesDestructionListVO> pageInfo = new PageInfo<DgArchivesDestructionListVO>(jyListVOList);
return Result.ok(pageInfo);
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result deleteDgArchivesDestruction(String bsm_destruction) {
//删除销毁记录表数据
dgarchivesdestructionMapper.deleteById(bsm_destruction);
//删除档案销毁目录数据
catalogService.deleteDestructionCatalog(bsm_destruction);
//修改档案信息表状态
dgarchivesdestructionMapper.updateArchivesStatus(bsm_destruction,"4");
return Result.ok();
}
@Override
public Result queryArchivesInfo(String bsm_destruction) {
return Result.ok(dgarchivesdestructionMapper.queryArchivesInfo(bsm_destruction));
}
@Override
public Result deleteDestructionArchivescataLog(String bsmArchives) {
catalogService.deleteDestructionCatalog(bsmArchives);
return Result.ok();
}
@Override
@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();
}
/**
* 根据销毁清册编号获取左侧档案号菜单
*
* @param xhqcbh 销毁清册编号
* @return
*/
@Override
public List getDestroyLeftMenu(String xhqcbh) {
List<DgArchivesDO> dgArchivesDestructionDOS = dgarchivesdestructionMapper.getDestroyLeftMenu(xhqcbh);
return dgArchivesDestructionDOS;
}
}