|
@@ -23,7 +23,9 @@ import com.lframework.starter.web.core.utils.PageHelperUtil; |
|
@@ -23,7 +23,9 @@ import com.lframework.starter.web.core.utils.PageHelperUtil; |
|
23
|
import com.lframework.starter.common.utils.Assert;
|
23
|
import com.lframework.starter.common.utils.Assert;
|
|
24
|
import com.lframework.starter.web.inner.components.oplog.OtherOpLogType;
|
24
|
import com.lframework.starter.web.inner.components.oplog.OtherOpLogType;
|
|
25
|
import com.lframework.starter.web.inner.entity.SysDataDicItem;
|
25
|
import com.lframework.starter.web.inner.entity.SysDataDicItem;
|
|
|
|
26
|
+import com.lframework.starter.web.inner.entity.SysUser;
|
|
26
|
import com.lframework.starter.web.inner.service.system.SysDataDicItemService;
|
27
|
import com.lframework.starter.web.inner.service.system.SysDataDicItemService;
|
|
|
|
28
|
+import com.lframework.starter.web.inner.service.system.SysUserService;
|
|
27
|
import com.lframework.xingyun.basedata.entity.Workshop;
|
29
|
import com.lframework.xingyun.basedata.entity.Workshop;
|
|
28
|
import com.lframework.xingyun.basedata.service.workshop.WorkshopService;
|
30
|
import com.lframework.xingyun.basedata.service.workshop.WorkshopService;
|
|
29
|
import com.lframework.xingyun.sc.entity.*;
|
31
|
import com.lframework.xingyun.sc.entity.*;
|
|
@@ -70,6 +72,8 @@ public class PurchaseOrderInfoServiceImpl extends BaseMpServiceImpl<PurchaseOrde |
|
@@ -70,6 +72,8 @@ public class PurchaseOrderInfoServiceImpl extends BaseMpServiceImpl<PurchaseOrde |
|
70
|
@Resource
|
72
|
@Resource
|
|
71
|
private SysDataDicItemService sysDataDicItemService;
|
73
|
private SysDataDicItemService sysDataDicItemService;
|
|
72
|
@Resource
|
74
|
@Resource
|
|
|
|
75
|
+ private SysUserService sysUserService;
|
|
|
|
76
|
+ @Resource
|
|
73
|
private ContractStdProcessingLineService contractStdProcessingLineService;
|
77
|
private ContractStdProcessingLineService contractStdProcessingLineService;
|
|
74
|
@Resource
|
78
|
@Resource
|
|
75
|
private OrderDetailReportService orderDetailReportService;
|
79
|
private OrderDetailReportService orderDetailReportService;
|
|
@@ -244,13 +248,15 @@ public class PurchaseOrderInfoServiceImpl extends BaseMpServiceImpl<PurchaseOrde |
|
@@ -244,13 +248,15 @@ public class PurchaseOrderInfoServiceImpl extends BaseMpServiceImpl<PurchaseOrde |
|
244
|
if (vo.getPackagingFee() != null) {
|
248
|
if (vo.getPackagingFee() != null) {
|
|
245
|
data.setPackagingFee(vo.getPackagingFee());
|
249
|
data.setPackagingFee(vo.getPackagingFee());
|
|
246
|
}
|
250
|
}
|
|
|
|
251
|
+ String createById = SecurityUtil.getCurrentUser().getId();
|
|
247
|
if (!StringUtil.isBlank(vo.getContractCreateById())) {
|
252
|
if (!StringUtil.isBlank(vo.getContractCreateById())) {
|
|
248
|
data.setContractCreateById(vo.getContractCreateById());
|
253
|
data.setContractCreateById(vo.getContractCreateById());
|
|
249
|
- data.setCreateById(vo.getContractCreateById());
|
254
|
+ createById = vo.getContractCreateById();
|
|
250
|
}
|
255
|
}
|
|
251
|
-
|
|
|
|
252
|
- if (StringUtil.isBlank(data.getContractCreateById())) {
|
|
|
|
253
|
- data.setCreateById(SecurityUtil.getCurrentUser().getId());
|
256
|
+ data.setCreateById(createById);
|
|
|
|
257
|
+ SysUser createUser = sysUserService.findById(createById);
|
|
|
|
258
|
+ if (createUser != null) {
|
|
|
|
259
|
+ data.setCreateBy(createUser.getName());
|
|
254
|
}
|
260
|
}
|
|
255
|
|
261
|
|
|
256
|
data.setSampleOrder(vo.isSampleOrder());
|
262
|
data.setSampleOrder(vo.isSampleOrder());
|
|
@@ -278,6 +284,7 @@ public class PurchaseOrderInfoServiceImpl extends BaseMpServiceImpl<PurchaseOrde |
|
@@ -278,6 +284,7 @@ public class PurchaseOrderInfoServiceImpl extends BaseMpServiceImpl<PurchaseOrde |
|
278
|
}
|
284
|
}
|
|
279
|
}
|
285
|
}
|
|
280
|
if (!vo.isNoFlowInstance()) {
|
286
|
if (!vo.isNoFlowInstance()) {
|
|
|
|
287
|
+ buildFlowStartUser(data);
|
|
281
|
flowInstanceWrapperService.startInstance(BPM_FLAG, data.getId(), BPM_FLAG, data);
|
288
|
flowInstanceWrapperService.startInstance(BPM_FLAG, data.getId(), BPM_FLAG, data);
|
|
282
|
}
|
289
|
}
|
|
283
|
//生成订单明细报表
|
290
|
//生成订单明细报表
|
|
@@ -286,6 +293,24 @@ public class PurchaseOrderInfoServiceImpl extends BaseMpServiceImpl<PurchaseOrde |
|
@@ -286,6 +293,24 @@ public class PurchaseOrderInfoServiceImpl extends BaseMpServiceImpl<PurchaseOrde |
|
286
|
return data.getId();
|
293
|
return data.getId();
|
|
287
|
}
|
294
|
}
|
|
288
|
|
295
|
|
|
|
|
296
|
+ private void buildFlowStartUser(PurchaseOrderInfo data) {
|
|
|
|
297
|
+ if (data == null) {
|
|
|
|
298
|
+ return;
|
|
|
|
299
|
+ }
|
|
|
|
300
|
+
|
|
|
|
301
|
+ String flowUserId = StringUtils.isNotBlank(data.getCreateById())
|
|
|
|
302
|
+ ? data.getCreateById()
|
|
|
|
303
|
+ : SecurityUtil.getCurrentUser().getId();
|
|
|
|
304
|
+ data.setUserId(flowUserId);
|
|
|
|
305
|
+
|
|
|
|
306
|
+ if (StringUtils.isBlank(data.getCreateBy())) {
|
|
|
|
307
|
+ SysUser createUser = sysUserService.findById(flowUserId);
|
|
|
|
308
|
+ if (createUser != null) {
|
|
|
|
309
|
+ data.setCreateBy(createUser.getName());
|
|
|
|
310
|
+ }
|
|
|
|
311
|
+ }
|
|
|
|
312
|
+ }
|
|
|
|
313
|
+
|
|
289
|
private void createOrderDetailReport(String businessId) {
|
314
|
private void createOrderDetailReport(String businessId) {
|
|
290
|
PurchaseOrderInfo purchaseOrderInfo = this.findById(businessId);
|
315
|
PurchaseOrderInfo purchaseOrderInfo = this.findById(businessId);
|
|
291
|
ContractDistributorStandard standard = contractDistributorStandardService.findById(purchaseOrderInfo.getContractId());
|
316
|
ContractDistributorStandard standard = contractDistributorStandardService.findById(purchaseOrderInfo.getContractId());
|