jyy
2022-04-15 f57554f7da5e4d05b4b4bab99bf49ac9ca8c2038
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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;
    }
}