|
@@ -141,6 +141,11 @@ public class AssetsProductionServiceImpl extends ServiceImpl<AssetsProductionMap
|
|
return this.updateById(assetsProduction);
|
|
return this.updateById(assetsProduction);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 更新产品选择类型
|
|
|
|
+ * @param assetsProduction prod
|
|
|
|
+ * @return Boolean
|
|
|
|
+ */
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public Boolean updateChoice(AssetsProduction assetsProduction) {
|
|
public Boolean updateChoice(AssetsProduction assetsProduction) {
|
|
@@ -153,12 +158,24 @@ public class AssetsProductionServiceImpl extends ServiceImpl<AssetsProductionMap
|
|
.eq(BusinessProductionChoiceLog::getTargetId, targetId)
|
|
.eq(BusinessProductionChoiceLog::getTargetId, targetId)
|
|
.eq(BaseEntity::getDeleted, 0)
|
|
.eq(BaseEntity::getDeleted, 0)
|
|
.eq(BusinessProductionChoiceLog::getTakeNoStatus, 0));
|
|
.eq(BusinessProductionChoiceLog::getTakeNoStatus, 0));
|
|
- choiceLog.setProductionId(assetsProduction.getId());
|
|
|
|
- choiceLog.setProductionType(assetsProduction.getProductionType());
|
|
|
|
- choiceLog.setPrintCount(assetsProduction.getPrintCount());
|
|
|
|
|
|
+ // 判断产品选择记录是否为空
|
|
|
|
+ if (ObjectUtil.isNotNull(choiceLog)) { // 不为空直接在原有信息更新
|
|
|
|
+ choiceLog.setProductionId(assetsProduction.getId());
|
|
|
|
+ choiceLog.setProductionType(assetsProduction.getProductionType());
|
|
|
|
+ choiceLog.setPrintCount(assetsProduction.getPrintCount());
|
|
|
|
+ } else { // 为空说明该评估对象没有产品选择记录, 需要新增一条(退回节点后新增了评估对象等情况可能会导致有没有产品选择记录的评估对象)
|
|
|
|
+ choiceLog = new BusinessProductionChoiceLog();
|
|
|
|
+ choiceLog.setBusinessType("ASSET_BUSINESS");
|
|
|
|
+ choiceLog.setProductionType(assetsProduction.getProductionType());
|
|
|
|
+ choiceLog.setBusinessId(assetsProduction.getBusinessId());
|
|
|
|
+ choiceLog.setTargetId(targetId);
|
|
|
|
+ choiceLog.setPrintCount(assetsProduction.getPrintCount());
|
|
|
|
+ choiceLog.setProductionId(assetsProduction.getId());
|
|
|
|
+ }
|
|
choiceLogList.add(choiceLog);
|
|
choiceLogList.add(choiceLog);
|
|
}
|
|
}
|
|
- choiceLogService.updateBatchById(choiceLogList);
|
|
|
|
|
|
+ // 保存或新增产品选择记录
|
|
|
|
+ choiceLogService.saveOrUpdateBatch(choiceLogList);
|
|
return this.updateById(assetsProduction);
|
|
return this.updateById(assetsProduction);
|
|
}
|
|
}
|
|
|
|
|