|
@ -26,15 +26,26 @@ |
|
|
package com.yxt.anrui.buscenter.biz.bussalesorderdeposit; |
|
|
package com.yxt.anrui.buscenter.biz.bussalesorderdeposit; |
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.BusSalesOrder; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.yxt.anrui.buscenter.api.bussalesorderdeposit.BusSalesOrderDeposit; |
|
|
import com.yxt.anrui.buscenter.api.bussalesorderdeposit.*; |
|
|
import com.yxt.anrui.buscenter.api.bussalesorderdeposit.BusSalesOrderDepositDetailsVo; |
|
|
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorderdeposit.BusSalesOrderDepositDto; |
|
|
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorderdeposit.app.AppBusSalesOrderDepositListVo; |
|
|
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorderdeposit.app.AppBusSalesOrderDepositVo; |
|
|
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorderprice.BusSalesOrderPrice; |
|
|
|
|
|
import com.yxt.anrui.buscenter.biz.busdepositfictitious.BusDepositFictitiousService; |
|
|
|
|
|
import com.yxt.anrui.buscenter.biz.bussalesorder.BusSalesOrderService; |
|
|
|
|
|
import com.yxt.anrui.buscenter.biz.bussalesorderprice.BusSalesOrderPriceService; |
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
import com.yxt.common.base.utils.PagerUtil; |
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Objects; |
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Project: anrui-buscenter(业务管理) <br/> |
|
|
* Project: anrui-buscenter(业务管理) <br/> |
|
|
* File: BusSalesOrderDepositService.java <br/> |
|
|
* File: BusSalesOrderDepositService.java <br/> |
|
@ -51,6 +62,14 @@ import org.springframework.stereotype.Service; |
|
|
@Service |
|
|
@Service |
|
|
public class BusSalesOrderDepositService extends MybatisBaseService<BusSalesOrderDepositMapper, BusSalesOrderDeposit> { |
|
|
public class BusSalesOrderDepositService extends MybatisBaseService<BusSalesOrderDepositMapper, BusSalesOrderDeposit> { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private BusSalesOrderService busSalesOrderService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private BusDepositFictitiousService busDepositFictitiousService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private BusSalesOrderPriceService busSalesOrderPriceService; |
|
|
|
|
|
|
|
|
public String saveOrderDepo(BusSalesOrderDepositDto busSalesOrderDepositDto, String sid) { |
|
|
public String saveOrderDepo(BusSalesOrderDepositDto busSalesOrderDepositDto, String sid) { |
|
|
BusSalesOrderDeposit busSalesOrderDeposit = new BusSalesOrderDeposit(); |
|
|
BusSalesOrderDeposit busSalesOrderDeposit = new BusSalesOrderDeposit(); |
|
|
BeanUtil.copyProperties(busSalesOrderDepositDto, busSalesOrderDeposit, "sid"); |
|
|
BeanUtil.copyProperties(busSalesOrderDepositDto, busSalesOrderDeposit, "sid"); |
|
@ -89,4 +108,36 @@ public class BusSalesOrderDepositService extends MybatisBaseService<BusSalesOrde |
|
|
return baseMapper.deleteByOrderSid(sid); |
|
|
return baseMapper.deleteByOrderSid(sid); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ResultBean<AppBusSalesOrderDepositVo> getDepositInfo(String sid) { |
|
|
|
|
|
ResultBean<AppBusSalesOrderDepositVo> rb = ResultBean.fireFail(); |
|
|
|
|
|
//查询销售订单是否存在
|
|
|
|
|
|
BusSalesOrder busSalesOrder = busSalesOrderService.fetchBySid(sid); |
|
|
|
|
|
if (busSalesOrder == null) { |
|
|
|
|
|
return rb.setMsg("该销售订单单据不存在"); |
|
|
|
|
|
} |
|
|
|
|
|
//查询该订金信息是否存在
|
|
|
|
|
|
AppBusSalesOrderDepositVo vo = baseMapper.getDepositInfo(sid); |
|
|
|
|
|
//根据销售订单sid查询价格信息
|
|
|
|
|
|
BusSalesOrderPrice busSalesOrderPrice = busSalesOrderPriceService.selectBySalesOrderSid(sid); |
|
|
|
|
|
if (vo == null) { |
|
|
|
|
|
vo = new AppBusSalesOrderDepositVo(); |
|
|
|
|
|
vo.setSaleOrderSid(sid); |
|
|
|
|
|
} else { |
|
|
|
|
|
//根据订金sid查询虚拟订单和订金的关联
|
|
|
|
|
|
List<AppBusSalesOrderDepositListVo> listVos = busDepositFictitiousService.getList(vo.getSid()); |
|
|
|
|
|
listVos.parallelStream().filter(Objects::nonNull).collect(Collectors.toList()); |
|
|
|
|
|
if (!listVos.isEmpty()) { |
|
|
|
|
|
for (AppBusSalesOrderDepositListVo listVo : listVos) { |
|
|
|
|
|
String payPath = listVo.getPayPath(); |
|
|
|
|
|
List<String> stringList = Arrays.asList(payPath.split(",")); |
|
|
|
|
|
listVo.setEntrustImage(stringList); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
vo.setVirtualOrderList(listVos); |
|
|
|
|
|
} |
|
|
|
|
|
if (busSalesOrderPrice != null) { |
|
|
|
|
|
vo.setCarNumber(busSalesOrderPrice.getQuantity().toString()); |
|
|
|
|
|
} |
|
|
|
|
|
return rb.success().setData(vo); |
|
|
|
|
|
} |
|
|
} |
|
|
} |