联系人信息
This commit is contained in:
parent
6955a3973e
commit
83e0e13647
@ -108,5 +108,5 @@ public interface CouponFeignClient {
|
||||
* 直接向用户发放代金卷
|
||||
* @return
|
||||
*/
|
||||
void sendUserCoupon(Long userId, Long reduceAmount);
|
||||
void sendUserCoupon(Long shopId,Long userId, Long reduceAmount);
|
||||
}
|
||||
|
@ -549,5 +549,5 @@ public interface OrderFeignClient {
|
||||
*/
|
||||
Long saveOrderToMall(SaveOrderToMallDTO saveOrderToMallDTO);
|
||||
|
||||
void updateOrderMall(Long mallOrderId, Integer orderStatus);
|
||||
void updateOrderMall(Long shopId,Long mallOrderId, Integer orderStatus);
|
||||
}
|
||||
|
@ -4,15 +4,15 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.tmerclub.cloud.api.coupon.feign.CouponFeignClient;
|
||||
import com.tmerclub.cloud.api.delivery.dto.CurOderReturnsDTO;
|
||||
import com.tmerclub.cloud.api.delivery.feign.DeliveryFeignClient;
|
||||
import com.tmerclub.cloud.api.order.dto.SaveOrderToMallDTO;
|
||||
import com.tmerclub.cloud.api.order.feign.OrderAddrFeignClient;
|
||||
import com.tmerclub.cloud.api.order.feign.OrderFeignClient;
|
||||
import com.tmerclub.cloud.api.user.feign.UserAddrFeignClient;
|
||||
import com.tmerclub.cloud.api.user.feign.UserBalanceLogFeignClient;
|
||||
import com.tmerclub.cloud.common.exception.LuckException;
|
||||
import com.tmerclub.cloud.common.local.constant.CueOrderStatus;
|
||||
import com.tmerclub.cloud.api.delivery.dto.CurOderReturnsDTO;
|
||||
import com.tmerclub.cloud.api.order.dto.SaveOrderToMallDTO;
|
||||
import com.tmerclub.cloud.common.order.vo.OrderAddrVO;
|
||||
import com.tmerclub.cloud.common.order.vo.UserAddrVO;
|
||||
import com.tmerclub.cloud.common.response.ServerResponseEntity;
|
||||
@ -118,8 +118,8 @@ public class CreateOrderManager {
|
||||
* @param mallOrderId mallOrderId
|
||||
* @param orderStatus 状态
|
||||
*/
|
||||
public void updateOrderMall(Long mallOrderId, Integer orderStatus) {
|
||||
orderFeignClient.updateOrderMall(mallOrderId, orderStatus);
|
||||
public void updateOrderMall(Long shopId, Long mallOrderId, Integer orderStatus) {
|
||||
orderFeignClient.updateOrderMall(shopId, mallOrderId, orderStatus);
|
||||
}
|
||||
|
||||
public void agreeOrder(CueAgreeOrderDTO cueAgreeOrderDTO) {
|
||||
@ -164,13 +164,13 @@ public class CreateOrderManager {
|
||||
break;
|
||||
case 2:
|
||||
// 代金卷支付
|
||||
couponFeignClient.sendUserCoupon(cueOrderVO.getUserId(), cueOrderVO.getVoucherAmount());
|
||||
couponFeignClient.sendUserCoupon(cueOrderVO.getShopId(), cueOrderVO.getUserId(), cueOrderVO.getVoucherAmount());
|
||||
break;
|
||||
default:
|
||||
throw new LuckException("支付方式错误,请检查!");
|
||||
}
|
||||
cueOrderMapper.update(cueOrder);
|
||||
this.updateOrderMall(cueOrderVO.getMallOrderId(), CueOrderStatus.EVALUATION_FAIL.value());
|
||||
this.updateOrderMall(cueOrderVO.getShopId(), cueOrderVO.getMallOrderId(), CueOrderStatus.EVALUATION_FAIL.value());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -212,7 +212,7 @@ public class CreateOrderManager {
|
||||
|
||||
cueOrder.setUpdateTime(DateUtil.date());
|
||||
cueOrderMapper.update(cueOrder);
|
||||
this.updateOrderMall(cueOrderVO.getMallOrderId(), cueOrder.getOrderStatus());
|
||||
this.updateOrderMall(null, cueOrderVO.getMallOrderId(), cueOrder.getOrderStatus());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -131,7 +131,10 @@ public class CueOrder extends BaseModel implements Serializable {
|
||||
* 寄出时候选定的仓库id
|
||||
*/
|
||||
private Long warehouseId;
|
||||
|
||||
/**
|
||||
* 店铺ID
|
||||
*/
|
||||
private Long shopId;
|
||||
/**
|
||||
* 用户退款地址id
|
||||
*/
|
||||
|
@ -116,6 +116,16 @@ public class AppCueOrderVO extends BaseVO implements Serializable {
|
||||
*/
|
||||
@Schema(description = "寄出时快递单号")
|
||||
private String sendNumber;
|
||||
/**
|
||||
* 用户姓名
|
||||
*/
|
||||
@Schema(description = "姓名")
|
||||
private String userName;
|
||||
/**
|
||||
* 用户联系方式
|
||||
*/
|
||||
@Schema(description = "手机号")
|
||||
private String userPhone;
|
||||
/**
|
||||
* 寄出时候选定的仓库id
|
||||
*/
|
||||
|
@ -146,6 +146,10 @@ public class CueOrderVO extends BaseVO implements Serializable {
|
||||
* 寄出时候选定的仓库id
|
||||
*/
|
||||
private Long warehouseId;
|
||||
/**
|
||||
* 寄出时候联动出的店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 用户退款地址id
|
||||
|
@ -102,7 +102,7 @@ public class CueOrderServiceImpl implements CueOrderService {
|
||||
|
||||
private void syncSend(CueOrderDTO cueOrderDTO) {
|
||||
// 修改系统订单的状态
|
||||
createOrderManager.updateOrderMall(cueOrderDTO.getMallOrderId(), cueOrderDTO.getOrderStatus());
|
||||
createOrderManager.updateOrderMall(null, cueOrderDTO.getMallOrderId(), cueOrderDTO.getOrderStatus());
|
||||
// 发送消息
|
||||
List<SendNotifyBO> notifyList = new ArrayList<>(Constant.INITIAL_CAPACITY);
|
||||
SendNotifyBO sendNotifyBO = new SendNotifyBO();
|
||||
@ -134,7 +134,7 @@ public class CueOrderServiceImpl implements CueOrderService {
|
||||
@Override
|
||||
public int saveMailing(CueSaveMailingDTO cueSaveMailingDTO) {
|
||||
// 修改系统订单的状态
|
||||
createOrderManager.updateOrderMall(cueSaveMailingDTO.getMallOrderId(), CueOrderStatus.FINISH_DELIVERY.value());
|
||||
createOrderManager.updateOrderMall(null, cueSaveMailingDTO.getMallOrderId(), CueOrderStatus.FINISH_DELIVERY.value());
|
||||
// 修改回收单状态
|
||||
CueOrder cueOrder = BeanUtil.toBean(cueSaveMailingDTO, CueOrder.class);
|
||||
cueOrder.setOrderStatus(CueOrderStatus.FINISH_DELIVERY.value());
|
||||
|
@ -24,6 +24,10 @@ public class Warehouse extends BaseModel implements Serializable {
|
||||
* 主键ID
|
||||
*/
|
||||
private Long warehouseId;
|
||||
/**
|
||||
* 店铺ID
|
||||
*/
|
||||
private Long shopId;
|
||||
/**
|
||||
* 仓库名称
|
||||
*/
|
||||
|
@ -21,6 +21,10 @@ public class WarehouseDTO implements Serializable {
|
||||
* 主键ID
|
||||
*/
|
||||
private Long warehouseId;
|
||||
/**
|
||||
* 店铺ID
|
||||
*/
|
||||
private Long shopId;
|
||||
/**
|
||||
* 仓库名称
|
||||
*/
|
||||
|
@ -26,6 +26,10 @@ public class WarehouseVO extends BaseVO implements Serializable {
|
||||
*/
|
||||
@Schema(description = "主键ID")
|
||||
private Long warehouseId;
|
||||
/**
|
||||
* 店铺ID
|
||||
*/
|
||||
private Long shopId;
|
||||
/**
|
||||
* 仓库名称
|
||||
*/
|
||||
|
@ -7,6 +7,7 @@ import com.tmerclub.cloud.common.database.dto.PageDTO;
|
||||
import com.tmerclub.cloud.common.database.util.PageUtil;
|
||||
import com.tmerclub.cloud.common.database.vo.PageVO;
|
||||
import com.tmerclub.cloud.common.exception.LuckException;
|
||||
import com.tmerclub.cloud.common.security.AuthUserContext;
|
||||
import com.tmerclub.cloud.cuerecycle.mapper.CueOrderMapper;
|
||||
import com.tmerclub.cloud.cuerecycle.model.CueOrder;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueOrderVO;
|
||||
@ -36,6 +37,7 @@ public class WarehouseServiceImpl implements WarehouseService {
|
||||
|
||||
@Override
|
||||
public PageVO<WarehouseVO> page(PageDTO pageDTO, WarehouseDTO warehouseDTO) {
|
||||
warehouseDTO.setShopId(AuthUserContext.get().getTenantId());
|
||||
return PageUtil.doPage(pageDTO, () -> warehouseMapper.list(warehouseDTO));
|
||||
}
|
||||
|
||||
@ -48,6 +50,7 @@ public class WarehouseServiceImpl implements WarehouseService {
|
||||
public int save(WarehouseDTO warehouseDTO) {
|
||||
Warehouse warehouse = BeanUtil.toBean(warehouseDTO, Warehouse.class);
|
||||
warehouse.setCreateTime(DateUtil.date());
|
||||
warehouse.setShopId(AuthUserContext.get().getTenantId());
|
||||
return warehouseMapper.save(warehouse);
|
||||
}
|
||||
|
||||
@ -82,6 +85,7 @@ public class WarehouseServiceImpl implements WarehouseService {
|
||||
CueOrder cueOrder = new CueOrder();
|
||||
cueOrder.setOrderId(orderId);
|
||||
cueOrder.setWarehouseId(nearbyWarehouse.getWarehouseId());
|
||||
cueOrder.setShopId(nearbyWarehouse.getShopId());
|
||||
cueOrderMapper.update(cueOrder);
|
||||
return nearbyWarehouse;
|
||||
} else {
|
||||
|
@ -32,12 +32,13 @@
|
||||
<result property="sendNumber" column="send_number"/>
|
||||
<result property="productImages" column="product_images"/>
|
||||
<result property="warehouseId" column="warehouse_id"/>
|
||||
<result property="shopId" column="shop_id"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Vo_Column_List">
|
||||
order_id,product_id,product_name,product_images,product_price,user_id,user_name,user_phone,cue_order_type,
|
||||
order_status,flaw_img_url,evidence_of_payment,order_remark,estimated_amount,actual_amount,voucher_amount,deleted,
|
||||
create_time,update_time,is_payed,pay_type,pay_time,delivery_time,finally_time,mall_order_id,send_number,order_addr_id,warehouse_id
|
||||
create_time,update_time,is_payed,pay_type,pay_time,delivery_time,finally_time,mall_order_id,send_number,order_addr_id,warehouse_id,shop_id
|
||||
</sql>
|
||||
|
||||
<select id="list" resultMap="cueOrderVOMap">
|
||||
@ -207,6 +208,9 @@
|
||||
<if test="printerId != null">
|
||||
printer_id = #{printerId},
|
||||
</if>
|
||||
<if test="shopId != null">
|
||||
shop_id = #{shopId},
|
||||
</if>
|
||||
<if test="backTrackingNumber != null and backTrackingNumber != ''">
|
||||
back_tracking_number = #{backTrackingNumber},
|
||||
</if>
|
||||
|
@ -25,7 +25,7 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="Vo_Column_List">
|
||||
warehouse_id,warehouse_name,warehouse_status,principal_name,principal_phone,province_id,province,city_id,city,area_id,area,post_code,addr,lng,lat,deleted,update_time,create_time
|
||||
shop_id,warehouse_id,warehouse_name,warehouse_status,principal_name,principal_phone,province_id,province,city_id,city,area_id,area,post_code,addr,lng,lat,deleted,update_time,create_time
|
||||
</sql>
|
||||
|
||||
<select id="list" resultMap="warehouseVOMap">
|
||||
@ -35,6 +35,9 @@
|
||||
warehouse
|
||||
<where>
|
||||
deleted = 0
|
||||
<if test="dto.shopId != null">
|
||||
AND shop_id = #{dto.shopId}
|
||||
</if>
|
||||
<if test="dto.warehouseName != null and dto.warehouseName != ''">
|
||||
AND warehouse_name LIKE CONCAT('%', #{dto.warehouseName}, '%')
|
||||
</if>
|
||||
@ -77,6 +80,7 @@
|
||||
</select>
|
||||
<select id="getNearbyWarehouse" resultType="com.tmerclub.cloud.warehouse.model.vo.WarehouseVO">
|
||||
SELECT
|
||||
shop_id,
|
||||
warehouse_id,
|
||||
warehouse_name,
|
||||
warehouse_status,
|
||||
@ -110,6 +114,7 @@
|
||||
<insert id="save" useGeneratedKeys="true" keyProperty="warehouseId">
|
||||
INSERT INTO warehouse
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="shopId != null">shop_id,</if>
|
||||
<if test="warehouseName != null and warehouseName != ''">warehouse_name,</if>
|
||||
<if test="warehouseStatus != null">warehouse_status,</if>
|
||||
<if test="principalName != null and principalName != ''">principal_name,</if>
|
||||
@ -127,6 +132,7 @@
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="shopId != null">#{shopId},</if>
|
||||
<if test="warehouseName != null and warehouseName != ''">#{warehouseName},</if>
|
||||
<if test="warehouseStatus != null">#{warehouseStatus},</if>
|
||||
<if test="principalName != null and principalName != ''">#{principalName},</if>
|
||||
|
@ -129,10 +129,10 @@ public class CouponFeignController implements CouponFeignClient {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendUserCoupon(Long userId, Long reduceAmount) {
|
||||
public void sendUserCoupon(Long shopId, Long userId, Long reduceAmount) {
|
||||
// 创建优惠卷
|
||||
CouponDTO couponDTO = new CouponDTO();
|
||||
couponDTO.setShopId(0L); //-
|
||||
couponDTO.setShopId(shopId);
|
||||
couponDTO.setCouponName("球杆置换代金卷");
|
||||
couponDTO.setSuitableProdType(SuitableProdType.ALL_SPU.value());
|
||||
couponDTO.setLimitNum(1);
|
||||
|
@ -599,10 +599,11 @@ public class OrderFeignController implements OrderFeignClient {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateOrderMall(Long mallOrderId, Integer orderStatus) {
|
||||
public void updateOrderMall(Long shopId,Long mallOrderId, Integer orderStatus) {
|
||||
Order order = new Order();
|
||||
order.setOrderId(mallOrderId);
|
||||
order.setStatus(orderStatus);
|
||||
order.setShopId(shopId);
|
||||
orderMapper.updateCueOrder(order);
|
||||
}
|
||||
}
|
||||
|
@ -393,5 +393,10 @@ public interface OrderMapper {
|
||||
* @param order 参数
|
||||
*/
|
||||
void saveCueOrder(Order order);
|
||||
/**
|
||||
* 更新cue订单
|
||||
*
|
||||
* @param order 参数
|
||||
*/
|
||||
void updateCueOrder(Order order);
|
||||
}
|
||||
|
@ -1343,8 +1343,14 @@
|
||||
<update id="updateCueOrder">
|
||||
update
|
||||
`order`
|
||||
set
|
||||
`status` = #{status}
|
||||
<set>
|
||||
<if test="status != null">
|
||||
`status` = #{status},
|
||||
</if>
|
||||
<if test="shopId != null">
|
||||
`shop_id` = #{shopId},
|
||||
</if>
|
||||
</set>
|
||||
where
|
||||
order_id = #{orderId}
|
||||
</update>
|
||||
|
Loading…
x
Reference in New Issue
Block a user