|
@@ -24,6 +24,7 @@ import org.apache.commons.io.FileUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -82,6 +83,38 @@ public class ProductServiceImpl implements ProductService {
|
|
return vo;
|
|
return vo;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public ResultVo productDetail(IdVO idVO) {
|
|
|
|
+ ProductDataVO productDataVO = new ProductDataVO();
|
|
|
|
+ ProductInformationDO productInformationDO = productInformationMapper.selectById(idVO.getId());
|
|
|
|
+ ProductInformationVO productInformationVO = new ProductInformationVO();
|
|
|
|
+ BeanUtils.copyProperties(productInformationDO,productInformationVO);
|
|
|
|
+ productDataVO.setProductInformationVO(productInformationVO);
|
|
|
|
+ ProductContractDO productContractDO = productContractMapper.selectByProductId(idVO.getId());
|
|
|
|
+ if(productContractDO!=null){
|
|
|
|
+ ProductContractVO productContractVO = new ProductContractVO();
|
|
|
|
+ BeanUtils.copyProperties(productContractDO,productContractVO);
|
|
|
|
+ productDataVO.setProductContractVO(productContractVO);
|
|
|
|
+ }
|
|
|
|
+ ProductDerivativeDO productDerivativeDO = productDerivativeMapper.selectByProductId(idVO.getId());
|
|
|
|
+ if(productDerivativeDO != null){
|
|
|
|
+ ProductDerivativeVO productDerivativeVO = new ProductDerivativeVO();
|
|
|
|
+ BeanUtils.copyProperties(productDerivativeDO,productDerivativeVO);
|
|
|
|
+ productDataVO.setProductDerivativeVO(productDerivativeVO);
|
|
|
|
+ }
|
|
|
|
+ List<InvestmentManagerDO> investmentManagerDOList = investmentManagerMapper.selectByRegisterNumber(productInformationDO.getRegisterNumber());
|
|
|
|
+ if(!investmentManagerDOList.isEmpty()){
|
|
|
|
+ List<InvestmentManagerVO> investmentManagerVOS = new ArrayList<>();
|
|
|
|
+ for (InvestmentManagerDO investmentManagerDO : investmentManagerDOList) {
|
|
|
|
+ InvestmentManagerVO investmentManagerVO = new InvestmentManagerVO();
|
|
|
|
+ BeanUtils.copyProperties(investmentManagerDO,investmentManagerVO);
|
|
|
|
+ investmentManagerVOS.add(investmentManagerVO);
|
|
|
|
+ }
|
|
|
|
+ productDataVO.setInvestmentManagerVOList(investmentManagerVOS);
|
|
|
|
+ }
|
|
|
|
+ return new ResultVo(ResultCode.SUCCESS,productDataVO);
|
|
|
|
+ }
|
|
|
|
+
|
|
private ProductUploadResult parseResult(ProductData productData) {
|
|
private ProductUploadResult parseResult(ProductData productData) {
|
|
ProductUploadResult result = new ProductUploadResult();
|
|
ProductUploadResult result = new ProductUploadResult();
|
|
int productStartRow = 8;
|
|
int productStartRow = 8;
|
|
@@ -138,7 +171,7 @@ public class ProductServiceImpl implements ProductService {
|
|
successDataVOList.add(successDataVO);
|
|
successDataVOList.add(successDataVO);
|
|
}
|
|
}
|
|
List<String> registerNumberList = investmentManagerDOList.stream().map(InvestmentManagerDO::getRegisterNumber).collect(Collectors.toList());
|
|
List<String> registerNumberList = investmentManagerDOList.stream().map(InvestmentManagerDO::getRegisterNumber).collect(Collectors.toList());
|
|
- if(StringUtil.isEmpty(registerNumberList)){
|
|
|
|
|
|
+ if(!registerNumberList.isEmpty()){
|
|
investmentManagerMapper.deleteByRegisterNumber(registerNumberList);
|
|
investmentManagerMapper.deleteByRegisterNumber(registerNumberList);
|
|
}
|
|
}
|
|
try{
|
|
try{
|