|
@@ -261,23 +261,25 @@ public class ApsProductionOrderServiceImpl extends ServiceImpl<ApsProductionOrde
|
|
|
}
|
|
|
|
|
|
//================校验通过,保存或更新订单相关信息=====================
|
|
|
- //获取当前用户的所属工厂
|
|
|
- SysUserVo currentUser = CXCommonUtils.getCurrentUser();
|
|
|
- String tenantId = currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1];
|
|
|
+ if (req.getIsNeedSave()) {
|
|
|
+ //获取当前用户的所属工厂
|
|
|
+ SysUserVo currentUser = CXCommonUtils.getCurrentUser();
|
|
|
+ String tenantId = currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1];
|
|
|
|
|
|
- //保存主表信息
|
|
|
- apsProductionOrderDo.setTenantid(tenantId);
|
|
|
- this.saveOrUpdate(apsProductionOrderDo);
|
|
|
+ //保存主表信息
|
|
|
+ apsProductionOrderDo.setTenantid(tenantId);
|
|
|
+ this.saveOrUpdate(apsProductionOrderDo);
|
|
|
|
|
|
- //保存产品明细子表
|
|
|
- for (ApsProductDetailVo apsProductDetailVo : apsProductDetailVoList) {
|
|
|
- apsProductDetailVo.setTenantid(tenantId);
|
|
|
- }
|
|
|
- apsProductDetailService.saveOrUpdateBatch(productDetailDoList);
|
|
|
+ //保存产品明细子表
|
|
|
+ for (ApsProductDetailVo apsProductDetailVo : apsProductDetailVoList) {
|
|
|
+ apsProductDetailVo.setTenantid(tenantId);
|
|
|
+ }
|
|
|
+ apsProductDetailService.saveOrUpdateBatch(productDetailDoList);
|
|
|
|
|
|
- //保存合并订单子表
|
|
|
- for (ApsProductionMergeOrderDo apsProductionMergeOrderDo : apsProductionMergeOrderDoList) {
|
|
|
- apsProductionMergeOrderDo.setTenantid(tenantId);
|
|
|
+ //保存合并订单子表
|
|
|
+ for (ApsProductionMergeOrderDo apsProductionMergeOrderDo : apsProductionMergeOrderDoList) {
|
|
|
+ apsProductionMergeOrderDo.setTenantid(tenantId);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (checkSchedule) {
|