Commit 05840b6c authored by hezhen's avatar hezhen

1232

parent 3545f609
......@@ -2,11 +2,13 @@ package com.xxfc.platform.vehicle.biz;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.util.BeanUtils;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.app.entity.Cofig;
......@@ -17,6 +19,7 @@ import com.xxfc.platform.vehicle.entity.VehiclePublishGoods;
import com.xxfc.platform.vehicle.entity.VehiclePublishReceive;
import com.xxfc.platform.vehicle.mapper.VehiclePublishMapper;
import com.xxfc.platform.vehicle.pojo.dto.VehiclePublishFindDTO;
import com.xxfc.platform.vehicle.pojo.vo.VehiclePublishGoodsVo;
import com.xxfc.platform.vehicle.pojo.vo.VehiclePublishVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
......@@ -25,6 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
......@@ -125,6 +129,46 @@ public class VehiclePublishBiz extends BaseBiz<VehiclePublishMapper, VehiclePubl
}
public JSONObject detailV2(Integer publisId){
VehiclePublish vehiclePublish = selectById(publisId);
JSONObject data = new JSONObject();
if (vehiclePublish != null ){
data.put("vehiclePublish",vehiclePublish);
VehiclePublishGoods publishGoods = new VehiclePublishGoods();
publishGoods.setPublishId(publisId);
List<VehiclePublishGoods> list = publishGoodsBiz.selectList(publishGoods);
if (list.size() > 0){
JSONArray array1 = new JSONArray();
JSONArray array2 = new JSONArray();
JSONArray array3 = new JSONArray();
for (VehiclePublishGoods vehiclePublishGoods : list){
JSONObject jsonObject = new JSONObject();
jsonObject.put("publishGoods",vehiclePublishGoods);
VehiclePublishReceive publishReceive = publishReceiveBiz.getReceivByPubilishId(vehiclePublishGoods.getId());
Integer publishGoodsStatus = 0 ;
if (publishReceive != null ){
publishGoodsStatus = publishReceive.getStatus();
jsonObject.put("publishGoodsStatus",publishGoodsStatus);
if (publishGoodsStatus == 1){
array1.add(jsonObject);
}else if (publishGoodsStatus == 3 || publishGoodsStatus == 5 || publishGoodsStatus == 6){
array2.add(jsonObject);
}
}else {
jsonObject.put("publishGoodsStatus",0);
array3.add(jsonObject);
}
}
data.put("array1",array1);
data.put("array2",array2);
data.put("array3",array3);
}
}
return data;
}
//入驻规则管理
public JSONObject getConfig(){
......
......@@ -520,6 +520,10 @@ public class VehiclePublishReceiveBiz extends BaseBiz<VehiclePublishReceiveMappe
return mapper.getReceivByVehicleId(vehicleId);
}
public VehiclePublishReceive getReceivByPubilishId(Integer pubilishId){
return mapper.getReceivByPubilishId(pubilishId);
}
public void canelReceiveOrder(String orderNo){
VehiclePublishFindDTO publishFindDTO = new VehiclePublishFindDTO();
......
......@@ -34,4 +34,8 @@ public interface VehiclePublishReceiveMapper extends Mapper<VehiclePublishReceiv
"WHERE vehicle_id = #{vehicleId} and `status` in (0,1,3)")
VehiclePublishReceive getReceivByVehicleId(@Param("vehicleId")String vehicleId);
@Select("SELECT * FROM vehicle_publish_receive WHERE publish_goods_id =#{pubilishId} and `status` in (1,3,5,6) ORDER BY id DESC LIMIT 1")
VehiclePublishReceive getReceivByPubilishId(@Param("pubilishId")Integer pubilishId);
}
\ No newline at end of file
......@@ -100,6 +100,15 @@ public class AppVehiclePublishController extends BaseController<VehiclePublishBi
}
@GetMapping("publishDetailV2")
@ApiModelProperty("我的发布详情")
@IgnoreUserToken
public ObjectRestResponse publishDetailV2(VehiclePublishFindDTO publishFindDTO) {
return ObjectRestResponse.succ(baseBiz.detailV2(publishFindDTO.getPublishId()));
}
......
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