Commit 68101db9 authored by unset's avatar unset

添加通知信息

parent f68a9d83
......@@ -126,7 +126,7 @@ public class AssertUtils {
throw new BaseException(orr.getMessage(), orr.getStatus());
}
orr.setData(orr.getData().parallelStream().map(t -> BeanUtil.toBean(t, tClass)).collect(Collectors.toList()));
orr.setData(orr.getData().stream().map(t -> BeanUtil.toBean(t, tClass)).collect(Collectors.toList()));
return orr.getData();
}
......
......@@ -175,7 +175,7 @@ public class AccessGatewayFilter implements GlobalFilter {
* @return
*/
private Stream<PermissionInfo> getPermissionIfs(final String requestUri, final String method, List<PermissionInfo> serviceInfo) {
return serviceInfo.parallelStream().filter(new Predicate<PermissionInfo>() {
return serviceInfo.stream().filter(new Predicate<PermissionInfo>() {
@Override
public boolean test(PermissionInfo permissionInfo) {
String uri = permissionInfo.getUri();
......@@ -230,7 +230,7 @@ public class AccessGatewayFilter implements GlobalFilter {
}
PermissionInfo current = null;
for (PermissionInfo info : permissions) {
boolean anyMatch = permissionInfos.parallelStream().anyMatch(new Predicate<PermissionInfo>() {
boolean anyMatch = permissionInfos.stream().anyMatch(new Predicate<PermissionInfo>() {
@Override
public boolean test(PermissionInfo permissionInfo) {
return permissionInfo.getCode().equals(info.getCode());
......
......@@ -22,7 +22,7 @@ public class UserDTO extends User {
private List<Integer> str2List(String str) {
if(StringUtils.isNotBlank(str)) {
return Arrays.asList(str.split(",")).parallelStream().map(s -> Integer.valueOf(s)).collect(Collectors.toList());
return Arrays.asList(str.split(",")).stream().map(s -> Integer.valueOf(s)).collect(Collectors.toList());
}else {
return new ArrayList<Integer>();
}
......
......@@ -51,7 +51,7 @@ public class AppUserLogRemarkBiz extends BaseBiz<AppUserLogRemarkMapper, AppUser
example.orderBy("time").desc().orderBy("crtTime").desc();
List<AppUserLogRemark> list = selectByExample(example);
if (CollectionUtil.isNotEmpty(list)) {
list.parallelStream().peek(e -> {
list.stream().peek(e -> {
if (!Objects.isNull(e)) {
e.setPhotoList(Lists.newArrayList(e.getPhotos().split(",")));
}
......
......@@ -244,7 +244,7 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
List<AppUserLogin> appUserLogins = mapper.selectbyPhones(phones);
Map<String, Integer> phoneAndUserIdMap = null;
if (CollectionUtils.isNotEmpty(appUserLogins)) {
phoneAndUserIdMap = appUserLogins.parallelStream().collect(Collectors.toMap(AppUserLogin::getUsername, AppUserLogin::getId));
phoneAndUserIdMap = appUserLogins.stream().collect(Collectors.toMap(AppUserLogin::getUsername, AppUserLogin::getId));
}
return phoneAndUserIdMap;
}
......
......@@ -105,8 +105,8 @@ public class BaseUserMemberExportBiz extends BaseBiz<BaseUserMemberExportMapper,
List<BaseUserMemberExport> baseUserMemberExports = new ArrayList<>();
List<BaseUserMemberLevel> levesls = userMemberLevelBiz.getLevesls();
Map<Integer, BaseUserMemberLevel> levelAndbaseUserMemberMap = levesls.parallelStream().collect(Collectors.toMap(BaseUserMemberLevel::getLevel, Function.identity()));
Map<String,Integer> leavelNameAndLeaveMap = levelAndbaseUserMemberMap.values().parallelStream().collect(Collectors.toMap(BaseUserMemberLevel::getName, BaseUserMemberLevel::getLevel));
Map<Integer, BaseUserMemberLevel> levelAndbaseUserMemberMap = levesls.stream().collect(Collectors.toMap(BaseUserMemberLevel::getLevel, Function.identity()));
Map<String,Integer> leavelNameAndLeaveMap = levelAndbaseUserMemberMap.values().stream().collect(Collectors.toMap(BaseUserMemberLevel::getName, BaseUserMemberLevel::getLevel));
List<String> phones = userMemberData.stream().map(x -> x[0]).distinct().collect(Collectors.toList());
Map<String, Integer> phoneAndUserIdMap = appUserLoginBiz.findPhoneAndUserIdMapByPhones(phones);
......
......@@ -140,11 +140,11 @@ public class PermissionService {
FrontUser frontUser = new FrontUser();
BeanUtils.copyProperties(user, frontUser);
List<PermissionInfo> permissionInfos = this.getPermissionByUsername(username);
Stream<PermissionInfo> menus = permissionInfos.parallelStream().filter((permission) -> {
Stream<PermissionInfo> menus = permissionInfos.stream().filter((permission) -> {
return permission.getType().equals(CommonConstants.RESOURCE_TYPE_MENU);
});
frontUser.setMenus(menus.collect(Collectors.toList()));
Stream<PermissionInfo> elements = permissionInfos.parallelStream().filter((permission) -> {
Stream<PermissionInfo> elements = permissionInfos.stream().filter((permission) -> {
return !permission.getType().equals(CommonConstants.RESOURCE_TYPE_MENU);
});
frontUser.setElements(elements.collect(Collectors.toList()));
......
......@@ -40,9 +40,9 @@ public class RscpImagePriceController extends BaseController<RscpImagePriceBiz,
List<ImagePriceVO> imagePriceVOS = CollUtil.newArrayList();
String key = "";
List<String> satelliteTypes = list.parallelStream().map(RscpImagePrice::getImageSatelliteType).distinct().collect(Collectors.toList());
List<String> satelliteTypes = list.stream().map(RscpImagePrice::getImageSatelliteType).distinct().collect(Collectors.toList());
for(String satelliteType : satelliteTypes) {
List<RscpImagePrice> imagePriceList = list.parallelStream().filter(rscpImagePrice -> satelliteType.equals(rscpImagePrice.getImageSatelliteType())).collect(Collectors.toList());
List<RscpImagePrice> imagePriceList = list.stream().filter(rscpImagePrice -> satelliteType.equals(rscpImagePrice.getImageSatelliteType())).collect(Collectors.toList());
imagePriceVOS.add(new ImagePriceVO(){{
setImageSatelliteType(satelliteType);
setSatelliteName(imagePriceList.get(0).getSatelliteName());
......
......@@ -105,7 +105,7 @@ public class DictionaryBiz extends BaseBiz<DictionaryMapper, Dictionary> {
public Map<String, Dictionary> getAll4Map() {
// List<Dictionary> dictionaries = this.getParentCommon(null);
List<Dictionary> dictionaries = selectListAll();
Map<String, Dictionary> dictionaryMap = dictionaries.parallelStream().collect(Collectors.toMap(dic -> dic.getType() + "_" + dic.getCode()
Map<String, Dictionary> dictionaryMap = dictionaries.stream().collect(Collectors.toMap(dic -> dic.getType() + "_" + dic.getCode()
, Function.identity(), (oldValue, newValue) -> newValue));
dictionaryMap.forEach((k, v) -> {
v.setChildrens(buildTree(v.getId()));
......@@ -115,7 +115,7 @@ public class DictionaryBiz extends BaseBiz<DictionaryMapper, Dictionary> {
/* public Map<String, Dictionary> getDictionaryUseType() {
List<Dictionary> dictionaries = selectListAll();
Map<String, Dictionary> dictionaryMap = dictionaries.parallelStream().collect(Collectors.toMap(dic -> dic.getType() + "_" + dic.getCode()
Map<String, Dictionary> dictionaryMap = dictionaries.stream().collect(Collectors.toMap(dic -> dic.getType() + "_" + dic.getCode()
, Function.identity(), (oldValue, newValue) -> newValue));
return dictionaryMap;
}*/
......
......@@ -46,7 +46,7 @@ public class ImageImgStorageBiz extends BaseBiz<ImageImgStorageMapper,ImageImgSt
if (imageImgStorage.getId() == null) {
insertSelectiveRe(imageImgStorage);
if (imageImgStorage.getImageInfoRelationList() != null && imageImgStorage.getImageInfoRelationList().size() > 0) {
imageImgStorage.getImageInfoRelationList().parallelStream().forEach(imageInfoRelation -> {
imageImgStorage.getImageInfoRelationList().stream().forEach(imageInfoRelation -> {
imageInfoRelation.setType(1);
imageInfoRelation.setRelationId(imageImgStorage.getId());
imageInfoRelationBiz.addUpdate(imageInfoRelation);
......@@ -63,7 +63,7 @@ public class ImageImgStorageBiz extends BaseBiz<ImageImgStorageMapper,ImageImgSt
updateSelectiveByIdRe(old);
}
if (old.getImageInfoRelationList() != null && old.getImageInfoRelationList().size() > 0) {
old.getImageInfoRelationList().parallelStream().forEach(imageInfoRelation -> {
old.getImageInfoRelationList().stream().forEach(imageInfoRelation -> {
imageInfoRelation.setType(1);
imageInfoRelation.setRelationId(old.getId());
imageInfoRelationBiz.addUpdate(imageInfoRelation);
......@@ -102,7 +102,7 @@ public class ImageImgStorageBiz extends BaseBiz<ImageImgStorageMapper,ImageImgSt
Query query = new Query(imageInformationStorageDto);
PageDataVO<ImageImgStorage> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.selectByExample(example));
if (pageDataVO != null && pageDataVO.getData() != null) {
pageDataVO.getData().parallelStream().forEach(imageImgStorage -> {
pageDataVO.getData().stream().forEach(imageImgStorage -> {
List<ImageInfoRelation> imageInfoRelationList = imageInfoRelationBiz.getAllById(imageImgStorage.getId(), 1);
if (imageInfoRelationList != null) {
imageImgStorage.setImageInfoRelationList(imageInfoRelationList);
......@@ -158,7 +158,7 @@ public class ImageImgStorageBiz extends BaseBiz<ImageImgStorageMapper,ImageImgSt
example.orderBy("updTime").desc();
List<ImageImgStorage> list = mapper.selectByExample(example);
if (list != null && list.size() > 0) {
list.parallelStream().forEach(imageImgStorage -> {
list.stream().forEach(imageImgStorage -> {
List<ImageInfoRelation> imageInfoRelationList = imageInfoRelationBiz.getAllById(imageImgStorage.getId(), 1);
if (imageInfoRelationList != null) {
imageImgStorage.setImageInfoRelationList(imageInfoRelationList);
......
......@@ -39,7 +39,7 @@ public class ImageInfoRelationBiz extends BaseBiz<ImageInfoRelationMapper,ImageI
public void deleteAll(Integer relationId) {
List<ImageInfoRelation> list = selectList(new ImageInfoRelation(){{setRelationId(relationId);setType(1);}});
if (list != null) {
list.parallelStream().forEach(imageInfoRelation -> {
list.stream().forEach(imageInfoRelation -> {
delete(imageInfoRelation);
});
}
......@@ -69,7 +69,7 @@ public class ImageInfoRelationBiz extends BaseBiz<ImageInfoRelationMapper,ImageI
example.createCriteria().andEqualTo("relationId", relationId).andEqualTo("type", type);
List<ImageInfoRelation> list = mapper.selectByExample(example);
if (list != null && list.size() > 0) {
list.parallelStream().forEach(imageInfoRelation -> {
list.stream().forEach(imageInfoRelation -> {
imageInfoRelation.setUrl(null);
});
return list;
......
......@@ -98,7 +98,7 @@ public class IndustryApplicationInfoBiz extends BaseBiz<IndustryApplicationInfoM
example.orderBy("rank");
List<IndustryApplicationInfo> industryApplicationInfoList = mapper.selectByExample(example);
if (industryApplicationInfoList != null && industryApplicationInfoList.size() > 0) {
industryApplicationInfoList.parallelStream().forEach(industryApplicationInfo -> {
industryApplicationInfoList.stream().forEach(industryApplicationInfo -> {
if (map.get(industryApplicationInfo.getFirstTypeId()) != null && map.get(industryApplicationInfo.getFirstTypeId()).size() > 0) {
IndustryApplicationType industryApplicationType = map.get(industryApplicationInfo.getFirstTypeId()).get(0);
IndustryTypeVo industryTypeVo = new IndustryTypeVo();
......
......@@ -110,7 +110,7 @@ public class NoticeInfoBiz extends BaseBiz<NoticeInfoMapper,NoticeInfo> {
criteria.andEqualTo("userId", noticeInfoDto.getUserId());
List<NoticeInfo> list = mapper.selectByExample(example);
if (list != null && list.size() > 0) {
list.parallelStream().forEach(noticeInfo -> {
list.forEach(noticeInfo -> {
noticeInfo.setIsRead(2);
updateSelectiveByIdRe(noticeInfo);
});
......
......@@ -208,7 +208,7 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
if (orderEInvoiceList != null && orderEInvoiceList.size() > 0) {
Map<Integer, List<OrderEInvoice>> map = orderEInvoiceList.stream().collect(Collectors.groupingBy(OrderEInvoice::getId));
if (map != null && map.size() > 0) {
orderInfoList.parallelStream().forEach(orderInfo -> {
orderInfoList.stream().forEach(orderInfo -> {
if (map.get(orderInfo.getInvoiceId()) != null && orderInfo != null) {
orderInfo.setOrderEInvoice(map.get(orderInfo.getInvoiceId()).get(0));
}
......@@ -255,7 +255,7 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
if (orderItemList != null) {
Map<Long, List<OrderItem>> map = orderItemList.stream().collect(Collectors.groupingBy(OrderItem::getOrderId));
if (map != null && map.size() > 0) {
orderInfoList.parallelStream().forEach(orderInfo -> {
orderInfoList.stream().forEach(orderInfo -> {
orderInfo.setOrderItemList(map.get(orderInfo.getOrderId()));
});
}
......@@ -281,7 +281,8 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
List<OrderItem> orderItemList = new ArrayList<>();
AtomicReference<Integer> number = new AtomicReference<>(0);
AtomicReference<Double> amount = new AtomicReference<>((double) 0);
itemInfoDtoList.parallelStream().forEach(itemInfoDto -> {
StringBuilder sb = new StringBuilder();
itemInfoDtoList.forEach(itemInfoDto -> {
switch (OrderTypeEnum.getByCode(itemInfoDto.getType())) {
//标准数据
case STANDARD_DATA:
......@@ -296,6 +297,8 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
orderItem.setDetailJson(JSONObject.toJSONString(imageDataVO));
orderItem.setDetailId(Long.valueOf(imageDataVO.getId()));
orderItemList.add(orderItem);
sb.append(imageDataVO.getImageSatelliteType());
sb.append(",");
//总数量
number.updateAndGet(v -> v + itemInfoDto.getNumber());
BigDecimal totalAmount = imageDataVO.getPrice().multiply(new BigDecimal(itemInfoDto.getNumber()));
......@@ -426,12 +429,13 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
orderInfo.setSendType(orderInfoDto.getSendType());
orderInfo.setType(1);
orderInfo.setSatellite(sb.toString());
/**
* 新增订单
*/
orderInfo.setOrderNo(OrderUtil.GetOrderNumber("", OrderUtil.APP_MID));
generateOrder(orderInfo);
orderItemList.parallelStream().forEach(orderItem -> {
orderItemList.stream().forEach(orderItem -> {
if (orderItem != null) {
orderItem.setOrderId(orderInfo.getOrderId());
orderItemBiz.insertSelective(orderItem);
......@@ -790,7 +794,7 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
return ObjectRestResponse.createFailedResult(ResultCode.ORDER_NOT_EXIST, ResultCode.getMsg(ResultCode.ORDER_NOT_EXIST));
}
List<OrderItem> orderItemList = new ArrayList<>();
itemInfoDtoList.parallelStream().forEach(itemInfoDto -> {
itemInfoDtoList.stream().forEach(itemInfoDto -> {
switch (OrderTypeEnum.getByCode(itemInfoDto.getType())) {
//标准数据
case STANDARD_DATA:
......@@ -847,7 +851,7 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
break;
}
});
orderItemList.parallelStream().forEach(orderItem -> {
orderItemList.stream().forEach(orderItem -> {
if (orderItem != null) {
orderItem.setOrderId(orderInfoDto.getOrderId());
orderItemBiz.insertSelective(orderItem);
......@@ -930,10 +934,10 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
case IMAGE_STORAGE:
List<ImageImgStorage> imageImgStorageList = imageImgStorageBiz.getAll(null, name).getData();
if (imageImgStorageList != null && imageImgStorageList.size() > 0) {
imageImgStorageList.parallelStream().forEach(imageImgStorage -> {
imageImgStorageList.stream().forEach(imageImgStorage -> {
List<ImageInfoRelation> imageInfoRelationList = imageImgStorage.getImageInfoRelationList();
if (imageInfoRelationList != null && imageInfoRelationList.size() > 0) {
imageInfoRelationList.parallelStream().forEach(imageInfoRelation -> {
imageInfoRelationList.stream().forEach(imageInfoRelation -> {
ItemInfoVo itemInfoVo = new ItemInfoVo();
itemInfoVo.setName(imageImgStorage.getName() + imageInfoRelation.getFileWidth());
itemInfoVo.setId(Long.parseLong(String.valueOf(imageInfoRelation.getId())));
......@@ -953,7 +957,7 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
case INDUSTRY_INFO:
List<IndustryApplicationInfo> industryApplicationInfoList = industryApplicationInfoBiz.getAllData(name);
if (industryApplicationInfoList != null && industryApplicationInfoList.size() > 0) {
industryApplicationInfoList.parallelStream().forEach(industryApplicationInfo -> {
industryApplicationInfoList.stream().forEach(industryApplicationInfo -> {
ItemInfoVo itemInfoVo = new ItemInfoVo();
itemInfoVo.setName(industryApplicationInfo.getTitle());
itemInfoVo.setId(Long.parseLong(String.valueOf(industryApplicationInfo.getId())));
......@@ -966,7 +970,7 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
setKeyword(name);
}}).getData();
if (pageDataVO != null && pageDataVO.getData() != null && pageDataVO.getData().size() > 0) {
pageDataVO.getData().parallelStream().forEach(imageDataVO -> {
pageDataVO.getData().stream().forEach(imageDataVO -> {
ItemInfoVo itemInfoVo = new ItemInfoVo();
itemInfoVo.setName(imageDataVO.getName());
itemInfoVo.setId(Long.parseLong(String.valueOf(imageDataVO.getId())));
......
......@@ -267,14 +267,14 @@ public class ShoppingCartInfoBiz extends BaseBiz<ShoppingCartInfoMapper, Shoppin
*/
private void convertToOrderInfo(List<ShoppingCartInfo> cartInfoList, CartOrderDto cartOrderDto, AppUserDTO appUserDTO) {
//总金额
double amount = cartInfoList.parallelStream().mapToDouble(shoppingCartInfo -> shoppingCartInfo.getTotalAmount().doubleValue()).sum();
double amount = cartInfoList.stream().mapToDouble(shoppingCartInfo -> shoppingCartInfo.getTotalAmount().doubleValue()).sum();
//总数量
Integer totalNumber = cartInfoList.parallelStream().mapToInt(ShoppingCartInfo::getNumber).sum();
Integer totalNumber = cartInfoList.stream().mapToInt(ShoppingCartInfo::getNumber).sum();
OrderInfo orderInfo = new OrderInfo();
orderInfo.setAmount(new BigDecimal(amount).setScale(2, BigDecimal.ROUND_HALF_UP));
orderInfo.setNumber(totalNumber);
orderInfoBiz.generateOrder(orderInfo);
cartInfoList.parallelStream().forEach(shoppingCartInfo -> {
cartInfoList.stream().forEach(shoppingCartInfo -> {
OrderItem orderItem = ShoppingCartInfo.convertToOrderItem(shoppingCartInfo);
orderItem.setOrderId(orderInfo.getOrderId());
orderItemBiz.insertSelectiveRe(orderItem);
......
......@@ -137,7 +137,7 @@ public class UserAddressBiz extends BaseBiz<UserAddressMapper, UserAddress> {
example.createCriteria().andEqualTo("userId", userId).andEqualTo("isDel", 0).andEqualTo("isDefault", 1);
List<UserAddress> list = mapper.selectByExample(example);
if (list != null && list.size() > 0) {
list.parallelStream().forEach(userAddress -> {
list.forEach(userAddress -> {
userAddress.setIsDefault(0);
updateSelectiveByIdRe(userAddress);
});
......
......@@ -182,7 +182,7 @@ public class UserInvoiceBiz extends BaseBiz<UserInvoiceMapper,UserInvoice> {
example.createCriteria().andEqualTo("userId", userId).andEqualTo("isDel", 0).andEqualTo("isDefault", 1);
List<UserInvoice> list = mapper.selectByExample(example);
if (list != null && list.size() > 0) {
list.parallelStream().forEach(userInvoice -> {
list.forEach(userInvoice -> {
userInvoice.setIsDefault(0);
updateSelectiveByIdRe(userInvoice);
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment