Commit d9b8c6d5 authored by 郑建's avatar 郑建 Committed by zhengjian

量子魔方6.6第二期

parent 049c8206
package com.quantgroup.asset.distribution.controller;
import java.util.List;
import java.util.concurrent.TimeUnit;
import com.quantgroup.asset.distribution.model.entity.fund.FundConfigCondition;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -109,6 +112,15 @@ public class FundModuleController {
return findChannelFundConfigCommon(configId, 2);
}
@RequestMapping("/simulation/conditions")
public GlobalResponse allConditions(Long configId){
return fundConfigConditions(configId);
}
@RequestMapping("/simulation/result")
public GlobalResponse simulationResult(List<FundConfigCondition> configConditions,Long configId){
return simulation(configConditions,configId);
}
private GlobalResponse saveChannelFundsConfigCommon(Integer type, Long id, String bizChannel, String funds, String remarks,
String auditor, String proposer, int oldOrNew) {
......@@ -182,4 +194,26 @@ public class FundModuleController {
log.info("资方模块接口, 根据id获取资方配置, configId : {} 耗时 : {}, response : {}", configId, stopwatch.stop().elapsed(TimeUnit.MILLISECONDS), JSON.toJSONString(response));
return response;
}
private GlobalResponse fundConfigConditions(Long configId){
log.info("资方模块接口,根据id获取所有案例, configId : {}", configId);
if (configId == null) {
return GlobalResponse.create(FundModuleResponse.ID_IS_EMPTY);
}
Stopwatch stopwatch = Stopwatch.createStarted();
GlobalResponse response = fundModuleService.getAllConditionsOfFundConfig(configId);
log.info("资方模块接口,根据id获取所有案例, configId : {} 耗时 : {}, response : {}", configId, stopwatch.stop().elapsed(TimeUnit.MILLISECONDS), JSON.toJSONString(response));
return response;
}
private GlobalResponse simulation(List<FundConfigCondition> configConditions,Long configId){
log.info("资方模块接口,根据案例进行空泡, configConditions : {}", configConditions);
if (CollectionUtils.isEmpty(configConditions)) {
return GlobalResponse.create(FundModuleResponse.ID_IS_EMPTY);
}
Stopwatch stopwatch = Stopwatch.createStarted();
GlobalResponse response = fundModuleService.simulationCases(configConditions,configId);
log.info("资方模块接口,根据id获取所有案例, configConditions : {} 耗时 : {}, response : {}", configConditions, stopwatch.stop().elapsed(TimeUnit.MILLISECONDS), JSON.toJSONString(response));
return response;
}
}
package com.quantgroup.asset.distribution.model.entity.fund;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class FundConfigCondition implements Serializable {
private static final long serialVersionUID = 1L;
private String conditionTempId;
private List<Condition> condition;
private Result result;
@Data
public static class Condition{
private String conditionCode;
private String conditionName;
private String conditionValue;
}
@Data
public static class Result{
private Boolean success;
private String fundInfo;
}
}
package com.quantgroup.asset.distribution.service.funding;
import com.quantgroup.asset.distribution.config.annotation.HandleException;
import com.quantgroup.asset.distribution.model.entity.fund.FundConfigCondition;
import com.quantgroup.asset.distribution.model.response.GlobalResponse;
import java.util.List;
/**
* 资方模块Service
* @author liwenbin
......@@ -99,4 +103,8 @@ public interface IFundModuleService {
* @return
*/
public GlobalResponse audit(Long id, Integer auditStatus);
GlobalResponse getAllConditionsOfFundConfig(Long configId);
GlobalResponse simulationCases(List<FundConfigCondition> configConditions,Long configId);
}
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