qxy 2 долоо хоног өмнө
parent
commit
d3ff6956af

+ 176 - 0
alien-entity/src/main/java/shop/alien/mapper/LifeCouponMapper.java

@@ -80,4 +80,180 @@ public interface LifeCouponMapper extends BaseMapper<LifeCoupon> {
             @Param("buyCount") int buyCount,
             @Param("soldOutStatus") int soldOutStatus
     );
+
+    /**
+     * 查询代金券详情(连表查询商铺信息)
+     *
+     * @param id 代金券ID
+     * @return LifeCouponVo
+     */
+    @Select("SELECT " +
+            "lc.id, " +
+            "lc.data_type, " +
+            "lc.buy_use_start_time, " +
+            "lc.buy_use_end_time, " +
+            "lc.use_festival, " +
+            "lc.coupon_code, " +
+            "lc.name, " +
+            "lc.store_id, " +
+            "lc.price, " +
+            "lc.offprice, " +
+            "lc.expiration_date, " +
+            "lc.start_date, " +
+            "lc.end_date, " +
+            "lc.unused_date, " +
+            "lc.single_qty, " +
+            "lc.buy_limit, " +
+            "lc.stock_qty, " +
+            "lc.use_rule, " +
+            "lc.min_use_peoples, " +
+            "lc.max_use_peoples, " +
+            "lc.dietary_preferences, " +
+            "lc.cooking_methods, " +
+            "lc.applicable_rule, " +
+            "lc.status, " +
+            "lc.image_path, " +
+            "lc.store_service, " +
+            "lc.fapiao_info, " +
+            "lc.type, " +
+            "lc.approval_comments, " +
+            "lc.open_price_protection, " +
+            "lc.price_below, " +
+            "lc.coupon_comp, " +
+            "lc.coupon_comp_date, " +
+            "lc.rate_score, " +
+            "lc.discount_tag, " +
+            "lc.discount_tag_name, " +
+            "lc.delete_flag, " +
+            "lc.status_delete_flag, " +
+            "lc.created_time, " +
+            "lc.created_user_id, " +
+            "lc.updated_time, " +
+            "lc.updated_user_id, " +
+            "lc.store_type, " +
+            "lc.sale_time_str_type, " +
+            "lc.sale_time_end_type, " +
+            "lc.purchase_limit_code, " +
+            "lc.original_price, " +
+            "lc.discounted_price, " +
+            "lc.business_types, " +
+            "lc.housing_type, " +
+            "lc.room_type, " +
+            "lc.room_type_code, " +
+            "lc.kitchen_xq, " +
+            "lc.bathroom_xq, " +
+            "lc.living_room, " +
+            "lc.location_of_the_property, " +
+            "lc.total_area, " +
+            "lc.entertainment_facilities_code, " +
+            "lc.entertainment_facilities, " +
+            "lc.convenience_facilities_code, " +
+            "lc.convenience_facilities, " +
+            "lc.bathroom_facilities_code, " +
+            "lc.bathroom_facilities, " +
+            "lc.bath_products_code, " +
+            "lc.bath_products, " +
+            "lc.service_code, " +
+            "lc.service, " +
+            "lc.safety_code, " +
+            "lc.safety, " +
+            "lc.reservation_instructions, " +
+            "lc.in_time, " +
+            "lc.out_time, " +
+            "lc.deposit_flag, " +
+            "lc.deposit_amount, " +
+            "lc.children_flag, " +
+            "lc.children_description, " +
+            "lc.pet_flag, " +
+            "lc.extra_bed_flag, " +
+            "lc.bed_price, " +
+            "lc.invoice_info, " +
+            "lc.invoice_instructions, " +
+            "lc.cancellation_policy_type, " +
+            "lc.cancellation_policy, " +
+            "lc.Cancellation_instructions, " +
+            "lc.insured_price, " +
+            "lc.validity_period_type, " +
+            "lc.box_type_code, " +
+            "lc.box_type, " +
+            "lc.snacks_code, " +
+            "lc.snacks, " +
+            "lc.available_duration, " +
+            "lc.write_off_type, " +
+            "lc.write_off, " +
+            "lc.refund_rules_type, " +
+            "lc.refund_rules, " +
+            "lc.refund_instructions, " +
+            "lc.edit_rules_code, " +
+            "lc.edit_rules, " +
+            "lc.edit_instructions, " +
+            "lc.tangchi_code, " +
+            "lc.tangchi, " +
+            "lc.sweat_sauna_code, " +
+            "lc.sweat_sauna, " +
+            "lc.pictures_and_text, " +
+            "lc.supplement, " +
+            "lc.unavailable_date_type, " +
+            "lc.reservation_rules, " +
+            "lc.applicable_num, " +
+            "lc.other_rules, " +
+            "lc.sales_type, " +
+            "lc.massage_technique_code, " +
+            "lc.massage_technique, " +
+            "lc.massage_area_code, " +
+            "lc.massage_area, " +
+            "lc.massage_tools_code, " +
+            "lc.massage_tools, " +
+            "lc.compress_tools_code, " +
+            "lc.compress_tools, " +
+            "lc.class_format_code, " +
+            "lc.class_format, " +
+            "lc.class_duration_code, " +
+            "lc.class_duration, " +
+            "lc.class_num_code, " +
+            "lc.class_num, " +
+            "lc.applicable_parts_code, " +
+            "lc.applicable_parts, " +
+            "lc.hygiene_code, " +
+            "lc.hygiene, " +
+            "lc.foundation_code, " +
+            "lc.foundation, " +
+            "lc.bathroom_code, " +
+            "lc.bathroom, " +
+            "lc.kitchen_code, " +
+            "lc.kitchen, " +
+            "lc.validity_period_yh_type, " +
+            "lc.validity_period_yh, " +
+            "lc.course_validity_period_code, " +
+            "lc.course_validity_period, " +
+            "lc.uploaded_picList, " +
+            "lc.validity_period, " +
+            "lc.stacking_type, " +
+            "lc.general_type, " +
+            "lc.single_can_use, " +
+            "lc.apply_type, " +
+            "lc.apply_desc, " +
+            "lc.expiration_type, " +
+            "lc.unused_type, " +
+            "lc.house_type, " +
+            "lc.house_type_b, " +
+            "lc.house_type_l, " +
+            "lc.house_type_k, " +
+            "lc.house_type_t, " +
+            "lc.sale_time_str, " +
+            "lc.sale_time_end, " +
+            "lc.unavai_lable_date, " +
+            "lc.room_type_str, " +
+            "lc.time_range, " +
+            "lc.cancellation_policy_str, " +
+            "lc.validity_periodyh_str, " +
+            "si.store_name, " +
+            "si.store_address, " +
+            "si.store_tel AS phone, " +
+            "si.business_status, " +
+            "si.store_status " +
+            "FROM life_coupon lc " +
+            "LEFT JOIN store_info si ON si.id = lc.store_id AND si.delete_flag = 0 " +
+            "WHERE lc.id = #{id} AND lc.delete_flag = 0")
+    LifeCouponVo getNewCouponDetail(@Param("id") String id);
 }

+ 17 - 0
alien-store/src/main/java/shop/alien/store/controller/LifeCouponController.java

@@ -10,6 +10,7 @@ import shop.alien.entity.result.R;
 import shop.alien.entity.store.EssentialHolidayComparison;
 import shop.alien.entity.store.LifeCoupon;
 import shop.alien.entity.store.vo.LifeCouponStatusVo;
+import shop.alien.entity.store.vo.LifeCouponVo;
 import shop.alien.store.service.LifeCouponService;
 
 import java.util.Map;
@@ -78,6 +79,22 @@ public class LifeCouponController {
         return R.data(lifeCouponService.getOne(objectLambdaQueryWrapper));
     }
 
+    @ApiOperation("代金卷详情")
+    @GetMapping("/getNewCouponDetail")
+    private R<LifeCouponVo> getNewCouponDetail(@RequestParam("id") String id) {
+        log.info("LifeCouponController.getNewCouponDetail?id={}", id);
+        try {
+            LifeCouponVo lifeCouponVo = lifeCouponService.getNewCouponDetail(id);
+            if (lifeCouponVo == null) {
+                return R.fail("代金券不存在或已删除");
+            }
+            return R.data(lifeCouponVo);
+        } catch (Exception e) {
+            log.error("LifeCouponController.getNewCouponDetail ERROR Msg={}", e.getMessage(), e);
+            return R.fail("查询失败");
+        }
+    }
+
     @ApiOperation("旧 核销订单")
     @ApiImplicitParams({@ApiImplicitParam(name = "storeId", value = "门店id", dataType = "Integer", paramType = "query", required = true), @ApiImplicitParam(name = "quanCode", value = "券码", dataType = "Integer", paramType = "query", required = true)})
     @GetMapping("/verify")

+ 7 - 2
alien-store/src/main/java/shop/alien/store/service/LifeCouponService.java

@@ -2,9 +2,7 @@ package shop.alien.store.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
-import org.springframework.web.bind.annotation.RequestParam;
 import shop.alien.entity.result.R;
-import org.springframework.web.bind.annotation.RequestParam;
 import shop.alien.entity.store.EssentialHolidayComparison;
 import shop.alien.entity.store.LifeCoupon;
 import shop.alien.entity.store.vo.LifeCouponStatusVo;
@@ -56,4 +54,11 @@ public interface LifeCouponService extends IService<LifeCoupon> {
      * @return
      */
     R<String> orderVerify(String orderCode);
+
+    /**
+     * 获取代金券详情(包含商铺信息)
+     * @param id 代金券ID
+     * @return LifeCouponVo
+     */
+    shop.alien.entity.store.vo.LifeCouponVo getNewCouponDetail(String id);
 }

+ 5 - 0
alien-store/src/main/java/shop/alien/store/service/impl/LifeCouponServiceImpl.java

@@ -702,4 +702,9 @@ public class LifeCouponServiceImpl extends ServiceImpl<LifeCouponMapper, LifeCou
         return R.success("效验通过");
     }
 
+    @Override
+    public shop.alien.entity.store.vo.LifeCouponVo getNewCouponDetail(String id) {
+        return lifeCouponMapper.getNewCouponDetail(id);
+    }
+
 }