|
@@ -28,6 +28,7 @@ import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import java.io.File;
|
|
@@ -156,6 +157,23 @@ public class ProductServiceImpl implements ProductService {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public ResultVo removeProduct(List<Integer> idList) {
|
|
|
+ ResultVo vo = new ResultVo(ResultCode.DELETE_SUCCESS);
|
|
|
+ vo.setData(true);
|
|
|
+ vo.setMsg(ResultCode.DELETE_SUCCESS.getMsg());
|
|
|
+ Integer userId = UserUtils.getLoginUser().getUserId();
|
|
|
+ List<ProductInformationDO> productInformationDOList = productInformationMapper.selectByIdList(idList);
|
|
|
+ for (ProductInformationDO productInformationDO : productInformationDOList) {
|
|
|
+ productInformationMapper.deleteByProductId(productInformationDO.getId(),userId);
|
|
|
+ productContractMapper.deleteByProductId(productInformationDO.getId(),userId);
|
|
|
+ productDerivativeMapper.deleteByProductId(productInformationDO.getId(),userId);
|
|
|
+ investmentManagerMapper.deleteByRegisterNumber(List.of(productInformationDO.getRegisterNumber()));
|
|
|
+ }
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
+
|
|
|
private ProductUploadResult parseResult(ProductData productData) {
|
|
|
ProductUploadResult result = new ProductUploadResult();
|
|
|
int productStartRow = 8;
|