yujian
2019-11-11 f995b45da163cea907cd5b109e7b5dbc2ff276c8
商城后端设置
5个文件已修改
58 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/admin/shop/BanLiShopGoodsAdminController.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/shop/BanLiShopGoodsSetsPayAdminController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/money/msg/MsgMoneyDetailServiceImpl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackExchangeServiceImpl.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackGiveRecordServiceImpl.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/shop/BanLiShopGoodsAdminController.java
@@ -21,9 +21,11 @@
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.entity.shop.BanLiShopGoods;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsClass;
import com.yeshi.fanli.exception.shop.BanLiShopGoodsException;
import com.yeshi.fanli.exception.shop.BanLiShopGoodsSetException;
import com.yeshi.fanli.exception.shop.BanLiShopGoodsSetPayException;
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsClassService;
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsService;
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
@@ -37,6 +39,9 @@
    @Resource
    private BanLiShopGoodsService banLiShopGoodsService;
    @Resource
    private BanLiShopGoodsClassService banLiShopGoodsClassService;
    /**
     * 保存信息
@@ -118,6 +123,14 @@
                return;
            }
            for (BanLiShopGoods shopGoods: list) {
                BanLiShopGoodsClass goodsClass = shopGoods.getGoodsClass();
                if (goodsClass != null) {
                    shopGoods.setGoodsClass(banLiShopGoodsClassService.selectByPrimaryKey(goodsClass.getId()));
                }
            }
            long count = banLiShopGoodsService.countGoods(key, state);
            int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
fanli/src/main/java/com/yeshi/fanli/controller/admin/shop/BanLiShopGoodsSetsPayAdminController.java
@@ -14,9 +14,11 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsSets;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsSetsPay;
import com.yeshi.fanli.exception.shop.BanLiShopGoodsSetPayException;
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsSetPayService;
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsSetService;
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
@@ -29,6 +31,9 @@
    
    @Resource
    private BanLiShopGoodsSetPayService banLiShopGoodsSetPayService;
    @Resource
    private BanLiShopGoodsSetService banLiShopGoodsSetService;
    
    
    @RequestMapping(value = "save")
@@ -98,6 +103,13 @@
                return;
            }
            
            for (BanLiShopGoodsSetsPay setsPay: list) {
                BanLiShopGoodsSets goodsSet = setsPay.getGoodsSet();
                if (goodsSet != null) {
                    setsPay.setGoodsSet(banLiShopGoodsSetService.selectByPrimaryKey(goodsSet.getId()));
                }
            }
            long count = banLiShopGoodsSetPayService.countQuery(key, payType, setId);
            
            int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
fanli/src/main/java/com/yeshi/fanli/service/impl/money/msg/MsgMoneyDetailServiceImpl.java
@@ -11,7 +11,6 @@
import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail;
import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
import com.yeshi.fanli.exception.msg.MsgMoneyDetailException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.money.msg.MsgMoneyDetailService;
import com.yeshi.fanli.service.inter.msg.UserMsgReadStateService;
import com.yeshi.fanli.util.Constant;
@@ -142,9 +141,6 @@
            detail.setUpdateTime(new Date());
            detail.setRead(false);
            msgMoneyDetailMapper.insertSelective(detail);
            System.out.println("1-insertSelective执行数据。。。。。。。。。。" + detail.getId());
            LogHelper.test("1-insertSelective执行数据。。。。。。。。。。" + detail.getId());
        } else if (detail.getMsgType() == MsgTypeMoneyTypeEnum.subSidy) {
            if (detail.getMoney() == null || detail.getUser() == null)
                throw new MsgMoneyDetailException(2, "消息信息不全");
@@ -153,10 +149,7 @@
            detail.setRead(false);
            msgMoneyDetailMapper.insertSelective(detail);
        }
        userMsgReadStateService.addMoneyMsgUnReadCount(detail.getUser().getId(), 1);
        System.out.println("1-insertSelective执行数据完成。。。。。。。。。。");
        LogHelper.test("2-insertSelective执行数据。。。。。。。。。。" + detail.getId());
    }
    @Override
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackExchangeServiceImpl.java
@@ -18,6 +18,7 @@
import com.yeshi.fanli.entity.common.AdminUser;
import com.yeshi.fanli.entity.money.UserMoneyDetail;
import com.yeshi.fanli.entity.money.UserMoneyDetail.UserMoneyDetailTypeEnum;
import com.yeshi.fanli.entity.redpack.RedPackBalance;
import com.yeshi.fanli.entity.redpack.RedPackDetail;
import com.yeshi.fanli.entity.redpack.RedPackDetail.RedPackDetailTypeEnum;
import com.yeshi.fanli.entity.redpack.RedPackExchange;
@@ -89,11 +90,18 @@
        String extractBanlenMin = redPackConfigService.getValueByKey("extract_banlen_min");
        
        BigDecimal balance = redPackBalanceService.getBalance(uid);
        if (balance == null || balance.compareTo(new BigDecimal(extractBanlenMin)) < 0)
        RedPackBalance balance = redPackBalanceService.selectByPrimaryKey(uid);
        if (balance == null)
            throw new RedPackExchangeException(1, "余额不足" + extractBanlenMin + "元");
        
        if (balance.compareTo(amount) < 0)
        if (balance.getState() != null && balance.getState() == RedPackBalance.STATE_LOCKED)
            throw new RedPackExchangeException(1, "红包已封禁,感谢使用");
        BigDecimal balanceMoney = balance.getMoney();
        if (balanceMoney == null || balanceMoney.compareTo(new BigDecimal(extractBanlenMin)) < 0)
            throw new RedPackExchangeException(1, "余额不足" + extractBanlenMin + "元");
        if (balanceMoney.compareTo(amount) < 0)
            throw new RedPackExchangeException(1, "提现余额不足");
        
        
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackGiveRecordServiceImpl.java
@@ -17,6 +17,7 @@
import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
import com.yeshi.fanli.entity.bus.user.TokenRecord;
import com.yeshi.fanli.entity.bus.user.TokenRecord.TokenTypeEnum;
import com.yeshi.fanli.entity.redpack.RedPackBalance;
import com.yeshi.fanli.entity.redpack.RedPackDetail;
import com.yeshi.fanli.entity.redpack.RedPackDetail.RedPackDetailTypeEnum;
import com.yeshi.fanli.entity.redpack.RedPackGiveRecord;
@@ -110,10 +111,17 @@
        if (amount.compareTo(new BigDecimal(giveMin)) < 0 || amount.compareTo(new BigDecimal(giveMax)) > 0)
            throw new RedPackGiveRecordException(1, "赠送金额至少" + giveMin + "元至多" + giveMax + "元");
        
        BigDecimal balance = redPackBalanceService.getBalance(uid);
        if (balance == null || amount.compareTo(balance) > 0)
        RedPackBalance balance = redPackBalanceService.selectByPrimaryKey(uid);
        if (balance == null)
            throw new RedPackGiveRecordException(1, "余额不足");
        if (balance.getState() != null && balance.getState() == RedPackBalance.STATE_LOCKED)
            throw new RedPackGiveRecordException(1, "红包已封禁,感谢使用");
        if (balance.getMoney() == null || amount.compareTo(balance.getMoney()) > 0)
            throw new RedPackGiveRecordException(1, "余额不足");
        Date nowDate = new Date();
        // 赠送记录
        RedPackGiveRecord giveRecord = new RedPackGiveRecord();