Commit e530bd36 authored by hezhen's avatar hezhen

123

parent ee9ff3a8
......@@ -54,6 +54,12 @@ public class OrderPulishReceiveDetail implements Serializable {
@Column(name = "receive_ids")
@ApiModelProperty(value = "接单ids(逗号隔开)")
private String receiveIds;
@Column(name = "refuse_receive_ids")
@ApiModelProperty(value = "拒绝的接单ids")
private String refuseReceiveIds;
}
......@@ -5,7 +5,7 @@ import com.xxfc.platform.order.entity.BaseOrder;
import com.xxfc.platform.order.entity.OrderItem;
import com.xxfc.platform.order.entity.OrderPulishReceiveDetail;
import com.xxfc.platform.order.entity.inter.OrderDetail;
import com.xxfc.platform.vehicle.entity.VehiclePublishGoods;
import com.xxfc.platform.vehicle.pojo.vo.VehiclePublishReceiveVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -14,13 +14,13 @@ import java.util.List;
@Data
public class PulishReceiveBO extends OrderPulishReceiveDetail implements OrderDetail {
private BaseOrder order;
private VehiclePublishGoods vehiclePublishGoods;
private List<VehiclePublishReceiveVo> receiveVos;
AppUserDTO appUserDTO;
/**
* 促成人联系方式
*/
@ApiModelProperty(value = "促成人联系方式")
String facilitatePhone;
Integer facilitatePhone;
/**
* 下单来源,1--app;2--小程序
......
......@@ -20,6 +20,7 @@ import com.xxfc.platform.tour.feign.TourFeign;
import com.xxfc.platform.universal.constant.DictionaryKey;
import com.xxfc.platform.universal.feign.ThirdFeign;
import com.xxfc.platform.vehicle.feign.VehicleFeign;
import com.xxfc.platform.vehicle.pojo.vo.VehiclePublishReceiveVo;
import lombok.extern.log4j.Log4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -93,10 +94,16 @@ public class OrderPulishReceiveService extends AbstractOrderHandle<OrderPulishRe
public void handleDetail(PulishReceiveBO bo) {
//设置订单状态为3
bo.getOrder().setStatus(OrderStatusEnum.ORDER_UNPAY.getCode());
//设置订单图片
bo.getOrder().setPicture(bo.getVehiclePublishGoods().getCover());
//设置订单名称
// bo.getOrder().setName(bo.getVehiclePublishGoods().getName());
List<VehiclePublishReceiveVo> receiveVos = bo.getReceiveVos();
if (receiveVos.size() > 0 ){
VehiclePublishReceiveVo receiveVo = receiveVos.get(0);
//设置订单图片
bo.getOrder().setPicture(receiveVo.getCover());
//设置订单名称
bo.getOrder().setName(receiveVo.getName());
}
super.handleDetail(bo);
......
......@@ -40,6 +40,36 @@ public class VehiclePublishReceive implements Serializable {
private String vehicleId;
@Column(name = "name")
@ApiModelProperty(value = "商品名称")
private String name;
@Column(name = "goods_type")
@ApiModelProperty(value = "商品类型 1--房车;2--机车;3--游艇;4-豪车")
private Integer goodsType;
@Column(name = "brand_id")
@ApiModelProperty(value = "品牌id")
private Integer brandId;
@Column(name = "category_id")
@ApiModelProperty(value = "型号id")
private Integer categoryId;
@Column(name = "cover")
@ApiModelProperty(value = "封面")
private String cover;
@Column(name = "extension_list")
@ApiModelProperty(value = "扩展信息(逗号隔开)")
private String extensionList;
@Column(name = "publish_goods_id")
@ApiModelProperty(value = "需求子id")
private Integer publishGoodsId;
......
......@@ -34,6 +34,9 @@ public class VehiclePublishReceiveDTO{
private Integer userId;
List<Integer> ids;
@ApiModelProperty("接单详情")
List<VehiclePublishReceive> receives;
......
package com.xxfc.platform.vehicle.pojo.vo;
import com.xxfc.platform.vehicle.entity.VehiclePublishReceive;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class VehiclePublishReceiveVo extends VehiclePublishReceive {
@ApiModelProperty("品牌名称")
String brandName;
@ApiModelProperty("型号名称")
String categoryName;
private List<VehicleExtensionVO> extensionVOS;
@ApiModelProperty("接单公司")
String receiveCompanyName;
@ApiModelProperty("发布公司")
String publishCompanyName;
@ApiModelProperty("需求id")
private Integer publishId;
}
......@@ -133,6 +133,11 @@ public class VehicleExtensionBiz extends BaseBiz<VehicleEextensionMapper, Vehicl
}
public String getExtensionIds(String vehicleId){
return mapper.getExtensionIds(vehicleId);
}
......
......@@ -5,11 +5,16 @@ package com.xxfc.platform.vehicle.biz;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.xxfc.platform.order.entity.BaseOrder;
import com.xxfc.platform.vehicle.entity.Vehicle;
import com.xxfc.platform.vehicle.entity.VehiclePublish;
import com.xxfc.platform.vehicle.entity.VehiclePublishGoods;
import com.xxfc.platform.vehicle.entity.VehiclePublishReceive;
import com.xxfc.platform.vehicle.mapper.VehiclePublishReceiveMapper;
import com.xxfc.platform.vehicle.pojo.dto.VehiclePublishReceiveDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -21,14 +26,65 @@ import java.util.List;
public class VehiclePublishReceiveBiz extends BaseBiz<VehiclePublishReceiveMapper, VehiclePublishReceive> {
@Autowired
VehicleBiz vehicleBiz;
@Autowired
VehiclePublishBiz vehiclePublishBiz;
@Autowired
VehiclePublishGoodsBiz publishGoodsBiz;
@Autowired
VehicleExtensionBiz vehicleExtensionBiz;
@Transactional(rollbackFor = Exception.class)
public void receive(VehiclePublishReceiveDTO publishReceiveDTO){
if (publishReceiveDTO == null || CollectionUtils.isEmpty(publishReceiveDTO.getReceives())){
Integer publishId = publishReceiveDTO.getPublishId() == null ? 0 : publishReceiveDTO.getPublishId();
if (publishId == 0 || CollectionUtils.isEmpty(publishReceiveDTO.getReceives())){
throw new BaseException("参数不能为空", ResultCode.FAILED_CODE);
}
VehiclePublish vehiclePublish = vehiclePublishBiz.selectById(publishId);
if (vehiclePublish == null ){
throw new BaseException("需求不存在或无效", ResultCode.FAILED_CODE);
}
Integer type = vehiclePublish.getType() == null ? 0 : vehiclePublish.getType();
List<VehiclePublishReceive> receives = publishReceiveDTO.getReceives();
for (VehiclePublishReceive vehiclePublishReceive : receives){
Integer id = vehiclePublishReceive.getId() == null ? 0 : vehiclePublishReceive.getId();
if (id == 0){
String vehicleId = vehiclePublishReceive.getVehicleId();
Vehicle vehicle = vehicleBiz.selectById(vehicleId);
if (vehicle == null ){
throw new BaseException("商品信息不存在", ResultCode.FAILED_CODE);
}
Integer publishGoodsId = vehiclePublishReceive.getPublishGoodsId() == null ? 0 : vehiclePublishReceive.getPublishGoodsId();
VehiclePublishGoods publishGoods = publishGoodsBiz.selectById(publishGoodsId);
if (publishGoods == null ){
throw new BaseException("子需求不存在", ResultCode.FAILED_CODE);
}
String cover = publishGoods.getCover();
Integer brandId = publishGoods.getBrandId();
Integer categoryId = publishGoods.getCategoryId();
String extensionList = publishGoods.getExtensionList();
if (type == 1 ){
cover = vehicle.getCover();
brandId = vehicle.getBrandId();
categoryId = vehicle.getCategoryId();
extensionList = vehicleExtensionBiz.getExtensionIds(vehicleId);
}
vehiclePublishReceive.setName(vehicle.getName());
vehiclePublishReceive.setGoodsType(vehiclePublish.getGoodsType());
vehiclePublishReceive.setCover(cover);
vehiclePublishReceive.setBrandId(brandId);
vehiclePublishReceive.setCategoryId(categoryId);
vehiclePublishReceive.setExtensionList(extensionList);
insertSelective(vehiclePublishReceive);
}else {
}
}
......@@ -36,6 +92,9 @@ public class VehiclePublishReceiveBiz extends BaseBiz<VehiclePublishReceiveMappe
}
public BaseOrder addOrder()
......
......@@ -6,6 +6,7 @@ import com.xxfc.platform.vehicle.entity.VehicleExtension;
import com.xxfc.platform.vehicle.pojo.dto.VehicleExtensionFindDTO;
import com.xxfc.platform.vehicle.pojo.vo.VehicleExtensionVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.additional.idlist.SelectByIdListMapper;
import tk.mybatis.mapper.common.Mapper;
......@@ -28,4 +29,7 @@ public interface VehicleEextensionMapper extends Mapper<VehicleExtension>, Selec
List<VehicleExtensionVO> selectListByPlatCata(VehicleExtensionFindDTO vehicleExtensionFindDTO);
@Select("SELECT GROUP_CONCAT(cata_id) FROM vehicle_extension WHERE vehicle_id=#{vehicleId} and is_del = 0")
String getExtensionIds(@Param("vehicleId") String vehicleId);
}
\ No newline at end of file
......@@ -2,9 +2,16 @@ package com.xxfc.platform.vehicle.mapper;
import com.xxfc.platform.vehicle.entity.VehiclePublishReceive;
import com.xxfc.platform.vehicle.pojo.dto.VehiclePublishReceiveDTO;
import com.xxfc.platform.vehicle.pojo.vo.VehiclePublishReceiveVo;
import tk.mybatis.mapper.additional.idlist.SelectByIdListMapper;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface VehiclePublishReceiveMapper extends Mapper<VehiclePublishReceive>, SelectByIdListMapper<VehiclePublishReceive,Integer> {
List<VehiclePublishReceiveVo> selectList(VehiclePublishReceiveDTO receiveDTO);
}
\ No newline at end of file
<?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.vehicle.mapper.VehiclePublishReceiveMapper">
<select id="selectList" resultType="com.xxfc.platform.vehicle.pojo.vo.VehiclePublishReceiveVo" parameterType="com.xxfc.platform.vehicle.pojo.dto.VehiclePublishReceiveDTO">
SELECT r.*,
b.cn_name as brandName,
c.`name` categoryName,
bc.`name` as receiveCompanyName,
bc1.`name` as publishCompanyName,
g.`publish_id` as publishId
FROM vehicle_publish_receive r
LEFT JOIN vehicle_brand b ON a.brand_id=b.id
LEFT JOIN vehicle_category c ON a.category_id=c.id
LEFT JOIN branch_company bc ON r.receive_company_id = bc.id
LEFT JOIN branch_company bc1 ON r.publish_company_id = bc1.id
LEFT JOIN vehicle_publish_goods g ON r.publish_goods_id=g.id
<where>
r.is_del = 0
<if test="publishId != null and publishId > 0">
AND g.`publish_id`= #{publishId}
</if>
<if test="publishGoodsId != null and publishGoodsId > 0">
AND r.`publish_goods_id`= #{publishGoodsId}
</if>
<if test="ids != null and ids.size > 0">
and r.id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
order by r.id DESC
</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