| | |
| | | |
| | | // =====================================订单包裹相关 |
| | | |
| | | /** |
| | | * 省内包裹 |
| | | */ |
| | | public static final String IN_PROVINCE_PACKAGE = "IN_PROVINCE_PACKAGE"; |
| | | |
| | | /** |
| | | * 外省包裹 |
| | | */ |
| | | public static final String OUT_PROVINCE_PACKAGE = "OUT_PROVINCE_PACKAGE"; |
| | | |
| | | /** |
| | | * 省内免邮费包裹 |
| | | */ |
| | | public static final String PROVINCE_OVER_FREE_PACKAGE = "PROVINCE_OVER_FREE_PACKAGE"; |
| | | |
| | | // =====================================订单短信提醒相关 |
| | | /** |
| | | * 短信提醒 |
| | | */ |
| | | public static final String MSG_ALERT = "MSG_ALERT"; |
| | | |
| | | /** |
| | | * 短信提醒号码(多个以",分割") |
| | | */ |
| | | public static final String MSG_ALERT_MOBILE = "MSG_ALERT_MOBILE"; |
| | | |
| | | /** |
| | | * 短信提醒内容 |
| | | */ |
| | | public static final String MSG_ALERT_CONTENT = "MSG_ALERT_CONTENT"; |
| | | |
| | | /** |
| | | * 商户余额不足短信提醒内容 |
| | | */ |
| | | public static final String MSG_ALERT_NSF = "MSG_ALERT_NSF"; |
| | | |
| | | /** |
| | | * 待开票 |
| | |
| | | public static final String REFUND_FAIL_NOTENOUGH = "NOTENOUGH"; |
| | | |
| | | |
| | | // =====================================分销相关 |
| | | /** |
| | | * 成为分销商最低额度(查询数据字典时使用) |
| | | * 运费 |
| | | */ |
| | | public static final String BECOMING_DISTRIBUTOR_CONDITION = "BECOMING_DISTRIBUTOR_CONDITION"; |
| | | |
| | | public static final String PACKAGE_PRICE = "PACKAGE_PRICE"; |
| | | /** |
| | | * 用户等级-分销商 |
| | | * 免免邮金额 |
| | | */ |
| | | public static final Integer USER_VIP_DISTRIBUTOR = 1; |
| | | |
| | | /** |
| | | * 积分业务类型-获得 |
| | | */ |
| | | public static final Integer SCORE_BUSINESS_TYPE_GET = 1; |
| | | |
| | | /** |
| | | * 积分业务类型-兑换 |
| | | */ |
| | | public static final Integer SCORE_BUSINESS_TYPE_EXCHANGE = 2; |
| | | |
| | | /** |
| | | * 免费配送距离 |
| | | */ |
| | | public static final String DELIVERY_DISTANCE = "delivery_distance"; |
| | | /** |
| | | * 支持学校列表 |
| | | */ |
| | | public static final String SCHOOL = "SCHOOL"; |
| | | |
| | | |
| | | /** |
| | | * 省运费关系 |
| | | */ |
| | | public static final String IN_PROVINCE_PACKAGE_PRICE = "IN_PROVINCE_PACKAGE_PRICE"; |
| | | public static final String FIRST_OUT_PROVINCE_PACKAGE_PRICE = "FIRST_OUT_PROVINCE_PACKAGE_PRICE"; |
| | | public static final String SECOND_OUT_PROVINCE_PACKAGE_PRICE = "SECOND_OUT_PROVINCE_PACKAGE_PRICE"; |
| | | |
| | | public static final String IN_PROVINCE_PACKAGE_LIST = "IN_PROVINCE_PACKAGE_LIST"; |
| | | public static final String FIRST_PROVINCE_PACKAGE_LIST = "FIRST_PROVINCE_PACKAGE_LIST"; |
| | | public static final String SECOND_PROVINCE_PACKAGE_LIST = "SECOND_PROVINCE_PACKAGE_LIST"; |
| | | /** |
| | | * 起送费 |
| | | */ |
| | | public static final String QSFY = "QSFY"; |
| | | public static final String FREE_PACKAGE_PRICE = "FREE_PACKAGE_PRICE"; |
| | | |
| | | |
| | | /** |
| | |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.hive.bean.ShoppingGoods; |
| | | import com.matrix.system.hive.dao.ShoppingGoodsDao; |
| | |
| | | } |
| | | } |
| | | //获取当前购物车产品可用的优惠券 |
| | | List<CouponReceiveInfoVO> usefulCoupon = wxShopCouponService.getCartVoCouponList(HostInterceptor.getCompanyId(),notCouponuyCart); |
| | | List<CouponReceiveInfoVO> usefulCoupon = wxShopCouponService.getCartVoCouponList(bizUser.getCompanyId(),notCouponuyCart); |
| | | |
| | | //获取用户使用的优惠券 |
| | | CouponReceiveInfoVO shopCoupon = new CouponReceiveInfoVO(); |
| | |
| | | |
| | | } |
| | | |
| | | Integer addrId = null; |
| | | if (shopReceiveAddress != null) { |
| | | addrId = shopReceiveAddress.getAddrId(); |
| | | } |
| | | |
| | | //得到订单计价说明 |
| | | DiscountExplain discountExplain = shopOrderService.buildDiscountExplain(cartList, shopCoupon.getReceiveId(), addrId); |
| | | DiscountExplain discountExplain = shopOrderService.buildDiscountExplain(cartList, shopCoupon.getReceiveId(), bizUser.getCompanyId()); |
| | | |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, buyCart, buyCart.size()); |
| | | //结算金额信息 |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.tools.WxUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.bean.CustomerDataDictionary; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.dao.CustomerDataDictionaryDao; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | |
| | | import com.matrix.system.shopXcx.api.service.WxShopRefundRecordService; |
| | | import com.matrix.system.shopXcx.api.tools.SMSTools; |
| | | import com.matrix.system.shopXcx.bean.ShopDeliveryInfo; |
| | | import com.matrix.system.shopXcx.bean.ShopOrder; |
| | | import com.matrix.system.shopXcx.bean.ShopRefundRecord; |
| | | import com.matrix.system.shopXcx.dao.ShopDeliveryInfoDao; |
| | | import com.matrix.system.shopXcx.dao.ShopOrderDao; |
| | | import com.matrix.system.shopXcx.dao.ShopRefundRecordDao; |
| | | import com.matrix.component.tools.WxUtils; |
| | | import com.matrix.system.shopXcx.api.service.WxShopRefundRecordService; |
| | | import com.matrix.system.shopXcx.api.tools.SMSTools; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | modifyMap.put("id", orderId); |
| | | modifyMap.put("orderStatus", ShopOrder.ORDER_STATUS_APPLY_MONEYBACK); |
| | | shopOrderDao.updateByMap(modifyMap); |
| | | //从数据字典获取需要发送的手机号码和短信提醒内容 |
| | | BusParameterSettings busParameterSetting1 =busParameterSettingsDao.selectCompanyParamByCode("MSG_ALERT_CONTENT_REFUND",17L); |
| | | |
| | | String msg = busParameterSetting1.getParamValue(); |
| | | |
| | | |
| | | //TODO 写死微商城17L公司id |
| | | BusParameterSettings busParameterSetting= busParameterSettingsDao.selectCompanyParamByCode("MSG_ALERT_MOBILE",17L); |
| | | |
| | | |
| | | String phons = busParameterSetting.getParamValue(); |
| | | |
| | | phons.replace(',',','); |
| | | List<String> result = Arrays.asList(phons.split(",")); |
| | | if(CollectionUtils.isNotEmpty(result)){ |
| | | for(String phon : result){ |
| | | smsTools.sendMsg(phon, msg + "退订回T" ); |
| | | } |
| | | } |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "保存成功"); |
| | | } |
| | | |
| | |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.shopXcx.api.service.WXShopOrderService; |
| | | import com.matrix.system.shopXcx.api.service.WxShopActivitiesGroupService; |
| | | import com.matrix.system.shopXcx.api.vo.WxActivitiesGroupBuyVO; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | @PostMapping(value = "/calPrice") |
| | | public AjaxResult calPrice(@RequestBody CreateGroupBuyDTO createGroupBuyDTO) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | ShopActivitiesGroupPrice groupPrice = shopActivitiesGroupPriceDao.selectById(createGroupBuyDTO.getGpId()); |
| | | // 判断参数中gjId是否为空,若为空则为团长开团。再判断团长价是否为空,如果不为空则拥有团长价 |
| | | if (createGroupBuyDTO.getGjId() == null) { |
| | |
| | | } else { |
| | | createGroupBuyDTO.setPrice(groupPrice.getGpPrice()); |
| | | } |
| | | BigDecimal postage = wxShopOrderService.calculationPostage(createGroupBuyDTO.getAddressId(), createGroupBuyDTO.getPrice()); |
| | | BigDecimal postage = wxShopOrderService.calculationPostage(createGroupBuyDTO.getPrice(),bizUser.getCompanyId()); |
| | | BigDecimal payPrice = createGroupBuyDTO.getPrice().multiply(BigDecimal.valueOf(createGroupBuyDTO.getCount())).add(postage); |
| | | AjaxResult ajaxResult = new AjaxResult(AjaxResult.STATUS_SUCCESS, null); |
| | | ajaxResult.putInMap("billPrice", createGroupBuyDTO.getPrice().multiply(BigDecimal.valueOf(createGroupBuyDTO.getCount()))); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.shopXcx.api.service.WXShopOrderService; |
| | | import com.matrix.system.shopXcx.api.service.WxShopActivitiesSecKillService; |
| | |
| | | @Autowired |
| | | private WXShopOrderService wxShopOrderService; |
| | | @Autowired |
| | | private WxShopActivitiesSecKillService wxShopActivitiesSecKillService; |
| | | private WxShopActivitiesSecKillService wxShopActvitiesSecKillService; |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @PostMapping(value = "/calSecKillPrice") |
| | | public AjaxResult calSecKillPrice(@RequestBody SecKillVO secKillVO) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | ShopActivitiesSeckillInfo seckillInfo = shopActivitiesSeckillInfoDao.selectById(secKillVO.getId()); |
| | | if (seckillInfo == null) { |
| | | return AjaxResult.buildFailInstance("参数有误"); |
| | | } |
| | | |
| | | BigDecimal postage = wxShopOrderService.calculationPostage(secKillVO.getAddressId(), seckillInfo.getSiPrice()); |
| | | BigDecimal postage = wxShopOrderService.calculationPostage(seckillInfo.getSiPrice(),bizUser.getCompanyId()); |
| | | BigDecimal payPrice = seckillInfo.getSiPrice().multiply(BigDecimal.valueOf(secKillVO.getCount())).add(postage); |
| | | AjaxResult ajaxResult = new AjaxResult(AjaxResult.STATUS_SUCCESS, null); |
| | | ajaxResult.putInMap("totalPrice", payPrice); |
| | |
| | | */ |
| | | @PostMapping(value = "/createSecKill") |
| | | public AjaxResult createSecKill(@RequestBody CreateSecKillDTO secKillDTO) throws Exception { |
| | | return wxShopActivitiesSecKillService.createSecKillOrder(secKillDTO); |
| | | return wxShopActvitiesSecKillService.createSecKillOrder(secKillDTO); |
| | | } |
| | | } |
| | |
| | | package com.matrix.system.shopXcx.api.service; |
| | | |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.bean.CustomerDataDictionary; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.dao.CustomerDataDictionaryDao; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.shopXcx.api.vo.ShopCartBillVo; |
| | | import com.matrix.system.shopXcx.api.vo.ShopCartVo; |
| | | import com.matrix.system.shopXcx.bean.ShopCoupon; |
| | | import com.matrix.system.shopXcx.bean.ShopShoppingCart; |
| | | import com.matrix.system.shopXcx.dao.ShopShoppingCartDao; |
| | | import com.matrix.system.shopXcx.api.vo.ShopCartBillVo; |
| | | import com.matrix.system.shopXcx.api.vo.ShopCartVo; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | // 1表示没有优惠的默认分组 |
| | | ShopCartVo def = new ShopCartVo(); |
| | | |
| | | /** |
| | | * 同城配送标题 |
| | | * //DataDictionary qsfy = dataDictionaryDao.selectByTypeCode(AppConstance.QSFY); |
| | | * //def.setMsg("2公里内满" + qsfy.getValue() + "元免配送费"); |
| | | */ |
| | | |
| | | |
| | | def.setMsg("商城"); |
| | | def.setCartList(new ArrayList<>()); |
| | |
| | | } |
| | | } |
| | | } else { |
| | | BusParameterSettings qsfy= busParameterSettingsDao.selectCompanyParamByCode(AppConstance.IN_PROVINCE_PACKAGE_LIST,17L); |
| | | |
| | | shopCartVo.setSubtotal(selectSum); |
| | | shopCartVo.setSrcPrice(selectSum); |
| | | if (selectSum.compareTo(new BigDecimal(qsfy.getParamValue())) < 0) { |
| | | shopCartVo.setSatisfactionCoupon(false); |
| | | } else { |
| | | shopCartVo.setSatisfactionCoupon(true); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | BigDecimal calculationPostage(Integer addressId, BigDecimal payPrice); |
| | | BigDecimal calculationPostage(BigDecimal payPrice,Long companyId); |
| | | |
| | | /** |
| | | * 创建订单 |
| | |
| | | */ |
| | | AjaxResult updateStockAndVolumeById(Integer orderId); |
| | | |
| | | DiscountExplain buildDiscountExplain(List<ShopCartVo> cartList, Integer id, Integer addrId); |
| | | DiscountExplain buildDiscountExplain(List<ShopCartVo> cartList, Integer id, Long companyId); |
| | | } |
| | |
| | | * 根据购物车选中的产品 |
| | | * @return |
| | | */ |
| | | public List<CouponReceiveInfoVO> getCartVoCouponList(Long shopId,List<ShopShoppingCart> shopShoppingCarts); |
| | | public List<CouponReceiveInfoVO> getCartVoCouponList(Long companyId,List<ShopShoppingCart> shopShoppingCarts); |
| | | |
| | | |
| | | /** |
| | |
| | | private BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | @Override |
| | | public BigDecimal calculationPostage(Integer addressId, BigDecimal payPrice) { |
| | | public BigDecimal calculationPostage(BigDecimal payPrice,Long companyId) { |
| | | BigDecimal postage = BigDecimal.ZERO; |
| | | if (addressId != null) { |
| | | ShopReceiveAddress shopReceiveAddress = shopReceiveAddressDao.selectById(addressId); |
| | | |
| | | |
| | | BusParameterSettings sn= busParameterSettingsDao.selectCompanyParamByCode(AppConstance.IN_PROVINCE_PACKAGE_LIST,17L); |
| | | |
| | | |
| | | BusParameterSettings pydq= busParameterSettingsDao.selectCompanyParamByCode(AppConstance.SECOND_PROVINCE_PACKAGE_LIST,17L); |
| | | |
| | | |
| | | |
| | | if (sn.getParamValue().indexOf(shopReceiveAddress.getAddrProvince()) > -1) { |
| | | //省内邮费计算 |
| | | postage = getPostageByDataBictionary(AppConstance.IN_PROVINCE_PACKAGE_PRICE, payPrice); |
| | | } else if (pydq.getParamValue().indexOf(shopReceiveAddress.getAddrProvince()) > -1) { |
| | | //偏远地区 |
| | | postage = getPostageByDataBictionary(AppConstance.SECOND_OUT_PROVINCE_PACKAGE_PRICE, payPrice); |
| | | } else { |
| | | //其他地区 |
| | | postage = getPostageByDataBictionary(AppConstance.FIRST_OUT_PROVINCE_PACKAGE_PRICE, payPrice); |
| | | BusParameterSettings yf = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.PACKAGE_PRICE, companyId); |
| | | BusParameterSettings myje = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.FREE_PACKAGE_PRICE, companyId); |
| | | if(yf!=null&&myje!=null){ |
| | | if (Double.parseDouble(myje.getParamValue()) > payPrice.doubleValue()) { |
| | | postage = new BigDecimal(yf.getParamValue()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | return postage; |
| | | } |
| | | |
| | | //todo 根据数据字典计算运费 运费设置为0 后面再改配置在改计算规则 |
| | | private BigDecimal getPostageByDataBictionary(String code, BigDecimal payPrice) { |
| | | |
| | | /*CustomerDataDictionary dd = dataDictionaryDao.selectByTypeCode(code); |
| | | |
| | | |
| | | BigDecimal postage = BigDecimal.ZERO; |
| | | if (StringUtils.isNotBlank(dd.getValue())) { |
| | | if (StringUtils.isNotBlank(dd.getExtValue()) |
| | | && payPrice.compareTo(new BigDecimal(dd.getExtValue())) >= 0) { |
| | | //达到条件免邮 |
| | | postage = BigDecimal.ZERO; |
| | | } else { |
| | | postage = new BigDecimal(dd.getValue()); |
| | | } |
| | | }*/ |
| | | return BigDecimal.ZERO; |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | //计算订单优惠信息 |
| | | DiscountExplain discountExplain = buildDiscountExplain(cartList, addShopOrderPOJO.getCouponReceiveId(), shopReceiveAddress.getAddrId()); |
| | | DiscountExplain discountExplain = buildDiscountExplain(cartList, addShopOrderPOJO.getCouponReceiveId(), bizUser.getCompanyId()); |
| | | |
| | | |
| | | ShopOrder shopOrder = new ShopOrder(); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public DiscountExplain buildDiscountExplain(List<ShopCartVo> cartList, Integer receiveId, Integer receiveAddrId) { |
| | | public DiscountExplain buildDiscountExplain(List<ShopCartVo> cartList, Integer receiveId, Long companyId) { |
| | | ShopCartBillVo shopCartBill = shoppingCartService.buildShopCartBillVo(cartList); |
| | | DiscountExplain discountExplain = new DiscountExplain(); |
| | | discountExplain.setActivity(shopCartBill.getBillCouponTotal()); |
| | |
| | | } |
| | | } |
| | | |
| | | discountExplain.setPostage(calculationPostage(receiveAddrId, discountExplain.getPayPrice())); |
| | | discountExplain.setPostage(calculationPostage(discountExplain.getPayPrice(),companyId)); |
| | | |
| | | //计算实际支付 |
| | | discountExplain.setPayPrice(discountExplain.getPayPrice().add(discountExplain.getPostage())); |
| | |
| | | import com.matrix.component.wechat.externalInterface.protocol.paramProtocol.BrandWCPayRequestData; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.constance.Dictionary; |
| | |
| | | if (shopReceiveAddress == null) { |
| | | throw new GlobleException("请选择正确的收获地址"); |
| | | } |
| | | |
| | | BizUser user=redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | ShopOrder shopOrder = new ShopOrder(); |
| | | shopOrder.setCompanyId(user.getCompanyId()); |
| | | shopOrder.setStoreId(Integer.parseInt(createGroupBuyDTO.getShopId().toString())); |
| | | shopOrder.setOrderType(ShopOrder.ORDER_TYPE_SERVICE); |
| | | |
| | |
| | | shopOrder.setPayResult(ShopOrder.ORDER_WX_STATUS_WAIT_PAY); |
| | | //如果没有提交购买方式或配送方式不是物流 |
| | | //获取邮费 |
| | | BigDecimal postPrice = wxShopOrderService.calculationPostage(createGroupBuyDTO.getAddressId(), createGroupBuyDTO.getPrice()); |
| | | BigDecimal postPrice = wxShopOrderService.calculationPostage(createGroupBuyDTO.getPrice(),user.getCompanyId()); |
| | | shopOrder.setPostage(postPrice); |
| | | BigDecimal payPrice = createGroupBuyDTO.getPrice().multiply(BigDecimal.valueOf(createGroupBuyDTO.getCount())).add(shopOrder.getPostage()); |
| | | shopOrder.setOrderMoney(payPrice); |
| | |
| | | } |
| | | |
| | | private ShopOrder createOrder(CreateSecKillDTO secKillDTO) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | ShopReceiveAddress shopReceiveAddress = shopReceiveAddressDao.selectById(secKillDTO.getAddressId()); |
| | | if (shopReceiveAddress == null) { |
| | | throw new GlobleException("请选择正确的收获地址"); |
| | |
| | | shopOrder.setUpdateBy("微信小程序生成"); |
| | | shopOrder.setCommodityPrice(secKillDTO.getPrice()); |
| | | shopOrder.setPurchaseQuantity(1); |
| | | shopOrder.setCompanyId(bizUser.getCompanyId()); |
| | | //购买方式 |
| | | shopOrder.setShippingMethod(secKillDTO.getShippingMethod()); |
| | | //生成订单号 |
| | |
| | | shopOrder.setPayResult(ShopOrder.ORDER_WX_STATUS_WAIT_PAY); |
| | | //如果没有提交购买方式或配送方式不是物流 |
| | | //获取邮费 |
| | | BigDecimal postPrice = wxShopOrderService.calculationPostage(secKillDTO.getAddressId(), secKillDTO.getPrice()); |
| | | BigDecimal postPrice = wxShopOrderService.calculationPostage(secKillDTO.getPrice(),bizUser.getCompanyId()); |
| | | shopOrder.setPostage(postPrice); |
| | | BigDecimal payPrice = secKillDTO.getPrice().multiply(BigDecimal.valueOf(secKillDTO.getCount())).add(shopOrder.getPostage()); |
| | | shopOrder.setOrderMoney(payPrice); |
| | |
| | | |
| | | BizUser bizUser = bizUserService.findByOpenId(orderDto.getUserId()); |
| | | SysOrder order = new SysOrder(); |
| | | //TODO 根据公司id区分 |
| | | SysVipInfo vipInfo = vipDao.selectByPhone(bizUser.getPhoneNumber()); |
| | | if(SysVipInfo.UNDEAL_VIP==vipInfo.getIsDeal()){ |
| | | //非成交客户下单更新客户为成交客户 |
| | |
| | | } |
| | | |
| | | //获取订单归属门店 |
| | | order.setCompanyId(vipInfo.getCompanyId()); |
| | | order.setCompanyId(orderDto.getCompanyId()); |
| | | order.setShopId(Long.parseLong(orderDto.getStoreId()+"")); |
| | | //同步的订单订单编号保持一致 |
| | | order.setOrderNo(orderDto.getOrderNo()); |