Quellcode durchsuchen

feat:产品要素详情页展示

chenjianhua vor 2 Wochen
Ursprung
Commit
f13f9a03b1

+ 2 - 0
service-base/src/main/java/com/simuwang/base/mapper/daq/InvestmentManagerMapper.java

@@ -9,4 +9,6 @@ import org.apache.ibatis.annotations.Param;
 public interface InvestmentManagerMapper extends BaseMapper<InvestmentManagerDO> {
 
     void deleteByRegisterNumber(@Param("registerNumberList") List<String> registerNumberList);
+
+    List<InvestmentManagerDO> selectByRegisterNumber(@Param("registerNumber") String investmentManager);
 }

+ 2 - 0
service-base/src/main/java/com/simuwang/base/mapper/daq/ProductContractMapper.java

@@ -10,4 +10,6 @@ import org.apache.ibatis.annotations.Param;
 public interface ProductContractMapper extends BaseMapper<ProductContractDO> {
 
     ProductContractDO selectByNameAndRegisterNumber(@Param("registerNumber") String registerNumber, @Param("productName")String productName);
+
+    ProductContractDO selectByProductId(@Param("productId") Integer id);
 }

+ 2 - 0
service-base/src/main/java/com/simuwang/base/mapper/daq/ProductDerivativeMapper.java

@@ -10,4 +10,6 @@ import org.apache.ibatis.annotations.Param;
 public interface ProductDerivativeMapper extends BaseMapper<ProductDerivativeDO> {
 
     ProductDerivativeDO selectByNameAndRegisterNumber(@Param("registerNumber") String registerNumber, @Param("productName")String productName);
+
+    ProductDerivativeDO selectByProductId(@Param("productId") Integer id);
 }

+ 34 - 0
service-base/src/main/java/com/simuwang/base/pojo/vo/InvestmentManagerVO.java

@@ -0,0 +1,34 @@
+package com.simuwang.base.pojo.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class InvestmentManagerVO {
+
+    private Integer id;
+
+    private String registerNumber;
+
+    private String managerName;
+
+    private String startDate;
+
+    private String endDate;
+
+    private Integer isvalid;
+
+    private String createtime;
+
+    private String updatetime;
+
+    private Integer creatorid;
+
+    private Integer updaterid;
+
+}

+ 47 - 0
service-base/src/main/java/com/simuwang/base/pojo/vo/ProductContractVO.java

@@ -0,0 +1,47 @@
+package com.simuwang.base.pojo.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.Date;
+@Data
+public class ProductContractVO {
+    private Integer id;
+
+    private Integer productId;
+
+    private String registerNumber;
+
+    private String productName;
+
+    private String productContract;
+
+    private String performanceBasic;
+
+    private String accruedMethod;
+
+    private Integer isvalid;
+
+    private String createtime;
+
+    private String updatetime;
+
+    private Integer creatorid;
+
+    private Integer updaterid;
+
+    private String investmentScope;
+
+    private String investmentLimit;
+
+    private String investmentStrategy;
+
+    private String investmentMethod;
+
+    private String remark;
+
+
+}

+ 18 - 0
service-base/src/main/java/com/simuwang/base/pojo/vo/ProductDataVO.java

@@ -0,0 +1,18 @@
+package com.simuwang.base.pojo.vo;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class ProductDataVO {
+
+    private ProductInformationVO productInformationVO;
+
+    private List<InvestmentManagerVO> investmentManagerVOList;
+
+    private ProductContractVO productContractVO;
+
+    private ProductDerivativeVO productDerivativeVO;
+
+}

+ 56 - 0
service-base/src/main/java/com/simuwang/base/pojo/vo/ProductDerivativeVO.java

@@ -0,0 +1,56 @@
+package com.simuwang.base.pojo.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.Date;
+@Data
+public class ProductDerivativeVO {
+    private Integer id;
+
+    private Integer productId;
+
+    private String registerNumber;
+
+    private String productName;
+
+    private String distributeReport;
+
+    private String cumulativeNav;
+
+    private String productShare;
+
+    private String productAsset;
+
+    private String productValuation;
+
+    private String startDate;
+
+    private String investmentManagerDesc;
+
+    private String productCount;
+
+    private String manageAsset;
+
+    private String feeNote;
+
+    private String managementfeeTrust;
+
+    private String managementfeeBank;
+
+    private String outsourceFee;
+
+    private Integer isvalid;
+
+    private String createtime;
+
+    private String updatetime;
+
+    private Integer creatorid;
+
+    private Integer updaterid;
+
+}

+ 4 - 0
service-base/src/main/resources/mapper/daq/InvestmentManagerMapper.xml

@@ -97,4 +97,8 @@
         #{registerNumber}
       </foreach>
     </update>
+  <select id="selectByRegisterNumber" resultMap="BaseResultMap">
+    select <include refid="Base_Column_List"></include>
+    from investment_manager where isvalid=1 and register_number=#{registerNumber}
+  </select>
 </mapper>

+ 6 - 0
service-base/src/main/resources/mapper/daq/ProductContractMapper.xml

@@ -49,5 +49,11 @@
         order by createtime
         limit 1
     </select>
+    <select id="selectByProductId" resultMap="BaseResultMap">
+        select ID, PRODUCT_ID, REGISTER_NUMBER, PRODUCT_NAME, PRODUCT_CONTRACT, PERFORMANCE_BASIC,
+               INVESTMENT_SCOPE, INVESTMENT_LIMIT, INVESTMENT_STRATEGY, INVESTMENT_METHOD, REMARK,
+               ACCRUED_METHOD, ISVALID, CREATETIME, UPDATETIME, CREATORID, UPDATERID
+        from product_contract where isvalid=1 and product_id=#{productId}
+    </select>
 
 </mapper>

+ 5 - 1
service-base/src/main/resources/mapper/daq/ProductDerivativeMapper.xml

@@ -39,7 +39,7 @@
     PRODUCT_COUNT, MANAGE_ASSET, FEE_NOTE, MANAGEMENTFEE_TRUST, MANAGEMENTFEE_BANK, OUTSOURCE_FEE, 
     ISVALID, CREATETIME, UPDATETIME, CREATORID, UPDATERID
   </sql>
-    <select id="selectByNameAndRegisterNumber" resultType="com.simuwang.base.pojo.dos.ProductDerivativeDO">
+    <select id="selectByNameAndRegisterNumber" resultMap="BaseResultMap">
       select <include refid="Base_Column_List"></include>
       from product_derivative where isvalid=1
       <if test="registerNumber != '' and registerNumber != null">
@@ -57,5 +57,9 @@
       order by createtime
       limit 1
     </select>
+  <select id="selectByProductId"  resultMap="BaseResultMap">
+    select <include refid="Base_Column_List"></include>
+    from product_derivative where isvalid=1 and product_id=#{productId}
+  </select>
 
 </mapper>

+ 7 - 0
service-manage/src/main/java/com/simuwang/manage/api/product/ProductController.java

@@ -2,6 +2,7 @@ package com.simuwang.manage.api.product;
 
 import com.simuwang.base.common.support.MybatisPage;
 import com.simuwang.base.pojo.dto.query.ProductPageQuery;
+import com.simuwang.base.pojo.vo.IdVO;
 import com.simuwang.base.pojo.vo.ProductInformationVO;
 import com.simuwang.logging.SystemLog;
 import com.simuwang.manage.service.ProductService;
@@ -43,4 +44,10 @@ public class ProductController {
     public ResultVo uploadProduct(@RequestPart(value = "file") MultipartFile file) {
         return productService.uploadProduct(file);
     }
+
+    @SystemLog(value = "查询产品要素明细", type = SystemLog.Type.UPLOAD_OR_IMPORT)
+    @GetMapping("/detail")
+    public ResultVo productDetail( IdVO idVO) {
+        return productService.productDetail(idVO);
+    }
 }

+ 3 - 0
service-manage/src/main/java/com/simuwang/manage/service/ProductService.java

@@ -2,6 +2,7 @@ package com.simuwang.manage.service;
 
 import com.simuwang.base.common.support.MybatisPage;
 import com.simuwang.base.pojo.dto.query.ProductPageQuery;
+import com.simuwang.base.pojo.vo.IdVO;
 import com.simuwang.base.pojo.vo.ProductInformationVO;
 import com.smppw.common.pojo.ResultVo;
 import org.springframework.web.multipart.MultipartFile;
@@ -10,4 +11,6 @@ public interface ProductService {
     MybatisPage<ProductInformationVO> searchProductList(ProductPageQuery prductPageQuery);
 
     ResultVo uploadProduct(MultipartFile file);
+
+    ResultVo productDetail(IdVO idVO);
 }

+ 34 - 1
service-manage/src/main/java/com/simuwang/manage/service/impl/ProductServiceImpl.java

@@ -24,6 +24,7 @@ import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -82,6 +83,38 @@ public class ProductServiceImpl implements ProductService {
         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) {
         ProductUploadResult result = new ProductUploadResult();
         int productStartRow = 8;
@@ -138,7 +171,7 @@ public class ProductServiceImpl implements ProductService {
             successDataVOList.add(successDataVO);
         }
         List<String> registerNumberList = investmentManagerDOList.stream().map(InvestmentManagerDO::getRegisterNumber).collect(Collectors.toList());
-        if(StringUtil.isEmpty(registerNumberList)){
+        if(!registerNumberList.isEmpty()){
             investmentManagerMapper.deleteByRegisterNumber(registerNumberList);
         }
         try{