xiaoyong931011
2021-06-30 e8427c666edaadf6a84efe2764e6eb5a9a22763d
20210630 积分拨付
3 files modified
24 ■■■■■ changed files
gc-user/src/main/java/com/xzx/gc/user/mapper/AccountMapper.java 2 ●●●●● patch | view | raw | blame | history
gc-user/src/main/java/com/xzx/gc/user/service/JhyInfoService.java 14 ●●●● patch | view | raw | blame | history
gc-user/src/main/resources/mapper/user/AccountMapper.xml 8 ●●●●● patch | view | raw | blame | history
gc-user/src/main/java/com/xzx/gc/user/mapper/AccountMapper.java
@@ -2,6 +2,7 @@
import com.xzx.gc.entity.AccountInfo;
import com.xzx.gc.entity.OrderInfo;
import com.xzx.gc.entity.ScoreDetails;
import com.xzx.gc.entity.UserInfo;
import com.xzx.gc.model.admin.AccountMoneyModel;
import com.xzx.gc.model.admin.UserAccountModel;
@@ -46,5 +47,6 @@
    List<OrderInfo> findArea();
    void insertScoreDetailsRet(ScoreDetails scoreDetailsRet);
}
gc-user/src/main/java/com/xzx/gc/user/service/JhyInfoService.java
@@ -8,7 +8,7 @@
import com.xzx.gc.common.exception.RestException;
import com.xzx.gc.entity.AccountInfo;
import com.xzx.gc.entity.JhyInfo;
import com.xzx.gc.entity.ScoreGoodsSearch;
import com.xzx.gc.entity.ScoreDetails;
import com.xzx.gc.user.dto.AddScoreNumDto;
import com.xzx.gc.user.dto.ExamineJwyDto;
import com.xzx.gc.user.dto.JhyApplyDto;
@@ -22,6 +22,7 @@
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@@ -119,10 +120,19 @@
        List<AccountInfo> accountInfos = accountMapper.selectByExample(exampleAccount);
        if(CollUtil.isNotEmpty(accountInfos)){
            AccountInfo accountInfo = accountInfos.get(0);
//            Integer collectScore = Integer.parseInt(accountInfo.getCollectScore());
            Integer collectScore = Integer.parseInt(accountInfo.getCollectScore());
//            collectScore = collectScore + model.getScore();
            accountInfo.setCollectScore(model.getScore().toString());
            accountMapper.updateByPrimaryKey(accountInfo);
            ScoreDetails scoreDetailsRet = new ScoreDetails();
            scoreDetailsRet.setUserId(model.getUserId());
            scoreDetailsRet.setType(ScoreDetails.SCORE_TYPE_ADMIN_RECHARGE);
            scoreDetailsRet.setOriginalScore(new BigDecimal(collectScore));
            scoreDetailsRet.setCurrentScore(new BigDecimal(model.getScore()));
            scoreDetailsRet.setChangeScore(new BigDecimal(model.getScore()));
            scoreDetailsRet.setCreatedTime(new Date());
            accountMapper.insertScoreDetailsRet(scoreDetailsRet);
        }
    }
}
gc-user/src/main/resources/mapper/user/AccountMapper.xml
@@ -133,4 +133,12 @@
    </select>
    <insert id="insertScoreDetailsRet">
        insert into xzx_score_details (CREATED_TIME, user_id, type, original_score, change_score, current_score)
        values (
                   #{createdTime}, #{userId}, #{type}, #{originalScore}, #{changeScore}, #{currentScore}
               )
    </insert>
</mapper>