admin
2019-01-14 0df58ff660b537fd4e646a56e90204ee99a1a7a9
资金校验BUG修改
3个文件已修改
36 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/HongBaoV2Mapper.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/hongbao/HongBaoV2Mapper.xml 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/ExtractServiceImpl.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/HongBaoV2Mapper.java
@@ -141,4 +141,13 @@
    Long countInviteOrderCountByUidAndSettleTime(@Param("uid") Long uid, @Param("state") int state,
            @Param("minDate") Date minDate, @Param("maxDate") Date maxDate);
    /**
     * 通过用户ID和状态查询数量
     *
     * @param uid
     * @param state
     * @return
     */
    Long countByUidAndState(@Param("uid") Long uid, @Param("state") int state);
}
fanli/src/main/java/com/yeshi/fanli/mapping/hongbao/HongBaoV2Mapper.xml
@@ -266,6 +266,16 @@
    </select>
    <select id="countByUidAndState" resultType="java.lang.Long">
        SELECT
        SUM(h.`hb_money`) FROM yeshi_ec_hongbao_v2 h
        WHERE h.`hb_uid`=#{uid}
        AND h.`hb_state`=#{state}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_hongbao_v2 where hb_id = #{id,jdbcType=BIGINT}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/ExtractServiceImpl.java
@@ -24,6 +24,7 @@
import com.yeshi.fanli.dao.mybatis.ExtractAuditRecordMapper;
import com.yeshi.fanli.dao.mybatis.ExtractMapper;
import com.yeshi.fanli.dao.mybatis.ExtractRecordMapper;
import com.yeshi.fanli.dao.mybatis.HongBaoV2Mapper;
import com.yeshi.fanli.dao.mybatis.MoneyRecordMapper;
import com.yeshi.fanli.dao.mybatis.PayInfoMapper;
import com.yeshi.fanli.dao.mybatis.SystemMapper;
@@ -141,11 +142,14 @@
    private HongBaoMapper hongBaoMapper;
    @Resource
    private HongBaoV2Mapper hongBaoV2Mapper;
    @Resource
    private PushService pushService;
    @Resource
    private UserNotificationService userNotificationService;
    @Resource
    private UserMoneyDetailMapper userMoneyDetailMapper;
@@ -312,7 +316,7 @@
        AccountDetails ad = AccountDetailsFactory.create("-" + extract.getMoney(), AccountDetailsFactory.TIXIAN, null,
                extract, user);
        accountDetailsMapper.insertSelective(ad);
        // 新版资金详情
        try {
            UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createExtract(extract);
@@ -325,7 +329,6 @@
                e1.printStackTrace();
            }
        }
        userNotificationService.extractApply(extract.getUserInfo().getId());
@@ -478,7 +481,7 @@
            AccountDetails ad = AccountDetailsFactory.create("+" + extract.getMoney(), AccountDetailsFactory.HUIKUAN,
                    null, extract, extract.getUserInfo());
            accountDetailsMapper.insertSelective(ad);
            // 新版资金详情
            try {
                UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createExtractReject(extract);
@@ -491,8 +494,6 @@
                    e1.printStackTrace();
                }
            }
            try {
@@ -554,8 +555,8 @@
    @Override
    public void checkExtract(String uid) throws ExtractException {
        int count = hongBaoMapper.getCountByUidAndState(Long.parseLong(uid), HongBao.STATE_YILINGQU);
        if (count == 0)
        Long count = hongBaoV2Mapper.countByUidAndState(Long.parseLong(uid), HongBao.STATE_YILINGQU);
        if (count == null || count == 0)
            throw new ExtractException(1, "没有已到账的红包");
        List<Integer> list = extractMapper.checkExtract(uid);
        if (list != null && list.size() > 0 && list.get(0) == 0)