admin
2019-11-11 2e53c542b4dfac6d1e62c7a2e7d21a3984e797c2
Merge remote-tracking branch 'origin/div' into div
24个文件已修改
464 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/admin/shop/BanLiShopGoodsAdminController.java 57 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/shop/BanLiShopGoodsSetAdminController.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/shop/BanLiShopGoodsSetsPayAdminController.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/shop/BanLiShopGoodsSetsMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/shop/BanLiShopGoodsSetsPayMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/shop/BanLiShopOrderMapper.java 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/FloatADMapper.xml 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopGoodsSetsMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopGoodsSetsPayMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopOrderMapper.xml 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandShopCaheServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/money/UserMoneyExtraServiceImpl.java 8 ●●●●● 补丁 | 查看 | 原始文档 | 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/service/impl/shop/BanLiShopGoodsServiceImpl.java 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsSetPayServiceImpl.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsSetServiceImpl.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/integral/IntegralTaskRecordServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/money/UserMoneyExtraService.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopGoodsService.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopGoodsSetPayService.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopGoodsSetService.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/shop/BanLiShopGoodsAdminController.java
@@ -1,29 +1,24 @@
package com.yeshi.fanli.controller.admin.shop;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.tencentcloud.COSManager;
import com.google.gson.Gson;
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;
@@ -38,6 +33,9 @@
    @Resource
    private BanLiShopGoodsService banLiShopGoodsService;
    @Resource
    private BanLiShopGoodsClassService banLiShopGoodsClassService;
    /**
     * 保存信息
     * 
@@ -48,50 +46,21 @@
    @RequestMapping(value = "save")
    public void save(String callback, BanLiShopGoods record, HttpServletRequest request, PrintWriter out) {
        try {
            String picture = null;
            if (request instanceof MultipartHttpServletRequest) {
                MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
                MultipartFile file = fileRequest.getFile("file");
                if (file != null)
                    picture = uploadPicture(file);
                banLiShopGoodsService.saveObject(fileRequest.getFile("file"),fileRequest.getFile("file2"), record);
            } else {
                banLiShopGoodsService.saveObject(null, null,record);
            }
            record.setPicture(picture);
            banLiShopGoodsService.addGoods(record);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
        } catch (BanLiShopGoodsException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
        } catch (BanLiShopGoodsSetException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
        } catch (BanLiShopGoodsSetPayException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
        } catch (Exception e) {
            e.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
        }
    }
    /**
     * 上传图片
     *
     * @param file
     * @return
     * @throws Exception
     */
    public String uploadPicture(MultipartFile file) throws BanLiShopGoodsException {
        // 文件解析
        InputStream inputStream;
        try {
            inputStream = file.getInputStream();
        } catch (IOException e) {
            e.printStackTrace();
            throw new BanLiShopGoodsException(1, "图片获取失败");
        }
        String contentType = file.getContentType();
        String type = contentType.substring(contentType.indexOf("/") + 1);
        // 文件路径
        String filePath = "/img/HomeNavbar/" + UUID.randomUUID().toString().replace("-", "") + "." + type;
        // 执行上传
        return COSManager.getInstance().uploadFile(inputStream, filePath).getUrl();
    }
    /**
     * 查询
@@ -118,6 +87,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/BanLiShopGoodsSetAdminController.java
@@ -5,6 +5,7 @@
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -14,6 +15,7 @@
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsSets;
import com.yeshi.fanli.exception.shop.BanLiShopGoodsSetException;
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsSetService;
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
@@ -28,6 +30,26 @@
    @Resource
    private BanLiShopGoodsSetService banLiShopGoodsSetService;
    
    /**
     * 保存信息
     *
     * @param callback
     * @param special
     * @param out
     */
    @RequestMapping(value = "save")
    public void save(String callback, BanLiShopGoodsSets record, HttpServletRequest request, PrintWriter out) {
        try {
            banLiShopGoodsSetService.saveObject(record);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
        } catch (BanLiShopGoodsSetException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
        } catch (Exception e) {
            e.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
        }
    }
    
     /** 
     * 删除
@@ -68,7 +90,7 @@
     * @param out
     */
    @RequestMapping(value = "query")
    public void query(String callback, Integer pageIndex, Integer pageSize, String key, PrintWriter out) {
    public void query(String callback, Integer pageIndex, Integer pageSize, String key, Long goodsId, PrintWriter out) {
        try {
            if (pageIndex == null || pageIndex < 1)
                pageIndex = 1;
@@ -76,13 +98,13 @@
            if (pageSize == null || pageSize < 1) 
                pageSize = Constant.PAGE_SIZE;
    
            List<BanLiShopGoodsSets> list = banLiShopGoodsSetService.listQuery(pageIndex, pageSize, key);
            List<BanLiShopGoodsSets> list = banLiShopGoodsSetService.listQuery(pageIndex, pageSize, key, goodsId);
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
                return;
            }
            
            long count = banLiShopGoodsSetService.countQuery(key);
            long count = banLiShopGoodsSetService.countQuery(key, goodsId);
            
            int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
            PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
fanli/src/main/java/com/yeshi/fanli/controller/admin/shop/BanLiShopGoodsSetsPayAdminController.java
@@ -5,6 +5,7 @@
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -13,8 +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;
@@ -27,6 +31,23 @@
    
    @Resource
    private BanLiShopGoodsSetPayService banLiShopGoodsSetPayService;
    @Resource
    private BanLiShopGoodsSetService banLiShopGoodsSetService;
    @RequestMapping(value = "save")
    public void save(String callback, BanLiShopGoodsSetsPay record, HttpServletRequest request, PrintWriter out) {
        try {
            banLiShopGoodsSetPayService.saveObject(record);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
        } catch (BanLiShopGoodsSetPayException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
        } catch (Exception e) {
            e.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
        }
    }
    
    
     /** 
@@ -68,7 +89,7 @@
     * @param out
     */
    @RequestMapping(value = "query")
    public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer payType, PrintWriter out) {
    public void query(String callback, Integer pageIndex, Integer pageSize, Long setId, String key, Integer payType, PrintWriter out) {
        try {
            if (pageIndex == null || pageIndex < 1)
                pageIndex = 1;
@@ -76,13 +97,20 @@
            if (pageSize == null || pageSize < 1) 
                pageSize = Constant.PAGE_SIZE;
    
            List<BanLiShopGoodsSetsPay> list = banLiShopGoodsSetPayService.listQuery(pageIndex, pageSize, key, payType);
            List<BanLiShopGoodsSetsPay> list = banLiShopGoodsSetPayService.listQuery(pageIndex, pageSize, key, payType, setId);
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
                return;
            }
            
            long count = banLiShopGoodsSetPayService.countQuery(key, payType);
            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);
            PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/shop/BanLiShopGoodsSetsMapper.java
@@ -27,7 +27,8 @@
     * @param count
     * @return
     */
    List<BanLiShopGoodsSets> listQuery(@Param("start") long start, @Param("count") int count, @Param("key") String key);
    List<BanLiShopGoodsSets> listQuery(@Param("start") long start, @Param("count") int count,
            @Param("key") String key, @Param("goodsId")Long goodsId);
    /**
     * 计数
@@ -36,5 +37,5 @@
     * @param state
     * @return
     */
    long countQuery(@Param("key") String key);
    long countQuery(@Param("key") String key, @Param("goodsId")Long goodsId);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/shop/BanLiShopGoodsSetsPayMapper.java
@@ -33,7 +33,8 @@
     * @param count
     * @return
     */
    List<BanLiShopGoodsSetsPay> listQuery(@Param("start") long start, @Param("count") int count, @Param("key") String key, @Param("payType") Integer payType);
    List<BanLiShopGoodsSetsPay> listQuery(@Param("start") long start, @Param("count") int count,
            @Param("key") String key, @Param("payType") Integer payType, @Param("setId")Long setId);
    /**
     * 计数
@@ -42,6 +43,6 @@
     * @param state
     * @return
     */
    long countQuery(@Param("key") String key, @Param("payType") Integer payType);
    long countQuery(@Param("key") String key, @Param("payType") Integer payType, @Param("setId")Long setId);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/shop/BanLiShopOrderMapper.java
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/FloatADMapper.xml
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopGoodsSetsMapper.xml
@@ -88,13 +88,14 @@
    <select id="listQuery" resultMap="BaseResultMap">
        select    <include refid="Base_Column_List" /> from yeshi_ec_shop_goods_set 
        where sgs_name like '${key}%'
            <if test="goodsId != null">AND sgs_goods_id = #{goodsId}</if>
        order by sgs_weight desc 
        limit #{start},#{count}
    </select>
    <select id="countQuery" resultType="java.lang.Long">
        select count(sgs_id) from yeshi_ec_shop_goods_set 
        where sgs_name like '${key}%'
        where sgs_name like '${key}%' <if test="goodsId != null">AND sgs_goods_id = #{goodsId}</if>
    </select>
    
    
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopGoodsSetsPayMapper.xml
@@ -49,6 +49,9 @@
        <if test="payType != null">
            and sp_pay_type=#{payType}
        </if>
        <if test="setId != null">
            and sp_goods_set_id = #{setId}
        </if>
        order by sp_weight desc 
        limit #{start},#{count}
    </select>
@@ -59,6 +62,9 @@
        <if test="payType != null">
            and sp_pay_type=#{payType}
        </if>
        <if test="setId != null">
            and sp_goods_set_id = #{setId}
        </if>
    </select>
    
    
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopOrderMapper.xml
fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandShopCaheServiceImpl.java
@@ -48,7 +48,7 @@
        
        BrandShopCahe brandShop = new BrandShopCahe();
        brandShop.setBrandId(brandInfo.getId());
        brandShop.setShop(ShopInfoVOFactory.convertTaoBaoShop(taoBaoShop));
        brandShop.setShop(shopInfoVO);
        brandShop.setCreateTime(new Date());
        brandShopCaheDao.insert(brandShop);
        return false;
fanli/src/main/java/com/yeshi/fanli/service/impl/money/UserMoneyExtraServiceImpl.java
@@ -1,7 +1,6 @@
package com.yeshi.fanli.service.impl.money;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
@@ -10,7 +9,6 @@
import com.yeshi.fanli.dao.mybatis.user.UserMoneyExtraMapper;
import com.yeshi.fanli.entity.bus.user.UserMoneyExtra;
import com.yeshi.fanli.service.inter.money.UserMoneyExtraService;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
@Service
public class UserMoneyExtraServiceImpl implements UserMoneyExtraService {
@@ -30,8 +28,8 @@
    
    
    @Override
    public void listValid(int page, int count) {
        userMoneyExtraMapper.listValid((page-1) * count, count);
    public List<UserMoneyExtra> listValid(int page, int count) {
        return userMoneyExtraMapper.listValid((page-1) * count, count);
    }
}
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();
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsServiceImpl.java
@@ -1,12 +1,16 @@
package com.yeshi.fanli.service.impl.shop;
import java.io.InputStream;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import org.yeshi.utils.tencentcloud.COSManager;
import com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsMapper;
import com.yeshi.fanli.entity.shop.BanLiShopGoods;
@@ -127,6 +131,92 @@
    }
    @Override
    public void saveObject(MultipartFile file, MultipartFile file2, BanLiShopGoods record) throws BanLiShopGoodsException, Exception{
        if (record.getGoodsClass() == null || record.getGoodsClass().getId() == null)
            throw new BanLiShopGoodsException(1, "请指定商品分类");
        if (StringUtil.isNullOrEmpty(record.getTitle()))
            throw new BanLiShopGoodsException(1, "缺少标题");
        if (file != null)
            record.setPicture(uploadPicture(file));
        if (file2 != null)
            record.setSquarePicture(uploadPicture(file2));
        if (record.getState() == null)
            record.setState(BanLiShopGoods.STATE_ONLINE);
        if (record.getSalesCount() == null)
            record.setSalesCount(0L);
        record.setUpdateTime(new Date());
        if (record.getId() == null) {
            if (StringUtil.isNullOrEmpty(record.getPicture()))
                throw new BanLiShopGoodsException(1, "缺少封面图");
            record.setCreateTime(new Date());
            banLiShopGoodsMapper.insertSelective(record);
        } else {
            BanLiShopGoods resultObj = banLiShopGoodsMapper.selectDetailByPrimaryKey(record.getId());
            if (resultObj == null)
                throw new BanLiShopGoodsException(1, "修改内容已不存在");
            if (StringUtil.isNullOrEmpty(record.getPicture())) {
                record.setPicture(resultObj.getPicture());
            } else {
                removePicture(resultObj.getPicture());
            }
            if (StringUtil.isNullOrEmpty(record.getSquarePicture())) {
                record.setSquarePicture(resultObj.getSquarePicture());
            } else {
                removePicture(resultObj.getSquarePicture());
            }
            if (StringUtil.isNullOrEmpty(record.getPicture()))
                throw new BanLiShopGoodsException(1, "缺少封面图");
            record.setCreateTime(resultObj.getCreateTime());
            banLiShopGoodsMapper.updateByPrimaryKey(record);
        }
    }
    /**
     * 上传图片
     * @param file
     * @return
     * @throws Exception
     */
    public String uploadPicture(MultipartFile file) throws Exception {
        // 文件解析
        InputStream inputStream = file.getInputStream();
        String contentType = file.getContentType();
        String type = contentType.substring(contentType.indexOf("/") + 1);
        // 文件路径
        String filePath="/img/BanLiShopGoods/"+UUID.randomUUID().toString().replace("-", "") + "." + type;
        // 执行上传
        String fileLink= COSManager.getInstance().uploadFile(inputStream, filePath).getUrl();
        return fileLink;
    }
    /**
     * 删除图片-不更新数据库
     * @param record
     * @throws Exception
     */
    public void removePicture(String picture) throws Exception {
        if (picture != null && picture.trim().length() > 0) {
            COSManager.getInstance().deleteFile(picture);
        }
    }
    @Override
    public void updateSelectiveByPrimaryKey(BanLiShopGoods goods) {
        if (goods == null || goods.getId() == null)
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsSetPayServiceImpl.java
@@ -75,6 +75,50 @@
    }
    @Override
    public void saveObject(BanLiShopGoodsSetsPay record) throws BanLiShopGoodsSetPayException {
        // 判断参数是否齐全
        if (record.getGoodsSet() == null || record.getGoodsSet().getId() == null)
            throw new BanLiShopGoodsSetPayException(1, "套餐不存在");
        if (record.getPayType() == null)
            throw new BanLiShopGoodsSetPayException(1, "请指定支付方式");
        if (record.getPayType() == BanLiShopGoodsSetsPay.PAY_TYPE_HONGBAO) {
            if (record.getHongBaoPrice() == null)
                throw new BanLiShopGoodsSetPayException(1, "请指定红包支付价格");
        } else if (record.getPayType() == BanLiShopGoodsSetsPay.PAY_TYPE_BALANCE) {
            if (record.getBalancePrice() == null)
                throw new BanLiShopGoodsSetPayException(1, "请指定余额支付价格");
        } else if (record.getPayType() == BanLiShopGoodsSetsPay.PAY_TYPE_HONGBAO_MONEY) {
            if (record.getHongBaoPrice() == null || record.getMoneyPrice() == null)
                throw new BanLiShopGoodsSetPayException(1, "请指定红包、现金支付价格");
        } else if (record.getPayType() == BanLiShopGoodsSetsPay.PAY_TYPE_MONEY) {
            if (record.getMoneyPrice() == null)
                throw new BanLiShopGoodsSetPayException(1, "请指定现金支付价格");
        }
        record.setUpdateTime(new Date());
        if (record.getId() == null) {
            record.setCreateTime(new Date());
            banLiShopGoodsSetsPayMapper.insertSelective(record);
            if (record.getWeight() == null) {// 权重更新
                BanLiShopGoodsSetsPay update = new BanLiShopGoodsSetsPay();
                update.setId(record.getId());
                update.setWeight((int) record.getId().longValue());
                banLiShopGoodsSetsPayMapper.updateByPrimaryKeySelective(update);
            }
        } else {
            BanLiShopGoodsSetsPay resultObj = banLiShopGoodsSetsPayMapper.selectByPrimaryKey(record.getId());
            if (resultObj == null)
                throw new BanLiShopGoodsSetPayException(1, "修改内容已不存在");
            record.setCreateTime(resultObj.getCreateTime());
            banLiShopGoodsSetsPayMapper.updateByPrimaryKey(record);
        }
    }
    @Override
    public void updateSelectiveByPrimaryKey(BanLiShopGoodsSetsPay pay) {
        if (pay.getId() == null)
            return;
@@ -99,13 +143,13 @@
    
    @Override
    public List<BanLiShopGoodsSetsPay> listQuery(int page, int pageSize, String key, Integer payType) {
        return banLiShopGoodsSetsPayMapper.listQuery((page - 1) * pageSize, pageSize, key, payType);
    public List<BanLiShopGoodsSetsPay> listQuery(int page, int pageSize, String key, Integer payType, Long setId) {
        return banLiShopGoodsSetsPayMapper.listQuery((page - 1) * pageSize, pageSize, key, payType, setId);
    }
    
    @Override
    public long countQuery(String key, Integer payType) {
        return banLiShopGoodsSetsPayMapper.countQuery(key, payType);
    public long countQuery(String key, Integer payType, Long setId) {
        return banLiShopGoodsSetsPayMapper.countQuery(key, payType, setId);
    }
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsSetServiceImpl.java
@@ -99,6 +99,44 @@
    }
    @Override
    public void saveObject(BanLiShopGoodsSets record) throws BanLiShopGoodsSetException {
        if (record.getGoods() == null || record.getGoods().getId() == null)
            throw new BanLiShopGoodsSetException(1, "请指定商品");
        if (StringUtil.isNullOrEmpty(record.getName()))
            throw new BanLiShopGoodsSetException(1, "缺少套餐名字");
        if (record.getOriginalPrice() == null || record.getZkPrice() == null)
            throw new BanLiShopGoodsSetException(1, "价格信息不完整");
        if (record.getStock() == null)
            throw new BanLiShopGoodsSetException(1, "缺少库存信息");
        record.setUpdateTime(new Date());
        if (record.getId() == null) {
            record.setCreateTime(new Date());
            banLiShopGoodsSetsMapper.insertSelective(record);
            if (record.getWeight() == null) {// 权重更新
                BanLiShopGoodsSets update = new BanLiShopGoodsSets();
                update.setId(record.getId());
                update.setWeight((int) record.getId().longValue());
                banLiShopGoodsSetsMapper.updateByPrimaryKeySelective(update);
            }
        } else {
            BanLiShopGoodsSets resultObj = banLiShopGoodsSetsMapper.selectDetailByPrimaryKey(record.getId());
            if (resultObj == null)
                throw new BanLiShopGoodsSetException(1, "修改内容已不存在");
            record.setCreateTime(resultObj.getCreateTime());
            banLiShopGoodsSetsMapper.updateByPrimaryKey(record);
        }
    }
    @Override
    public void updateSelectiveByPrimaryKey(BanLiShopGoodsSets set) {
        if (set.getId() == null)
@@ -128,13 +166,13 @@
    }
    @Override
    public List<BanLiShopGoodsSets> listQuery(int page, int pageSize, String key) {
        return banLiShopGoodsSetsMapper.listQuery((page - 1) * pageSize, pageSize, key);
    public List<BanLiShopGoodsSets> listQuery(int page, int pageSize, String key, Long goodsId) {
        return banLiShopGoodsSetsMapper.listQuery((page - 1) * pageSize, pageSize, key, goodsId);
    }
    @Override
    public long countQuery(String key) {
        return banLiShopGoodsSetsMapper.countQuery(key);
    public long countQuery(String key, Long goodsId) {
        return banLiShopGoodsSetsMapper.countQuery(key, goodsId);
    }
    @Override
fanli/src/main/java/com/yeshi/fanli/service/impl/user/integral/IntegralTaskRecordServiceImpl.java
@@ -556,7 +556,7 @@
        MsgOtherRewardIntegralDTO msgOther = new MsgOtherRewardIntegralDTO();
        msgOther.setTitle("推广红包");
        msgOther.setTotal("推广红包¥" + tlj.setScale(2));
        msgOther.setNum(goldCoin + "枚");
        msgOther.setNum(addGoldCoin + "枚");
        msgOther.setSource("已进入到可用金币中");
        msgOther.setExplain("原推广红包功能下线,剩余推广红包按照10:1折算为金币 ");
        userOtherMsgNotificationService.taoLiJinExchangeMsg(uid, "本折算有且仅有一次", msgOther);
fanli/src/main/java/com/yeshi/fanli/service/inter/money/UserMoneyExtraService.java
@@ -1,5 +1,7 @@
package com.yeshi.fanli.service.inter.money;
import java.util.List;
import com.yeshi.fanli.entity.bus.user.UserMoneyExtra;
public interface UserMoneyExtraService {
@@ -18,5 +20,11 @@
    public void updateByPrimaryKeySelective(UserMoneyExtra record);
    public void listValid(int page, int count);
    /**
     * 获取有效金币用户
     * @param page
     * @param count
     * @return
     */
    public List<UserMoneyExtra> listValid(int page, int count);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopGoodsService.java
@@ -2,6 +2,8 @@
import java.util.List;
import org.springframework.web.multipart.MultipartFile;
import com.yeshi.fanli.entity.shop.BanLiShopGoods;
import com.yeshi.fanli.exception.shop.BanLiShopGoodsException;
import com.yeshi.fanli.exception.shop.BanLiShopGoodsSetException;
@@ -86,5 +88,16 @@
     */
    public void addSalesCount(Long id,int count);
    
    /**
     * 后台维护
     * @param file
     * @param file2
     * @param record
     * @throws BanLiShopGoodsSetException
     * @throws Exception
     */
    public void saveObject(MultipartFile file, MultipartFile file2, BanLiShopGoods record)
            throws BanLiShopGoodsException, Exception;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopGoodsSetPayService.java
@@ -3,6 +3,7 @@
import java.util.List;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsSetsPay;
import com.yeshi.fanli.exception.shop.BanLiShopGoodsSetException;
import com.yeshi.fanli.exception.shop.BanLiShopGoodsSetPayException;
/**
@@ -73,8 +74,15 @@
     * @param payType
     * @return
     */
    public List<BanLiShopGoodsSetsPay> listQuery(int page, int pageSize, String key, Integer payType);
    public List<BanLiShopGoodsSetsPay> listQuery(int page, int pageSize, String key, Integer payType, Long setId);
    public long countQuery(String key, Integer payType);
    public long countQuery(String key, Integer payType, Long setId);
    /**
     * 后台编辑
     * @param record
     * @throws BanLiShopGoodsSetException
     */
    public void saveObject(BanLiShopGoodsSetsPay record) throws BanLiShopGoodsSetPayException;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopGoodsSetService.java
@@ -73,9 +73,9 @@
     * @param key
     * @return
     */
    public List<BanLiShopGoodsSets> listQuery(int page, int pageSize, String key);
    public List<BanLiShopGoodsSets> listQuery(int page, int pageSize, String key, Long goodsId);
    public long countQuery(String key);
    public long countQuery(String key, Long goodsId);
    
    /**
     * 销量增加
@@ -84,4 +84,11 @@
     */
    public void addSalesCount(Long id,int count);
    /**
     * 后台编辑
     * @param record
     * @throws BanLiShopGoodsSetException
     */
    public void saveObject(BanLiShopGoodsSets record) throws BanLiShopGoodsSetException;
}
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java
@@ -1297,6 +1297,53 @@
            userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
            userMsgVO.setContentItems(items);
            return userMsgVO;
        } else if (msg.getType() == MsgTypeOtherTypeEnum.taoLiJinExchange) {
            if (StringUtil.isNullOrEmpty(msg.getContent()))
                return null;
            MsgOtherRewardIntegralDTO dto = new Gson().fromJson(msg.getContent(), MsgOtherRewardIntegralDTO.class);
            if (dto == null)
                return null;
            icon = "http://img.flqapp.com/resource/msg/icon_msg_other_system_give.png";
            List<ClientTextStyleVO> contentList = new ArrayList<>();
            if (!StringUtil.isNullOrEmpty(dto.getExplain())) {
                contentList = new ArrayList<>();
                contentList.add(new ClientTextStyleVO(dto.getExplain() + "", COLOR_CONTENT));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("原因", COLOR_TITLE), contentList));
            }
            if (dto.getTotal() != null) {
                contentList = new ArrayList<>();
                contentList.add(new ClientTextStyleVO(dto.getTotal(), COLOR_CONTENT));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("可则算额", COLOR_TITLE), contentList));
            }
            if (!StringUtil.isNullOrEmpty(dto.getNum())) {
                contentList = new ArrayList<>();
                contentList.add(new ClientTextStyleVO(dto.getNum() + "", COLOR_CONTENT));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("折算金币", COLOR_TITLE), contentList));
            }
            if (!StringUtil.isNullOrEmpty(dto.getSource())) {
                contentList = new ArrayList<>();
                contentList.add(new ClientTextStyleVO(dto.getSource(), COLOR_CONTENT));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("状态", COLOR_TITLE), contentList));
            }
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
                    COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
            UserMsgVO userMsgVO = new UserMsgVO();
            userMsgVO.setIcon(icon);
            userMsgVO.setTitle(dto.getTitle());
            userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
            userMsgVO.setContentItems(items);
            return userMsgVO;
        }
        return new UserMsgVO(icon, msg.getType().getDesc(),