| | |
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsSubClass;
|
| | | import com.yeshi.fanli.entity.bus.su.clazz.SuperGoodsClass;
|
| | | import com.yeshi.fanli.entity.system.System;
|
| | | import com.yeshi.fanli.service.inter.config.SystemService;
|
| | | import com.yeshi.fanli.service.inter.goods.ClassRecommendGoodsService;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService;
|
| | | import com.yeshi.fanli.service.inter.goods.GoodsClassService;
|
| | | import com.yeshi.fanli.service.inter.goods.GoodsSecondClassService;
|
| | | import com.yeshi.fanli.service.inter.goods.GoodsSubClassService;
|
| | |
| | | private GoodsClassDao goodsClassDao;
|
| | |
|
| | | @Resource
|
| | | private SystemService systemService;
|
| | | private BusinessSystemService businessSystemService;
|
| | |
|
| | | @Resource
|
| | | private SuperGoodsClassService superGoodsClassService;
|
| | |
|
| | | @Resource
|
| | | private ClassRecommendGoodsService classRecommendGoodsService;
|
| | |
|
| | | @Resource
|
| | | private GoodsSecondClassService goodsSecondClassService;
|
| | |
| | | public List<GoodsClassAdmin> getGoodsClassAdmins(int index, String platform, String packages, String key) {
|
| | | final int strat = index * Constant.PAGE_SIZE;
|
| | | platform = Utils.getMap().get(platform);
|
| | | com.yeshi.fanli.entity.system.System system = systemService.getSystem(platform, packages);
|
| | | BusinessSystem system = businessSystemService.getBusinessSystem(platform, packages);
|
| | | List<GoodsClass> GoodsClassList = null;
|
| | | List<SuperGoodsClass> superGoodsClassList = null;
|
| | | Map<Long, GoodsClassAdmin> goodsClassAdminMap = new HashMap<Long, GoodsClassAdmin>();
|
| | |
| | | gcIdList.add(rs.getId());
|
| | | }
|
| | | superGoodsClassList = superGoodsClassService.getSuperGoodsClasss(gcIdList);
|
| | | Map<Long, List<System>> superMap = new HashMap<Long, List<System>>();
|
| | | Map<Long, List<BusinessSystem>> superMap = new HashMap<Long, List<BusinessSystem>>();
|
| | | Long rsId = null;
|
| | | List<System> systemList = null;
|
| | | List<BusinessSystem> systemList = null;
|
| | | for (SuperGoodsClass srs : superGoodsClassList) {
|
| | | rsId = srs.getGoodsClass().getId();
|
| | | systemList = superMap.get(rsId);
|
| | | if (systemList == null) {
|
| | | systemList = new ArrayList<System>();
|
| | | systemList = new ArrayList<BusinessSystem>();
|
| | | }
|
| | | systemList.add(srs.getSystem());
|
| | | superMap.put(rsId, systemList);
|
| | |
| | | if (rsa == null) {
|
| | | rsa = new GoodsClassAdmin();
|
| | | }
|
| | | List<System> list = superMap.get(id);
|
| | | List<BusinessSystem> list = superMap.get(id);
|
| | | if (list != null) {
|
| | | rsa.getSystemList().addAll(superMap.get(id));
|
| | | }
|
| | |
| | |
|
| | | public int getCount(String platform, String packages, final String key) {
|
| | | platform = Utils.getMap().get(platform);
|
| | | final System system = systemService.getSystem(platform, packages);
|
| | | final BusinessSystem system = businessSystemService.getBusinessSystem(platform, packages);
|
| | | return (Integer) goodsClassDao.excute(new HibernateCallback<Integer>() {
|
| | |
|
| | | public Integer doInHibernate(Session session) throws HibernateException {
|
| | |
| | | public void deleteGoodsClasss(long[] gcids) {
|
| | | for (long id : gcids) {
|
| | | superGoodsClassService.deleteSuperGoodsClass(id);
|
| | | classRecommendGoodsService.deleteClassGoodsByGC(id);
|
| | | goodsSecondClassService.deleteSecondClassByGC(id);
|
| | | goodsClassDao.delete(new GoodsClass(id));
|
| | | }
|
| | |
| | | @Override
|
| | | public List<GoodsClass> queryAll(String platform, String packages) throws Exception{
|
| | |
|
| | | List<System> defultList = systemService.getSystems();
|
| | | List<BusinessSystem> defultList = businessSystemService.getBusinessSystems();
|
| | |
|
| | | platform = Utils.getMap().get(platform);
|
| | | com.yeshi.fanli.entity.system.System system = systemService.getSystem(platform, packages);
|
| | | BusinessSystem system = businessSystemService.getBusinessSystem(platform, packages);
|
| | |
|
| | | List<GoodsClass> goodsClassList = new ArrayList<GoodsClass>();
|
| | | List<SuperGoodsClass> superGoodsClassList = null;
|
| | |
| | | long rsId = srs.getGoodsClass().getId();
|
| | |
|
| | | if (gclass.getId() == rsId) {
|
| | | System gsystem = srs.getSystem();
|
| | | BusinessSystem gsystem = srs.getSystem();
|
| | | gList.add(gsystem.getId());
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | List<System> newList = new ArrayList<System>();
|
| | | List<BusinessSystem> newList = new ArrayList<BusinessSystem>();
|
| | | // 是否有关联系统选项
|
| | | for (System dsystem : defultList) {
|
| | | for (BusinessSystem dsystem : defultList) {
|
| | |
|
| | | System newsystem = new System();
|
| | | BusinessSystem newsystem = new BusinessSystem();
|
| | |
|
| | | PropertyUtils.copyProperties(newsystem, dsystem);
|
| | | newsystem.setCheck(0);
|