Commit 6d4f77d487d0907a160a50d443319263e03c0814

Authored by 房远帅
1 parent 24f28104

1:模板调整2:锁价后的库存合同就不能再拆分

... ... @@ -215,7 +215,8 @@ public class ContractDistributorStandardServiceImpl extends
215 215 public List<ContractDistributorStandard> query(QueryContractDistributorStandardVo vo) {
216 216
217 217 List<ContractDistributorStandard> datas = getBaseMapper().query(vo);
218   - CollectionUtils.emptyIfNull(datas).forEach(data -> data.setCanSplit(isCanSplitByCode(data.getCode())));
  218 + CollectionUtils.emptyIfNull(datas).forEach(data -> data.setCanSplit(isCanSplitByCode(data.getCode())
  219 + && !Boolean.TRUE.equals(data.getPriceSpecLocked())));
219 220 return datas;
220 221 }
221 222
... ... @@ -226,7 +227,7 @@ public class ContractDistributorStandardServiceImpl extends
226 227 if (data == null) {
227 228 return null;
228 229 }
229   - data.setCanSplit(isCanSplitByCode(data.getCode()));
  230 + data.setCanSplit(isCanSplitByCode(data.getCode()) && !Boolean.TRUE.equals(data.getPriceSpecLocked()));
230 231 Wrapper<PurchaseOrderInfo> orderInfoWrapper = Wrappers.lambdaQuery(PurchaseOrderInfo.class)
231 232 .eq(PurchaseOrderInfo::getContractId, data.getId());
232 233 List<PurchaseOrderInfo> purchaseOrderInfoList = purchaseOrderInfoService.list(orderInfoWrapper);
... ... @@ -778,6 +779,9 @@ public class ContractDistributorStandardServiceImpl extends
778 779 if (ObjectUtil.isNull(original)) {
779 780 throw new DefaultClientException("合同不存在!");
780 781 }
  782 + if (Boolean.TRUE.equals(original.getPriceSpecLocked())) {
  783 + throw new DefaultClientException("合同已完成锁价/锁规,无法拆分!");
  784 + }
781 785 if (original.getTotalQuantity() == null) {
782 786 throw new DefaultClientException("合同合计数量为空,无法拆分!");
783 787 }
... ...