indicator design

pull/1/head
fengyu.wang 5 years ago
parent e59c2f3c1e
commit 9963b062c0
  1. 13
      blockchain-server/blockchain-server-btc/src/main/java/com/blockchain/server/btc/inner/BtcWalletInner.java
  2. 7
      blockchain-server/blockchain-server-currency/src/main/java/com/blockchain/server/currency/inner/CurrencyMarketInnerController.java
  3. 11
      blockchain-server/blockchain-server-eos/src/main/java/com/blockchain/server/eos/inner/EosWalletInnerController.java
  4. 6
      blockchain-server/blockchain-server-eth/src/main/java/com/blockchain/server/eth/inner/EthWalletInner.java
  5. 47
      blockchain-server/blockchain-server-yyyf/src/main/java/com/blockchain/server/yyyf/indicators/IndicatorsManager.java
  6. 21
      blockchain-server/blockchain-server-yyyf/src/main/java/com/blockchain/server/yyyf/indicators/dto/AssetsReporter.java
  7. 16
      blockchain-server/blockchain-server-yyyf/src/main/java/com/blockchain/server/yyyf/indicators/dto/IndicatorsDetail.java
  8. 21
      blockchain-server/blockchain-server-yyyf/src/main/java/com/blockchain/server/yyyf/task/ExamProcessTask.java

@ -1,6 +1,10 @@
package com.blockchain.server.btc.inner; package com.blockchain.server.btc.inner;
import com.blockchain.common.base.dto.ResultDTO; import com.blockchain.common.base.dto.ResultDTO;
import com.blockchain.common.base.util.SSOHelper;
import com.blockchain.server.btc.common.constants.BtcApplicationConstans;
import com.blockchain.server.btc.controller.api.BtcWalletApi;
import com.blockchain.server.btc.dto.BtcWalletDTO;
import com.blockchain.server.btc.inner.api.BtcWalletInnerApi; import com.blockchain.server.btc.inner.api.BtcWalletInnerApi;
import com.blockchain.server.btc.service.BtcWalletService; import com.blockchain.server.btc.service.BtcWalletService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -12,6 +16,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@Api(BtcWalletInnerApi.MARKET_CONTROLLER_API) @Api(BtcWalletInnerApi.MARKET_CONTROLLER_API)
@RestController @RestController
@RequestMapping("/inner/wallet") @RequestMapping("/inner/wallet")
@ -26,4 +33,10 @@ public class BtcWalletInner {
return ResultDTO.requstSuccess(btcWalletService.insertWallet(userOpenId)); return ResultDTO.requstSuccess(btcWalletService.insertWallet(userOpenId));
} }
@GetMapping("/getWallets")
public ResultDTO<List<BtcWalletDTO>> getWallets(@RequestParam("userId") String userId,
@RequestParam("walletType") String walletType) {
return ResultDTO.requstSuccess(btcWalletService.selectAllByUserOpenId(userId, walletType));
}
} }

@ -1,6 +1,7 @@
package com.blockchain.server.currency.inner; package com.blockchain.server.currency.inner;
import com.blockchain.common.base.dto.ResultDTO; import com.blockchain.common.base.dto.ResultDTO;
import com.blockchain.server.currency.dto.CurrencyMarketDTO;
import com.blockchain.server.currency.inner.api.CurrencyMarketInnerApi; import com.blockchain.server.currency.inner.api.CurrencyMarketInnerApi;
import com.blockchain.server.currency.service.CurrencyMarketService; import com.blockchain.server.currency.service.CurrencyMarketService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List;
@Api(CurrencyMarketInnerApi.MARKET_CONTROLLER_API) @Api(CurrencyMarketInnerApi.MARKET_CONTROLLER_API)
@RestController @RestController
@ -36,4 +38,9 @@ public class CurrencyMarketInnerController {
return ResultDTO.requstSuccess(null); return ResultDTO.requstSuccess(null);
} }
@RequestMapping(value = "/getList", method = RequestMethod.GET)
public List<CurrencyMarketDTO> getList() {
return currencyMarketService.getList();
}
} }

@ -3,6 +3,8 @@ package com.blockchain.server.eos.inner;
import com.blockchain.common.base.dto.ResultDTO; import com.blockchain.common.base.dto.ResultDTO;
import com.blockchain.common.base.dto.WalletChangeDTO; import com.blockchain.common.base.dto.WalletChangeDTO;
import com.blockchain.common.base.dto.WalletOrderDTO; import com.blockchain.common.base.dto.WalletOrderDTO;
import com.blockchain.common.base.util.SSOHelper;
import com.blockchain.server.eos.dto.WalletDTO;
import com.blockchain.server.eos.inner.api.EosWalletApi; import com.blockchain.server.eos.inner.api.EosWalletApi;
import com.blockchain.server.eos.service.EosWalletService; import com.blockchain.server.eos.service.EosWalletService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -13,6 +15,9 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/** /**
* @author Harvey * @author Harvey
* @date 2019/2/19 18:09 * @date 2019/2/19 18:09
@ -49,4 +54,10 @@ public class EosWalletInnerController {
return ResultDTO.requstSuccess(); return ResultDTO.requstSuccess();
} }
@GetMapping("/selectWalletByWalletType")
public ResultDTO<List<WalletDTO>> selectWalletByWalletType(@RequestParam("userOpenId") String userOpenId,
@RequestParam("walletType") String walletType) {
return ResultDTO.requstSuccess(eosWalletService.listWalletByWalletType(walletType, userOpenId));
}
} }

@ -60,4 +60,10 @@ public class EthWalletInner {
return ResultDTO.requstSuccess(); return ResultDTO.requstSuccess();
} }
@GetMapping("/getWallets")
public ResultDTO getWallets(@RequestParam("userId") String userId,
@RequestParam(name = "walletType", required = false) String walletType) {
return ResultDTO.requstSuccess(ethWalletService.selectByUserOpenIdAndWalletType(userId, walletType));
}
} }

@ -0,0 +1,47 @@
package com.blockchain.server.yyyf.indicators;
import com.blockchain.server.yyyf.indicators.dto.AssetsReporter;
import java.util.List;
import java.util.Map;
public interface IndicatorsManager {
/**
* save assets reporter item
*
* @author fengyu.wang
* @date 2020-05-27 22:32:30
*/
void saveAssetsReporter(List<AssetsReporter> assetsReporterList);
/**
* get assets reporter item by assessUserId
*
* @param assessUserId page result id
* @author fengyu.wang
* @date 2020-05-27 22:32:49
*/
List<AssetsReporter> getAssetsReporterListByAssessUserId(String assessUserId);
/**
* calculate single indicator
*
* @param assessUserId page result id
* @param type indicators type
* @return indicators result
* @author fengyu.wang
* @date 2020-05-27 22:34:19
*/
float calculateIndicators(String assessUserId, String type);
/**
* calculate indicator by full exam
*
* @param assessUserId page result id
* @return indicators type -> indicators result
* @author fengyu.wang
* @date 2020-05-27 22:36:01
*/
Map<String, Float> calculatePageIndicators(String assessUserId);
}

@ -0,0 +1,21 @@
package com.blockchain.server.yyyf.indicators.dto;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* assets recoding day by day
*
* @author fengyu.wang
* @date 2020-05-27 22:59:34
*/
@Data
public class AssetsReporter {
private String assessUserId;//成绩id
private String coinName;//币种
private int days;//交易天数
private BigDecimal assets;//资产总额
private Date createTime;//创建时间
}

@ -0,0 +1,16 @@
package com.blockchain.server.yyyf.indicators.dto;
import lombok.Data;
/**
* indicators persist
*
* @author fengyu.wang
* @date 2020-05-27 22:55:14
*/
@Data
public class IndicatorsDetail {
private String assessUserId;
private String type;//indicator type
private float indicator;
}

@ -0,0 +1,21 @@
package com.blockchain.server.yyyf.task;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
@Configuration
@EnableScheduling
public class ExamProcessTask {
@Scheduled(cron="0 0 0 1/1 * ? *")
public void processRecording() {
//1.获取所有正在进行考核学生id(子系统userId)
//2.获取 币币总资产 + 法币总资产 + 数据钱包 + 初始资产 + 挂单资金
//3.计算总资产 转换成RMB
//4.获取学生考核开始时间 计算当前进行到第几天
//5.获取学生试卷Id assessUserId
//6.保存到DB
}
}
Loading…
Cancel
Save