|
...
|
...
|
@@ -22,9 +22,12 @@ import com.lframework.starter.web.core.annotations.oplog.OpLog; |
|
22
|
22
|
import com.lframework.starter.web.core.utils.PageHelperUtil;
|
|
23
|
23
|
import com.lframework.starter.common.utils.Assert;
|
|
24
|
24
|
import com.lframework.starter.web.inner.components.oplog.OtherOpLogType;
|
|
|
25
|
+import com.lframework.xingyun.basedata.entity.Workshop;
|
|
|
26
|
+import com.lframework.xingyun.basedata.service.workshop.WorkshopService;
|
|
25
|
27
|
import com.lframework.xingyun.sc.entity.PurchaseOrderInfo;
|
|
26
|
28
|
import com.lframework.xingyun.sc.entity.PurchaseOrderRevoke;
|
|
27
|
29
|
import com.lframework.xingyun.sc.entity.PurchaseOrderRevokeLine;
|
|
|
30
|
+import com.lframework.xingyun.sc.handlers.TransactorHandler;
|
|
28
|
31
|
import com.lframework.xingyun.sc.mappers.PurchaseOrderRevokeMapper;
|
|
29
|
32
|
import com.lframework.xingyun.sc.service.order.PurchaseOrderInfoService;
|
|
30
|
33
|
import com.lframework.xingyun.sc.service.order.PurchaseOrderRevokeLineService;
|
|
...
|
...
|
@@ -54,6 +57,10 @@ public class PurchaseOrderRevokeServiceImpl extends BaseMpServiceImpl<PurchaseOr |
|
54
|
57
|
private FlowInstanceWrapperService flowInstanceWrapperService;
|
|
55
|
58
|
@Resource
|
|
56
|
59
|
private FlowTaskWrapperMapper flowTaskWrapperMapper;
|
|
|
60
|
+ @Resource
|
|
|
61
|
+ private TransactorHandler transactorHandler;
|
|
|
62
|
+ @Resource
|
|
|
63
|
+ private WorkshopService workshopService;
|
|
57
|
64
|
|
|
58
|
65
|
@Override
|
|
59
|
66
|
public PageResult<PurchaseOrderRevoke> query(Integer pageIndex, Integer pageSize, QueryPurchaseOrderRevokeVo vo) {
|
|
...
|
...
|
@@ -187,6 +194,15 @@ public class PurchaseOrderRevokeServiceImpl extends BaseMpServiceImpl<PurchaseOr |
|
187
|
194
|
|
|
188
|
195
|
//开启审核
|
|
189
|
196
|
data.setUserId(SecurityUtil.getCurrentUser().getId());
|
|
|
197
|
+ String deptCode = transactorHandler.returnDeptCode(SecurityUtil.getCurrentUser().getId());
|
|
|
198
|
+ data.setDeptCode(deptCode);
|
|
|
199
|
+ PurchaseOrderInfo purchaseOrderInfo = purchaseOrderInfoService.findById(vo.getPurchaseOrderId());
|
|
|
200
|
+ if (StringUtils.isNotEmpty(purchaseOrderInfo.getWorkshopId())) {
|
|
|
201
|
+ Workshop workshop = workshopService.findById(purchaseOrderInfo.getWorkshopId());
|
|
|
202
|
+ if (workshop != null) {
|
|
|
203
|
+ data.setWorkshopCode(workshop.getCode());
|
|
|
204
|
+ }
|
|
|
205
|
+ }
|
|
190
|
206
|
flowInstanceWrapperService.startInstance(BPM_FLAG, data.getId(), BPM_FLAG, data);
|
|
191
|
207
|
|
|
192
|
208
|
return data.getId();
|
|
...
|
...
|
@@ -232,6 +248,15 @@ public class PurchaseOrderRevokeServiceImpl extends BaseMpServiceImpl<PurchaseOr |
|
232
|
248
|
data.setSumRevokeQuantity(bigDecimal);
|
|
233
|
249
|
//开启审核
|
|
234
|
250
|
data.setUserId(SecurityUtil.getCurrentUser().getId());
|
|
|
251
|
+ String deptCode = transactorHandler.returnDeptCode(SecurityUtil.getCurrentUser().getId());
|
|
|
252
|
+ data.setDeptCode(deptCode);
|
|
|
253
|
+ PurchaseOrderInfo purchaseOrderInfo = purchaseOrderInfoService.findById(data.getPurchaseOrderId());
|
|
|
254
|
+ if (StringUtils.isNotEmpty(purchaseOrderInfo.getWorkshopId())) {
|
|
|
255
|
+ Workshop workshop = workshopService.findById(purchaseOrderInfo.getWorkshopId());
|
|
|
256
|
+ if (workshop != null) {
|
|
|
257
|
+ data.setWorkshopCode(workshop.getCode());
|
|
|
258
|
+ }
|
|
|
259
|
+ }
|
|
235
|
260
|
flowInstanceWrapperService.startInstance(BPM_FLAG, data.getId(), BPM_FLAG, data);
|
|
236
|
261
|
|
|
237
|
262
|
OpLogUtil.setVariable("id", data.getId());
|
...
|
...
|
|