袁野 3 months ago
parent ba56d995a2
commit a8f5ad5845
  1. 18
      order/src/main/java/com/order/controller/OrderPayController.java
  2. 1
      order/src/main/java/com/order/controller/business/BsOrderGoodsController.java
  3. 2
      schedule/src/main/java/com/hfkj/schedule/OrderGoodsSchedule.java
  4. 61
      service/src/main/java/com/hfkj/dao/BsOrderCouponMapper.java
  5. 15
      service/src/main/java/com/hfkj/service/goods/BsOrderGoodsService.java
  6. 23
      service/src/main/java/com/hfkj/service/goods/impl/BsOrderGoodsServiceImpl.java
  7. 19
      service/src/main/java/com/hfkj/service/order/OrderRefundSuccessService.java

@ -198,24 +198,6 @@ public class OrderPayController {
orderChildService.editData(orderChild);
}
// 插入订单关联
BsUserLoginLog bsUserLoginLog = bsUserLoginLogService.findUserLog(order.getUserId());
BsOrderOutside bsOrderOutside = new BsOrderOutside();
if (bsUserLoginLog != null) {
bsOrderOutside.setPlatformCode(bsUserLoginLog.getPlatformCode());
bsOrderOutside.setPlatformName(bsUserLoginLog.getPlatformName());
bsOrderOutside.setLoginTypeCode(bsUserLoginLog.getLoginTypeCode());
bsOrderOutside.setLoginTypeName(bsUserLoginLog.getLoginTypeName());
}
bsOrderOutside.setOrderNo(order.getOrderNo());
bsOrderOutside.setStatus(1);
bsOrderOutside.setCreateTime(new Date());
bsOrderOutside.setUpdateTime(new Date());
bsOrderOutsideService.create(bsOrderOutside);
order.setPayChannelOrderNo(thirdPreOrder.getString("preOrderNo"));
orderService.editData(order);

@ -302,7 +302,6 @@ public class BsOrderGoodsController {
// 删除缓存
orderService.cacheDelete(goodsOrder.getOrderNo());
bsOrderGoodsService.cacheDelete(goodsOrder.getLogisticsNo());
bsOrderGoodsService.update(goodsOrder);
getLogisticsMsg(goodsOrder.getId());
return ResponseMsgUtil.success("更新成功!");

@ -61,7 +61,7 @@ public class OrderGoodsSchedule {
}
}
@Scheduled(cron = "30 0 0 * * ?")
@Scheduled(cron = "5 0 0 * * ?")
public void getLogisticsMsg() {
Map<String , Object> objectMap = new HashMap<>();

@ -129,67 +129,6 @@ public interface BsOrderCouponMapper extends BsOrderCouponMapperExt {
})
List<BsOrderCoupon> selectByExample(BsOrderCouponExample example);
@Select({
"select",
<<<<<<< HEAD
"id, order_no, child_order_no, mer_id, platform_code, user_id, user_phone, goods_id, ",
"goods_name, goods_type_id, goods_type_name, goods_brand_id, goods_brand_name, ",
"goods_specs_id, goods_specs_name, goods_spesc_original_price, goods_spesc_sale_price, ",
"goods_vpd_id, goods_vpd_key, goods_vpd_source, goods_count, total_price, total_deduction_price, ",
=======
"id, order_no, child_order_no, mer_id, user_id, user_phone, goods_id, goods_name, ",
"goods_type_id, goods_type_name, goods_brand_id, goods_brand_name, goods_specs_id, ",
"goods_specs_name, goods_spesc_original_price, goods_spesc_sale_price, goods_vpd_id, ",
"goods_vpd_key, goods_vpd_source, goods_count, total_price, total_deduction_price, ",
>>>>>>> 829e638cdd103b441766e88156903755733dca7a
"coupon_discount_price, integral_discount_price, pay_real_price, pay_channel, ",
"pay_serial_no, pay_type, `status`, create_time, pay_time, cancel_time, refund_time, ",
"finish_time, update_time, ext_1, ext_2, ext_3",
"from bs_order_coupon",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="child_order_no", property="childOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="platform_code", property="platformCode", jdbcType=JdbcType.VARCHAR),
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
@Result(column="goods_id", property="goodsId", jdbcType=JdbcType.BIGINT),
@Result(column="goods_name", property="goodsName", jdbcType=JdbcType.VARCHAR),
@Result(column="goods_type_id", property="goodsTypeId", jdbcType=JdbcType.BIGINT),
@Result(column="goods_type_name", property="goodsTypeName", jdbcType=JdbcType.VARCHAR),
@Result(column="goods_brand_id", property="goodsBrandId", jdbcType=JdbcType.BIGINT),
@Result(column="goods_brand_name", property="goodsBrandName", jdbcType=JdbcType.VARCHAR),
@Result(column="goods_specs_id", property="goodsSpecsId", jdbcType=JdbcType.BIGINT),
@Result(column="goods_specs_name", property="goodsSpecsName", jdbcType=JdbcType.VARCHAR),
@Result(column="goods_spesc_original_price", property="goodsSpescOriginalPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="goods_spesc_sale_price", property="goodsSpescSalePrice", jdbcType=JdbcType.DECIMAL),
@Result(column="goods_vpd_id", property="goodsVpdId", jdbcType=JdbcType.BIGINT),
@Result(column="goods_vpd_key", property="goodsVpdKey", jdbcType=JdbcType.VARCHAR),
@Result(column="goods_vpd_source", property="goodsVpdSource", jdbcType=JdbcType.INTEGER),
@Result(column="goods_count", property="goodsCount", jdbcType=JdbcType.INTEGER),
@Result(column="total_price", property="totalPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="total_deduction_price", property="totalDeductionPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="coupon_discount_price", property="couponDiscountPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="integral_discount_price", property="integralDiscountPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="pay_real_price", property="payRealPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="pay_channel", property="payChannel", jdbcType=JdbcType.INTEGER),
@Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="cancel_time", property="cancelTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="finish_time", property="finishTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
BsOrderCoupon selectByPrimaryKey(Long id);
@UpdateProvider(type=BsOrderCouponSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsOrderCoupon record, @Param("example") BsOrderCouponExample example);

@ -139,21 +139,6 @@ public interface BsOrderGoodsService {
*/
Object getLogisticsMsg(String logisticsNo , String mobile);
/**
* 更新缓存
* @param logisticsNo
* @param logistics
* @return
*/
GoodsLogistics cache(String logisticsNo , GoodsLogistics logistics);
/**
* 删除缓存
* @param logisticsNo
* @return
*/
void cacheDelete(String logisticsNo);
/**
* @Author Sum1Dream
* @Name getLogisticsMsg

@ -255,34 +255,15 @@ public class BsOrderGoodsServiceImpl implements BsOrderGoodsService {
@Override
public Object getLogisticsMsg(String logisticsNo , String mobile) {
Object data = redisUtil.get(CACHE_KEY + logisticsNo);
if (data == null) {
JSONObject jsonObjects = OrderUtil.getLogisticsMsg(logisticsNo , mobile);
if (jsonObjects == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂未发货!");
}
if (jsonObjects.getInteger("code") == 200 && jsonObjects.getBoolean("success")) {
GoodsLogistics logistics = editLogistics((JSONObject) jsonObjects.get("data"));
return cache(logisticsNo , logistics);
}
return jsonObjects;
} else {
return data;
}
System.out.println("======================================" + jsonObjects);
return editLogistics((JSONObject) jsonObjects.get("data"));
}
@Override
public GoodsLogistics cache(String getLogisticsNo , GoodsLogistics logistics) {
// 缓存
redisUtil.set(CACHE_KEY + getLogisticsNo, logistics, CACHE_TIME);
return logistics;
}
@Override
public void cacheDelete(String getLogisticsNo) {
// 缓存
redisUtil.del(CACHE_KEY + getLogisticsNo);
}
@Override
public void confirmReceipt(Long orderGoodsId) {

@ -5,16 +5,15 @@ import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.config.CommonSysConst;
import com.hfkj.entity.BsOrderChild;
import com.hfkj.entity.BsOrderCinema;
import com.hfkj.entity.BsOrderCoupon;
import com.hfkj.entity.BsOrderGoods;
import com.hfkj.entity.*;
import com.hfkj.model.order.OrderChildModel;
import com.hfkj.model.order.OrderModel;
import com.hfkj.qianzhu.channel.CinemaService;
import com.hfkj.service.coupon.BsOrderCouponService;
import com.hfkj.service.goods.BsOrderCinemaService;
import com.hfkj.service.goods.BsOrderStarbucksService;
import com.hfkj.service.goods.impl.BsOrderGoodsServiceImpl;
import com.hfkj.service.goods.impl.BsOrderStarbucksServiceImpl;
import com.hfkj.sysenum.order.OrderChildProductTypeEnum;
import com.hfkj.sysenum.order.OrderChildStatusEnum;
import org.springframework.beans.factory.annotation.Autowired;
@ -42,6 +41,8 @@ public class OrderRefundSuccessService {
private BsOrderGoodsServiceImpl bsOrderGoodsService;
@Resource
private BsOrderCouponService orderCouponService;
@Resource
private BsOrderStarbucksService bsOrderStarbucksService;
/**
* 订单业务处理
@ -123,4 +124,14 @@ public class OrderRefundSuccessService {
}
}
public void starbucks(BsOrderChild childOrder) {
// 查询星巴克订单
BsOrderStarbucks orderStarbucks = bsOrderStarbucksService.findGoodsOrder(childOrder.getOrderNo());
if (orderStarbucks != null) {
orderStarbucks.setStatus(OrderChildStatusEnum.status4.getCode());
orderStarbucks.setUpdateTime(new Date());
bsOrderStarbucksService.update(orderStarbucks);
}
}
}

Loading…
Cancel
Save