Commit 5a3359ef authored by 张亚辉's avatar 张亚辉

无净值基金

parent ad25b855
package com.tanpu.fund.api;
import com.tanpu.common.model.fund.req.FundNoNavReq;
import com.tanpu.common.model.fund.resq.FundNoNavResp;
import com.tanpu.common.resp.CommonResp;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
/**
* @author zyh
* @description 无净值产品
*/
public interface IfaFundApi {
@ApiOperation("新增无净值产品")
@PostMapping("/fundnonav/ifa/add")
CommonResp fundnonavAdd(@RequestBody FundNoNavReq req);
@ApiOperation("编辑无净值产品")
@PostMapping("/fundnonav/ifa/edit")
CommonResp fundnonavEdit(@RequestBody FundNoNavReq req);
@ApiOperation("查询无净值产品详情")
@GetMapping("/fundnonav/ifa/detail")
CommonResp<FundNoNavResp> fundnonavDetail(@RequestParam("id") String id);
}
package com.tanpu.fund.controller;
import com.tanpu.common.auth.mapping.TanpuInterfaceLoginAuth;
import com.tanpu.common.model.fund.req.FundNoNavReq;
import com.tanpu.common.model.fund.resq.FundNoNavResp;
import com.tanpu.common.resp.CommonResp;
import com.tanpu.fund.api.IfaFundApi;
import com.tanpu.fund.service.IfaFundService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @author: zyh
* @date: 2021-03-13 2:44 下午
* @description:
*/
@RestController
public class IfaFundController implements IfaFundApi {
@Resource
private IfaFundService ifaFundService;
@TanpuInterfaceLoginAuth
@Override
public CommonResp fundnonavAdd(FundNoNavReq req) {
if (StringUtils.isEmpty(req.getFundName())) {
return CommonResp.error(CommonResp.PARAMETER_INVALID_STATUS_CODE, CommonResp.PARAMETER_INVALID_MESSAGE);
}
this.ifaFundService.fundnonavAdd(req);
return CommonResp.success();
}
@TanpuInterfaceLoginAuth
@Override
public CommonResp fundnonavEdit(FundNoNavReq req) {
if (StringUtils.isEmpty(req.getId()) || StringUtils.isEmpty(req.getFundName())) {
return CommonResp.error(CommonResp.PARAMETER_INVALID_STATUS_CODE, CommonResp.PARAMETER_INVALID_MESSAGE);
}
this.ifaFundService.fundnonavEdit(req);
return CommonResp.success();
}
@Override
public CommonResp<FundNoNavResp> fundnonavDetail(String id) {
if (StringUtils.isEmpty(id)) {
return CommonResp.error(CommonResp.PARAMETER_INVALID_STATUS_CODE, CommonResp.PARAMETER_INVALID_MESSAGE);
}
return CommonResp.success(this.ifaFundService.fundnonavDetail(id));
}
}
package com.tanpu.fund.entity.generator; package com.tanpu.fund.entity.generator;
import java.math.BigDecimal;
import java.util.Date;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.Date;
@Data @Data
@Builder @Builder
@AllArgsConstructor @AllArgsConstructor
...@@ -96,6 +97,8 @@ public class IfaImportedFundInfo { ...@@ -96,6 +97,8 @@ public class IfaImportedFundInfo {
*/ */
private String ifaId; private String ifaId;
private Integer hasNav;
private Date createTime; private Date createTime;
private String createBy; private String createBy;
...@@ -105,4 +108,39 @@ public class IfaImportedFundInfo { ...@@ -105,4 +108,39 @@ public class IfaImportedFundInfo {
private String updateBy; private String updateBy;
private Integer deleteTag; private Integer deleteTag;
}
\ No newline at end of file /**
* 净值更新周期
*/
private Integer navFrequency;
/**
* 机构id
*/
private String orgId;
/**
* 募集开始时间
*/
private Date raiseStarttime;
/**
* 募集结束时间
*/
private Date raiseEndtime;
/**
* 产品类型 0:无净值产品 1:有净值产品
*/
private Integer proSubType;
/**
* 产品摘要
*/
private String proAbstract;
/**
* 产品详情
*/
private String proInfoDesc;
}
package com.tanpu.fund.feign.user; package com.tanpu.fund.feign.user;
import com.tanpu.common.model.file.req.FileQueryReq;
import com.tanpu.common.model.file.req.FileSaveReq;
import com.tanpu.common.model.file.resp.FileQueryResp;
import com.tanpu.common.model.product.resp.ProductLabel; import com.tanpu.common.model.product.resp.ProductLabel;
import com.tanpu.common.model.product.resp.UserInfoVo; import com.tanpu.common.model.product.resp.UserInfoVo;
import com.tanpu.common.model.user.resp.ColumnVO; import com.tanpu.common.model.user.resp.ColumnVO;
...@@ -10,6 +13,7 @@ import io.swagger.annotations.ApiOperation; ...@@ -10,6 +13,7 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import javax.validation.Valid; import javax.validation.Valid;
...@@ -39,4 +43,11 @@ public interface FeignClientForFatools { ...@@ -39,4 +43,11 @@ public interface FeignClientForFatools {
@GetMapping("/batch/get/label") @GetMapping("/batch/get/label")
CommonResp<Map<String, List<ProductLabel>>> batchGetLabelByIdInfo(@RequestParam("list")@Valid @NotEmpty List<String> list); CommonResp<Map<String, List<ProductLabel>>> batchGetLabelByIdInfo(@RequestParam("list")@Valid @NotEmpty List<String> list);
@ApiOperation(value = "保存关联附件")
@PostMapping(value = "/file/save", produces = {"application/json"})
CommonResp fileSave(@RequestBody FileSaveReq req);
@ApiOperation(value = "查询附件")
@GetMapping(value = "/file/query", produces = {"application/json"})
CommonResp<List<FileQueryResp>> fileQuery(@RequestBody FileQueryReq req);
} }
package com.tanpu.fund.feign.user; package com.tanpu.fund.feign.user;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.tanpu.common.model.file.req.FileQueryReq;
import com.tanpu.common.model.file.req.FileSaveReq;
import com.tanpu.common.model.file.resp.FileQueryResp;
import com.tanpu.common.model.product.resp.ProductLabel; import com.tanpu.common.model.product.resp.ProductLabel;
import com.tanpu.common.model.product.resp.UserInfoVo; import com.tanpu.common.model.product.resp.UserInfoVo;
import com.tanpu.common.model.user.resp.ColumnVO; import com.tanpu.common.model.user.resp.ColumnVO;
...@@ -57,6 +60,20 @@ public class FeignbackForFatools implements FallbackFactory<FeignClientForFatool ...@@ -57,6 +60,20 @@ public class FeignbackForFatools implements FallbackFactory<FeignClientForFatool
log.error("FeignClientForUser.getColumnInfo 查询栏目失败 id:{}", JSON.toJSONString(list)); log.error("FeignClientForUser.getColumnInfo 查询栏目失败 id:{}", JSON.toJSONString(list));
return null; return null;
} }
@Override
public CommonResp fileSave(FileSaveReq req) {
log.error("请求信息", throwable);
log.error("FeignClientForUser.fileSave 查询栏目失败 id:{}", JSON.toJSONString(req));
return null;
}
@Override
public CommonResp<List<FileQueryResp>> fileQuery(FileQueryReq req) {
log.error("请求信息", throwable);
log.error("FeignClientForUser.fileQuery 查询栏目失败 id:{}", JSON.toJSONString(req));
return null;
}
}; };
} }
......
...@@ -2,10 +2,11 @@ package com.tanpu.fund.mapper.generator; ...@@ -2,10 +2,11 @@ package com.tanpu.fund.mapper.generator;
import com.tanpu.fund.entity.generator.IfaImportedFundInfo; import com.tanpu.fund.entity.generator.IfaImportedFundInfo;
import com.tanpu.fund.entity.generator.IfaImportedFundInfoExample; import com.tanpu.fund.entity.generator.IfaImportedFundInfoExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper @Mapper
public interface IfaImportedFundInfoMapper { public interface IfaImportedFundInfoMapper {
long countByExample(IfaImportedFundInfoExample example); long countByExample(IfaImportedFundInfoExample example);
...@@ -32,6 +33,8 @@ public interface IfaImportedFundInfoMapper { ...@@ -32,6 +33,8 @@ public interface IfaImportedFundInfoMapper {
int insertOrUpdateSelective(IfaImportedFundInfo record); int insertOrUpdateSelective(IfaImportedFundInfo record);
int insertOrUpdateWithBLOBs(IfaImportedFundInfo record);
/** /**
* insert record to table selective * insert record to table selective
* *
...@@ -40,6 +43,8 @@ public interface IfaImportedFundInfoMapper { ...@@ -40,6 +43,8 @@ public interface IfaImportedFundInfoMapper {
*/ */
int insertSelective(IfaImportedFundInfo record); int insertSelective(IfaImportedFundInfo record);
List<IfaImportedFundInfo> selectByExampleWithBLOBs(IfaImportedFundInfoExample example);
List<IfaImportedFundInfo> selectByExample(IfaImportedFundInfoExample example); List<IfaImportedFundInfo> selectByExample(IfaImportedFundInfoExample example);
/** /**
...@@ -52,6 +57,8 @@ public interface IfaImportedFundInfoMapper { ...@@ -52,6 +57,8 @@ public interface IfaImportedFundInfoMapper {
int updateByExampleSelective(@Param("record") IfaImportedFundInfo record, @Param("example") IfaImportedFundInfoExample example); int updateByExampleSelective(@Param("record") IfaImportedFundInfo record, @Param("example") IfaImportedFundInfoExample example);
int updateByExampleWithBLOBs(@Param("record") IfaImportedFundInfo record, @Param("example") IfaImportedFundInfoExample example);
int updateByExample(@Param("record") IfaImportedFundInfo record, @Param("example") IfaImportedFundInfoExample example); int updateByExample(@Param("record") IfaImportedFundInfo record, @Param("example") IfaImportedFundInfoExample example);
/** /**
...@@ -62,6 +69,8 @@ public interface IfaImportedFundInfoMapper { ...@@ -62,6 +69,8 @@ public interface IfaImportedFundInfoMapper {
*/ */
int updateByPrimaryKeySelective(IfaImportedFundInfo record); int updateByPrimaryKeySelective(IfaImportedFundInfo record);
int updateByPrimaryKeyWithBLOBs(IfaImportedFundInfo record);
/** /**
* update record * update record
* *
...@@ -73,4 +82,4 @@ public interface IfaImportedFundInfoMapper { ...@@ -73,4 +82,4 @@ public interface IfaImportedFundInfoMapper {
int updateBatch(List<IfaImportedFundInfo> list); int updateBatch(List<IfaImportedFundInfo> list);
int batchInsert(@Param("list") List<IfaImportedFundInfo> list); int batchInsert(@Param("list") List<IfaImportedFundInfo> list);
} }
\ No newline at end of file
package com.tanpu.fund.service;
import com.tanpu.common.model.fund.req.FundNoNavReq;
import com.tanpu.common.model.fund.resq.FundNoNavResp;
/**
* @author: zyh
* @date: 2021-03-13 2:45 下午
* @description:
*/
public interface IfaFundService {
void fundnonavAdd(FundNoNavReq req);
void fundnonavEdit(FundNoNavReq req);
FundNoNavResp fundnonavDetail(String id);
}
package com.tanpu.fund.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.tanpu.common.auth.UserInfoThreadLocalHolder;
import com.tanpu.common.enums.BizEnums;
import com.tanpu.common.enums.FileTypeEnums;
import com.tanpu.common.model.file.req.FileQueryReq;
import com.tanpu.common.model.file.req.FileSaveReq;
import com.tanpu.common.model.file.resp.FileQueryResp;
import com.tanpu.common.model.fund.req.FundNoNavReq;
import com.tanpu.common.model.fund.resq.FundNoNavResp;
import com.tanpu.common.resp.CommonResp;
import com.tanpu.common.utils.SnowFlakeUtil;
import com.tanpu.fund.entity.generator.IfaImportedFundInfo;
import com.tanpu.fund.feign.user.FeignClientForFatools;
import com.tanpu.fund.mapper.generator.IfaImportedFundInfoMapper;
import com.tanpu.fund.service.IfaFundService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
* @author: zyh
* @date: 2021-03-13 2:46 下午
* @description:
*/
@Service
public class IfaFundServieImpl implements IfaFundService {
@Resource
private SnowFlakeUtil snowFlakeUtil;
@Resource
private IfaImportedFundInfoMapper ifaImportedFundInfoMapper;
@Resource
private FeignClientForFatools feignClientForFatools;
@Override
public void fundnonavAdd(FundNoNavReq req) {
IfaImportedFundInfo p = new IfaImportedFundInfo();
BeanUtils.copyProperties(req, p);
p.setId(snowFlakeUtil.uniqueLong());
p.setRaiseStarttime(req.getRaiseStarttime());
p.setRaiseEndtime(req.getRaiseEndtime());
p.setIfaId(UserInfoThreadLocalHolder.getserInfo().getId());
p.setCreateBy(UserInfoThreadLocalHolder.getserInfo().getId());
p.setCreateTime(new Date());
p.setDeleteTag(BizEnums.DeleteTag.tag_init);
ifaImportedFundInfoMapper.insertSelective(p);
//保存附件
if (CollectionUtil.isNotEmpty(req.getProInfoDescPics())) {
feignClientForFatools.fileSave(FileSaveReq.builder().refId(p.getId()).fileIds(req.getProInfoDescPics()).build());
}
if (CollectionUtil.isNotEmpty(req.getProFileDatas())) {
feignClientForFatools.fileSave(FileSaveReq.builder().refId(p.getId()).fileIds(req.getProFileDatas()).build());
}
}
@Override
public void fundnonavEdit(FundNoNavReq req) {
IfaImportedFundInfo p = new IfaImportedFundInfo();
BeanUtils.copyProperties(req, p);
p.setRaiseStarttime(req.getRaiseStarttime());
p.setRaiseEndtime(req.getRaiseEndtime());
p.setIfaId(UserInfoThreadLocalHolder.getserInfo().getId());
p.setUpdateBy(UserInfoThreadLocalHolder.getserInfo().getId());
p.setUpdateTime(new Date());
p.setDeleteTag(BizEnums.DeleteTag.tag_init);
ifaImportedFundInfoMapper.updateByPrimaryKey(p);
//保存附件
if (CollectionUtil.isNotEmpty(req.getProInfoDescPics())) {
feignClientForFatools.fileSave(FileSaveReq.builder().refId(p.getId()).fileIds(req.getProInfoDescPics()).build());
}
if (CollectionUtil.isNotEmpty(req.getProFileDatas())) {
feignClientForFatools.fileSave(FileSaveReq.builder().refId(p.getId()).fileIds(req.getProFileDatas()).build());
}
}
@Override
public FundNoNavResp fundnonavDetail(String id) {
IfaImportedFundInfo ifaImportedFundInfo = ifaImportedFundInfoMapper.selectByPrimaryKey(id);
FundNoNavResp p = new FundNoNavResp();
BeanUtils.copyProperties(ifaImportedFundInfo, p);
p.setRaiseStarttime(ifaImportedFundInfo.getRaiseStarttime() != null ? ifaImportedFundInfo.getRaiseStarttime().getTime() : null);
p.setRaiseEndtime(ifaImportedFundInfo.getRaiseEndtime() != null ? ifaImportedFundInfo.getRaiseEndtime().getTime() : null);
//详情图片
{
CommonResp<List<FileQueryResp>> commonResp = feignClientForFatools.fileQuery(FileQueryReq.builder().refId(id)
.fileType(FileTypeEnums.fundnonavdetail.name()).build());
if (commonResp.isSuccess()) {
p.setProInfoDescPics(commonResp.getAttributes());
}
}
//资料
{
CommonResp<List<FileQueryResp>> commonResp = feignClientForFatools.fileQuery(FileQueryReq.builder().refId(id)
.fileType(FileTypeEnums.fundnonavdatas.name()).build());
if (commonResp.isSuccess()) {
p.setProFileDatas(commonResp.getAttributes());
}
}
return p;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment