Commit 51a75a1f authored by 周健威's avatar 周健威

Merge remote-tracking branch 'origin/dev' into dev

parents a0048a45 b2f91d3b
...@@ -149,6 +149,11 @@ public class IndustryApplicationInfo implements Serializable { ...@@ -149,6 +149,11 @@ public class IndustryApplicationInfo implements Serializable {
*/ */
private BigDecimal price; private BigDecimal price;
/**
* 源文件路径
*/
private String sourceFile;
@Transient @Transient
private String firstTitle; private String firstTitle;
......
...@@ -282,7 +282,7 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> { ...@@ -282,7 +282,7 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
switch (OrderTypeEnum.getByCode(itemInfoDto.getType())) { switch (OrderTypeEnum.getByCode(itemInfoDto.getType())) {
//标准数据 //标准数据
case STANDARD_DATA: case STANDARD_DATA:
List<ImageDataVO> imageDataVOList = datacenterFeign.queryByIds(orderInfoDto.getDetailId() + "").getData(); List<ImageDataVO> imageDataVOList = datacenterFeign.queryByIds(itemInfoDto.getId() + "").getData();
if (imageDataVOList != null && imageDataVOList.size() > 0) { if (imageDataVOList != null && imageDataVOList.size() > 0) {
ImageDataVO imageDataVO = imageDataVOList.get(0); ImageDataVO imageDataVO = imageDataVOList.get(0);
OrderItem orderItem = new OrderItem(); OrderItem orderItem = new OrderItem();
...@@ -364,7 +364,7 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> { ...@@ -364,7 +364,7 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
amount.updateAndGet(v -> new Double((double) (v + totalAmount.doubleValue()))); amount.updateAndGet(v -> new Double((double) (v + totalAmount.doubleValue())));
//下单后删除购物车 //下单后删除购物车
shoppingCartInfo.setIsDel(1); shoppingCartInfo.setIsDel(1);
shoppingCartInfoBiz.updateSelectiveByIdRe(shoppingCartInfo); shoppingCartInfoBiz.delete(shoppingCartInfo);
} }
break; break;
default: default:
......
...@@ -54,6 +54,7 @@ public class ConfirmOrderService { ...@@ -54,6 +54,7 @@ public class ConfirmOrderService {
/** /**
* 确认订单 * 确认订单
*
* @param confirmOrderDto * @param confirmOrderDto
* @return * @return
*/ */
...@@ -68,9 +69,7 @@ public class ConfirmOrderService { ...@@ -68,9 +69,7 @@ public class ConfirmOrderService {
AtomicReference<Integer> number = new AtomicReference<>(0); AtomicReference<Integer> number = new AtomicReference<>(0);
AtomicReference<Double> amount = new AtomicReference<>((double) 0); AtomicReference<Double> amount = new AtomicReference<>((double) 0);
itemInfoDtoList.parallelStream().forEach(itemInfoDto -> { itemInfoDtoList.parallelStream().forEach(itemInfoDto -> {
switch (OrderTypeEnum.getByCode(itemInfoDto.getType())) { if (itemInfoDto.getType().equals(OrderTypeEnum.STANDARD_DATA.getType())) {
//标准数据
case STANDARD_DATA:
List<ImageDataVO> imageDataVOList = datacenterFeign.queryByIds(itemInfoDto.getId() + "").getData(); List<ImageDataVO> imageDataVOList = datacenterFeign.queryByIds(itemInfoDto.getId() + "").getData();
if (imageDataVOList != null && imageDataVOList.size() > 0) { if (imageDataVOList != null && imageDataVOList.size() > 0) {
ImageDataVO imageDataVO = imageDataVOList.get(0); ImageDataVO imageDataVO = imageDataVOList.get(0);
...@@ -86,9 +85,9 @@ public class ConfirmOrderService { ...@@ -86,9 +85,9 @@ public class ConfirmOrderService {
BigDecimal totalAmount = imageDataVO.getPrice().multiply(new BigDecimal(itemInfoDto.getNumber())); BigDecimal totalAmount = imageDataVO.getPrice().multiply(new BigDecimal(itemInfoDto.getNumber()));
amount.updateAndGet(v -> new Double((double) (v + totalAmount.doubleValue()))); amount.updateAndGet(v -> new Double((double) (v + totalAmount.doubleValue())));
} }
break; }
//行业应用
case INDUSTRY_INFO: if (itemInfoDto.getType().equals(OrderTypeEnum.INDUSTRY_INFO.getType())) {
IndustryApplicationInfo industryApplicationInfo = industryApplicationInfoBiz.getOneById(itemInfoDto.getId().intValue()).getData(); IndustryApplicationInfo industryApplicationInfo = industryApplicationInfoBiz.getOneById(itemInfoDto.getId().intValue()).getData();
if (industryApplicationInfo != null) { if (industryApplicationInfo != null) {
ItemInfoVo itemInfoVo = new ItemInfoVo(); ItemInfoVo itemInfoVo = new ItemInfoVo();
...@@ -105,11 +104,11 @@ public class ConfirmOrderService { ...@@ -105,11 +104,11 @@ public class ConfirmOrderService {
BigDecimal totalAmount = industryApplicationInfo.getPrice().multiply(new BigDecimal(itemInfoDto.getNumber())); BigDecimal totalAmount = industryApplicationInfo.getPrice().multiply(new BigDecimal(itemInfoDto.getNumber()));
amount.updateAndGet(v -> new Double((double) (v + totalAmount.doubleValue()))); amount.updateAndGet(v -> new Double((double) (v + totalAmount.doubleValue())));
} }
break; }
//影像图库
case IMAGE_STORAGE: if (itemInfoDto.getType().equals(OrderTypeEnum.IMAGE_STORAGE.getType())) {
ImageInfoRelation imageInfoRelation = imageInfoRelationBiz.selectById(itemInfoDto.getId()); ImageInfoRelation imageInfoRelation = imageInfoRelationBiz.selectById(itemInfoDto.getId());
if (imageInfoRelation != null ) { if (imageInfoRelation != null) {
ImageImgStorage imageImgStorage = imageImgStorageBiz.getDetail(itemInfoDto.getId().intValue()).getData(); ImageImgStorage imageImgStorage = imageImgStorageBiz.getDetail(itemInfoDto.getId().intValue()).getData();
if (imageImgStorage != null) { if (imageImgStorage != null) {
List<ImageInfoRelation> imageInfoRelationList = new ArrayList<>(); List<ImageInfoRelation> imageInfoRelationList = new ArrayList<>();
...@@ -130,10 +129,9 @@ public class ConfirmOrderService { ...@@ -130,10 +129,9 @@ public class ConfirmOrderService {
amount.updateAndGet(v -> new Double((double) (v + totalAmount.doubleValue()))); amount.updateAndGet(v -> new Double((double) (v + totalAmount.doubleValue())));
} }
} }
break; }
//购物车 if (itemInfoDto.getType().equals(OrderTypeEnum.SHOPPING_CART_INFO.getType())) {
case SHOPPING_CART_INFO: ShoppingCartInfo shoppingCartInfo = shoppingCartInfoBiz.selectOne(new ShoppingCartInfo(){{setCartId(itemInfoDto.getId());}});
ShoppingCartInfo shoppingCartInfo = shoppingCartInfoBiz.selectById(itemInfoDto.getId());
if (shoppingCartInfo != null) { if (shoppingCartInfo != null) {
ItemInfoVo itemInfoVo = new ItemInfoVo(); ItemInfoVo itemInfoVo = new ItemInfoVo();
itemInfoVo.setId(shoppingCartInfo.getCartId()); itemInfoVo.setId(shoppingCartInfo.getCartId());
...@@ -148,12 +146,9 @@ public class ConfirmOrderService { ...@@ -148,12 +146,9 @@ public class ConfirmOrderService {
BigDecimal totalAmount = shoppingCartInfo.getTotalAmount(); BigDecimal totalAmount = shoppingCartInfo.getTotalAmount();
amount.updateAndGet(v -> new Double((double) (v + totalAmount.doubleValue()))); amount.updateAndGet(v -> new Double((double) (v + totalAmount.doubleValue())));
} }
break;
default:
break;
} }
}); });
confirmOrderInfoVo.setTotalAmount(new BigDecimal(amount.get())); confirmOrderInfoVo.setTotalAmount(new BigDecimal(amount.get()).setScale(2, BigDecimal.ROUND_HALF_UP));
confirmOrderInfoVo.setNumber(number.get()); confirmOrderInfoVo.setNumber(number.get());
confirmOrderInfoVo.setItemInfoVoList(itemInfoVoList); confirmOrderInfoVo.setItemInfoVoList(itemInfoVoList);
} }
...@@ -164,7 +159,7 @@ public class ConfirmOrderService { ...@@ -164,7 +159,7 @@ public class ConfirmOrderService {
confirmOrderInfoVo.setFee(new BigDecimal(dictionary.getDetail())); confirmOrderInfoVo.setFee(new BigDecimal(dictionary.getDetail()));
} }
if (confirmOrderInfoVo.getFee() != null) { if (confirmOrderInfoVo.getFee() != null) {
confirmOrderInfoVo.setActAmount(confirmOrderInfoVo.getTotalAmount().add(confirmOrderInfoVo.getFee())); confirmOrderInfoVo.setActAmount(confirmOrderInfoVo.getTotalAmount().add(confirmOrderInfoVo.getFee()).setScale(2, BigDecimal.ROUND_HALF_UP));
} }
return ObjectRestResponse.succ(confirmOrderInfoVo); return ObjectRestResponse.succ(confirmOrderInfoVo);
} }
......
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