Commit 2f935507 by 张富康

feat(order): 添加订单优惠券信息查询功能

- 在CustomerInviteRecordMapper中新增listCustomerInviteRecordLatest方法
- 添加最新客户邀请记录查询的SQL映射配置
- 在CustomerProfileInfoDTO中增加优惠券信息字段
- 在GoodsOrderService中集成优惠券信息查询逻辑
- 实现订单详情中优惠券信息的关联查询功能
1 parent 896859c4
...@@ -228,6 +228,12 @@ public class CustomerProfileInfoDTO implements Serializable { ...@@ -228,6 +228,12 @@ public class CustomerProfileInfoDTO implements Serializable {
*/ */
private String isAll; private String isAll;
/**
* 优惠券信息
*/
@ApiModelProperty(notes = "优惠券信息")
private CustomerInviteRecordDTO customerInviteRecordDTO;
/** /**
* 分页参数 pageNum * 分页参数 pageNum
......
...@@ -21,6 +21,8 @@ public interface CustomerInviteRecordMapper extends OreMapper<CustomerInviteReco ...@@ -21,6 +21,8 @@ public interface CustomerInviteRecordMapper extends OreMapper<CustomerInviteReco
List<CustomerInviteRecordDTO> listCustomerInviteRecord(CustomerInviteRecordDTO condition); List<CustomerInviteRecordDTO> listCustomerInviteRecord(CustomerInviteRecordDTO condition);
CustomerInviteRecordDTO listCustomerInviteRecordLatest(CustomerInviteRecordDTO condition);
CustomerInviteRecordDTO customerInviteStatusCount(CustomerInviteRecordDTO condition); CustomerInviteRecordDTO customerInviteStatusCount(CustomerInviteRecordDTO condition);
List<CustomerInviteRecordDTO> pageInvitedRecordMerchant(CustomerInviteRecordDTO condition); List<CustomerInviteRecordDTO> pageInvitedRecordMerchant(CustomerInviteRecordDTO condition);
......
...@@ -13,6 +13,7 @@ import cn.com.glsx.dj.smartcarlife.dto.AdvanceOrderDTO; ...@@ -13,6 +13,7 @@ import cn.com.glsx.dj.smartcarlife.dto.AdvanceOrderDTO;
import cn.com.glsx.dj.smartcarlife.dto.BehaviorAbnormalMonitoringWeeklyDTO; import cn.com.glsx.dj.smartcarlife.dto.BehaviorAbnormalMonitoringWeeklyDTO;
import cn.com.glsx.dj.smartcarlife.dto.ClientSignatureDTO; import cn.com.glsx.dj.smartcarlife.dto.ClientSignatureDTO;
import cn.com.glsx.dj.smartcarlife.dto.CustomerClueDTO; import cn.com.glsx.dj.smartcarlife.dto.CustomerClueDTO;
import cn.com.glsx.dj.smartcarlife.dto.CustomerInviteRecordDTO;
import cn.com.glsx.dj.smartcarlife.dto.CustomerPhotosDTO; import cn.com.glsx.dj.smartcarlife.dto.CustomerPhotosDTO;
import cn.com.glsx.dj.smartcarlife.dto.CustomerProfileInfoDTO; import cn.com.glsx.dj.smartcarlife.dto.CustomerProfileInfoDTO;
import cn.com.glsx.dj.smartcarlife.dto.CustomerProfileInfoGroupDTO; import cn.com.glsx.dj.smartcarlife.dto.CustomerProfileInfoGroupDTO;
...@@ -7189,6 +7190,11 @@ public class GoodsOrderService { ...@@ -7189,6 +7190,11 @@ public class GoodsOrderService {
// 查询商品信息 // 查询商品信息
List<GoodsSubOrderDTO> goodsSubOrderDTOs = goodsOrderCustomerMapper.getSubOrderInfo(dto.getId()); List<GoodsSubOrderDTO> goodsSubOrderDTOs = goodsOrderCustomerMapper.getSubOrderInfo(dto.getId());
result.setGoodsSubOrderDTOS(goodsSubOrderDTOs); result.setGoodsSubOrderDTOS(goodsSubOrderDTOs);
// 查询优惠券信息
CustomerInviteRecordDTO condition = new CustomerInviteRecordDTO();
condition.setCustomerId(dto.getId());
CustomerInviteRecordDTO customerInviteRecordDTO = customerInviteRecordMapper.listCustomerInviteRecordLatest(condition);
result.setCustomerInviteRecordDTO(customerInviteRecordDTO);
return result; return result;
} }
......
...@@ -485,4 +485,28 @@ ...@@ -485,4 +485,28 @@
SET t1.invite_date = #{inviteDate}; SET t1.invite_date = #{inviteDate};
</update> </update>
<select id="listCustomerInviteRecordLatest" resultMap="DTOResultMap">
select dclcir.id,dclcir.customer_id, dclcir.status, dclcir.invite_date, dclcir.customer_coupon_id,
ifnull(dclcc.customer_name, dclci.customer_name) as customer_name, dclci.customer_phone,
dclci.car_brand_id, dclci.car_brand, dclci.car_childs_brand_id, dclci.car_childs_brand_name,
dclci.car_series_id, dclci.car_series_name, dclcc.coupon_name, dclcc.created_date as getCouponDate,
dclcc.user_id as issuerUserId, dclcc.employee_name, dclcc.coupon_type, dclcc.coupon_type_name,
dclcir.traffic_effectiveness
from dj_car_life_customer_invite_record dclcir
left join dj_car_life_customer_coupon dclcc on dclcir.customer_coupon_id = dclcc.id
left join dj_car_life_merchant_coupon dclmc on dclcc.merchant_coupon_id = dclmc.id
left join dj_car_life_customer_info dclci on dclcir.customer_id = dclci.id
where dclcir.deleted_flag = 'N'
and not exists (
select 1
from dj_car_life_goods_order dclgo
where dclgo.deleted_flag = 'N'
and dclgo.customer_coupon_id = dclcc.id
and dclgo.construction_flag = 'Y'
)
and dclcir.customer_id = #{customerId}
order by dclcc.created_date desc limit 1
</select>
</mapper> </mapper>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!