From f4a0f2acc63d7785eab108419a4e16f5f688cb95 Mon Sep 17 00:00:00 2001 From: yujian <yujian@163.com> Date: 星期六, 18 一月 2020 12:06:27 +0800 Subject: [PATCH] 用户注册信息 --- fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialCardServiceImpl.java | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialCardServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialCardServiceImpl.java index b3437e9..da79d8d 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialCardServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialCardServiceImpl.java @@ -7,21 +7,21 @@ import java.util.UUID; import javax.annotation.Resource; -import javax.transaction.Transactional; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; import org.yeshi.utils.tencentcloud.COSManager; import com.yeshi.fanli.dao.mybatis.homemodule.SpecialCardMapper; import com.yeshi.fanli.entity.bus.homemodule.SpecialCard; import com.yeshi.fanli.entity.bus.homemodule.SpecialPlace; -import com.yeshi.fanli.exception.FloatADException; import com.yeshi.fanli.exception.homemodule.SpecialCardException; import com.yeshi.fanli.service.inter.config.BusinessSystemService; import com.yeshi.fanli.service.inter.homemodule.SpecialCardService; import com.yeshi.fanli.service.inter.homemodule.SpecialPlaceService; import com.yeshi.fanli.service.inter.homemodule.SpecialService; +import com.yeshi.fanli.util.FilePathEnum; @Service @@ -79,7 +79,14 @@ // 淇敼 SpecialCard resultObj = specialCardMapper.selectByPrimaryKey(id); if (resultObj == null) { - throw new FloatADException(1, "淇敼鍐呭宸蹭笉瀛樺湪"); + throw new SpecialCardException(1, "淇敼鍐呭宸蹭笉瀛樺湪"); + } + + // 鍒犻櫎鍥剧墖 + Boolean delPicture = record.getDelPicture(); + if (delPicture != null && delPicture) { + removePicture(resultObj.getBottomPicture()); + resultObj.setBottomPicture(null); } if (picture != null && picture.trim().length() > 0) { @@ -143,7 +150,7 @@ String type = contentType.substring(contentType.indexOf("/") + 1); // 鏂囦欢璺緞 - String filePath="/img/SpecialCard/"+UUID.randomUUID().toString().replace("-", "") + "." + type; + String filePath=FilePathEnum.specialCard.getPath() +UUID.randomUUID().toString().replace("-", "") + "." + type; // 鎵ц涓婁紶 String fileLink= COSManager.getInstance().uploadFile(inputStream, filePath).getUrl(); @@ -163,7 +170,7 @@ @Override - @Transactional + @Transactional(rollbackFor=Exception.class) public int deleteBatchByPrimaryKey(List<Long> list) throws Exception{ specialService.deleteBatchByCardID(list); return specialCardMapper.deleteBatchByPrimaryKey(list); @@ -178,7 +185,7 @@ } for (SpecialCard specialCard: listObj) { - long totalSpecial= specialService.countlistQueryByCard(specialCard.getId(), null); + long totalSpecial= specialService.countlistQueryByCard(specialCard.getId(), null, null); specialCard.setTotalSpecial(totalSpecial); Date startTime = specialCard.getStartTime(); -- Gitblit v1.8.0