|
|
|
@ -11,6 +11,7 @@ import com.sztzjy.forex.trading_trading.entity.TakeStash;
|
|
|
|
|
import com.sztzjy.forex.trading_trading.service.MemberService;
|
|
|
|
|
import com.sztzjy.forex.trading_trading.service.TakeStashService;
|
|
|
|
|
import com.sztzjy.forex.trading_trading.service.TrainingService;
|
|
|
|
|
import com.sztzjy.forex.trading_trading.service.WainingService;
|
|
|
|
|
import com.sztzjy.forex.trading_trading.util.BigDecimalUtils;
|
|
|
|
|
import com.sztzjy.forex.trading_trading.util.ForexMarketDateUtil;
|
|
|
|
|
import com.sztzjy.forex.trading_trading.util.RedisUtil;
|
|
|
|
@ -50,6 +51,9 @@ public class TakeStashController {
|
|
|
|
|
@Autowired
|
|
|
|
|
BigDecimalUtils bigDecimalUtils;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
WainingService wainingService;
|
|
|
|
|
|
|
|
|
|
//获取当前持仓表 status 0为获取当前持仓/1为挂单持仓/2为历史持仓
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
@PostMapping("getTakeStashList")
|
|
|
|
@ -265,7 +269,12 @@ public class TakeStashController {
|
|
|
|
|
takeStash.setProfitAndLossByClose(profitAndLoss);
|
|
|
|
|
takeStash.setTimeTransactionClose(new Date());
|
|
|
|
|
takeStashService.updateByPrimaryKeySelective(takeStash);
|
|
|
|
|
|
|
|
|
|
wainingService.compareMarginLevels(member.getMemberId(),member.getTrainingId());//更改可用保证金后 调用预警
|
|
|
|
|
|
|
|
|
|
return new ResultEntity(HttpStatus.OK, "平仓成功");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -297,6 +306,8 @@ public class TakeStashController {
|
|
|
|
|
takeStash.setStatus(2);
|
|
|
|
|
takeStash.setProfitAndLossByClose(bigDecimalUtils.sub(backFund,tradingMargin)); //盈亏=返还资金-进仓时使用的保证金
|
|
|
|
|
takeStashService.updateByPrimaryKeySelective(takeStash);
|
|
|
|
|
|
|
|
|
|
wainingService.compareMarginLevels(member.getMemberId(),member.getTrainingId());//更改可用保证金后 调用预警
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|