|
...
|
...
|
@@ -3,7 +3,10 @@ package com.lframework.xingyun.sc.impl.ledger; |
|
3
|
3
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
4
|
4
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
5
|
5
|
import com.github.pagehelper.PageInfo;
|
|
|
6
|
+import com.lframework.starter.bpm.mappers.FlowTaskWrapperMapper;
|
|
|
7
|
+import com.lframework.starter.bpm.service.FlowInstanceWrapperService;
|
|
6
|
8
|
import com.lframework.starter.common.utils.CollectionUtil;
|
|
|
9
|
+import com.lframework.starter.web.core.components.security.SecurityUtil;
|
|
7
|
10
|
import com.lframework.starter.web.core.impl.BaseMpServiceImpl;
|
|
8
|
11
|
import com.lframework.starter.web.core.utils.PageResultUtil;
|
|
9
|
12
|
import com.lframework.starter.web.core.utils.OpLogUtil;
|
|
...
|
...
|
@@ -18,15 +21,22 @@ import com.lframework.starter.common.utils.StringUtil; |
|
18
|
21
|
import com.lframework.starter.common.utils.ObjectUtil;
|
|
19
|
22
|
import com.lframework.starter.common.utils.Assert;
|
|
20
|
23
|
import com.lframework.xingyun.sc.entity.FundCoordination;
|
|
|
24
|
+import com.lframework.xingyun.sc.entity.FundOrderingUnit;
|
|
|
25
|
+import com.lframework.xingyun.sc.entity.FundOrderingUnitDetail;
|
|
|
26
|
+import com.lframework.xingyun.sc.handlers.TransactorHandler;
|
|
21
|
27
|
import com.lframework.xingyun.sc.mappers.FundCoordinationMapper;
|
|
22
|
28
|
import com.lframework.xingyun.sc.service.ledger.FundCoordinationService;
|
|
|
29
|
+import com.lframework.xingyun.sc.service.ledger.FundOrderingUnitDetailService;
|
|
23
|
30
|
import com.lframework.xingyun.sc.service.ledger.FundOrderingUnitService;
|
|
24
|
31
|
import com.lframework.xingyun.sc.service.ledger.PendingDeliveryOrderService;
|
|
|
32
|
+import com.lframework.xingyun.sc.vo.ledger.detail.QueryFundOrderingUnitDetailVo;
|
|
25
|
33
|
import com.lframework.xingyun.sc.vo.ledger.fund.CreateFundCoordinationVo;
|
|
26
|
34
|
import com.lframework.xingyun.sc.vo.ledger.fund.QueryFundCoordinationVo;
|
|
27
|
35
|
import com.lframework.xingyun.sc.vo.ledger.fund.UpdateFundCoordinationVo;
|
|
28
|
36
|
import com.lframework.xingyun.sc.vo.ledger.pending.CreatePendingDeliveryOrderVo;
|
|
29
|
37
|
import com.lframework.xingyun.sc.vo.ledger.rel.CreateFundOrderingUnitVo;
|
|
|
38
|
+import com.lframework.xingyun.sc.vo.ledger.rel.QueryFundOrderingUnitVo;
|
|
|
39
|
+import org.apache.commons.collections.CollectionUtils;
|
|
30
|
40
|
import org.springframework.transaction.annotation.Transactional;
|
|
31
|
41
|
import org.springframework.stereotype.Service;
|
|
32
|
42
|
import javax.annotation.Resource;
|
|
...
|
...
|
@@ -34,11 +44,19 @@ import java.util.List; |
|
34
|
44
|
|
|
35
|
45
|
@Service
|
|
36
|
46
|
public class FundCoordinationServiceImpl extends BaseMpServiceImpl<FundCoordinationMapper, FundCoordination> implements FundCoordinationService {
|
|
|
47
|
+ private static final String BPM_FLAG = "FUND_COORDINATION";
|
|
37
|
48
|
|
|
38
|
49
|
@Resource
|
|
39
|
50
|
private FundOrderingUnitService fundOrderingUnitService;
|
|
40
|
51
|
@Resource
|
|
41
|
52
|
private PendingDeliveryOrderService pendingDeliveryOrderService;
|
|
|
53
|
+ @Resource
|
|
|
54
|
+ private TransactorHandler transactorHandler;
|
|
|
55
|
+ @Resource
|
|
|
56
|
+ private FlowInstanceWrapperService flowInstanceWrapperService;
|
|
|
57
|
+ @Resource
|
|
|
58
|
+ private FundOrderingUnitDetailService fundOrderingUnitDetailService;
|
|
|
59
|
+
|
|
42
|
60
|
|
|
43
|
61
|
@Override
|
|
44
|
62
|
public PageResult<FundCoordination> query(Integer pageIndex, Integer pageSize, QueryFundCoordinationVo vo) {
|
|
...
|
...
|
@@ -110,6 +128,7 @@ public class FundCoordinationServiceImpl extends BaseMpServiceImpl<FundCoordinat |
|
110
|
128
|
if (!StringUtil.isBlank(vo.getType())) {
|
|
111
|
129
|
data.setType(vo.getType());
|
|
112
|
130
|
}
|
|
|
131
|
+ data.setStatus("AUDIT");
|
|
113
|
132
|
|
|
114
|
133
|
getBaseMapper().insert(data);
|
|
115
|
134
|
|
|
...
|
...
|
@@ -131,6 +150,10 @@ public class FundCoordinationServiceImpl extends BaseMpServiceImpl<FundCoordinat |
|
131
|
150
|
}
|
|
132
|
151
|
OpLogUtil.setVariable("id", data.getId());
|
|
133
|
152
|
OpLogUtil.setExtra(vo);
|
|
|
153
|
+ //审核
|
|
|
154
|
+ String deptCode = transactorHandler.returnDeptCode(SecurityUtil.getCurrentUser().getId());
|
|
|
155
|
+ data.setDeptCode(deptCode);
|
|
|
156
|
+ flowInstanceWrapperService.startInstance(BPM_FLAG, data.getId(), BPM_FLAG, data);
|
|
134
|
157
|
|
|
135
|
158
|
return data.getId();
|
|
136
|
159
|
}
|
|
...
|
...
|
@@ -178,6 +201,57 @@ public class FundCoordinationServiceImpl extends BaseMpServiceImpl<FundCoordinat |
|
178
|
201
|
getBaseMapper().deleteById(id);
|
|
179
|
202
|
}
|
|
180
|
203
|
|
|
|
204
|
+ @OpLog(type = OtherOpLogType.class, name = "修改资金协调手续,ID:{}", params = {"#id"})
|
|
|
205
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
206
|
+ @Override
|
|
|
207
|
+ public void updateStatus(String id, String status) {
|
|
|
208
|
+
|
|
|
209
|
+ FundCoordination data = getBaseMapper().findById(id);
|
|
|
210
|
+ if (ObjectUtil.isNull(data)) {
|
|
|
211
|
+ throw new DefaultClientException("资金协调手续不存在!");
|
|
|
212
|
+ }
|
|
|
213
|
+
|
|
|
214
|
+ LambdaUpdateWrapper<FundCoordination> updateWrapper = Wrappers.lambdaUpdate(FundCoordination.class)
|
|
|
215
|
+ .set(FundCoordination::getStatus, StringUtil.isBlank(status) ? null : status)
|
|
|
216
|
+ .eq(FundCoordination::getId, id);
|
|
|
217
|
+
|
|
|
218
|
+ getBaseMapper().update(updateWrapper);
|
|
|
219
|
+
|
|
|
220
|
+ OpLogUtil.setVariable("id", data.getId());
|
|
|
221
|
+ OpLogUtil.setExtra(id);
|
|
|
222
|
+ }
|
|
|
223
|
+
|
|
|
224
|
+ @OpLog(type = OtherOpLogType.class, name = "修改资金协调手续,ID:{}", params = {"#id"})
|
|
|
225
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
226
|
+ @Override
|
|
|
227
|
+ public void reviewPass(String id) {
|
|
|
228
|
+
|
|
|
229
|
+ FundCoordination data = getBaseMapper().findById(id);
|
|
|
230
|
+ if (ObjectUtil.isNull(data)) {
|
|
|
231
|
+ throw new DefaultClientException("资金协调手续不存在!");
|
|
|
232
|
+ }
|
|
|
233
|
+ //更新状态
|
|
|
234
|
+ updateStatus(id, "PASS");
|
|
|
235
|
+ //更新应收款台账的协调办理日期
|
|
|
236
|
+ QueryFundOrderingUnitVo vo = new QueryFundOrderingUnitVo();
|
|
|
237
|
+ vo.setFundId(id);
|
|
|
238
|
+ List<FundOrderingUnit> fundOrderingUnitList = fundOrderingUnitService.query(vo);
|
|
|
239
|
+ if (CollectionUtil.isNotEmpty(fundOrderingUnitList)){
|
|
|
240
|
+ for (FundOrderingUnit fundOrderingUnit : fundOrderingUnitList) {
|
|
|
241
|
+ //资金协调手续订货单位应收款明细
|
|
|
242
|
+ QueryFundOrderingUnitDetailVo vo1 = new QueryFundOrderingUnitDetailVo();
|
|
|
243
|
+ vo1.setFundOrderingUnitId(fundOrderingUnit.getId());
|
|
|
244
|
+ List<FundOrderingUnitDetail> fundOrderingUnitDetailList = fundOrderingUnitDetailService.query(vo1);
|
|
|
245
|
+ if (CollectionUtils.isNotEmpty(fundOrderingUnitDetailList)) {
|
|
|
246
|
+ //更新应收款台账的协调办理日期
|
|
|
247
|
+
|
|
|
248
|
+ }
|
|
|
249
|
+ }
|
|
|
250
|
+ }
|
|
|
251
|
+ //解封订货单
|
|
|
252
|
+ }
|
|
|
253
|
+
|
|
|
254
|
+
|
|
181
|
255
|
@Override
|
|
182
|
256
|
public void cleanCacheByKey(Serializable key) {
|
|
183
|
257
|
|
...
|
...
|
|