| | |
| | | if (StringUtil.isNullOrEmpty(name))
|
| | | throw new BrandInfoException(1, "名称不能为空");
|
| | |
|
| | | String shopKey = record.getShopKey();
|
| | | if (StringUtil.isNullOrEmpty(shopKey))
|
| | | record.setShopKey(name);
|
| | | |
| | | String searchKey = record.getSearchKey();
|
| | | if (StringUtil.isNullOrEmpty(searchKey))
|
| | | record.setSearchKey(name);
|
| | |
| | |
|
| | | if (picture != null && picture.trim().length() > 0) {
|
| | | // 删除老图
|
| | | if (picture != null && picture.trim().length() > 0 && !Constant.IS_TEST) {
|
| | | COSManager.getInstance().deleteFile(picture);
|
| | | if (resultObj.getIcon() != null && resultObj.getIcon().trim().length() > 0 && !Constant.IS_TEST) {
|
| | | COSManager.getInstance().deleteFile(resultObj.getIcon());
|
| | | };
|
| | | // 存储新图
|
| | | record.setIcon(picture);
|
| | | } else {
|
| | | record.setIcon(resultObj.getIcon());
|
| | | }
|
| | | |
| | | record.setGoodsTotal(resultObj.getGoodsTotal());
|
| | | if (state == 0){
|
| | | record.setGoodsTotal(0);
|
| | | } else {
|
| | | record.setGoodsTotal(resultObj.getGoodsTotal());
|
| | | }
|
| | | record.setCreateTime(resultObj.getCreateTime());
|
| | | record.setUpdateTime(new Date());
|
| | | brandInfoMapper.updateByPrimaryKey(record);
|
| | |
| | | if (count == 0)
|
| | | return;
|
| | |
|
| | | for (int page = 1; page < (count / 100) + 1; page++) {
|
| | | updateTotalGoods((page - 1) * 100, 100);
|
| | | for (int page = 0; page < (count / 100) + 1; page++) {
|
| | | updateTotalGoods(page * 100, 100);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return brandInfoMapper.listValidByCidToApp(cid);
|
| | | }
|
| | |
|
| | | @Cacheable(value = "brandCache", key = "'listValidToApp-'+#start+'-'+#start +'-'+#cid")
|
| | | // @Cacheable(value = "brandCache", key = "'listValidToApp-'+#start+'-'+#start +'-'+#cid")
|
| | | @Override
|
| | | public List<BrandInfoVO> listValidToApp(long start, int count, Long cid) {
|
| | | List<BrandInfoVO> list = brandInfoMapper.listBrandInfoVO(start, count, cid);
|