| | |
| | | state = 0;
|
| | | record.setState(state);
|
| | | }
|
| | | // 图片上传
|
| | | |
| | | |
| | | String picture = null;
|
| | | if (file != null) {
|
| | | try {
|
| | | try { // 图片上传
|
| | | picture = uploadPicture(file);
|
| | | } catch (Exception e) {
|
| | | throw new BrandInfoException(1, "图片上传失败");
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | String searchKey = record.getSearchKey();
|
| | | if (!StringUtil.isNullOrEmpty(searchKey)) {
|
| | | if (StringUtil.isNullOrEmpty(record.getSearchKeyJD()))
|
| | | record.setSearchKeyJD(searchKey);
|
| | | |
| | | if (StringUtil.isNullOrEmpty(record.getSearchKeyPDD()))
|
| | | record.setSearchKeyPDD(searchKey);
|
| | | }
|
| | | |
| | | String shopKey = record.getShopKey();
|
| | | if (!StringUtil.isNullOrEmpty(shopKey)) {
|
| | | if (StringUtil.isNullOrEmpty(record.getShopKeyJD()))
|
| | | record.setShopKeyJD(shopKey);
|
| | | |
| | | if (StringUtil.isNullOrEmpty(record.getShopKeyPDD()))
|
| | | record.setShopKeyPDD(shopKey);
|
| | | }
|
| | | record.setName(name.trim());
|
| | | record.setUpdateTime(new Date());
|
| | | |
| | | Long id = record.getId();
|
| | | if (id == null) {
|
| | | record.setCreateTime(new Date());
|
| | | record.setIcon(picture);
|
| | | record.setWeight(500.00);
|
| | | record.setGoodsTotal(0);
|
| | | record.setShopTotal(0);
|
| | | record.setUpdateTime(new Date());
|
| | | record.setCreateTime(new Date());
|
| | | brandInfoMapper.insert(record);
|
| | |
|
| | | BrandInfo resultObj = new BrandInfo();
|
| | | resultObj.setId(record.getId());
|
| | | resultObj.setOrder(Integer.valueOf(record.getId().toString()));
|
| | | resultObj.setWeight(500.00);
|
| | | brandInfoMapper.updateByPrimaryKeySelective(resultObj);
|
| | | } else {
|
| | | BrandInfo resultObj = brandInfoMapper.selectByPrimaryKey(id);
|
| | |
| | | record.setGoodsTotal(resultObj.getGoodsTotal());
|
| | | record.setShopTotal(resultObj.getShopTotal());
|
| | | }
|
| | | |
| | | record.setOrder(resultObj.getOrder());
|
| | | record.setWeight(resultObj.getWeight());
|
| | | record.setCreateTime(resultObj.getCreateTime());
|
| | | record.setUpdateTime(new Date());
|
| | | brandInfoMapper.updateByPrimaryKey(record);
|
| | |
|
| | | if (state == 0){
|