package com.matrix.system.hive.service;
|
|
import com.matrix.system.hive.bean.ShoppingGoods;
|
import com.matrix.system.hive.bean.ShoppingGoodsAssemble;
|
import com.matrix.system.hive.bean.SysProjUse;
|
import com.matrix.system.hive.dao.ShoppingGoodsAssembleDao;
|
import com.matrix.system.hive.dao.ShoppingGoodsDao;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Component;
|
|
import java.util.List;
|
|
/**
|
* 绑定项目余次相关的产品信息
|
*/
|
@Component
|
public class ProjUserTools {
|
|
@Autowired
|
ShoppingGoodsDao shoppingGoodsDao;
|
@Autowired
|
ShoppingGoodsAssembleDao shoppingGoodsAssembleDao;
|
|
|
|
|
public SysProjUse budingProjInfo(SysProjUse projUse) {
|
ShoppingGoods shoppingGoods1 = shoppingGoodsDao.selectById(projUse.getProjId());
|
projUse.setProjInfo(shoppingGoods1);
|
//选择服务订单页面绑定产品重构
|
ShoppingGoodsAssemble shoppingGoodsAssemble = shoppingGoodsAssembleDao.selectById(projUse.getAssembleId());
|
projUse.setShoppingGoodsAssemble(shoppingGoodsAssemble);
|
if (projUse.getTaocanId() != null) {
|
ShoppingGoods shoppingGoods = shoppingGoodsDao.selectById(projUse.getTaocanId());
|
List<ShoppingGoodsAssemble> assembleList = shoppingGoodsAssembleDao.selectGoodsByShoppingGoodsIdAndType(shoppingGoods.getId(),ShoppingGoods.SHOPPING_GOODS_TYPE_XM);
|
shoppingGoods.setAssembleGoods(assembleList);
|
projUse.setShoppingGoods(shoppingGoods);
|
}
|
return projUse;
|
}
|
}
|