Commit 474460dd authored by youjj's avatar youjj

Merge branch 'base-modify' of http://10.5.52.3/youjj/cloud-platform into base-modify

parents 2e8ec319 05c041c2
package com.github.wxiaoqi.security.common.msg;
import com.github.wxiaoqi.security.common.constant.RestCode;
import com.github.wxiaoqi.security.common.util.SystemProperty;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
/**
* Created by Ace on 2017/6/11.
......@@ -9,6 +11,10 @@ public class ObjectRestResponse<T> extends BaseResponse {
T data;
boolean rel;
private static final Integer WEB_CALL_RESULT_SUCCESS = ResultCode.SUCCESS_CODE;
private static final Integer WEB_CALL_RESULT_FAILED = ResultCode.FAILED_CODE;
private static final String RESULT_SUCCESS_MSG = "操作成功";
private static final String RESULT_FAIL_MSG = "操作失败";
public boolean isRel() {
return rel;
......@@ -54,4 +60,30 @@ public class ObjectRestResponse<T> extends BaseResponse {
public static <T> ObjectRestResponse succ(T data) {
return new ObjectRestResponse().status(RestCode.SUCCESS.getStatus()).msg(RestCode.SUCCESS.getMsg()).data(data).rel(true);
}
/**
* 创建一个异常的调用结果,根据code获取对应的提示
* @param code
* @return
*/
public static ObjectRestResponse createFailedResultMsg(Integer code) {
return new ObjectRestResponse().status(code).msg(SystemProperty.getResultConfig(code + "")).rel(false);
}
/**
* 创建一个异常的调用结果
* @param message
* @return
*/
public static ObjectRestResponse createFailedResult(Integer code, String message) {
return new ObjectRestResponse().status(code).msg(message).rel(false);
}
/**
* 操作失败
* @return
*/
public static ObjectRestResponse createDefaultFail() {
return new ObjectRestResponse().status(WEB_CALL_RESULT_FAILED).msg(RESULT_FAIL_MSG).rel(false);
}
}
......@@ -33,7 +33,7 @@ import java.util.List;
@EnableDiscoveryClient
@EnableCircuitBreaker
@SpringBootApplication
@EnableFeignClients({"com.github.wxiaoqi.security.auth.client.feign", "com.xxfc.platform.universal.feign"})
@EnableFeignClients({"com.github.wxiaoqi.security.auth.client.feign", "com.xxfc.platform.universal.feign", "com.github.wxiaoqi.security.admin"})
@EnableScheduling
@EnableAceAuthClient
@EnableAceCache
......
package com.github.wxiaoqi.security.admin.feign;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* ${DESCRIPTION}
*
* @author wanghaobin
* @create 2017-06-21 8:11
*/
@FeignClient(value = "ace-admin")
public interface UserFeign {
@RequestMapping(value = "/public/app/userinfo-by-token")
public ObjectRestResponse<AppUserDTO> userDetailByToken(@RequestParam("token") String token);
}
package com.github.wxiaoqi.security.admin.feign.dto;
import lombok.Data;
/**
* 用户详情信息表
*/
@Data
public class AppUserDTO {
private Integer id;
private Integer userid;
private Integer isMember;
private String nickname;
private String realname;
private String headimgurl;
private String email;
private Integer sex;
private String birthday;
private String personSign;
private String remark;
private Long createtime;
private Long updatetime;
private Integer isdel;
}
......@@ -10,7 +10,7 @@ spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.jdbc.Driver
url: jdbc:mysql://10.5.52.3:3306/xxfc_tour?useUnicode=true&characterEncoding=UTF-8
url: jdbc:mysql://10.5.52.3:3306/xxfc_order?useUnicode=true&characterEncoding=UTF-8
username: root
password: sslcloud123*()
jackson:
......
#代码生成器,配置信息
#包名
package=com.xxfc.platform.tour
package=com.xxfc.platform.order
#作者
author=zjw
#Email
......
package com.xxfc.platform.order.entity;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 旅游订单详情
*
* @author zjw
* @email nishijjo@qq.com
* @date 2019-06-06 18:18:33
*/
@Data
@Table(name = "order_tour_detail")
public class OrderTourDetail implements Serializable {
private static final long serialVersionUID = 1L;
//主键
@Id
@GeneratedValue(generator = "JDBC")
@ApiModelProperty("主键")
private Integer id;
//基础订单id
@Column(name = "order_id")
@ApiModelProperty(value = "基础订单id")
private Integer orderId;
//名称
@Column(name = "name")
@ApiModelProperty(value = "名称")
private String name;
//创建时间
@Column(name = "crt_time")
@ApiModelProperty(value = "创建时间", hidden = true )
private Long crtTime;
//更新时间
@Column(name = "upd_time")
@ApiModelProperty(value = "更新时间", hidden = true )
private Long updTime;
//开始时间
@Column(name = "start_time")
@ApiModelProperty(value = "开始时间")
private Long startTime;
//结束时间
@Column(name = "end_time")
@ApiModelProperty(value = "结束时间")
private Long endTime;
//天数
@Column(name = "day_num")
@ApiModelProperty(value = "天数")
private Integer dayNum;
//出发地点
@Column(name = "start_addr")
@ApiModelProperty(value = "出发地点")
private String startAddr;
//还车地点
@Column(name = "end_addr")
@ApiModelProperty(value = "还车地点")
private String endAddr;
//出发城市编号
@Column(name = "start_city")
@ApiModelProperty(value = "出发城市编号")
private Integer startCity;
//还车城市编号
@Column(name = "end_city")
@ApiModelProperty(value = "还车城市编号")
private Integer endCity;
//出发城市名称
@Column(name = "start_city_name")
@ApiModelProperty(value = "出发城市名称")
private String startCityName;
//还车城市名称
@Column(name = "end_city_name")
@ApiModelProperty(value = "还车城市名称")
private String endCityName;
//自己乘客ids
@Column(name = "my_passager_ids")
@ApiModelProperty(value = "自己乘客ids")
private String myPassagerIds;
//出发公司Id
@Column(name = "start_company_id")
@ApiModelProperty(value = "出发公司Id")
private Integer startCompanyId;
//费用明细
@Column(name = "cost_detail")
@ApiModelProperty(value = "费用明细")
private String costDetail;
//商品id
@Column(name = "good_id")
@ApiModelProperty(value = "商品id")
private Integer goodId;
//商品规格ids
@Column(name = "spe_ids")
@ApiModelProperty(value = "商品规格ids")
private String speIds;
//具体商品(商品项)id
@Column(name = "spe_price_id")
@ApiModelProperty(value = "具体商品(商品项)id")
private String spePriceId;
}
package com.xxfc.platform.order.pojo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.Column;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
@Data
public class AddTourDTO {
public static final DateTimeFormatter DEFAULT_DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd");
//开始时间
@Column(name = "start_time")
@ApiModelProperty(value = "活动开始时间")
private Long startTime;
//结束时间
@Column(name = "end_time")
@ApiModelProperty(value = "活动结束时间")
private Long endTime;
//天数
@Column(name = "day_num")
@ApiModelProperty(value = "天数")
private Integer dayNum;
//取车地点
@Column(name = "start_addr")
@ApiModelProperty(value = "出发地点")
private String startAddr;
//还车地点
@Column(name = "end_addr")
@ApiModelProperty(value = "结束地点")
private String endAddr;
//费用详情
@Column(name = "cost_detail")
@ApiModelProperty(value = "费用详情")
private String costDetail;
//取车城市编号
@Column(name = "start_city")
@ApiModelProperty(value = "出发城市编号")
private Integer startCity;
//还车城市编号
@Column(name = "end_city")
@ApiModelProperty(value = "结束城市编号")
private Integer endCity;
//取车城市名称
@Column(name = "start_city_name")
@ApiModelProperty(value = "出发城市名称")
private String startCityName;
//还车城市名称
@Column(name = "end_city_name")
@ApiModelProperty(value = "结束城市名称")
private String endCityName;
//自己乘客ids
@Column(name = "my_passager_ids")
@ApiModelProperty(value = "自己乘客ids")
private String myPassagerIds;
//出发公司Id
@Column(name = "start_company_id")
@ApiModelProperty(value = "出发公司Id")
private Integer startCompanyId;
//商品id
@Column(name = "good_id")
@ApiModelProperty(value = "商品id")
private Integer goodId;
//商品规格ids
@Column(name = "spe_ids")
@ApiModelProperty(value = "商品规格ids")
private String speIds;
//具体商品(商品项)id
@Column(name = "spe_price_id")
@ApiModelProperty(value = "具体商品(商品项)id")
private String spePriceId;
}
package com.xxfc.platform.order.pojo.order;
import com.xxfc.platform.order.entity.BaseOrder;
import com.xxfc.platform.order.entity.OrderRentVehicleDetail;
import com.xxfc.platform.order.entity.OrderTourDetail;
import com.xxfc.platform.order.entity.inter.OrderDetail;
import com.xxfc.platform.vehicle.entity.VehicleModel;
import lombok.Data;
@Data
public class TourBO extends OrderTourDetail implements OrderDetail {
private BaseOrder order;
// private Tour
}
......@@ -25,6 +25,7 @@
<version>2.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.xxfc.platform</groupId>
<artifactId>xx-vehicle-api</artifactId>
......@@ -33,9 +34,8 @@
<dependency>
<groupId>com.xxfc.platform</groupId>
<artifactId>xx-vehicle-api</artifactId>
<artifactId>xx-tour-api</artifactId>
<version>2.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
......
package com.xxfc.platform.tour.biz;
import com.xxfc.platform.tour.mapper.TourGoodSpePriceMapper;
import org.springframework.stereotype.Service;
import com.xxfc.platform.tour.entity.TourGoodSpePrice;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
/**
* 旅游商品规格价格表
*
* @author zjw
* @email nishijjo@qq.com
* @date 2019-06-06 11:41:51
*/
@Service
public class TourGoodSpePriceBiz extends BaseBiz<TourGoodSpePriceMapper,TourGoodSpePrice> {
package com.xxfc.platform.order.biz;
import org.springframework.stereotype.Service;
import com.xxfc.platform.order.entity.OrderTourDetail;
import com.xxfc.platform.order.mapper.OrderTourDetailMapper;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
/**
* 旅游订单详情
*
* @author zjw
* @email nishijjo@qq.com
* @date 2019-06-06 18:18:33
*/
@Service
public class OrderTourDetailBiz extends BaseBiz<OrderTourDetailMapper,OrderTourDetail> {
}
\ No newline at end of file
package com.xxfc.platform.order.mapper;
import com.xxfc.platform.order.entity.OrderTourDetail;
import tk.mybatis.mapper.common.Mapper;
/**
* 旅游订单详情
*
* @author zjw
* @email nishijjo@qq.com
* @date 2019-06-06 18:18:33
*/
public interface OrderTourDetailMapper extends Mapper<OrderTourDetail> {
}
package com.xxfc.platform.order.rest;
import cn.hutool.core.bean.BeanUtil;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.xxfc.platform.order.biz.OrderTourDetailBiz;
import com.xxfc.platform.order.entity.OrderRentVehicleDetail;
import com.xxfc.platform.order.entity.OrderTourDetail;
import com.xxfc.platform.order.pojo.AddRentVehicleDTO;
import com.xxfc.platform.order.pojo.AddTourDTO;
import com.xxfc.platform.order.pojo.order.RentVehicleBO;
import com.xxfc.platform.order.service.OrderTourService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping("orderTour")
public class OrderTourController extends BaseController<OrderTourDetailBiz,OrderTourDetail> {
@Autowired
OrderTourService orderTourService;
@RequestMapping(value = "add",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "确认旅游订单")
public ObjectRestResponse<OrderRentVehicleDetail> add(@RequestBody AddTourDTO vo){
RentVehicleBO bo = BeanUtil.toBean(vo, RentVehicleBO.class);
orderTourService.createOrder(bo);
return new ObjectRestResponse<>().rel(true).data(bo.getOrder());
}
}
\ No newline at end of file
package com.xxfc.platform.order.service;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.lang.Dict;
import cn.hutool.extra.template.Template;
import cn.hutool.extra.template.TemplateConfig;
import cn.hutool.extra.template.TemplateEngine;
import cn.hutool.extra.template.TemplateUtil;
import com.xxfc.platform.order.biz.OrderCostDetailBiz;
import com.xxfc.platform.order.biz.OrderRentVehicleBiz;
import com.xxfc.platform.order.biz.OrderTemplateBiz;
import com.xxfc.platform.order.contant.enumerate.OrderCostEnum;
import com.xxfc.platform.order.contant.enumerate.OrderStatusEnum;
import com.xxfc.platform.order.contant.enumerate.OrderTypeEnum;
import com.xxfc.platform.order.entity.OrderCostDetail;
import com.xxfc.platform.order.pojo.order.RentVehicleBO;
import com.xxfc.platform.order.pojo.price.RentVehiclePriceVO;
import com.xxfc.platform.vehicle.entity.VehicleModel;
import com.xxfc.platform.vehicle.feign.VehicleFeign;
import lombok.extern.log4j.Log4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.math.BigDecimal;
@Service
@Log4j
public class OrderTourService extends AbstractOrderHandle<OrderRentVehicleBiz, RentVehicleBO> {
private static BigDecimal DRIVER_PRICE = new BigDecimal("600.00");
private static BigDecimal DAMAGE_SAFE = new BigDecimal("100.00"); //车损免赔
private static Integer DRIVER_TYPE_COMPANY = 1;
private static BigDecimal DEPOSIT = new BigDecimal("20000.00");
@Autowired
VehicleFeign vehicleFeign;
@Autowired
OrderCostDetailBiz orderCostDetailBiz;
@Autowired
OrderTemplateBiz orderTemplateBiz;
@PostConstruct
public void init(){
this.orderTypeEnum = OrderTypeEnum.RentVehicle;
}
@Override
public void initDetail(RentVehicleBO bo) {
super.initDetail(bo);
VehicleModel vehicleModel = vehicleFeign.get(bo.getModelId()).getData();
bo.setVehicleModel(vehicleModel);
}
@Override
public void handleDetail(RentVehicleBO bo) {
//获取可用车辆
acquireVehicle(bo);
//设置订单状态为3
bo.getOrder().setStatus(OrderStatusEnum.ORDER_UNPAY.getCode());
//设置订单图片
bo.getOrder().setPicture(bo.getVehicleModel().getPicture());
//设置订单名称
bo.getOrder().setName(bo.getVehicleModel().getName());
super.handleDetail(bo);
}
@Override
public void handleCalculate(RentVehicleBO bo) {
RentVehiclePriceVO rvpv = calculatePrice(bo);
BeanUtil.copyProperties(rvpv, bo.getOrder());
BeanUtil.copyProperties(rvpv, bo);
}
@Override
public RentVehiclePriceVO calculatePrice(RentVehicleBO detail) {
BigDecimal orderAmount = BigDecimal.ZERO;
BigDecimal goodsAmount = BigDecimal.ZERO;
BigDecimal vehicleAmount = BigDecimal.ZERO;
BigDecimal driverAmount = BigDecimal.ZERO;
//计算价格
//计算车辆费用
VehicleModel vehicleModel = vehicleFeign.get(detail.getModelId()).getData();
vehicleAmount = vehicleAmount.add(vehicleModel.getPrice().multiply(BigDecimal.valueOf(detail.getDayNum())));
if(DRIVER_TYPE_COMPANY.equals(detail.getDriverType())) {
//计算司机费用
driverAmount = driverAmount.add(DRIVER_PRICE.multiply(BigDecimal.valueOf(detail.getDayNum())));
}
//商品价格
goodsAmount = goodsAmount.add(vehicleAmount).add(driverAmount);
//总价格(包含押金)
orderAmount = orderAmount.add(goodsAmount).add(DEPOSIT);
//生成订单明细
RentVehiclePriceVO rvp = new RentVehiclePriceVO();
rvp.setOrderAmount(orderAmount);
rvp.setGoodsAmount(goodsAmount);
rvp.setDriverAmount(driverAmount);
rvp.setVehicleAmount(vehicleAmount);
rvp.setRealAmount(orderAmount);
rvp.setDeposit(DEPOSIT);
rvp.setModelAmount(vehicleModel.getPrice());
rvp.setDriverPrice(DRIVER_PRICE);
rvp.setModelName(vehicleModel.getName());
rvp.setDayNum(detail.getDayNum());
rvp.setVehicleNum(1);
rvp.setDriverNum(1);
detail.setCostDetail(costDetail(rvp));
return rvp;
}
/**
* 计算费用明细
* @param vo
* @return
*/
private String costDetail(RentVehiclePriceVO vo) {
//orderTemplateBiz.result(orderTemplateBiz.selectById(OrderCostEnum.RentVehicle.getCode()), Dict.parse(pojo));
TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig());
OrderCostDetail orderCostDetail = orderCostDetailBiz.selectById(OrderCostEnum.RentVehicle.getCode());
Template template = engine.getTemplate(orderCostDetail.getTemplate());
String result = template.render(Dict.parse(vo));
vo.setCostDetail(result);
return result;
}
private String acquireVehicle(RentVehicleBO detail) {
//根据车型、时间、距离,门店,预定车辆
// BookVehicleVO bookVehicleVO = new BookVehicleVO(){{
// setBookStartDate(detail);
// }};
// vehicleFeign.rentApplyVehicle()
String vehicleId = "0e9a88db-cb1b-48a4-b307-40f89eed906f";
detail.setVehicleId(vehicleId);
return vehicleId;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xxfc.platform.order.mapper.OrderTourDetailMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.xxfc.platform.order.entity.OrderTourDetail" id="orderTourDetailMap">
<result property="id" column="id"/>
<result property="orderId" column="order_id"/>
<result property="name" column="name"/>
<result property="crtTime" column="crt_time"/>
<result property="updTime" column="upd_time"/>
<result property="startTime" column="start_time"/>
<result property="endTime" column="end_time"/>
<result property="dayNum" column="day_num"/>
<result property="startAddr" column="start_addr"/>
<result property="endAddr" column="end_addr"/>
<result property="startCity" column="start_city"/>
<result property="endCity" column="end_city"/>
<result property="startCityName" column="start_city_name"/>
<result property="endCityName" column="end_city_name"/>
<result property="myPassagerIds" column="my_passager_ids"/>
<result property="startCompanyId" column="start_company_id"/>
<result property="costDetail" column="cost_detail"/>
</resultMap>
</mapper>
\ No newline at end of file
......@@ -10,5 +10,13 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.xxfc.platform</groupId>
<artifactId>xx-tour-api</artifactId>
<dependencies>
<dependency>
<groupId>com.github.wxiaoqi</groupId>
<artifactId>ace-admin</artifactId>
<version>2.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.xxfc.platform.tour.common;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
@Slf4j
public class TourBaseController<Biz extends BaseBiz> {
@Autowired
protected HttpServletRequest request;
@Autowired
protected Biz baseBiz;
@Autowired
protected UserFeign userFeign;
@Autowired
protected UserAuthConfig userAuthConfig;
public AppUserDTO getUserInfo(){
return userFeign.userDetailByToken(userAuthConfig.getToken(request)).getData();
}
}
package com.xxfc.platform.tour.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* 计算价格
*/
@Data
public class TourSpePriceDto {
//用户id
@ApiModelProperty(value = "用户id")
private Integer userId;
//用户等级
@ApiModelProperty(value = "用户等级")
private Integer level;
//规格i
@ApiModelProperty(value = "规格id")
private Integer speId;
//儿童人数
@ApiModelProperty(value = "儿童人数")
private String childNumber;
//"成人人数
@ApiModelProperty(value = "成人人数")
private String endTime;
}
......@@ -115,6 +115,11 @@ public class TourGood implements Serializable {
@Column(name = "unit")
@ApiModelProperty(value = "单位")
private String unit;
//是否删除,0否,1是
@Column(name = "is_del")
@ApiModelProperty(value = "是否删除,0否,1是")
private Integer isDel;
}
......@@ -39,8 +39,14 @@ public class TourGoodSite implements Serializable {
@Column(name = "address")
@ApiModelProperty(value = "站点地址")
private String address;
//出发时间
//分公司id
@Column(name = "company_id")
@ApiModelProperty(value = "分公司id")
private String companyId;
//出发时间
@Column(name = "depart_time")
@ApiModelProperty(value = "出发时间")
private Long departTime;
......
package com.xxfc.platform.tour.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* 出发时间
*
* @author zjw
* @email nishijjo@qq.com
* @date 2019-06-06 11:41:51
*/
@Data
public class TourDepartTimeVo {
@ApiModelProperty("")
private Integer id;
//商品id
@ApiModelProperty(value = "商品id")
private Integer goodId;
//出行时间
@ApiModelProperty(value = "出行时间")
private String startTime;
//出行时间
@ApiModelProperty(value = "结束时间")
private String endTime;
//出行时间
@ApiModelProperty(value = "出行周几")
private Integer startWeek;
//结束时间
@ApiModelProperty(value = "结束周几")
private Integer endWeek;
//规格id
@ApiModelProperty(value = "规格id")
private String speId;
//价格
@ApiModelProperty(value = "价格")
private BigDecimal price;
//儿童价格
@ApiModelProperty(value = "儿童价格")
private BigDecimal childPrice;
//会员价格
@ApiModelProperty(value = "会员价格")
private String memberPrice;
//库存
@ApiModelProperty(value = "库存")
private Integer stock;
}
package com.xxfc.platform.tour.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 出发地址
*
* @author zjw
* @email nishijjo@qq.com
* @date 2019-06-06 11:41:51
*/
@Data
public class TourDepartVo {
private Integer id;
//路线id
@ApiModelProperty(value = "路线id")
private Integer goodId;
//站点名称
@ApiModelProperty(value = "站点名称")
private String name;
//站点地址
@ApiModelProperty(value = "站点地址")
private String address;
//分公司id
@ApiModelProperty(value = "分公司id")
private String companyId;
//出发时间
@ApiModelProperty(value = "出发时间")
private Long departTime;
//站点经度
@ApiModelProperty(value = "站点经度")
private Double longitude;
//站点纬度
@ApiModelProperty(value = "站点纬度")
private Double latitude;
//站点介绍
@ApiModelProperty(value = "站点介绍")
private String intro;
//类型
@ApiModelProperty(value = "类型")
private Integer type;
}
package com.xxfc.platform.tour.vo;
import java.math.BigDecimal;
import java.util.List;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 旅游商品表
*
* @author zjw
* @email nishijjo@qq.com
* @date 2019-06-06 11:41:51
*/
@Data
public class TourGoodDetailVo {
private Integer id;
//商品名
@ApiModelProperty(value = "商品名")
private String name;
//商品封面图
@ApiModelProperty(value = "商品封面图")
private String cover;
//商品原价
@ApiModelProperty(value = "商品原价")
private BigDecimal price;
//儿童价格
@ApiModelProperty(value = "儿童价格")
private BigDecimal childPrice;
//商品浏览量
@ApiModelProperty(value = "商品浏览量")
private Integer viewCount;
//商品销售量
@ApiModelProperty(value = "商品销售量")
private Integer saleCount;
//商品描述
@ApiModelProperty(value = "商品描述")
private String describe;
//商品详情(行程亮点)
@ApiModelProperty(value = "商品详情(行程亮点)")
private String content;
//行程介绍
@ApiModelProperty(value = "行程介绍")
private String introduce;
//费用说明
@ApiModelProperty(value = "费用说明")
private String explain;
//排序
@ApiModelProperty(value = "排序")
private Integer rank;
//状态:0-未发布;1-上架;2-下架
@ApiModelProperty(value = "状态:0-未发布;1-上架;2-下架")
private Integer status;
//创建时间
@ApiModelProperty(value = "创建时间", hidden = true )
private Long crtTime;
//更新时间
@ApiModelProperty(value = "更新时间", hidden = true )
private Long updTime;
//是否推荐:0-未推荐;1-已推荐
@ApiModelProperty(value = "是否推荐:0-未推荐;1-已推荐")
private Integer recommend;
//是否会员价:0-否;1-是
@ApiModelProperty(value = "是否会员价:0-否;1-是")
private Integer isMember;
//库存
@ApiModelProperty(value = "库存")
private Integer stock;
//单位
@ApiModelProperty(value = "单位")
private String unit;
//等级价格
@ApiModelProperty(value = "等级价格")
private List<TourMemberVo> memberVo;
//出发时间
@ApiModelProperty(value = "出发时间")
private List<TourDepartTimeVo> tourDepartTimeVo;
//出发地点
@ApiModelProperty(value = "出发地点")
private List<TourDepartVo> tourDepartVo;
//目的地
@ApiModelProperty(value = "目的地")
private String destination;
}
package com.xxfc.platform.tour.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* 等级金额表
*
* @author zjw
* @email nishijjo@qq.com
* @date 2019-06-06 11:41:51
*/
@Data
public class TourMemberVo {
//等级名称
@ApiModelProperty(value = "等级名称")
private String name;
//等级
@ApiModelProperty(value = "等级")
private Integer level;
//金额
@ApiModelProperty(value = "金额")
private BigDecimal price;
}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.xxfc.common</groupId>
<artifactId>xx-common-platform-web</artifactId>
<version>2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.xxfc.platform</groupId>
<artifactId>xx-tour-server</artifactId>
<dependencies>
<!-- 自己项目 -->
<dependency>
<groupId>com.xxfc.platform</groupId>
<artifactId>xx-tour-api</artifactId>
<version>2.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- 此插件用来生成通用mapper的代码 -->
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<configurationFile>
${basedir}/src/main/resources/builder/generatorConfig.xml
</configurationFile>
<overwrite>true</overwrite>
<verbose>true</verbose>
</configuration>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.30</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>tk.mybatis</groupId>
<artifactId>mapper</artifactId>
<version>${mapper.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.xxfc.common</groupId>
<artifactId>xx-common-platform-web</artifactId>
<version>2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.xxfc.platform</groupId>
<artifactId>xx-tour-server</artifactId>
<dependencies>
<!-- 自己项目 -->
<dependency>
<groupId>com.xxfc.platform</groupId>
<artifactId>xx-tour-api</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<!-- 此插件用来生成通用mapper的代码 -->
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<configurationFile>
${basedir}/src/main/resources/builder/generatorConfig.xml
</configurationFile>
<overwrite>true</overwrite>
<verbose>true</verbose>
</configuration>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.30</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>tk.mybatis</groupId>
<artifactId>mapper</artifactId>
<version>${mapper.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
......@@ -14,7 +14,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@EnableDiscoveryClient
@EnableScheduling
@EnableAceAuthClient
@EnableFeignClients({"com.github.wxiaoqi.security.auth.client.feign"})
@EnableFeignClients({"com.github.wxiaoqi.security.auth.client.feign","com.github.wxiaoqi.security.admin.feign"})
@EnableAceCache
@tk.mybatis.spring.annotation.MapperScan(basePackages = "com.xxfc.platform.tour.mapper")
public class TourApplication {
......
package com.xxfc.platform.tour.biz;
import com.xxfc.platform.tour.mapper.TourGoodMapper;
import org.springframework.stereotype.Service;
import com.xxfc.platform.tour.entity.TourGood;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
/**
* 旅游商品表
*
* @author zjw
* @email nishijjo@qq.com
* @date 2019-06-06 11:41:51
*/
@Service
public class TourGoodBiz extends BaseBiz<TourGoodMapper,TourGood> {
package com.xxfc.platform.tour.biz;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.tour.mapper.TourGoodMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xxfc.platform.tour.entity.TourGood;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import java.util.HashMap;
import java.util.Map;
/**
* 旅游商品表
*
* @author zjw
* @email nishijjo@qq.com
* @date 2019-06-06 11:41:51
*/
@Service
@Slf4j
public class TourGoodBiz extends BaseBiz<TourGoodMapper, TourGood> {
@Autowired
private TourGoodMapper tourGoodMapper;
/**
* 查询旅游路线列表
*
* @param page
* @param limit
* @param query
* @param latitude
* @param longitude
* @param tagId
* @param distance
* @return
*/
public PageDataVO<TourGood> getGoodList(int page, int limit, String query, Double latitude, Double longitude, Integer tagId, Double distance) {
//查询参数
Map<String, Object> params = new HashMap<String, Object>();
params.put("query", query);
params.put("latitude", latitude);
params.put("longitude", longitude);
params.put("tagId", tagId);
params.put("distance", distance);
// List<TourGood> list = tourGoodMapper.getGoodList(params);
return PageDataVO.pageInfo(page, limit, mapper.getGoodList(params));
}
}
\ No newline at end of file
package com.xxfc.platform.tour.biz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.xxfc.platform.tour.entity.TourGood;
import com.xxfc.platform.tour.mapper.TourGoodMapper;
import com.xxfc.platform.tour.mapper.TourGoodSiteMapper;
import com.xxfc.platform.tour.mapper.TourGoodSpePriceMapper;
import com.xxfc.platform.tour.vo.TourDepartTimeVo;
import com.xxfc.platform.tour.vo.TourDepartVo;
import com.xxfc.platform.tour.vo.TourGoodDetailVo;
import com.xxfc.platform.tour.vo.TourMemberVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xxfc.platform.tour.entity.TourGoodSpePrice;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.List;
/**
* 旅游商品规格价格表
*
* @author zjw
* @email nishijjo@qq.com
* @date 2019-06-06 11:41:51
*/
@Service
@Slf4j
public class TourGoodDetailBiz extends BaseBiz<TourGoodMapper, TourGood> {
@Autowired
TourGoodSpePriceMapper priceMapper;
@Autowired
TourGoodSiteMapper siteMapper;
//获取商品详情
public ObjectRestResponse<TourGoodDetailVo> getGoodDetaileById(Integer id){
if(id==null||id==0){
return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE, "参数为空");
}
try {
TourGood TourGood = mapper.getOne(id);
if (TourGood != null) {
TourGoodDetailVo detailVo = new TourGoodDetailVo();
BeanUtils.copyProperties(detailVo, TourGood);
BigDecimal price=detailVo.getPrice();
if(price!=null&&detailVo.getIsMember()>0){
List<TourMemberVo> memberList=new ArrayList<>();
for(int i=1;i<4;i++){
TourMemberVo memberVo=new TourMemberVo();
memberVo.setLevel(i);
memberVo.setName(getName(i));
BigDecimal member_price=price.multiply(new BigDecimal("0.88")).setScale(2, RoundingMode.HALF_UP); ;
memberVo.setPrice(member_price);
memberList.add(memberVo);
}
detailVo.setMemberVo(memberList);
}
//获取出行时间
List<TourDepartTimeVo> timelist=priceMapper.getAllByGoodId(id);
detailVo.setTourDepartTimeVo(timelist);
//获取出发地点
List<TourDepartVo> departList=siteMapper.getlistByGoodId(id);
detailVo.setTourDepartVo(departList);
return ObjectRestResponse.succ(detailVo);
}
return ObjectRestResponse.createDefaultFail();
}catch (Exception e) {
e.printStackTrace();
log.error("---商品详情---id====="+id+"----异常---msg==="+ e.getMessage());
return ObjectRestResponse.createFailedResult(ResultCode.EXCEPTION_CODE, "出现异常");
}
}
public String getName(Integer type){
String name="";
switch (type){
case 1:
name="普通会员";
break;
case 2:
name="黄金会员";
break;
case 3:
name="钻石会员";
break;
}
return name;
}
}
\ No newline at end of file
package com.xxfc.platform.tour.mapper;
import com.xxfc.platform.tour.entity.TourGood;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
import java.util.Map;
/**
* 旅游商品表
......@@ -11,5 +14,10 @@ import tk.mybatis.mapper.common.Mapper;
* @date 2019-06-06 11:41:51
*/
public interface TourGoodMapper extends Mapper<TourGood> {
//获取商品信息
public TourGood getOne(@Param("id")Integer id);
//查询旅游路线列表
public List<TourGood> getGoodList(@Param("params") Map<String,Object> map);
}
package com.xxfc.platform.tour.mapper;
import com.xxfc.platform.tour.entity.TourGoodSite;
import com.xxfc.platform.tour.vo.TourDepartVo;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
/**
* 路线站点表
*
......@@ -11,5 +15,8 @@ import tk.mybatis.mapper.common.Mapper;
* @date 2019-06-06 11:41:51
*/
public interface TourGoodSiteMapper extends Mapper<TourGoodSite> {
public List<TourDepartVo> getlistByGoodId(@Param("goodId") Integer goodId);
}
package com.xxfc.platform.tour.mapper;
import com.xxfc.platform.tour.entity.TourGoodSpePrice;
import com.xxfc.platform.tour.vo.TourDepartTimeVo;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
/**
* 旅游商品规格价格表
*
......@@ -11,5 +15,9 @@ import tk.mybatis.mapper.common.Mapper;
* @date 2019-06-06 11:41:51
*/
public interface TourGoodSpePriceMapper extends Mapper<TourGoodSpePrice> {
List<TourDepartTimeVo> getAllByGoodId(@Param("goodId") Integer goodId);
}
package com.xxfc.platform.tour.rest;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.xxfc.platform.tour.biz.TourGoodBiz;
import com.xxfc.platform.tour.entity.TourGood;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("tourGood")
public class TourGoodController extends BaseController<TourGoodBiz,TourGood> {
package com.xxfc.platform.tour.rest;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken;
import com.github.wxiaoqi.security.common.msg.BaseResponse;
import com.github.wxiaoqi.security.common.msg.ListRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.tour.biz.TourGoodBiz;
import com.xxfc.platform.tour.entity.TourGood;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("tourGood")
public class TourGoodController extends BaseController<TourGoodBiz, TourGood> {
/**
* 查询旅游路线列表
*
* @param page
* @param limit
* @param query
* @param latitude
* @param longitude
* @param tagId
* @param distance
* @return
*/
@ApiOperation("查询旅游路线列表")
@RequestMapping(value = "/app/unauth/getGoodList", method = RequestMethod.GET)
@IgnoreClientToken
@ResponseBody
public PageDataVO<TourGood> getGoodList(@RequestParam(value = "page", required = true) Integer page, @RequestParam(value = "limit", required = true) Integer limit,
@RequestParam(value = "query") String query, @RequestParam(value = "latitude", required = false) Double latitude,
@RequestParam(value = "longitude", required = false) Double longitude, @RequestParam(value = "tagId", required = false) Integer tagId,
@RequestParam(value = "distance", defaultValue = "10.00") Double distance) {
return baseBiz.getGoodList(page, limit, query, latitude, longitude, tagId, distance);
}
}
\ No newline at end of file
package com.xxfc.platform.tour.rest;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.tour.biz.TourGoodDetailBiz;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("good")
@IgnoreClientToken
public class TourGoodDetailController{
@Autowired
TourGoodDetailBiz detailBiz;
//获取商品详情
@RequestMapping(value = "/app/unauth/details", method = RequestMethod.GET)
@IgnoreUserToken
public ObjectRestResponse details(@RequestParam(value = "goodId",defaultValue = "0") Integer goodId) {
return detailBiz.getGoodDetaileById(goodId);
}
}
\ No newline at end of file
package com.xxfc.platform.tour.rest;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.tour.biz.TourGoodSpeBiz;
import com.xxfc.platform.tour.entity.TourGoodSpe;
import com.xxfc.platform.tour.common.TourBaseController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("tourGoodSpe")
public class TourGoodSpeController extends BaseController<TourGoodSpeBiz,TourGoodSpe> {
@RequestMapping("spe")
@IgnoreClientToken
public class TourGoodSpeController extends TourBaseController<TourGoodSpeBiz> {
//获取商品详情
@RequestMapping(value = "/user/prices", method = RequestMethod.GET)
public ObjectRestResponse user() {
AppUserDTO userDTO=getUserInfo();
return ObjectRestResponse.succ(userDTO);
}
}
\ No newline at end of file
package com.xxfc.platform.tour.rest;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.xxfc.platform.tour.biz.TourGoodSpePriceBiz;
import com.xxfc.platform.tour.entity.TourGoodSpePrice;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("tourGoodSpePrice")
public class TourGoodSpePriceController extends BaseController<TourGoodSpePriceBiz,TourGoodSpePrice> {
}
\ No newline at end of file
......@@ -25,4 +25,33 @@
<result property="unit" column="unit"/>
</resultMap>
<!--查询旅游路线列表-->
<select id="getGoodList" parameterType="java.util.Map" resultMap="tourGoodMap">
SELECT * from tour_good t
where 1=1
<if test="params.query != null and params.query != ''">
and (t.`name` like CONCAT('%',#{params.query},'%') or t.introduce like CONCAT('%',#{params.query},'%'))
</if>
<if test="params.latitude != null and params.latitude != '' and params.longitude != null and params.longitude != ''">
and t.id in (SELECT s.good_id from (
select good_id,
if(ROUND(( (2 * ASIN( SQRT( POW( SIN((latitude * PI() / 180.0- #{params.latitude}* PI() / 180.0)/2), 2)+COS( latitude * PI() / 180.0)*COS( #{params.longitude} * PI() / 180.0)
*POW(SIN((longitude * PI() / 180.0 - #{params.longitude}* PI() /180.0)/2),2))))*6378.137)*10000)/10000 is null ,0,ROUND(( (2 * ASIN( SQRT( POW( SIN((latitude * PI() / 180.0-22.954205* PI() / 180.0)/2), 2)+COS( latitude * PI() / 180.0)*COS(113.879421 * PI() / 180.0)
*POW(SIN((longitude * PI() / 180.0 - #{params.longitude}* PI() /180.0)/2),2))))*6378.137)*10000)/10000 ) AS distance
FROM tour_good_site
order by distance
) s
where s.distance &lt; #{params.distance})
</if>
<if test="params.tagId != null and params.tagId != '' ">
and t.id in (SELECT tg.good_id from tour_good_tag tg
where tg.tag_id = 1) and t.recommend = 1
ORDER BY t.recommend
</if>
</select>
<select id="getOne" resultMap="tourGoodMap">
SELECT * FROM tour_good WHERE id =#{id} and is_del=0
</select>
</mapper>
\ No newline at end of file
......@@ -20,5 +20,24 @@
<result property="intro" column="intro"/>
<result property="isDel" column="is_del"/>
</resultMap>
<resultMap type="com.xxfc.platform.tour.vo.TourDepartVo" id="tourDepartVoMap">
<result property="id" column="id"/>
<result property="goodId" column="good_id"/>
<result property="name" column="name"/>
<result property="address" column="address"/>
<result property="companyId" column="company_id"/>
<result property="departTime" column="depart_time"/>
<result property="longitude" column="longitude"/>
<result property="latitude" column="latitude"/>
<result property="type" column="type"/>
<result property="intro" column="intro"/>
</resultMap>
<!-- 获取出行时间 -->
<select id="getlistByGoodId" resultMap="tourDepartVoMap">
SELECT id,good_id,name,address,company_id,depart_time,longitude,latitude,type,intro FROM tour_good_site
WHERE good_id=#{goodId} and is_del=0
</select>
</mapper>
\ No newline at end of file
......@@ -19,4 +19,27 @@
<result property="isDel" column="is_del"/>
</resultMap>
<resultMap type="com.xxfc.platform.tour.vo.TourDepartTimeVo" id="tourDepartTimeVoMap">
<result property="id" column="id"/>
<result property="goodId" column="good_id"/>
<result property="startTime" column="start_time"/>
<result property="endTime" column="end_time"/>
<result property="speId" column="spe_id"/>
<result property="price" column="price"/>
<result property="childPrice" column="child_price"/>
<result property="memberPrice" column="member_price"/>
<result property="stock" column="stock"/>
<result property="startWeek" column="startWeek"/>
<result property="endWeek" column="endWeek"/>
</resultMap>
<!-- 获取出行时间 -->
<select id="getAllByGoodId" resultMap="tourDepartTimeVoMap">
SELECT id,good_id,good_id,DATE_FORMAT(start_time,'%Y-%m-%d') as start_time,DATE_FORMAT(end_time,'%Y-%m-%d') as end_time,spe_id,price,child_price,member_price,stock,
DATE_FORMAT(start_time,'%w') as startWeek,DATE_FORMAT(end_time,'%w') as endWeek
FROM tour_good_spe_price WHERE good_id=#{goodId} and is_del=0
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment