Commit 7dff958c authored by hanfeng's avatar hanfeng

Merge branch 'master-modify-background-bug-hf' into base-modify

parents 860b98f7 6a9638a5
......@@ -87,8 +87,8 @@ public interface UserFeign {
* @param ids
* @return
*/
@RequestMapping(value = "/public/getByUserIds", method = RequestMethod.GET)
public ObjectRestResponse<List<AppUserVo>> getByUserIds(@RequestParam("ids")List<Integer> ids);
@GetMapping(value = "/public/getByUserIds")
ObjectRestResponse<List<AppUserVo>> getByUserIds(@RequestParam("ids")List<Integer> ids);
/**
* 购买会员
......
......@@ -81,4 +81,9 @@ public interface ActivityFeign {
@ApiOperation("获取所用优惠卷")
@GetMapping("/coupon/coupons")
Map<String, Coupon> coupons();
@ApiOperation("获取所用优惠卷")
@GetMapping("/coupon/couponsBycouponIds")
List<Coupon> couponsByTickerNoList(@RequestParam(value = "tickerNoList") List<String> tickerNoList);
}
......@@ -9,10 +9,12 @@ import com.xxfc.platform.activity.constant.CouponUsed;
import com.xxfc.platform.activity.dto.CouponDTO;
import com.xxfc.platform.activity.dto.CouponFindDTO;
import com.xxfc.platform.activity.entity.Coupon;
import com.xxfc.platform.activity.entity.UserCoupon;
import com.xxfc.platform.activity.vo.CouponPagVo;
import com.xxfc.platform.activity.vo.CouponTitleVo;
import com.xxfc.platform.activity.vo.CouponVo;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xxfc.platform.activity.mapper.CouponMapper;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
......@@ -33,7 +35,8 @@ import java.util.*;
*/
@Service
public class CouponBiz extends BaseBiz<CouponMapper, Coupon> {
@Autowired
private UserCouponBiz userCouponBiz;
//获取优惠卷
public Coupon getCouponByUsed(Integer used){
......@@ -135,4 +138,9 @@ public class CouponBiz extends BaseBiz<CouponMapper, Coupon> {
}
return map;
}
public List<Coupon> couponsByTickerNoList(List<String> tickerNoList) {
return mapper.couponsByTickerNoList(tickerNoList);
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.xxfc.platform.activity.mapper;
import com.xxfc.platform.activity.entity.Coupon;
import com.xxfc.platform.activity.vo.CouponTitleVo;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.math.BigDecimal;
......@@ -22,4 +23,5 @@ public interface CouponMapper extends Mapper<Coupon> {
List<Coupon> getCoupons();
List<Coupon> couponsByTickerNoList(@Param(value = "tickerNoList") List<String> tickerNoList);
}
......@@ -4,7 +4,9 @@ import com.github.wxiaoqi.security.common.rest.BaseController;
import com.xxfc.platform.activity.biz.CouponBiz;
import com.xxfc.platform.activity.entity.Coupon;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
......@@ -16,9 +18,15 @@ import java.util.Map;
public class CouponController extends BaseController<CouponBiz, Coupon> {
@ApiOperation("获取所用优惠卷")
@RequestMapping("/coupons")
@GetMapping("/coupons")
public Map<String, Coupon> coupons() {
return baseBiz.getCoupons();
}
@ApiOperation("获取所用优惠卷")
@GetMapping("/couponsBycouponIds")
public List<Coupon> couponsBycouponIds(@RequestParam(value = "tickerNoList") List<String> tickerNoList) {
return baseBiz.couponsByTickerNoList(tickerNoList);
}
}
\ No newline at end of file
......@@ -46,4 +46,15 @@
select id ,title,used_amount from coupon
</select>
<select id="couponsByTickerNoList" resultType="com.xxfc.platform.activity.entity.Coupon">
select c.* from user_coupon u left join coupon c on u.coupon_id=c.id
<where>
u.ticker_no in
<foreach collection="tickerNoList" item="no" index="index" open="(" separator="," close=")">
#{no}
</foreach>
</where>
</select>
</mapper>
\ No newline at end of file
......@@ -60,8 +60,8 @@ public class OrderListVo extends BaseOrder {
@ApiModelProperty(value = "使用优惠卷")
ArrayList<Coupon> couponList ;
List<Coupon> couponList;
@ApiModelProperty(value = "退还优惠卷")
ArrayList<Coupon> backCouponList;
List<Coupon> backCouponList;
}
......@@ -39,10 +39,19 @@ public class OrderVehicleCrosstownDto extends OrderVehicleCrosstown {
List<DepositRefundRecord> depositRefundRecord;
/**
* 交付人名称
*/
private String deliveryName;
/**
* 交付人手机号
*/
private String deliveryPhone;
/**
* 交付时间
*/
private Long deliveryTime;
}
......@@ -175,10 +175,7 @@ public class BackStageOrderController extends CommonBaseController implements Us
}
}
}
Map<String, Coupon> coupons=null;
if (dto.getType()==1) {
coupons = activityFeign.coupons();
}
for (OrderListVo orderPageVO : list) {
AppUserVo appUserVo = appvoMap.get(orderPageVO.getUserId());
......@@ -190,33 +187,16 @@ public class BackStageOrderController extends CommonBaseController implements Us
orderPageVO.setMemberName(appUserVo.getMemberName());
}
if (dto.getType()==1&&coupons!=null) {
ArrayList<Coupon> couponList = Lists.newArrayList();
ArrayList<Coupon> backCouponList = Lists.newArrayList();
if (dto.getType()==1) {
if (StringUtils.isNotBlank(orderPageVO.getCouponTickerNos())) {
String[] couponIds = orderPageVO.getCouponTickerNos().split(",");
for (String couponId : couponIds) {
couponList.add(coupons.get(couponId));
}
}
if (StringUtils.isNotBlank(orderPageVO.getBackCoupon())) {
String[] backCouponIds = orderPageVO.getBackCoupon().split(",");
for (String backCouponId : backCouponIds) {
backCouponList.add(coupons.get(backCouponId));
List<Coupon> couponList = activityFeign.couponsByTickerNoList(Lists.newArrayList(couponIds));
orderPageVO.setCouponList(couponList);
}
}
orderPageVO.setCouponList(couponList);
orderPageVO.setBackCouponList(backCouponList);
}
// String carArticlesJson = orderPageVO.getCarArticlesJson();
// if (StringUtils.isNotBlank(carArticlesJson)){
// List<OrderAccompanyDTO> orderAccompanyDTOS = JSONObject.parseArray(carArticlesJson, OrderAccompanyDTO.class);
// orderPageVO.setOrderAccompanyDTOS(orderAccompanyDTOS);
// if (CollectionUtils.isNotEmpty(orderAccompanyDTOS)) {
// List<String> collect = orderAccompanyDTOS.parallelStream().map(OrderAccompanyDTO::getName).collect(Collectors.toList());
// orderPageVO.setCarArticles(collect);
// }
// }
if (orderPageVO.getOrderRentVehicleDetail() != null && orderPageVO.getOrderRentVehicleDetail().getVehicleId() != null) {
RestResponse<Vehicle> restResponse = vehicleFeign.findById(orderPageVO.getOrderRentVehicleDetail().getVehicleId());
log.info("获取车辆信息返回消息:{}", restResponse.getData());
......
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