| | |
| | | shopOrder.setOrderType(ShopOrder.ORDER_TYPE_GOODS); |
| | | |
| | | List<ShopOrderDetails> details = new ArrayList<>(); |
| | | // 是否包含实物商品 |
| | | boolean hasRealGoods = false; |
| | | |
| | | Integer orderCount = 0; |
| | | for (OrderItemDto orderItemDto : shopOrderDto.getOrderItemList()) { |
| | | ShopOrderDetails shopOrderDetails = new ShopOrderDetails(); |
| | | shopOrderDetails.setCreateBy(AppConstance.SYSTEM_USER); |
| | | shopOrderDetails.setUpdateBy(AppConstance.SYSTEM_USER); |
| | | shopOrderDetails.setpId(orderItemDto.getProductId()); |
| | | |
| | | if (!hasRealGoods) { |
| | | ShopProduct shopProduct = shopProductDao.selectById(orderItemDto.getProductId()); |
| | | if (shopProduct.getIsUnrealProduct() == 2) { |
| | | hasRealGoods = true; |
| | | } |
| | | } |
| | | |
| | | shopOrderDetails.setsId(orderItemDto.getSkuId()); |
| | | shopOrderDetails.setCount(orderItemDto.getCount()); |
| | | if(ShopOrderDetails.PAYTYPE_MICRO==orderItemDto.getPayType()){ |
| | |
| | | shopOrder.setOrderType(ShopOrder.ORDER_TYPE_GOODS); |
| | | //购买方式 |
| | | shopOrder.setShippingMethod(shopOrderDto.getDeliverySelect()); |
| | | // 客户选择的物流配送,且没有实物产品(全是虚拟产品), 则直接门店自提,无需填写配送单 |
| | | if (ShopOrder.SHIPPING_METHOD_WL == shopOrderDto.getDeliverySelect() && !hasRealGoods) { |
| | | shopOrder.setShippingMethod(ShopOrder.SHIPPING_METHOD_MDZT); |
| | | } |
| | | //生成订单号 |
| | | shopOrder.setOrderNo(WxUtils.getOrderNum()); |
| | | //设置支付状态 |
| | |
| | | |
| | | private Long companyId; |
| | | |
| | | |
| | | /** |
| | | * 是否虚拟产品 1/是 2/否 |
| | | */ |
| | | private Integer isUnrealProduct; |
| | | |
| | | } |
| | |
| | | <result property="ableScorePay" column="able_score_pay"/> |
| | | <result property="ableSales" column="able_sales"/> |
| | | <result property="scoreCategoryId" column="score_category_id"/> |
| | | <result property="isUnrealProduct" column="is_unreal_product"/> |
| | | |
| | | <association property="shopCoupon" select="com.matrix.system.shopXcx.dao.ShopCouponDao.selectById" |
| | | column="{id=couponId}"></association> |
| | |
| | | company_id, |
| | | able_score_pay, |
| | | able_sales, |
| | | is_unreal_product, |
| | | score_category_id |
| | | |
| | | </sql> |
| | |
| | | #{item.shopIds}, |
| | | #{item.companyId}, |
| | | #{item.ableScorePay}, |
| | | #{item.ableSales}, |
| | | #{item.ableSales}, |
| | | #{item.isUnrealProduct}, |
| | | #{item.scoreCategoryId} |
| | | |
| | | </sql> |
| | |
| | | able_sales = #{record.ableSales}, |
| | | </if> |
| | | <if test="record.scoreCategoryId != null and record.scoreCategoryId "> |
| | | score_category_id = #{record.scoreCategoryId}, |
| | | score_category_id = #{record.scoreCategoryId}, |
| | | </if> |
| | | <if test="record.isUnrealProduct != null and record.isUnrealProduct"> |
| | | is_unreal_product = #{record.isUnrealProduct}, |
| | | </if> |
| | | |
| | | </set> |
| | |
| | | a.able_score_pay, |
| | | a.able_sales, |
| | | a.score_category_id, |
| | | a.is_unreal_product, |
| | | (SELECT SUM(s.stock) from shop_sku s where s.p_id = a.id) as stockNum, |
| | | (SELECT ROUND(SUM(s.stock),2) from shop_sku s where s.p_id = a.id) as stockNum, |
| | | shop_ids |
| | |
| | | |
| | | |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">是否虚拟产品 |
| | | </label> |
| | | <div class="col-sm-4"> |
| | | <select th:field="${obj.isUnrealProduct}" class="form-control select2 " size="1" |
| | | name="isUnrealProduct" |
| | | style="width: 100%"> |
| | | <option value="2" th:selected="${obj.isUnrealProduct == '2'}">否</option> |
| | | <option value="1" th:selected="${obj.isUnrealProduct == '1'}">是</option> |
| | | </option> |
| | | |
| | | </select> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |