| | |
| | | import com.yeshi.fanli.service.inter.goods.GoodsClassService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.HomeNavbarService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperBannerService;
|
| | | import com.yeshi.fanli.util.FilePathEnum;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | |
|
| | |
| | | picture = uploadPicture(file);
|
| | | }
|
| | |
|
| | | Boolean isDefault = record.getIsDefault();
|
| | | if (isDefault == null) {
|
| | | record.setIsDefault(false);
|
| | | }
|
| | | |
| | | Boolean isFixed = record.getIsFixed();
|
| | | if (isFixed == null) {
|
| | | record.setIsFixed(false);
|
| | | }
|
| | | |
| | | Long id = record.getId();
|
| | | if (id == null) {
|
| | | record.setPicture(picture);
|
| | |
| | | String type = contentType.substring(contentType.indexOf("/") + 1);
|
| | |
|
| | | // 文件路径
|
| | | String filePath="/img/HomeNavbar/"+UUID.randomUUID().toString().replace("-", "") + "." + type;
|
| | | String filePath= FilePathEnum.homeNavbar.getPath() +UUID.randomUUID().toString().replace("-", "") + "." + type;
|
| | | // 执行上传
|
| | | String fileLink= COSManager.getInstance().uploadFile(inputStream, filePath).getUrl();
|
| | |
|
| | |
| | |
|
| | | HomeNavbar changeObj = null;
|
| | | if (GoodsClass.SEX_ALL == sex || GoodsClass.SEX_DEFAULT == sex) {
|
| | | changeObj = homeNavbarMapper.getDefaultChangeOrder(moveType, resultObj.getOrderby());
|
| | | Integer orderby = resultObj.getOrderby();
|
| | | changeObj = homeNavbarMapper.getDefaultChangeOrder(moveType, orderby);
|
| | | if (changeObj == null ) {
|
| | | throw new HomeNavbarException(1, "已经在最边缘,无可交换的位置");
|
| | | }
|
| | | resultObj.setOrderby(changeObj.getOrderby());
|
| | | changeObj.setOrderby(resultObj.getOrderby());
|
| | | changeObj.setOrderby(orderby);
|
| | | } else if (GoodsClass.SEX_MAN == sex) {
|
| | | changeObj = homeNavbarMapper.getManChangeOrder(moveType, resultObj.getOrderMan());
|
| | | Integer orderMan = resultObj.getOrderMan();
|
| | | changeObj = homeNavbarMapper.getManChangeOrder(moveType, orderMan);
|
| | | if (changeObj == null ) {
|
| | | throw new HomeNavbarException(1, "已经在最边缘,无可交换的位置");
|
| | | }
|
| | | resultObj.setOrderMan(changeObj.getOrderMan());
|
| | | changeObj.setOrderMan( resultObj.getOrderMan());
|
| | | changeObj.setOrderMan(orderMan);
|
| | | } else if (GoodsClass.SEX_WOMAN == sex) {
|
| | | changeObj = homeNavbarMapper.getWomanChangeOrder(moveType, resultObj.getOrderWoman());
|
| | | Integer orderWoman = resultObj.getOrderWoman();
|
| | | changeObj = homeNavbarMapper.getWomanChangeOrder(moveType, orderWoman);
|
| | | if (changeObj == null ) {
|
| | | throw new HomeNavbarException(1, "已经在最边缘,无可交换的位置");
|
| | | }
|
| | | resultObj.setOrderWoman(changeObj.getOrderWoman());
|
| | | changeObj.setOrderWoman( resultObj.getOrderWoman());
|
| | | changeObj.setOrderWoman(orderWoman);
|
| | | }
|
| | |
|
| | | if (changeObj == null ) {
|