| | |
| | | import com.yeshi.fanli.dao.mybatis.GoodsClassMapper;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsSubClass;
|
| | | import com.yeshi.fanli.entity.bus.clazz.TaoBaoClass;
|
| | | import com.yeshi.fanli.exception.GoodsClassException;
|
| | | import com.yeshi.fanli.service.inter.goods.GoodsClassService;
|
| | | import com.yeshi.fanli.service.inter.goods.GoodsSubClassService;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoClassService;
|
| | | import com.yeshi.fanli.service.inter.lable.LabelClassService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | |
| | | @Resource
|
| | | private LabelClassService labelClassService;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoClassService taoBaoClassService;
|
| | | |
| | |
|
| | | public GoodsClass getGoodsClass(long id) {
|
| | | return goodsClassMapper.selectByPrimaryKey(id);
|
| | |
| | | // 标签
|
| | | int countlabel = labelClassService.getCountQueryByClassId(gclass.getId());
|
| | | gclass.setCountlabel(countlabel);
|
| | | |
| | | |
| | | List<TaoBaoClass> listTB = taoBaoClassService.listBySystemCid(0, Integer.MAX_VALUE, gclass.getId());
|
| | | if (listTB == null || listTB.size() == 0) {
|
| | | gclass.setTaobaoCids("");
|
| | | } else {
|
| | | String taobaoCids = ""; |
| | | for (TaoBaoClass taoBaoClass: listTB) {
|
| | | taobaoCids = taobaoCids + taoBaoClass.getCategoryName() + "-" + taoBaoClass.getCategoryId() + ",";
|
| | | }
|
| | | |
| | | if (!StringUtil.isNullOrEmpty(taobaoCids)){
|
| | | taobaoCids = taobaoCids.substring(0, taobaoCids.length()-1);
|
| | | } |
| | | gclass.setTaobaoCids(taobaoCids);
|
| | | }
|
| | | |
| | | }
|
| | | return list;
|
| | | }
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | public void saveObject(MultipartFile file, GoodsClass record) throws GoodsClassException, Exception{
|
| | |
|
| | | String name = record.getName();
|
| | |
| | | } else if (!StringUtil.isJson(params)) {
|
| | | throw new GoodsClassException(1, "筛选条件非JSON格式");
|
| | | }
|
| | | |
| | |
|
| | |
|
| | | Long id = record.getId();
|
| | |
| | | record.setCreatetime(resultObj.getCreatetime());
|
| | | goodsClassMapper.updateByPrimaryKey(record);
|
| | | }
|
| | | |
| | | // 保存淘宝商品分类id
|
| | | String taobaoCids = record.getTaobaoCids();
|
| | | if (!StringUtil.isNullOrEmpty(taobaoCids) && !"null".equalsIgnoreCase(taobaoCids)) {
|
| | | taoBaoClassService.save(record.getId(), taobaoCids);
|
| | | }
|
| | | }
|
| | |
|
| | |
|