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); 
 | 
  
 | 
    } 
 | 
  
 | 
  
 | 
} 
 |