| | |
| | | package com.matrix.system.shopXcx.api.tools; |
| | | |
| | | import com.matrix.system.common.bean.CustomerDataDictionary; |
| | | import com.matrix.system.common.dao.CustomerDataDictionaryDao; |
| | | import com.matrix.biz.service.BizUserService; |
| | | import com.matrix.component.tools.WxTempLateMsgUtil; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.shopXcx.api.pojo.AddShopOrderPOJO; |
| | | import com.matrix.system.shopXcx.api.pojo.ShopOrderDto; |
| | | import com.matrix.system.shopXcx.api.pojo.OrderPostageInfoPOJO; |
| | | import com.matrix.system.shopXcx.api.pojo.OrderProductSkuPOJO; |
| | | import com.matrix.system.shopXcx.api.pojo.OrderItemDto; |
| | | import com.matrix.system.shopXcx.api.service.WxShopMemberDayService; |
| | | import com.matrix.system.shopXcx.bean.*; |
| | | import com.matrix.system.shopXcx.dao.*; |
| | |
| | | private WxShopMemberDayService wxShopMemberDayService; |
| | | @Autowired |
| | | private BizUserService bizUserService; |
| | | @Autowired |
| | | private ShopScoreRecordDao shopScoreRecordDao; |
| | | |
| | | |
| | | private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日"); |
| | |
| | | |
| | | /** |
| | | * 处理产品规格信息 |
| | | * @param addShopOrderPOJO |
| | | * @param shopOrderDto |
| | | */ |
| | | public List<ShopOrderDetails> processProductSkuInfo(ShopOrder shopOrder, AddShopOrderPOJO addShopOrderPOJO, |
| | | public List<ShopOrderDetails> processProductSkuInfo(ShopOrder shopOrder, ShopOrderDto shopOrderDto, |
| | | ShopCoupon shopCoupon) { |
| | | List<ShopOrderDetails> resList = new ArrayList<>(); |
| | | List<OrderProductSkuPOJO> skuList = addShopOrderPOJO.getSkuList(); |
| | | List<OrderItemDto> skuList = shopOrderDto.getOrderItemList(); |
| | | if (CollectionUtils.isEmpty(skuList)) { |
| | | return resList; |
| | | } |
| | |
| | | //设置购买数量 |
| | | int total = 0; |
| | | BigDecimal commodityMoney = new BigDecimal("0"); |
| | | for (OrderProductSkuPOJO orderProductSkuPOJO : skuList) { |
| | | ids.add(orderProductSkuPOJO.getSkuId()); |
| | | total += orderProductSkuPOJO.getCount(); |
| | | for (OrderItemDto orderItemDto : skuList) { |
| | | ids.add(orderItemDto.getSkuId()); |
| | | total += orderItemDto.getCount(); |
| | | } |
| | | shopOrder.setPurchaseQuantity(total); |
| | | List<ShopSku> contrastList = shopSkuDao.selectByIds(ids); |
| | |
| | | |
| | | BigDecimal couponTotalMoney = new BigDecimal("0"); |
| | | Double discountRate = wxShopMemberDayService.getMemberDay(); |
| | | for (OrderProductSkuPOJO orderProductSkuPOJO : skuList) { |
| | | for (OrderItemDto orderItemDto : skuList) { |
| | | boolean isExist = false; |
| | | for (ShopSku shopSku : contrastList) { |
| | | if (shopSku.getId().equals(orderProductSkuPOJO.getSkuId())) { |
| | | if (shopSku.getId().equals(orderItemDto.getSkuId())) { |
| | | isExist = true; |
| | | ShopOrderDetails shopOrderDetails = new ShopOrderDetails(); |
| | | shopOrderDetails.setCreateBy(AppConstance.SYSTEM_USER); |
| | |
| | | shopOrderDetails.setpId(shopSku.getPId()); |
| | | shopOrderDetails.setsId(shopSku.getId()); |
| | | shopOrderDetails.setPrice(shopSku.getPrice()); |
| | | shopOrderDetails.setCount(orderProductSkuPOJO.getCount()); |
| | | shopOrderDetails.setCount(orderItemDto.getCount()); |
| | | BigDecimal price = new BigDecimal(shopSku.getPrice().toString()); |
| | | BigDecimal count = new BigDecimal(orderProductSkuPOJO.getCount().toString()); |
| | | BigDecimal count = new BigDecimal(orderItemDto.getCount().toString()); |
| | | shopOrderDetails.setsTitle(shopSku.getName()); |
| | | resList.add(shopOrderDetails); |
| | | |