|
@@ -84,7 +84,9 @@ public class AssetsProductionServiceImpl extends ServiceImpl<AssetsProductionMap
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
public Boolean add(AssetsProduction assetsProduction) {
|
|
public Boolean add(AssetsProduction assetsProduction) {
|
|
|
|
+ this.save(assetsProduction);
|
|
// 选择产品时给当前选择产品的评估对象添加选择产品记录
|
|
// 选择产品时给当前选择产品的评估对象添加选择产品记录
|
|
List<BusinessProductionChoiceLog> choiceLogList = new ArrayList<>();
|
|
List<BusinessProductionChoiceLog> choiceLogList = new ArrayList<>();
|
|
for (Long targetId : assetsProduction.getTargetIdList()){
|
|
for (Long targetId : assetsProduction.getTargetIdList()){
|
|
@@ -93,14 +95,31 @@ public class AssetsProductionServiceImpl extends ServiceImpl<AssetsProductionMap
|
|
choiceLog.setProductionType(assetsProduction.getProductionType());
|
|
choiceLog.setProductionType(assetsProduction.getProductionType());
|
|
choiceLog.setBusinessId(assetsProduction.getBusinessId());
|
|
choiceLog.setBusinessId(assetsProduction.getBusinessId());
|
|
choiceLog.setTargetId(targetId);
|
|
choiceLog.setTargetId(targetId);
|
|
|
|
+ choiceLog.setPrintCount(assetsProduction.getPrintCount());
|
|
|
|
+ choiceLog.setProductionId(assetsProduction.getId());
|
|
choiceLogList.add(choiceLog);
|
|
choiceLogList.add(choiceLog);
|
|
}
|
|
}
|
|
- choiceLogService.saveBatch(choiceLogList);
|
|
|
|
- return this.save(assetsProduction);
|
|
|
|
|
|
+ return choiceLogService.saveBatch(choiceLogList);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
public Boolean update(AssetsProduction assetsProduction) {
|
|
public Boolean update(AssetsProduction assetsProduction) {
|
|
|
|
+ // 更新选择产品时给当前选择产品的评估对象更新选择产品记录
|
|
|
|
+ List<BusinessProductionChoiceLog> choiceLogList = new ArrayList<>();
|
|
|
|
+ for (Long targetId : assetsProduction.getTargetIdList()){
|
|
|
|
+ BusinessProductionChoiceLog choiceLog = choiceLogService.getOne(new LambdaQueryWrapper<BusinessProductionChoiceLog>()
|
|
|
|
+ .eq(BusinessProductionChoiceLog::getBusinessType, "ASSET_BUSINESS")
|
|
|
|
+ .eq(BusinessProductionChoiceLog::getBusinessId, assetsProduction.getBusinessId())
|
|
|
|
+ .eq(BusinessProductionChoiceLog::getTargetId, targetId)
|
|
|
|
+ .eq(BaseEntity::getDeleted, 0)
|
|
|
|
+ .eq(BusinessProductionChoiceLog::getTakeNoStatus, 0));
|
|
|
|
+ choiceLog.setProductionId(assetsProduction.getId());
|
|
|
|
+ choiceLog.setProductionType(assetsProduction.getProductionType());
|
|
|
|
+ choiceLog.setPrintCount(assetsProduction.getPrintCount());
|
|
|
|
+ choiceLogList.add(choiceLog);
|
|
|
|
+ }
|
|
|
|
+ choiceLogService.updateBatchById(choiceLogList);
|
|
return this.updateById(assetsProduction);
|
|
return this.updateById(assetsProduction);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -253,7 +272,7 @@ public class AssetsProductionServiceImpl extends ServiceImpl<AssetsProductionMap
|
|
} else { // 意见书可以直接出库
|
|
} else { // 意见书可以直接出库
|
|
return this.update(new LambdaUpdateWrapper<AssetsProduction>()
|
|
return this.update(new LambdaUpdateWrapper<AssetsProduction>()
|
|
.set(AssetsProduction::getRepertoryState, 1)
|
|
.set(AssetsProduction::getRepertoryState, 1)
|
|
- .set(AssetsProduction::getRepertoryInTime, new Date())
|
|
|
|
|
|
+ .set(AssetsProduction::getRepertoryOutTime, new Date())
|
|
.eq(BaseEntity::getId, wareHouseDTO.getProductionId())
|
|
.eq(BaseEntity::getId, wareHouseDTO.getProductionId())
|
|
.eq(AssetsProduction::getProductionNo, wareHouseDTO.getProductionNo()));
|
|
.eq(AssetsProduction::getProductionNo, wareHouseDTO.getProductionNo()));
|
|
}
|
|
}
|