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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package com.matrix.system.common.service.impl;
 
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.tools.UUIDUtil;
import com.matrix.system.common.bean.CustomerDataDictionary;
import com.matrix.system.common.bean.SysCompany;
import com.matrix.system.common.dao.CustomerDataDictionaryDao;
import com.matrix.system.hive.bean.ShoppingGoodsCategory;
import com.matrix.system.hive.bean.SysShopInfo;
import com.matrix.system.hive.dao.ShoppingGoodsCategoryDao;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.ArrayList;
import java.util.List;
 
@Service
public class InitShoppingGoodsCategoryService {
 
    @Autowired
    private ShoppingGoodsCategoryDao shoppingGoodsCategoryDao;
 
 
 
    /**
     * 初始化公司的数据字典
     * @param sysCompany
     */
    public void initShoppingGoodsCategory(SysCompany sysCompany , SysShopInfo zbSop) {
        List<ShoppingGoodsCategory> shoppingGoodsCategoryList=new ArrayList<>();
        //组装初始化数据
 
        ShoppingGoodsCategory d1=new ShoppingGoodsCategory();
        d1.setCompanyId(sysCompany.getComId());
        d1.setParentId(0L);
        d1.setName("家居产品");
        d1.setShopId(zbSop.getId());
        d1.setSequence(1);
        shoppingGoodsCategoryList.add(d1);
 
        ShoppingGoodsCategory d2=new ShoppingGoodsCategory();
        d2.setCompanyId(sysCompany.getComId());
        d2.setParentId(0L);
        d2.setName("服务项目");
        d2.setShopId(zbSop.getId());
        d2.setSequence(2);
        shoppingGoodsCategoryList.add(d2);
 
        ShoppingGoodsCategory d3=new ShoppingGoodsCategory();
        d3.setCompanyId(sysCompany.getComId());
        d3.setParentId(0L);
        d3.setName("套餐");
        d3.setShopId(zbSop.getId());
        d3.setSequence(3);
        shoppingGoodsCategoryList.add(d3);
 
        ShoppingGoodsCategory d4=new ShoppingGoodsCategory();
        d4.setCompanyId(sysCompany.getComId());
        d4.setParentId(0L);
        d4.setName("卡项");
        d4.setShopId(zbSop.getId());
        d4.setSequence(4);
        shoppingGoodsCategoryList.add(d4);
 
        //插入数据库
        shoppingGoodsCategoryDao.batchInsert(shoppingGoodsCategoryList);
 
    }
 
 
}