Helius
2020-08-06 fe0f38889f72cb517ca995a55b8d5a40c2127ec8
modify
1 files added
3 files modified
30 ■■■■■ changed files
src/main/java/com/xcong/excoin/modules/contract/service/impl/RabbitOrderServiceImpl.java 4 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/dao/FollowFollowerProfitDao.java 3 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/quartz/job/FollowProfitUpdateJob.java 18 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/documentary/FollowFollowerProfitDao.xml 5 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/service/impl/RabbitOrderServiceImpl.java
@@ -13,6 +13,7 @@
import com.xcong.excoin.modules.contract.service.RabbitOrderService;
import com.xcong.excoin.modules.documentary.common.NoticeConstant;
import com.xcong.excoin.modules.documentary.dao.FollowFollowerOrderRelationDao;
import com.xcong.excoin.modules.documentary.dao.FollowFollowerProfitDao;
import com.xcong.excoin.modules.documentary.dao.FollowTraderInfoDao;
import com.xcong.excoin.modules.documentary.dao.FollowTraderProfitDetailDao;
import com.xcong.excoin.modules.documentary.entity.FollowFollowerOrderRelationEntity;
@@ -76,6 +77,8 @@
    private FollowTraderInfoDao followTraderInfoDao;
    @Resource
    private FollowTraderProfitDetailDao followTraderProfitDetailDao;
    @Resource
    private FollowFollowerProfitDao followFollowerProfitDao;
    @Transactional(rollbackFor = Exception.class)
    @Override
@@ -192,6 +195,7 @@
                if (MemberEntity.IS_TRADER_Y.equals(memberEntity.getIsTrader())) {
                    followOrderOperationService.closingFollowOrders(holdOrderEntity.getOrderNo());
                } else {
                    followFollowerProfitDao.updateFollowerProfitByTradeMemberId(holdOrderEntity.getBondAmount().subtract(holdOrderEntity.getOpeningFeeAmount()), profitOrLoss, traderInfoEntity.getMemberId(), memberEntity.getId());
                    LogRecordUtils.insertFollowerNotice(memberEntity.getId(), NoticeConstant.CLOSE_ORDER_TITLE, StrUtil.format(NoticeConstant.CLOSE_ORDER_CONTENT, contractOrderEntity.getSymbol(), contractOrderEntity.getClosingPrice(), profitOrLoss));
                }
            }
src/main/java/com/xcong/excoin/modules/documentary/dao/FollowFollowerProfitDao.java
@@ -1,5 +1,6 @@
package com.xcong.excoin.modules.documentary.dao;
import java.math.BigDecimal;
import java.util.List;
import org.apache.ibatis.annotations.Param;
@@ -36,4 +37,6 @@
    IPage<FollowFollowerProfitEntity> selectTradeFollowerProfitEntitys(Page<FollowFollowerProfitEntity> page,
            @Param("memberId")Long memberId);
    
    int updateFollowerProfitByTradeMemberId(@Param("principal") BigDecimal principal, @Param("profit") BigDecimal profit, @Param("tradeMemberId") Long tradeMemberId, @Param("memberId") Long memberId);
}
src/main/java/com/xcong/excoin/quartz/job/FollowProfitUpdateJob.java
New file
@@ -0,0 +1,18 @@
package com.xcong.excoin.quartz.job;
import org.springframework.stereotype.Component;
/**
 *
 *
 * @author wzy
 * @date 2020-08-06
 **/
@Component
public class FollowProfitUpdateJob {
    public void traderProfitUpdate() {
    }
}
src/main/resources/mapper/documentary/FollowFollowerProfitDao.xml
@@ -84,4 +84,9 @@
            and trade_id = #{traderId} 
    </select>
    <update id="updateFollowerProfitByTradeMemberId">
        update follow_follower_profit
        set total_principal=#{principal}, total_profit=#{profit}
        where trade_member_id=#{tradeMemberId} and member_id=#{memberId}
    </update>
</mapper>