Commit 40ad5f18 by HlQ

[chg] 代码优化

1 parent 784207e7
......@@ -221,7 +221,7 @@ public class ContractRunner {
if (!productArr.isEmpty()) {
productArr.forEach(pro -> {
var product = JSONUtil.parseObj(pro);
var crmProJson = crmProList.stream().filter(p -> p.getInt("dataId").equals(product.getInt("text_1"))).toList().get(0);
var crmProJson = crmProList.stream().filter(p -> p.getInt("dataId").equals(product.getInt("text_1"))).toList().getFirst();
var crmPro = crmProJson.getJSONObject("data");
var contractProduct = new RContractProduct();
......
......@@ -217,7 +217,7 @@ public class StoreServiceImpl extends MPJBaseServiceImpl<StoreMapper, Store> imp
Opt.ofNullable(masterContract)
.map(c -> contractId2CpMap.getOrDefault(c.getId(), ListUtil.empty()))
.filter(CollUtil::isNotEmpty)
.map(l -> l.get(0).getNodeDate())
.map(l -> l.getFirst().getNodeDate())
.ifPresent(nodeDate -> masterContract.setFinalDate(nodeDate));
storeVO.setMainContract(Opt.ofNullable(masterContract).map(c -> converter.convert(c, ContractVO.class)).orElse(null));
......@@ -312,7 +312,7 @@ public class StoreServiceImpl extends MPJBaseServiceImpl<StoreMapper, Store> imp
Opt.ofNullable(contractId2CpMap.getOrDefault(masterContract.getId(), ListUtil.empty()))
.filter(CollUtil::isNotEmpty)
.map(l -> l.get(0).getNodeDate())
.map(l -> l.getFirst().getNodeDate())
.ifPresent(masterContract::setFinalDate);
Date finalDate = masterContract.getFinalDate();
......@@ -442,7 +442,7 @@ public class StoreServiceImpl extends MPJBaseServiceImpl<StoreMapper, Store> imp
.leftJoin(StoreLog.class, StoreLog::getStoreId, Store::getId)
.eq(StoreLog::getId, id);
var storeVO = this.selectJoinOne(StoreVO.class, wrapper);
var storeLog = storeVO.getStoreLog().get(0);
var storeLog = storeVO.getStoreLog().getFirst();
var user = (User) redissonClient.getBucket(RedisKeyEnum.DING_PREFIX.getVal() + RedisKeyEnum.USER_ID.getVal() + storeLog.getCreateUser()).get();
var content = storeLog.getContent();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!