admin
2019-11-01 56bcbcf230f4ce53376c7ccc99b91990d3375f9d
板栗商城
4个文件已修改
39个文件已添加
3213 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/shop/BanLiShopGoodsClassMapper.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/shop/BanLiShopGoodsImgMapper.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/shop/BanLiShopGoodsMapper.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/shop/BanLiShopGoodsSetsMapper.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/shop/BanLiShopGoodsSetsPayMapper.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/shop/BanLiShopOrderMapper.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/redpack/RedPackDetail.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/shop/BanLiShopGoods.java 158 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/shop/BanLiShopGoodsClass.java 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/shop/BanLiShopGoodsImg.java 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/shop/BanLiShopGoodsSets.java 163 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/shop/BanLiShopGoodsSetsPay.java 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/shop/BanLiShopOrder.java 237 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/shop/ChargeTypeEnum.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/shop/BanLiShopGoodsException.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/shop/BanLiShopGoodsSetException.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/shop/BanLiShopGoodsSetPayException.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/shop/BanLiShopOrderException.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopGoodsClassMapper.xml 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopGoodsImgMapper.xml 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopGoodsMapper.xml 144 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopGoodsSetsMapper.xml 167 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopGoodsSetsPayMapper.xml 118 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopOrderMapper.xml 174 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackBalanceServiceImpl.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsClassServiceImpl.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsImgServiceImpl.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsServiceImpl.java 157 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsSetPayServiceImpl.java 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsSetServiceImpl.java 130 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopOrderPayServiceImpl.java 155 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopOrderServiceImpl.java 198 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopGoodsClassService.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopGoodsImgService.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopGoodsService.java 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopGoodsSetPayService.java 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopGoodsSetService.java 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopOrderPayService.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopOrderService.java 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/taobao/dataoke/DaTaoKeGoodsDetailV2Service.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/RedPackDetailFactory.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/mybatishandler/shop/ChargeTypeEnumHandler.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/shop/BanLiShopUtil.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/shop/BanLiShopGoodsClassMapper.java
New file
@@ -0,0 +1,8 @@
package com.yeshi.fanli.dao.mybatis.shop;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsClass;
public interface BanLiShopGoodsClassMapper extends BaseMapper<BanLiShopGoodsClass> {
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/shop/BanLiShopGoodsImgMapper.java
New file
@@ -0,0 +1,12 @@
package com.yeshi.fanli.dao.mybatis.shop;
import java.util.List;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsImg;
public interface BanLiShopGoodsImgMapper extends BaseMapper<BanLiShopGoodsImg> {
    List<BanLiShopGoodsImg> listByGoodsId(Long goodsId);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/shop/BanLiShopGoodsMapper.java
New file
@@ -0,0 +1,35 @@
package com.yeshi.fanli.dao.mybatis.shop;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.shop.BanLiShopGoods;
public interface BanLiShopGoodsMapper extends BaseMapper<BanLiShopGoods> {
    BanLiShopGoods selectDetailByPrimaryKey(Long id);
    /**
     * 商品列表查询
     *
     * @param key
     * @param state
     * @param start
     * @param count
     * @return
     */
    List<BanLiShopGoods> listGoods(@Param("key") String key, @Param("state") Integer state, @Param("start") long start,
            @Param("count") int count);
    /**
     * 商品计数
     *
     * @param key
     * @param state
     * @return
     */
    long countGoods(@Param("key") String key, @Param("state") Integer state);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/shop/BanLiShopGoodsSetsMapper.java
New file
@@ -0,0 +1,17 @@
package com.yeshi.fanli.dao.mybatis.shop;
import java.util.List;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsSets;
public interface BanLiShopGoodsSetsMapper extends BaseMapper<BanLiShopGoodsSets> {
    BanLiShopGoodsSets selectDetailByPrimaryKey(Long id);
    List<BanLiShopGoodsSets> listDetailByGoodsId(Long goodsId);
    long countByGoodsId(Long goodsId);
    List<BanLiShopGoodsSets> listByGoodsId(Long goodsId);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/shop/BanLiShopGoodsSetsPayMapper.java
New file
@@ -0,0 +1,24 @@
package com.yeshi.fanli.dao.mybatis.shop;
import java.util.List;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsSetsPay;
public interface BanLiShopGoodsSetsPayMapper extends BaseMapper<BanLiShopGoodsSetsPay> {
    /**
     * 根据套餐ID查询列表
     * @param goodsSetId
     * @return
     */
    List<BanLiShopGoodsSetsPay> listByGoodsSetId(Long goodsSetId);
    /**
     * 根据套餐ID计数
     * @param goodsSetId
     * @return
     */
    long countByGoodsSetId(Long goodsSetId);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/shop/BanLiShopOrderMapper.java
New file
@@ -0,0 +1,11 @@
package com.yeshi.fanli.dao.mybatis.shop;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.shop.BanLiShopOrder;
public interface BanLiShopOrderMapper extends BaseMapper<BanLiShopOrder> {
    BanLiShopOrder selectByPrimaryKeyForUpdate(Long id);
}
fanli/src/main/java/com/yeshi/fanli/entity/redpack/RedPackDetail.java
@@ -17,20 +17,18 @@
@Table("yeshi_red_pack_detail")
public class RedPackDetail {
    public enum RedPackDetailTypeEnum {
        invite("立得现金", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        newUserReward("新人奖励", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        increaseReward("递增奖励", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        seriesReward("连续奖励", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        refund("红包退回", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        videoRecharge("视频会员充值", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        musicRecharge("音乐会员充值", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        invite("立得现金", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        newUserReward("新人奖励", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        increaseReward("递增奖励", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        seriesReward("连续奖励", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        refund("红包退回", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        useByShopOrder("商城订单使用", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        violation("红包涉嫌违规", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        giveOthers("红包赠送待领取中", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        giveOthersSucceed("红包赠送领取成功", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        giveOthersFail("红包赠送超时退回", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        giveOthersReceive("好友赠送", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        giveOthers("红包赠送待领取中", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        giveOthersSucceed("红包赠送领取成功", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        giveOthersFail("红包赠送超时退回", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        giveOthersReceive("好友赠送", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        redExchange("红包提现中", "http://img.flqapp.com/resource/msg/icon_hongbao_tixian.png"),
        redExchangePass("红包提现成功", "http://img.flqapp.com/resource/msg/icon_hongbao_tixian.png"),
        redExchangeReject("红包提现失败", "http://img.flqapp.com/resource/msg/icon_hongbao_tixian.png");
@@ -46,7 +44,7 @@
        public String getDesc() {
            return desc;
        }
        public String getPicture() {
            return picture;
        }
fanli/src/main/java/com/yeshi/fanli/entity/shop/BanLiShopGoods.java
New file
@@ -0,0 +1,158 @@
package com.yeshi.fanli.entity.shop;
import java.util.Date;
import java.util.List;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
/**
 * 板栗商城商品
 *
 * @author Administrator
 *
 */
@Table("yeshi_ec_shop_goods")
public class BanLiShopGoods {
    public final static int STATE_ONLINE = 1;// 在线
    public final static int STATE_OFFLINE = 0;// 下线
    @Column(name = "sg_id")
    private Long id;
    @Column(name = "sg_title")
    private String title;
    @Column(name = "sg_class_id")
    private BanLiShopGoodsClass goodsClass;
    @Column(name = "sg_sales_count")
    private Long salesCount;
    @Column(name = "sg_picture")
    private String picture;// 封面图标
    @Column(name = "sg_desc")
    private String desc;// 简介
    @Column(name = "sg_charge_type")
    private ChargeTypeEnum chargeType;// 充值类型 充值类商品有此属性
    @Column(name = "sg_state")
    private Integer state;// 商品状态 0-下线 1-在线
    @Column(name = "sg_create_time")
    private Date createTime;
    @Column(name = "sg_update_time")
    private Date updateTime;
    @Column(name = "sg_weight")
    private Integer weight;
    // 套餐
    private List<BanLiShopGoodsSets> setsList;
    // 图片
    private List<BanLiShopGoodsImg> imgList;
    public BanLiShopGoods() {
    }
    public BanLiShopGoods(Long id) {
        this.id = id;
    }
    public List<BanLiShopGoodsImg> getImgList() {
        return imgList;
    }
    public void setImgList(List<BanLiShopGoodsImg> imgList) {
        this.imgList = imgList;
    }
    public List<BanLiShopGoodsSets> getSetsList() {
        return setsList;
    }
    public void setSetsList(List<BanLiShopGoodsSets> setsList) {
        this.setsList = setsList;
    }
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    public BanLiShopGoodsClass getGoodsClass() {
        return goodsClass;
    }
    public void setGoodsClass(BanLiShopGoodsClass goodsClass) {
        this.goodsClass = goodsClass;
    }
    public Long getSalesCount() {
        return salesCount;
    }
    public void setSalesCount(Long salesCount) {
        this.salesCount = salesCount;
    }
    public String getPicture() {
        return picture;
    }
    public void setPicture(String picture) {
        this.picture = picture;
    }
    public String getDesc() {
        return desc;
    }
    public void setDesc(String desc) {
        this.desc = desc;
    }
    public ChargeTypeEnum getChargeType() {
        return chargeType;
    }
    public void setChargeType(ChargeTypeEnum chargeType) {
        this.chargeType = chargeType;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    public Integer getState() {
        return state;
    }
    public void setState(Integer state) {
        this.state = state;
    }
    public Integer getWeight() {
        return weight;
    }
    public void setWeight(Integer weight) {
        this.weight = weight;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/shop/BanLiShopGoodsClass.java
New file
@@ -0,0 +1,66 @@
package com.yeshi.fanli.entity.shop;
import java.util.Date;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
/**
 * 商品分类
 *
 * @author Administrator
 *
 */
@Table("yeshi_ec_shop_goods_class")
public class BanLiShopGoodsClass {
    @Column(name = "sgc_id")
    private Long id;
    @Column(name = "sgc_name")
    private String name;// 分类名称
    @Column(name = "sgc_picture")
    private String picture;// 分类图标
    @Column(name = "sgc_create_time")
    private Date createTime;
    @Column(name = "sgc_update_time")
    private Date updateTime;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getPicture() {
        return picture;
    }
    public void setPicture(String picture) {
        this.picture = picture;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/shop/BanLiShopGoodsImg.java
New file
@@ -0,0 +1,70 @@
package com.yeshi.fanli.entity.shop;
import java.util.Date;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
@Table("yeshi_ec_shop_goods_imgs")
public class BanLiShopGoodsImg {
    @Column(name = "sgi_id")
    private Long id;
    @Column(name = "sgi_goods_id")
    private BanLiShopGoods goods;
    @Column(name = "sgi_url")
    private String url;
    @Column(name = "sgi_url_md5")
    private String urlMD5;
    @Column(name = "sgi_create_time")
    private Date createTime;
    @Column(name = "sgi_weight")
    private Integer weight;
    public Integer getWeight() {
        return weight;
    }
    public void setWeight(Integer weight) {
        this.weight = weight;
    }
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public BanLiShopGoods getGoods() {
        return goods;
    }
    public void setGoods(BanLiShopGoods goods) {
        this.goods = goods;
    }
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    public String getUrlMD5() {
        return urlMD5;
    }
    public void setUrlMD5(String urlMD5) {
        this.urlMD5 = urlMD5;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/shop/BanLiShopGoodsSets.java
New file
@@ -0,0 +1,163 @@
package com.yeshi.fanli.entity.shop;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
/**
 * 商品套餐
 *
 * @author Administrator
 *
 */
@Table("yeshi_ec_shop_goods_set")
public class BanLiShopGoodsSets {
    public final static int STATE_ONLINE = 1;// 在线
    public final static int STATE_OFFLINE = 0;// 下线
    @Column(name = "sgs_id")
    private Long id;
    @Column(name = "sgs_name")
    private String name;// 套餐全名
    @Column(name = "sgs_sub_name")
    private String subName;// 套餐简称
    @Column(name = "sgs_goods_id")
    private BanLiShopGoods goods;// 商品
    @Column(name = "sgs_original_price")
    private BigDecimal originalPrice;// 原价/官方价
    @Column(name = "sgs_zk_price")
    private BigDecimal zkPrice;// 折扣价
    @Column(name = "sgs_sales_count")
    private Long salesCount;// 销量
    @Column(name = "sgs_stock")
    private Integer stock;// 库存
    @Column(name = "sgs_charge_fulu_num")
    private String chargeFuLuNum;// 福禄充值平台的商品ID
    @Column(name = "sgs_create_time")
    private Date createTime;
    @Column(name = "sgs_update_time")
    private Date updateTime;
    private List<BanLiShopGoodsSetsPay> payList;// 支付方式列表
    @Column(name = "sgs_weight")
    private Integer weight;
    @Column(name = "sgs_state")
    private Integer state;
    public String getSubName() {
        return subName;
    }
    public void setSubName(String subName) {
        this.subName = subName;
    }
    public Integer getState() {
        return state;
    }
    public void setState(Integer state) {
        this.state = state;
    }
    public Integer getWeight() {
        return weight;
    }
    public void setWeight(Integer weight) {
        this.weight = weight;
    }
    public List<BanLiShopGoodsSetsPay> getPayList() {
        return payList;
    }
    public void setPayList(List<BanLiShopGoodsSetsPay> payList) {
        this.payList = payList;
    }
    public String getChargeFuLuNum() {
        return chargeFuLuNum;
    }
    public void setChargeFuLuNum(String chargeFuLuNum) {
        this.chargeFuLuNum = chargeFuLuNum;
    }
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public BanLiShopGoods getGoods() {
        return goods;
    }
    public void setGoods(BanLiShopGoods goods) {
        this.goods = goods;
    }
    public BigDecimal getOriginalPrice() {
        return originalPrice;
    }
    public void setOriginalPrice(BigDecimal originalPrice) {
        this.originalPrice = originalPrice;
    }
    public BigDecimal getZkPrice() {
        return zkPrice;
    }
    public void setZkPrice(BigDecimal zkPrice) {
        this.zkPrice = zkPrice;
    }
    public Long getSalesCount() {
        return salesCount;
    }
    public void setSalesCount(Long salesCount) {
        this.salesCount = salesCount;
    }
    public Integer getStock() {
        return stock;
    }
    public void setStock(Integer stock) {
        this.stock = stock;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/shop/BanLiShopGoodsSetsPay.java
New file
@@ -0,0 +1,132 @@
package com.yeshi.fanli.entity.shop;
import java.math.BigDecimal;
import java.util.Date;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
/**
 * 套餐支付方式配置
 *
 * @author Administrator
 *
 */
@Table("yeshi_ec_shop_goods_set_pay")
public class BanLiShopGoodsSetsPay {
    public static final int PAY_TYPE_HONGBAO = 1;// 红包支付
    public static final int PAY_TYPE_BALANCE = 2;// 账户余额支付
    public static final int PAY_TYPE_MONEY = 3;// 现金支付
    public static final int PAY_TYPE_HONGBAO_MONEY = 13;// 红包+现金支付
    @Column(name = "sp_id")
    private Long id;
    @Column(name = "sp_goods_set_id")
    private BanLiShopGoodsSets goodsSet;// 商品套餐
    @Column(name = "sp_discount")
    private BigDecimal disCount;// 折扣
    @Column(name = "sp_price_hongbao")
    private BigDecimal hongBaoPrice;// 红包支付价格
    @Column(name = "sp_price_balance")
    private BigDecimal balancePrice;// 余额支付价格
    @Column(name = "sp_price_money")
    private BigDecimal moneyPrice;// 现金支付价格
    @Column(name = "sp_pay_type")
    private Integer payType;// 支付方式
    @Column(name = "sp_tag")
    private String tag;// 标签
    @Column(name = "sp_create_time")
    private Date createTime;
    @Column(name = "sp_update_time")
    private Date updateTime;
    @Column(name = "sp_weight")
    private Integer weight;//排序权重
    public Integer getWeight() {
        return weight;
    }
    public void setWeight(Integer weight) {
        this.weight = weight;
    }
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public BanLiShopGoodsSets getGoodsSet() {
        return goodsSet;
    }
    public void setGoodsSet(BanLiShopGoodsSets goodsSet) {
        this.goodsSet = goodsSet;
    }
    public BigDecimal getDisCount() {
        return disCount;
    }
    public void setDisCount(BigDecimal disCount) {
        this.disCount = disCount;
    }
    public BigDecimal getHongBaoPrice() {
        return hongBaoPrice;
    }
    public void setHongBaoPrice(BigDecimal hongBaoPrice) {
        this.hongBaoPrice = hongBaoPrice;
    }
    public BigDecimal getBalancePrice() {
        return balancePrice;
    }
    public void setBalancePrice(BigDecimal balancePrice) {
        this.balancePrice = balancePrice;
    }
    public BigDecimal getMoneyPrice() {
        return moneyPrice;
    }
    public void setMoneyPrice(BigDecimal moneyPrice) {
        this.moneyPrice = moneyPrice;
    }
    public Integer getPayType() {
        return payType;
    }
    public void setPayType(Integer payType) {
        this.payType = payType;
    }
    public String getTag() {
        return tag;
    }
    public void setTag(String tag) {
        this.tag = tag;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/shop/BanLiShopOrder.java
New file
@@ -0,0 +1,237 @@
package com.yeshi.fanli.entity.shop;
import java.math.BigDecimal;
import java.util.Date;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
/**
 * 订单
 *
 * @author Administrator
 *
 */
@Table("yeshi_ec_shop_order")
public class BanLiShopOrder {
    public final static int PAY_STATE_NOPAY = 0;// 未支付
    public final static int PAY_STATE_PAID = 1;// 已支付
    public final static int STATE_INVALID = -1;// 失效
    public final static int STATE_NO_PAY = 0;// 未支付
    public final static int STATE_PAID = 1;// 已支付,待审核
    public final static int STATE_REJECT = 10;// 审核拒绝
    public final static int STATE_SUCCESS = 20;// 交易成功
    @Column(name = "so_id")
    private Long id;
    @Column(name = "so_uid")
    private Long uid;
    @Column(name = "so_order_no")
    private String orderNo;
    @Column(name = "so_goods_id")
    private BanLiShopGoods goods;
    @Column(name = "so_goods_set_id")
    private BanLiShopGoodsSets goodsSet;
    @Column(name = "so_payment_hongbao")
    private BigDecimal hongBaoPayment;// 红包支付金额
    @Column(name = "so_payment_hongbao_state")
    private Integer hongBaoPaymentState;// 支付金额状态
    @Column(name = "so_payment_money")
    private BigDecimal balancePayment;// 余额支付金额
    @Column(name = "so_payment_money_state")
    private Integer balancePaymentState;// 余额金额状态
    @Column(name = "so_payment_balance")
    private BigDecimal moneyPayment;// 现金支付金额
    @Column(name = "so_payment_balance_state")
    private Integer moneyPaymentState;// 现金金额状态
    @Column(name = "so_pay_time")
    private Date payTime;// 订单支付时间
    @Column(name = "so_reject_time")
    private Date rejectTime;// 拒绝时间
    @Column(name = "so_success_time")
    private Date successTime;// 交易成功时间
    @Column(name = "so_state") // -1-已失效 0-未支付 1-已支付,待审核 10-审核拒绝 20-交易成功
    private Integer state;// 状态
    @Column(name = "so_state_desc")
    private String stateDesc;// 状态简介
    @Column(name = "so_charge_account")
    private String chargeAccount;// 充值账号
    @Column(name = "so_charge_account2")
    private String chargeAccount2;// 充值账号2(备用)
    @Column(name = "so_beizhu")
    private String beiZhu;// 备注
    @Column(name = "so_create_time")
    private Date createTime;// 创建时间
    @Column(name = "so_update_time")
    private Date updateTime;// 更新时间
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public Long getUid() {
        return uid;
    }
    public void setUid(Long uid) {
        this.uid = uid;
    }
    public String getOrderNo() {
        return orderNo;
    }
    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }
    public BanLiShopGoods getGoods() {
        return goods;
    }
    public void setGoods(BanLiShopGoods goods) {
        this.goods = goods;
    }
    public BanLiShopGoodsSets getGoodsSet() {
        return goodsSet;
    }
    public void setGoodsSet(BanLiShopGoodsSets goodsSet) {
        this.goodsSet = goodsSet;
    }
    public BigDecimal getHongBaoPayment() {
        return hongBaoPayment;
    }
    public void setHongBaoPayment(BigDecimal hongBaoPayment) {
        this.hongBaoPayment = hongBaoPayment;
    }
    public Integer getHongBaoPaymentState() {
        return hongBaoPaymentState;
    }
    public void setHongBaoPaymentState(Integer hongBaoPaymentState) {
        this.hongBaoPaymentState = hongBaoPaymentState;
    }
    public BigDecimal getBalancePayment() {
        return balancePayment;
    }
    public void setBalancePayment(BigDecimal balancePayment) {
        this.balancePayment = balancePayment;
    }
    public Integer getBalancePaymentState() {
        return balancePaymentState;
    }
    public void setBalancePaymentState(Integer balancePaymentState) {
        this.balancePaymentState = balancePaymentState;
    }
    public BigDecimal getMoneyPayment() {
        return moneyPayment;
    }
    public void setMoneyPayment(BigDecimal moneyPayment) {
        this.moneyPayment = moneyPayment;
    }
    public Integer getMoneyPaymentState() {
        return moneyPaymentState;
    }
    public void setMoneyPaymentState(Integer moneyPaymentState) {
        this.moneyPaymentState = moneyPaymentState;
    }
    public Date getPayTime() {
        return payTime;
    }
    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }
    public Date getRejectTime() {
        return rejectTime;
    }
    public void setRejectTime(Date rejectTime) {
        this.rejectTime = rejectTime;
    }
    public Date getSuccessTime() {
        return successTime;
    }
    public void setSuccessTime(Date successTime) {
        this.successTime = successTime;
    }
    public Integer getState() {
        return state;
    }
    public void setState(Integer state) {
        this.state = state;
    }
    public String getStateDesc() {
        return stateDesc;
    }
    public void setStateDesc(String stateDesc) {
        this.stateDesc = stateDesc;
    }
    public String getChargeAccount() {
        return chargeAccount;
    }
    public void setChargeAccount(String chargeAccount) {
        this.chargeAccount = chargeAccount;
    }
    public String getChatgeAccount2() {
        return chargeAccount2;
    }
    public void setChatgeAccount2(String chargeAccount2) {
        this.chargeAccount2 = chargeAccount2;
    }
    public String getBeiZhu() {
        return beiZhu;
    }
    public void setBeiZhu(String beiZhu) {
        this.beiZhu = beiZhu;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/shop/ChargeTypeEnum.java
New file
@@ -0,0 +1,22 @@
package com.yeshi.fanli.entity.shop;
public enum ChargeTypeEnum {
    qq("QQ号", "请输入常用QQ号码充值"), phone("手机号码", "请输入常用手机号");
    private final String name;
    private final String desc;
    private ChargeTypeEnum(String name, String desc) {
        this.name = name;
        this.desc = desc;
    }
    public String getName() {
        return this.name;
    }
    public String getDesc() {
        return this.desc;
    }
}
fanli/src/main/java/com/yeshi/fanli/exception/shop/BanLiShopGoodsException.java
New file
@@ -0,0 +1,17 @@
package com.yeshi.fanli.exception.shop;
import com.yeshi.fanli.exception.BaseException;
public class BanLiShopGoodsException extends BaseException {
    private static final long serialVersionUID = 572112205824229000L;
    public BanLiShopGoodsException(int code, String msg) {
        super(code, msg);
    }
    public BanLiShopGoodsException() {
        super();
    }
}
fanli/src/main/java/com/yeshi/fanli/exception/shop/BanLiShopGoodsSetException.java
New file
@@ -0,0 +1,16 @@
package com.yeshi.fanli.exception.shop;
import com.yeshi.fanli.exception.BaseException;
public class BanLiShopGoodsSetException extends BaseException {
    private static final long serialVersionUID = 572112205824229000L;
    public BanLiShopGoodsSetException(int code, String msg) {
        super(code, msg);
    }
    public BanLiShopGoodsSetException() {
        super();
    }
}
fanli/src/main/java/com/yeshi/fanli/exception/shop/BanLiShopGoodsSetPayException.java
New file
@@ -0,0 +1,16 @@
package com.yeshi.fanli.exception.shop;
import com.yeshi.fanli.exception.BaseException;
public class BanLiShopGoodsSetPayException extends BaseException {
    private static final long serialVersionUID = 572112205824229000L;
    public BanLiShopGoodsSetPayException(int code, String msg) {
        super(code, msg);
    }
    public BanLiShopGoodsSetPayException() {
        super();
    }
}
fanli/src/main/java/com/yeshi/fanli/exception/shop/BanLiShopOrderException.java
New file
@@ -0,0 +1,16 @@
package com.yeshi.fanli.exception.shop;
import com.yeshi.fanli.exception.BaseException;
public class BanLiShopOrderException extends BaseException {
    private static final long serialVersionUID = 572112205824229000L;
    public BanLiShopOrderException(int code, String msg) {
        super(code, msg);
    }
    public BanLiShopOrderException() {
        super();
    }
}
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopGoodsClassMapper.xml
New file
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsClassMapper">
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.shop.BanLiShopGoodsClass">
        <id column="sgc_id" property="id" jdbcType="BIGINT" />
        <result column="sgc_name" property="name" jdbcType="VARCHAR" />
        <result column="sgc_picture" property="picture" jdbcType="VARCHAR" />
        <result column="sgc_create_time" property="createTime"
            jdbcType="TIMESTAMP" />
        <result column="sgc_update_time" property="updateTime"
            jdbcType="TIMESTAMP" />
    </resultMap>
    <sql id="Base_Column_List">sgc_id,sgc_name,sgc_picture,sgc_create_time,sgc_update_time
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_shop_goods_class where sgc_id = #{id,jdbcType=BIGINT}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_shop_goods_class where sgc_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoodsClass"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_shop_goods_class
        (sgc_id,sgc_name,sgc_picture,sgc_create_time,sgc_update_time) values
        (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoodsClass"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_shop_goods_class
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">sgc_id,</if>
            <if test="name != null">sgc_name,</if>
            <if test="picture != null">sgc_picture,</if>
            <if test="createTime != null">sgc_create_time,</if>
            <if test="updateTime != null">sgc_update_time,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="name != null">#{name,jdbcType=VARCHAR},</if>
            <if test="picture != null">#{picture,jdbcType=VARCHAR},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoodsClass">update
        yeshi_ec_shop_goods_class set sgc_name =
        #{name,jdbcType=VARCHAR},sgc_picture =
        #{picture,jdbcType=VARCHAR},sgc_create_time =
        #{createTime,jdbcType=TIMESTAMP},sgc_update_time =
        #{updateTime,jdbcType=TIMESTAMP} where sgc_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoodsClass">
        update yeshi_ec_shop_goods_class
        <set>
            <if test="name != null">sgc_name=#{name,jdbcType=VARCHAR},</if>
            <if test="picture != null">sgc_picture=#{picture,jdbcType=VARCHAR},</if>
            <if test="createTime != null">sgc_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">sgc_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
        </set>
        where sgc_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopGoodsImgMapper.xml
New file
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsImgMapper">
    <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.shop.BanLiShopGoodsImg">
        <id column="sgi_id" property="id" jdbcType="BIGINT" />
        <result column="sgi_url" property="url" jdbcType="VARCHAR" />
        <result column="sgi_url_md5" property="urlMD5" jdbcType="VARCHAR" />
        <result column="sgi_create_time" property="createTime"
            jdbcType="TIMESTAMP" />
        <result column="sgi_weight" property="weight" jdbcType="INTEGER" />
        <association property="goods" column="sgi_goods_id"
            javaType="com.yeshi.fanli.entity.shop.BanLiShopGoods">
            <id column="sgi_goods_id" property="id" jdbcType="BIGINT" />
        </association>
    </resultMap>
    <sql id="Base_Column_List">sgi_id,sgi_goods_id,sgi_url,sgi_url_md5,sgi_create_time,sgi_weight
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_shop_goods_imgs where sgi_id = #{id,jdbcType=BIGINT}
    </select>
    <select id="listByGoodsId" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_shop_goods_imgs where sgi_goods_id = #{0}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_shop_goods_imgs where sgi_id = #{id,jdbcType=BIGINT}</delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoodsImg"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_shop_goods_imgs
        (sgi_id,sgi_goods_id,sgi_url,sgi_url_md5,sgi_create_time,sgi_weight)
        values
        (#{id,jdbcType=BIGINT},#{goods.id,jdbcType=BIGINT},#{url,jdbcType=VARCHAR},#{urlMD5,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{weight,jdbcType=INTEGER})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoodsImg"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_shop_goods_imgs
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">sgi_id,</if>
            <if test="goods != null">sgi_goods_id,</if>
            <if test="url != null">sgi_url,</if>
            <if test="urlMD5 != null">sgi_url_md5,</if>
            <if test="createTime != null">sgi_create_time,</if>
            <if test="weight != null">sgi_weight,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="goods != null">#{goods.id,jdbcType=BIGINT},</if>
            <if test="url != null">#{url,jdbcType=VARCHAR},</if>
            <if test="urlMD5 != null">#{urlMD5,jdbcType=VARCHAR},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="weight != null">#{weight,jdbcType=INTEGER}</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoodsImg">update
        yeshi_ec_shop_goods_imgs set sgi_goods_id =
        #{goods.id,jdbcType=BIGINT},sgi_url =
        #{url,jdbcType=VARCHAR},sgi_url_md5 =
        #{urlMD5,jdbcType=VARCHAR},sgi_create_time =
        #{createTime,jdbcType=TIMESTAMP} ,sgi_weight
        =#{weight,jdbcType=INTEGER} where sgi_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoodsImg">
        update yeshi_ec_shop_goods_imgs
        <set>
            <if test="goods != null">sgi_goods_id=#{goods.id,jdbcType=BIGINT},</if>
            <if test="url != null">sgi_url=#{url,jdbcType=VARCHAR},</if>
            <if test="urlMD5 != null">sgi_url_md5=#{urlMD5,jdbcType=VARCHAR},</if>
            <if test="createTime != null">sgi_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="weight !=null">sgi_weight =#{weight,jdbcType=INTEGER},</if>
        </set>
        where sgi_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopGoodsMapper.xml
New file
@@ -0,0 +1,144 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsMapper">
    <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.shop.BanLiShopGoods">
        <id column="sg_id" property="id" jdbcType="BIGINT" />
        <result column="sg_title" property="title" jdbcType="VARCHAR" />
        <result column="sg_sales_count" property="salesCount" jdbcType="BIGINT" />
        <result column="sg_picture" property="picture" jdbcType="VARCHAR" />
        <result column="sg_desc" property="desc" jdbcType="VARCHAR" />
        <result column="sg_charge_type" property="chargeType" jdbcType="VARCHAR" />
        <result column="sg_state" property="state" jdbcType="INTEGER" />
        <result column="sg_create_time" property="createTime" jdbcType="TIMESTAMP" />
        <result column="sg_update_time" property="updateTime" jdbcType="TIMESTAMP" />
        <result column="sg_weight" property="weight" jdbcType="INTEGER" />
        <association property="goodsClass" column="sg_class_id"
            javaType="com.yeshi.fanli.entity.shop.BanLiShopGoodsClass">
            <id column="sg_class_id" property="id" jdbcType="BIGINT" />
        </association>
    </resultMap>
    <resultMap id="BaseResultDetailMap" type="com.yeshi.fanli.entity.shop.BanLiShopGoods">
        <id column="sg_id" property="id" jdbcType="BIGINT" />
        <result column="sg_title" property="title" jdbcType="VARCHAR" />
        <result column="sg_sales_count" property="salesCount" jdbcType="BIGINT" />
        <result column="sg_picture" property="picture" jdbcType="VARCHAR" />
        <result column="sg_desc" property="desc" jdbcType="VARCHAR" />
        <result column="sg_charge_type" property="chargeType" jdbcType="VARCHAR" />
        <result column="sg_state" property="state" jdbcType="INTEGER" />
        <result column="sg_create_time" property="createTime" jdbcType="TIMESTAMP" />
        <result column="sg_update_time" property="updateTime" jdbcType="TIMESTAMP" />
        <result column="sg_weight" property="weight" jdbcType="INTEGER" />
        <association property="goodsClass" column="sg_class_id"
            javaType="com.yeshi.fanli.entity.shop.BanLiShopGoodsClass"
            select="com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsClassMapper.selectByPrimaryKey" />
        <collection property="setsList" column="sg_id"
            select="com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsSetsMapper.listDetailByGoodsId" />
        <collection property="imgList" column="sg_id"
            select="com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsImgMapper.listByGoodsId" />
    </resultMap>
    <sql id="Base_Column_List">sg_id,sg_title,sg_class_id,sg_sales_count,sg_picture,sg_desc,sg_charge_type,sg_state,sg_create_time,sg_update_time,sg_weight
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_shop_goods where sg_id = #{id,jdbcType=BIGINT}
    </select>
    <select id="selectDetailByPrimaryKey" resultMap="BaseResultDetailMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_shop_goods where sg_id = #{0}
    </select>
    <select id="listGoods" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_shop_goods where sg_title like '${key}%'
        <if test="state!=null">
            and sg_state=#{state}
        </if>
        order by sg_weight desc #{start},#{count}
    </select>
    <select id="countGoods" resultType="java.lang.Long">
        select
        count(*)
        from yeshi_ec_shop_goods where sg_title like '${key}%'
        <if test="state!=null">
            and sg_state=#{state}
        </if>
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_shop_goods where sg_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoods"
        useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_shop_goods
        (sg_id,sg_title,sg_class_id,sg_sales_count,sg_picture,sg_desc,sg_charge_type,sg_state,sg_create_time,sg_update_time,sg_weight)
        values
        (#{id,jdbcType=BIGINT},#{title,jdbcType=VARCHAR},#{goodsClass.id,jdbcType=BIGINT},#{salesCount,jdbcType=BIGINT},#{picture,jdbcType=VARCHAR},#{desc,jdbcType=VARCHAR},#{chargeType,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{weight,jdbcType=INTEGER})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoods"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_shop_goods
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">sg_id,</if>
            <if test="title != null">sg_title,</if>
            <if test="goodsClass != null">sg_class_id,</if>
            <if test="salesCount != null">sg_sales_count,</if>
            <if test="picture != null">sg_picture,</if>
            <if test="desc != null">sg_desc,</if>
            <if test="chargeType != null">sg_charge_type,</if>
            <if test="state != null">sg_state,</if>
            <if test="createTime != null">sg_create_time,</if>
            <if test="updateTime != null">sg_update_time,</if>
            <if test="weight != null">sg_weight,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="title != null">#{title,jdbcType=VARCHAR},</if>
            <if test="goodsClass != null">#{goodsClass.id,jdbcType=BIGINT},</if>
            <if test="salesCount != null">#{salesCount,jdbcType=BIGINT},</if>
            <if test="picture != null">#{picture,jdbcType=VARCHAR},</if>
            <if test="desc != null">#{desc,jdbcType=VARCHAR},</if>
            <if test="chargeType != null">#{chargeType,jdbcType=VARCHAR},</if>
            <if test="state != null">#{state,jdbcType=INTEGER},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="weight != null">#{weight,jdbcType=INTEGER}</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoods">update
        yeshi_ec_shop_goods set sg_title =
        #{title,jdbcType=VARCHAR},sg_class_id =
        #{goodsClass.id,jdbcType=BIGINT},sg_sales_count =
        #{salesCount,jdbcType=BIGINT},sg_picture =
        #{picture,jdbcType=VARCHAR},sg_desc =
        #{desc,jdbcType=VARCHAR},sg_charge_type =
        #{chargeType,jdbcType=VARCHAR},sg_state =
        #{state,jdbcType=INTEGER},sg_create_time =
        #{createTime,jdbcType=TIMESTAMP},sg_update_time =
        #{updateTime,jdbcType=TIMESTAMP} ,sg_weight
        =#{weight,jdbcType=INTEGER} where sg_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoods">
        update yeshi_ec_shop_goods
        <set>
            <if test="title != null">sg_title=#{title,jdbcType=VARCHAR},</if>
            <if test="goodsClass != null">sg_class_id=#{goodsClass.id,jdbcType=BIGINT},</if>
            <if test="salesCount != null">sg_sales_count=#{salesCount,jdbcType=BIGINT},</if>
            <if test="picture != null">sg_picture=#{picture,jdbcType=VARCHAR},</if>
            <if test="desc != null">sg_desc=#{desc,jdbcType=VARCHAR},</if>
            <if test="chargeType != null">sg_charge_type=#{chargeType,jdbcType=VARCHAR},</if>
            <if test="state != null">sg_state=#{state,jdbcType=INTEGER},</if>
            <if test="createTime != null">sg_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">sg_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="weight !=null">sg_weight =#{weight,jdbcType=INTEGER},</if>
        </set>
        where sg_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopGoodsSetsMapper.xml
New file
@@ -0,0 +1,167 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsSetsMapper">
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.shop.BanLiShopGoodsSets">
        <id column="sgs_id" property="id" jdbcType="BIGINT" />
        <result column="sgs_name" property="name" jdbcType="VARCHAR" />
        <result column="sgs_original_price" property="originalPrice"
            jdbcType="DECIMAL" />
        <result column="sgs_zk_price" property="zkPrice" jdbcType="DECIMAL" />
        <result column="sgs_sales_count" property="salesCount"
            jdbcType="BIGINT" />
        <result column="sgs_stock" property="stock" jdbcType="INTEGER" />
        <result column="sgs_charge_fulu_num" property="chargeFuLuNum"
            jdbcType="VARCHAR" />
        <result column="sgs_create_time" property="createTime"
            jdbcType="TIMESTAMP" />
        <result column="sgs_update_time" property="updateTime"
            jdbcType="TIMESTAMP" />
        <result column="sgs_weight" property="weight" jdbcType="INTEGER" />
        <result column="sgs_sub_name" property="subName" jdbcType="VARCHAR" />
        <result column="sgs_state" property="state" jdbcType="INTEGER" />
        <association property="goods" column="sgs_goods_id"
            javaType="com.yeshi.fanli.entity.shop.BanLiShopGoods">
            <id column="sgs_goods_id" property="id" jdbcType="BIGINT" />
        </association>
    </resultMap>
    <resultMap id="BaseResultDetailMap"
        type="com.yeshi.fanli.entity.shop.BanLiShopGoodsSets">
        <id column="sgs_id" property="id" jdbcType="BIGINT" />
        <result column="sgs_name" property="name" jdbcType="VARCHAR" />
        <result column="sgs_original_price" property="originalPrice"
            jdbcType="DECIMAL" />
        <result column="sgs_zk_price" property="zkPrice" jdbcType="DECIMAL" />
        <result column="sgs_sales_count" property="salesCount"
            jdbcType="BIGINT" />
        <result column="sgs_stock" property="stock" jdbcType="INTEGER" />
        <result column="sgs_charge_fulu_num" property="chargeFuLuNum"
            jdbcType="VARCHAR" />
        <result column="sgs_create_time" property="createTime"
            jdbcType="TIMESTAMP" />
        <result column="sgs_update_time" property="updateTime"
            jdbcType="TIMESTAMP" />
        <result column="sgs_weight" property="weight" jdbcType="INTEGER" />
        <result column="sgs_sub_name" property="subName" jdbcType="VARCHAR" />
        <result column="sgs_state" property="state" jdbcType="INTEGER" />
        <association property="goods" column="sgs_goods_id"
            javaType="com.yeshi.fanli.entity.shop.BanLiShopGoods">
            <id column="sgs_goods_id" property="id" jdbcType="BIGINT" />
        </association>
        <collection property="payList" column="sgs_id"
            ofType="com.yeshi.fanli.entity.shop.BanLiShopGoodsSetsPay"
            select="com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsSetsPayMapper.listByGoodsSetId" />
    </resultMap>
    <sql id="Base_Column_List">sgs_id,sgs_name,sgs_goods_id,sgs_original_price,sgs_zk_price,sgs_sales_count,sgs_stock,sgs_charge_fulu_num,sgs_create_time,sgs_update_time,sgs_weight,sgs_sub_name,sgs_state
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_shop_goods_set where sgs_id = #{id,jdbcType=BIGINT}
    </select>
    <select id="selectDetailByPrimaryKey" resultMap="BaseResultDetailMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_shop_goods_set where sgs_id = #{0}
    </select>
    <select id="listDetailByGoodsId" resultMap="BaseResultDetailMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_shop_goods_set where sgs_goods_id = #{0}
    </select>
    <select id="countByGoodsId" resultType="java.lang.Long"
        parameterType="java.lang.Long">select count(*) from yeshi_ec_shop_goods_set where
        sgs_goods_id = #{0}
    </select>
    <select id="listByGoodsId" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_shop_goods_set where sgs_goods_id = #{0}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_shop_goods_set where sgs_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoodsSets"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_shop_goods_set
        (sgs_id,sgs_name,sgs_goods_id,sgs_original_price,sgs_zk_price,sgs_sales_count,sgs_stock,sgs_charge_fulu_num,sgs_create_time,sgs_update_time,sgs_weight,sgs_sub_name,sgs_state)
        values
        (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{goods.id,jdbcType=BIGINT},#{originalPrice,jdbcType=DECIMAL},#{zkPrice,jdbcType=DECIMAL},#{salesCount,jdbcType=BIGINT},#{stock,jdbcType=INTEGER},#{chargeFuLuNum,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{weight,jdbcType=INTEGER},#{subName,jdbcType=VARCHAR},#{state,jdbcType=INTEGER})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoodsSets"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_shop_goods_set
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">sgs_id,</if>
            <if test="name != null">sgs_name,</if>
            <if test="goods != null">sgs_goods_id,</if>
            <if test="originalPrice != null">sgs_original_price,</if>
            <if test="zkPrice != null">sgs_zk_price,</if>
            <if test="salesCount != null">sgs_sales_count,</if>
            <if test="stock != null">sgs_stock,</if>
            <if test="chargeFuLuNum != null">sgs_charge_fulu_num,</if>
            <if test="createTime != null">sgs_create_time,</if>
            <if test="updateTime != null">sgs_update_time,</if>
            <if test="weight != null">sgs_weight,</if>
            <if test="subName != null">sgs_sub_name,</if>
            <if test="state != null">sgs_state,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="name != null">#{name,jdbcType=VARCHAR},</if>
            <if test="goods != null">#{goods.id,jdbcType=BIGINT},</if>
            <if test="originalPrice != null">#{originalPrice,jdbcType=DECIMAL},</if>
            <if test="zkPrice != null">#{zkPrice,jdbcType=DECIMAL},</if>
            <if test="salesCount != null">#{salesCount,jdbcType=BIGINT},</if>
            <if test="stock != null">#{stock,jdbcType=INTEGER},</if>
            <if test="chargeFuLuNum != null">#{chargeFuLuNum,jdbcType=VARCHAR},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="weight != null">#{weight,jdbcType=INTEGER},</if>
            <if test="subName != null">#{subName,jdbcType=VARCHAR}</if>
            <if test="state != null">#{state,jdbcType=INTEGER}</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoodsSets">update
        yeshi_ec_shop_goods_set set sgs_name =
        #{name,jdbcType=VARCHAR},sgs_goods_id =
        #{goods.id,jdbcType=BIGINT},sgs_original_price =
        #{originalPrice,jdbcType=DECIMAL},sgs_zk_price =
        #{zkPrice,jdbcType=DECIMAL},sgs_sales_count =
        #{salesCount,jdbcType=BIGINT},sgs_stock =
        #{stock,jdbcType=INTEGER},sgs_charge_fulu_num =
        #{chargeFuLuNum,jdbcType=VARCHAR},sgs_create_time =
        #{createTime,jdbcType=TIMESTAMP},sgs_update_time =
        #{updateTime,jdbcType=TIMESTAMP} ,sgs_weight
        =#{weight,jdbcType=INTEGER} ,sgs_sub_name =#{subName,jdbcType=VARCHAR}
        ,sgs_state =#{state,jdbcType=INTEGER} where sgs_id =
        #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoodsSets">
        update yeshi_ec_shop_goods_set
        <set>
            <if test="name != null">sgs_name=#{name,jdbcType=VARCHAR},</if>
            <if test="goods != null">sgs_goods_id=#{goods.id,jdbcType=BIGINT},</if>
            <if test="originalPrice != null">sgs_original_price=#{originalPrice,jdbcType=DECIMAL},
            </if>
            <if test="zkPrice != null">sgs_zk_price=#{zkPrice,jdbcType=DECIMAL},</if>
            <if test="salesCount != null">sgs_sales_count=#{salesCount,jdbcType=BIGINT},</if>
            <if test="stock != null">sgs_stock=#{stock,jdbcType=INTEGER},</if>
            <if test="chargeFuLuNum != null">sgs_charge_fulu_num=#{chargeFuLuNum,jdbcType=VARCHAR},
            </if>
            <if test="createTime != null">sgs_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">sgs_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="weight !=null">sgs_weight =#{weight,jdbcType=INTEGER},</if>
            <if test="subName !=null">sgs_sub_name =#{subName,jdbcType=VARCHAR},</if>
            <if test="state !=null">sgs_state =#{state,jdbcType=INTEGER},</if>
        </set>
        where sgs_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopGoodsSetsPayMapper.xml
New file
@@ -0,0 +1,118 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsSetsPayMapper">
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.shop.BanLiShopGoodsSetsPay">
        <id column="sp_id" property="id" jdbcType="BIGINT" />
        <result column="sp_discount" property="disCount" jdbcType="DECIMAL" />
        <result column="sp_price_hongbao" property="hongBaoPrice"
            jdbcType="DECIMAL" />
        <result column="sp_price_balance" property="balancePrice"
            jdbcType="DECIMAL" />
        <result column="sp_price_money" property="moneyPrice" jdbcType="DECIMAL" />
        <result column="sp_pay_type" property="payType" jdbcType="VARCHAR" />
        <result column="sp_tag" property="tag" jdbcType="VARCHAR" />
        <result column="sp_create_time" property="createTime" jdbcType="TIMESTAMP" />
        <result column="sp_update_time" property="updateTime" jdbcType="TIMESTAMP" />
        <result column="sp_weight" property="weight" jdbcType="INTEGER" />
        <association property="goodsSet" column="sp_goods_set_id"
            javaType="com.yeshi.fanli.entity.shop.BanLiShopGoodsSets">
            <id column="sp_goods_set_id" property="id" jdbcType="BIGINT" />
        </association>
    </resultMap>
    <sql id="Base_Column_List">sp_id,sp_goods_set_id,sp_discount,sp_price_hongbao,sp_price_balance,sp_price_money,sp_pay_type,sp_tag,sp_create_time,sp_update_time,sp_weight
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_shop_goods_set_pay where sp_id = #{id,jdbcType=BIGINT}
    </select>
    <select id="listByGoodsSetId" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_shop_goods_set_pay where sp_goods_set_id = #{0}
    </select>
    <select id="countByGoodsSetId" resultType="java.lang.Long"
        parameterType="java.lang.Long">
        select
        count(*)
        from yeshi_ec_shop_goods_set_pay where sp_goods_set_id = #{0}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_shop_goods_set_pay where sp_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoodsSetsPay"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_shop_goods_set_pay
        (sp_id,sp_goods_set_id,sp_discount,sp_price_hongbao,sp_price_balance,sp_price_money,sp_pay_type,sp_tag,sp_create_time,sp_update_time,sp_weight)
        values
        (#{id,jdbcType=BIGINT},#{goodsSet.id,jdbcType=BIGINT},#{disCount,jdbcType=DECIMAL},#{hongBaoPrice,jdbcType=DECIMAL},#{balancePrice,jdbcType=DECIMAL},#{moneyPrice,jdbcType=DECIMAL},#{payType,jdbcType=VARCHAR},#{tag,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{weight,jdbcType=INTEGER})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoodsSetsPay"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_shop_goods_set_pay
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">sp_id,</if>
            <if test="goodsSet != null">sp_goods_set_id,</if>
            <if test="disCount != null">sp_discount,</if>
            <if test="hongBaoPrice != null">sp_price_hongbao,</if>
            <if test="balancePrice != null">sp_price_balance,</if>
            <if test="moneyPrice != null">sp_price_money,</if>
            <if test="payType != null">sp_pay_type,</if>
            <if test="tag != null">sp_tag,</if>
            <if test="createTime != null">sp_create_time,</if>
            <if test="updateTime != null">sp_update_time,</if>
            <if test="weight != null">sp_weight,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="goodsSet != null">#{goodsSet.id,jdbcType=BIGINT},</if>
            <if test="disCount != null">#{disCount,jdbcType=DECIMAL},</if>
            <if test="hongBaoPrice != null">#{hongBaoPrice,jdbcType=DECIMAL},</if>
            <if test="balancePrice != null">#{balancePrice,jdbcType=DECIMAL},</if>
            <if test="moneyPrice != null">#{moneyPrice,jdbcType=DECIMAL},</if>
            <if test="payType != null">#{payType,jdbcType=VARCHAR},</if>
            <if test="tag != null">#{tag,jdbcType=VARCHAR},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="weight != null">#{weight,jdbcType=INTEGER}</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoodsSetsPay">update
        yeshi_ec_shop_goods_set_pay set sp_goods_set_id =
        #{goodsSet.id,jdbcType=BIGINT},sp_discount =
        #{disCount,jdbcType=DECIMAL},sp_price_hongbao =
        #{hongBaoPrice,jdbcType=DECIMAL},sp_price_balance =
        #{balancePrice,jdbcType=DECIMAL},sp_price_money =
        #{moneyPrice,jdbcType=DECIMAL},sp_pay_type =
        #{payType,jdbcType=VARCHAR},sp_tag =
        #{tag,jdbcType=VARCHAR},sp_create_time =
        #{createTime,jdbcType=TIMESTAMP},sp_update_time =
        #{updateTime,jdbcType=TIMESTAMP} ,sp_weight
        =#{weight,jdbcType=INTEGER} where sp_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopGoodsSetsPay">
        update yeshi_ec_shop_goods_set_pay
        <set>
            <if test="goodsSet != null">sp_goods_set_id=#{goodsSet.id,jdbcType=BIGINT},</if>
            <if test="disCount != null">sp_discount=#{disCount,jdbcType=DECIMAL},</if>
            <if test="hongBaoPrice != null">sp_price_hongbao=#{hongBaoPrice,jdbcType=DECIMAL},</if>
            <if test="balancePrice != null">sp_price_balance=#{balancePrice,jdbcType=DECIMAL},</if>
            <if test="moneyPrice != null">sp_price_money=#{moneyPrice,jdbcType=DECIMAL},</if>
            <if test="payType != null">sp_pay_type=#{payType,jdbcType=VARCHAR},</if>
            <if test="tag != null">sp_tag=#{tag,jdbcType=VARCHAR},</if>
            <if test="createTime != null">sp_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">sp_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="weight !=null">sp_weight =#{weight,jdbcType=INTEGER},</if>
        </set>
        where sp_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopOrderMapper.xml
New file
@@ -0,0 +1,174 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeshi.fanli.dao.mybatis.shop.BanLiShopOrderMapper">
    <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.shop.BanLiShopOrder">
        <id column="so_id" property="id" jdbcType="BIGINT" />
        <result column="so_uid" property="uid" jdbcType="BIGINT" />
        <result column="so_order_no" property="orderNo" jdbcType="VARCHAR" />
        <result column="so_payment_hongbao" property="hongBaoPayment"
            jdbcType="DECIMAL" />
        <result column="so_payment_hongbao_state" property="hongBaoPaymentState"
            jdbcType="INTEGER" />
        <result column="so_payment_money" property="balancePayment"
            jdbcType="DECIMAL" />
        <result column="so_payment_money_state" property="balancePaymentState"
            jdbcType="INTEGER" />
        <result column="so_payment_balance" property="moneyPayment"
            jdbcType="DECIMAL" />
        <result column="so_payment_balance_state" property="moneyPaymentState"
            jdbcType="INTEGER" />
        <result column="so_pay_time" property="payTime" jdbcType="TIMESTAMP" />
        <result column="so_reject_time" property="rejectTime" jdbcType="TIMESTAMP" />
        <result column="so_success_time" property="successTime"
            jdbcType="TIMESTAMP" />
        <result column="so_state" property="state" jdbcType="INTEGER" />
        <result column="so_state_desc" property="stateDesc" jdbcType="VARCHAR" />
        <result column="so_charge_account" property="chargeAccount"
            jdbcType="VARCHAR" />
        <result column="so_charge_account2" property="chargeAccount2"
            jdbcType="VARCHAR" />
        <result column="so_beizhu" property="beiZhu" jdbcType="VARCHAR" />
        <result column="so_create_time" property="createTime" jdbcType="TIMESTAMP" />
        <result column="so_update_time" property="updateTime" jdbcType="TIMESTAMP" />
        <association property="goods" column="so_goods_id"
            javaType="com.yeshi.fanli.entity.shop.BanLiShopGoods">
            <id column="so_goods_id" property="id" jdbcType="BIGINT" />
        </association>
        <association property="goodsSet" column="so_goods_set_id"
            javaType="com.yeshi.fanli.entity.shop.BanLiShopGoodsSets">
            <id column="so_goods_set_id" property="id" jdbcType="BIGINT" />
        </association>
    </resultMap>
    <sql id="Base_Column_List">so_id,so_uid,so_order_no,so_goods_id,so_goods_set_id,so_payment_hongbao,so_payment_hongbao_state,so_payment_money,so_payment_money_state,so_payment_balance,so_payment_balance_state,so_pay_time,so_reject_time,so_success_time,so_state,so_state_desc,so_charge_account,so_charge_account2,so_beizhu,so_create_time,so_update_time
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_shop_order where so_id = #{id,jdbcType=BIGINT}
    </select>
    <select id="selectByPrimaryKeyForUpdate" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_shop_order where so_id = #{0} for update
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_shop_order where so_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.shop.BanLiShopOrder"
        useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_shop_order
        (so_id,so_uid,so_order_no,so_goods_id,so_goods_set_id,so_payment_hongbao,so_payment_hongbao_state,so_payment_money,so_payment_money_state,so_payment_balance,so_payment_balance_state,so_pay_time,so_reject_time,so_success_time,so_state,so_state_desc,so_charge_account,so_charge_account2,so_beizhu,so_create_time,so_update_time)
        values
        (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{orderNo,jdbcType=VARCHAR},#{goods.id,jdbcType=BIGINT},#{goodsSet.id,jdbcType=BIGINT},#{hongBaoPayment,jdbcType=DECIMAL},#{hongBaoPaymentState,jdbcType=INTEGER},#{balancePayment,jdbcType=DECIMAL},#{balancePaymentState,jdbcType=INTEGER},#{moneyPayment,jdbcType=DECIMAL},#{moneyPaymentState,jdbcType=INTEGER},#{payTime,jdbcType=TIMESTAMP},#{rejectTime,jdbcType=TIMESTAMP},#{successTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{stateDesc,jdbcType=VARCHAR},#{chargeAccount,jdbcType=VARCHAR},#{chargeAccount2,jdbcType=VARCHAR},#{beiZhu,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopOrder"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_shop_order
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">so_id,</if>
            <if test="uid != null">so_uid,</if>
            <if test="orderNo != null">so_order_no,</if>
            <if test="goods != null">so_goods_id,</if>
            <if test="goodsSet != null">so_goods_set_id,</if>
            <if test="hongBaoPayment != null">so_payment_hongbao,</if>
            <if test="hongBaoPaymentState != null">so_payment_hongbao_state,</if>
            <if test="balancePayment != null">so_payment_money,</if>
            <if test="balancePaymentState != null">so_payment_money_state,</if>
            <if test="moneyPayment != null">so_payment_balance,</if>
            <if test="moneyPaymentState != null">so_payment_balance_state,</if>
            <if test="payTime != null">so_pay_time,</if>
            <if test="rejectTime != null">so_reject_time,</if>
            <if test="successTime != null">so_success_time,</if>
            <if test="state != null">so_state,</if>
            <if test="stateDesc != null">so_state_desc,</if>
            <if test="chargeAccount != null">so_charge_account,</if>
            <if test="chargeAccount2 != null">so_charge_account2,</if>
            <if test="beiZhu != null">so_beizhu,</if>
            <if test="createTime != null">so_create_time,</if>
            <if test="updateTime != null">so_update_time,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="uid != null">#{uid,jdbcType=BIGINT},</if>
            <if test="orderNo != null">#{orderNo,jdbcType=VARCHAR},</if>
            <if test="goods != null">#{goods.id,jdbcType=BIGINT},</if>
            <if test="goodsSet != null">#{goodsSet.id,jdbcType=BIGINT},</if>
            <if test="hongBaoPayment != null">#{hongBaoPayment,jdbcType=DECIMAL},</if>
            <if test="hongBaoPaymentState != null">#{hongBaoPaymentState,jdbcType=INTEGER},</if>
            <if test="balancePayment != null">#{balancePayment,jdbcType=DECIMAL},</if>
            <if test="balancePaymentState != null">#{balancePaymentState,jdbcType=INTEGER},</if>
            <if test="moneyPayment != null">#{moneyPayment,jdbcType=DECIMAL},</if>
            <if test="moneyPaymentState != null">#{moneyPaymentState,jdbcType=INTEGER},</if>
            <if test="payTime != null">#{payTime,jdbcType=TIMESTAMP},</if>
            <if test="rejectTime != null">#{rejectTime,jdbcType=TIMESTAMP},</if>
            <if test="successTime != null">#{successTime,jdbcType=TIMESTAMP},</if>
            <if test="state != null">#{state,jdbcType=INTEGER},</if>
            <if test="stateDesc != null">#{stateDesc,jdbcType=VARCHAR},</if>
            <if test="chargeAccount != null">#{chargeAccount,jdbcType=VARCHAR},</if>
            <if test="chargeAccount2 != null">#{chargeAccount2,jdbcType=VARCHAR},</if>
            <if test="beiZhu != null">#{beiZhu,jdbcType=VARCHAR},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.shop.BanLiShopOrder">update
        yeshi_ec_shop_order set so_uid = #{uid,jdbcType=BIGINT},so_order_no =
        #{orderNo,jdbcType=VARCHAR},so_goods_id =
        #{goods.id,jdbcType=BIGINT},so_goods_set_id =
        #{goodsSet.id,jdbcType=BIGINT},so_payment_hongbao =
        #{hongBaoPayment,jdbcType=DECIMAL},so_payment_hongbao_state =
        #{hongBaoPaymentState,jdbcType=INTEGER},so_payment_money =
        #{balancePayment,jdbcType=DECIMAL},so_payment_money_state =
        #{balancePaymentState,jdbcType=INTEGER},so_payment_balance =
        #{moneyPayment,jdbcType=DECIMAL},so_payment_balance_state =
        #{moneyPaymentState,jdbcType=INTEGER},so_pay_time =
        #{payTime,jdbcType=TIMESTAMP},so_reject_time =
        #{rejectTime,jdbcType=TIMESTAMP},so_success_time =
        #{successTime,jdbcType=TIMESTAMP},so_state =
        #{state,jdbcType=INTEGER},so_state_desc =
        #{stateDesc,jdbcType=VARCHAR},so_charge_account =
        #{chargeAccount,jdbcType=VARCHAR},so_charge_account2 =
        #{chargeAccount2,jdbcType=VARCHAR},so_beizhu =
        #{beiZhu,jdbcType=VARCHAR},so_create_time =
        #{createTime,jdbcType=TIMESTAMP},so_update_time =
        #{updateTime,jdbcType=TIMESTAMP} where so_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.shop.BanLiShopOrder">
        update yeshi_ec_shop_order
        <set>
            <if test="uid != null">so_uid=#{uid,jdbcType=BIGINT},</if>
            <if test="orderNo != null">so_order_no=#{orderNo,jdbcType=VARCHAR},</if>
            <if test="goods != null">so_goods_id=#{goods.id,jdbcType=BIGINT},</if>
            <if test="goodsSet != null">so_goods_set_id=#{goodsSet.id,jdbcType=BIGINT},</if>
            <if test="hongBaoPayment != null">so_payment_hongbao=#{hongBaoPayment,jdbcType=DECIMAL},
            </if>
            <if test="hongBaoPaymentState != null">so_payment_hongbao_state=#{hongBaoPaymentState,jdbcType=INTEGER},
            </if>
            <if test="balancePayment != null">so_payment_money=#{balancePayment,jdbcType=DECIMAL},</if>
            <if test="balancePaymentState != null">so_payment_money_state=#{balancePaymentState,jdbcType=INTEGER},
            </if>
            <if test="moneyPayment != null">so_payment_balance=#{moneyPayment,jdbcType=DECIMAL},</if>
            <if test="moneyPaymentState != null">so_payment_balance_state=#{moneyPaymentState,jdbcType=INTEGER},
            </if>
            <if test="payTime != null">so_pay_time=#{payTime,jdbcType=TIMESTAMP},</if>
            <if test="rejectTime != null">so_reject_time=#{rejectTime,jdbcType=TIMESTAMP},</if>
            <if test="successTime != null">so_success_time=#{successTime,jdbcType=TIMESTAMP},</if>
            <if test="state != null">so_state=#{state,jdbcType=INTEGER},</if>
            <if test="stateDesc != null">so_state_desc=#{stateDesc,jdbcType=VARCHAR},</if>
            <if test="chargeAccount != null">so_charge_account=#{chargeAccount,jdbcType=VARCHAR},</if>
            <if test="chargeAccount2 != null">so_charge_account2=#{chargeAccount2,jdbcType=VARCHAR},
            </if>
            <if test="beiZhu != null">so_beizhu=#{beiZhu,jdbcType=VARCHAR},</if>
            <if test="createTime != null">so_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">so_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
        </set>
        where so_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackBalanceServiceImpl.java
@@ -20,7 +20,7 @@
    @Resource
    private RedPackBalanceMapper redPackBalanceMapper;
    @Resource
    private RedPackDetailService redPackDetailService;
@@ -33,15 +33,14 @@
    public BigDecimal getBalance(Long uid) {
        if (uid == null || uid == 0)
            return null;
        RedPackBalance redPackBalance = redPackBalanceMapper.selectByPrimaryKey(uid);
        if (redPackBalance != null)
            return redPackBalance.getMoney();
        return null;
    }
    @Override
    public void addRedPack(Long uid, BigDecimal money) {
        if (uid == null || uid == 0 || money == null)
@@ -58,27 +57,33 @@
            redPackBalanceMapper.addRedPack(uid, money);
        }
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void addRedPack(Long uid, BigDecimal money, RedPackDetail detail) throws RedPackBalanceException {
        if (uid == null || uid == 0 || money == null ||  detail == null)
        if (uid == null || uid == 0 || money == null || detail == null)
            throw new RedPackBalanceException(1, "参数传递不完整");
        // 加入明细
        redPackDetailService.insertSelective(detail);
        // 减少红包
        redPackBalanceMapper.addRedPack(uid, money);
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void subRedPack(Long uid, BigDecimal money, RedPackDetail detail) throws RedPackBalanceException {
        if (uid == null || uid == 0 || money == null ||  detail == null)
        if (uid == null || uid == 0 || money == null || detail == null)
            throw new RedPackBalanceException(1, "参数传递不完整");
        // 加入明细
        redPackDetailService.insertSelective(detail);
        RedPackBalance balance = redPackBalanceMapper.selectForUpdate(uid);
        if (balance.getMoney() == null)
            throw new RedPackBalanceException(2, "红包余额不足");
        if (balance.getMoney().compareTo(money) < 0)
            throw new RedPackBalanceException(2, "红包余额不足");
        // 减少红包
        redPackBalanceMapper.subRedPack(uid, money);
    }
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsClassServiceImpl.java
New file
@@ -0,0 +1,22 @@
package com.yeshi.fanli.service.impl.shop;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsClassMapper;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsClass;
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsClassService;
@Service
public class BanLiShopGoodsClassServiceImpl implements BanLiShopGoodsClassService {
    @Resource
    private BanLiShopGoodsClassMapper banLiShopGoodsClassMapper;
    @Override
    public BanLiShopGoodsClass selectByPrimaryKey(Long id) {
        return banLiShopGoodsClassMapper.selectByPrimaryKey(id);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsImgServiceImpl.java
New file
@@ -0,0 +1,74 @@
package com.yeshi.fanli.service.impl.shop;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsImgMapper;
import com.yeshi.fanli.entity.shop.BanLiShopGoods;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsImg;
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsImgService;
import com.yeshi.fanli.util.StringUtil;
@Service
public class BanLiShopGoodsImgServiceImpl implements BanLiShopGoodsImgService {
    @Resource
    private BanLiShopGoodsImgMapper banLiShopGoodsImgMapper;
    // 添加图片
    @Override
    public void addImg(String pictureUrl, Long goodsId) {
        if (StringUtil.isNullOrEmpty(pictureUrl) || goodsId == null) {
            return;
        }
        String imgMD5 = StringUtil.Md5(pictureUrl);
        BanLiShopGoodsImg img = new BanLiShopGoodsImg();
        img.setCreateTime(new Date());
        img.setGoods(new BanLiShopGoods(goodsId));
        img.setUrl(pictureUrl);
        img.setUrlMD5(imgMD5);
        banLiShopGoodsImgMapper.insertSelective(img);
        if (img.getWeight() == null) {
            BanLiShopGoodsImg update = new BanLiShopGoodsImg();
            update.setId(img.getId());
            update.setWeight((int) img.getId().longValue());
            banLiShopGoodsImgMapper.updateByPrimaryKeySelective(update);
        }
    }
    @Override
    public List<BanLiShopGoodsImg> listByGoodsId(Long goodsId) {
        return banLiShopGoodsImgMapper.listByGoodsId(goodsId);
    }
    @Override
    public BanLiShopGoodsImg selectByPrimaryKey(Long id) {
        return banLiShopGoodsImgMapper.selectByPrimaryKey(id);
    }
    @Override
    public void updateSelectiveByPrimaryKey(BanLiShopGoodsImg img) {
        if (img == null || img.getId() == null)
            return;
        banLiShopGoodsImgMapper.updateByPrimaryKeySelective(img);
    }
    @Transactional
    @Override
    public void delete(List<Long> idsList) {
        if (idsList != null)
            for (Long id : idsList)
                deleteByPrimaryKey(id);
    }
    @Override
    public void deleteByPrimaryKey(Long id) {
        banLiShopGoodsImgMapper.deleteByPrimaryKey(id);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsServiceImpl.java
New file
@@ -0,0 +1,157 @@
package com.yeshi.fanli.service.impl.shop;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsMapper;
import com.yeshi.fanli.entity.shop.BanLiShopGoods;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsImg;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsSets;
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.BanLiShopGoodsImgService;
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsService;
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsSetService;
import com.yeshi.fanli.util.StringUtil;
@Service
public class BanLiShopGoodsServiceImpl implements BanLiShopGoodsService {
    @Resource
    private BanLiShopGoodsSetService banLiShopGoodsSetService;
    @Resource
    private BanLiShopGoodsImgService banLiShopGoodsImgService;
    @Resource
    private BanLiShopGoodsMapper banLiShopGoodsMapper;
    @Override
    public List<BanLiShopGoods> listGoods(String key, Integer state, int page, int pageSize) {
        return banLiShopGoodsMapper.listGoods(key, state, (page - 1) * pageSize, pageSize);
    }
    @Override
    public long countGoods(String key, Integer state) {
        return banLiShopGoodsMapper.countGoods(key, state);
    }
    @Override
    public BanLiShopGoods getGoodsDetail(Long goodsId) {
        return banLiShopGoodsMapper.selectDetailByPrimaryKey(goodsId);
    }
    @Override
    public BanLiShopGoods selectByPrimaryKey(Long id) {
        return banLiShopGoodsMapper.selectByPrimaryKey(id);
    }
    @Override
    public void addGoods(BanLiShopGoods goods)
            throws BanLiShopGoodsException, BanLiShopGoodsSetException, BanLiShopGoodsSetPayException {
        if (goods.getId() == null) {// 新增
            if (goods.getGoodsClass() == null || goods.getGoodsClass().getId() == null) {
                throw new BanLiShopGoodsSetException(1, "请指定商品分类");
            }
            if (StringUtil.isNullOrEmpty(goods.getTitle()))
                throw new BanLiShopGoodsSetException(1, "缺少标题");
            if (StringUtil.isNullOrEmpty(goods.getPicture()))
                throw new BanLiShopGoodsSetException(1, "缺少封面图");
            // 默认上线
            if (goods.getState() == null)
                goods.setState(BanLiShopGoods.STATE_ONLINE);
            if (goods.getSalesCount() == null)
                goods.setSalesCount(0L);
            if (goods.getCreateTime() == null)
                goods.setCreateTime(new Date());
            banLiShopGoodsMapper.insertSelective(goods);
            if (goods.getWeight() == null) {// 权重更新
                BanLiShopGoods update = new BanLiShopGoods();
                update.setId(goods.getId());
                update.setWeight((int) goods.getId().longValue());
                banLiShopGoodsMapper.updateByPrimaryKeySelective(update);
            }
            if (goods.getSetsList() != null && goods.getSetsList().size() > 0) {
                for (BanLiShopGoodsSets set : goods.getSetsList())// 更新支付方式
                {
                    set.setGoods(goods);
                    banLiShopGoodsSetService.addSet(set);
                }
            }
            // TODO 更改图片
            if (goods.getImgList() != null)
                for (BanLiShopGoodsImg img : goods.getImgList()) {
                    banLiShopGoodsImgService.addImg(img.getUrl(), goods.getId());
                }
        } else {// 修改
            updateSelectiveByPrimaryKey(goods);
            // 更新支付方式
            if (goods.getSetsList() != null && goods.getSetsList().size() > 0) {
                // 删除原有套餐
                List<BanLiShopGoodsSets> setList = banLiShopGoodsSetService.listByGoodsId(goods.getId());
                for (BanLiShopGoodsSets set : setList)
                    banLiShopGoodsSetService.deleteByPrimaryKey(set.getId());
                // 添加新的套餐
                for (BanLiShopGoodsSets set : goods.getSetsList())// 更新支付方式
                    banLiShopGoodsSetService.addSet(set);
            }
            // 更新图片
            if (goods.getImgList() != null && goods.getImgList().size() > 0) {
                // 删除原有图片
                List<BanLiShopGoodsImg> imgList = banLiShopGoodsImgService.listByGoodsId(goods.getId());
                for (BanLiShopGoodsImg img : imgList)
                    banLiShopGoodsImgService.deleteByPrimaryKey(img.getId());
                // 添加新的图片
                for (BanLiShopGoodsImg img : goods.getImgList())// 更新支付方式
                    banLiShopGoodsImgService.addImg(img.getUrl(), goods.getId());
            }
        }
    }
    @Override
    public void updateSelectiveByPrimaryKey(BanLiShopGoods goods) {
        if (goods == null || goods.getId() == null)
            return;
        if (goods.getUpdateTime() == null)
            goods.setUpdateTime(new Date());
    }
    @Transactional
    @Override
    public void delete(List<Long> idsList) {
        if (idsList != null)
            for (Long id : idsList)
                deleteByPrimaryKey(id);
    }
    @Transactional
    @Override
    public void deleteByPrimaryKey(Long id) {
        banLiShopGoodsMapper.deleteByPrimaryKey(id);
        List<BanLiShopGoodsSets> setList = banLiShopGoodsSetService.listByGoodsId(id);
        if (setList != null)
            for (BanLiShopGoodsSets set : setList)
                banLiShopGoodsSetService.deleteByPrimaryKey(set.getId());
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsSetPayServiceImpl.java
New file
@@ -0,0 +1,100 @@
package com.yeshi.fanli.service.impl.shop;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsSetsPayMapper;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsSetsPay;
import com.yeshi.fanli.exception.shop.BanLiShopGoodsSetPayException;
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsSetPayService;
@Service
public class BanLiShopGoodsSetPayServiceImpl implements BanLiShopGoodsSetPayService {
    @Resource
    private BanLiShopGoodsSetsPayMapper banLiShopGoodsSetsPayMapper;
    @Override
    public List<BanLiShopGoodsSetsPay> listByGoodsSetId(Long goodsSetId) {
        return banLiShopGoodsSetsPayMapper.listByGoodsSetId(goodsSetId);
    }
    @Override
    public int countByGoodsSetId(Long goodsSetId) {
        return (int) banLiShopGoodsSetsPayMapper.countByGoodsSetId(goodsSetId);
    }
    @Override
    public BanLiShopGoodsSetsPay selectByPrimaryKey(Long id) {
        return banLiShopGoodsSetsPayMapper.selectByPrimaryKey(id);
    }
    @Transactional
    @Override
    public void addSetPay(BanLiShopGoodsSetsPay pay) throws BanLiShopGoodsSetPayException {
        if (pay.getId() == null)// 新增
        {
            // 判断参数是否齐全
            if (pay.getGoodsSet() == null || pay.getGoodsSet().getId() == null)
                throw new BanLiShopGoodsSetPayException(1, "套餐不存在");
            if (pay.getPayType() == null)
                throw new BanLiShopGoodsSetPayException(1, "请指定支付方式");
            if (pay.getPayType() == BanLiShopGoodsSetsPay.PAY_TYPE_HONGBAO) {
                if (pay.getHongBaoPrice() == null)
                    throw new BanLiShopGoodsSetPayException(1, "请指定价格");
            } else if (pay.getPayType() == BanLiShopGoodsSetsPay.PAY_TYPE_BALANCE) {
                if (pay.getBalancePrice() == null)
                    throw new BanLiShopGoodsSetPayException(1, "请指定价格");
            } else if (pay.getPayType() == BanLiShopGoodsSetsPay.PAY_TYPE_HONGBAO_MONEY) {
                if (pay.getHongBaoPrice() == null || pay.getMoneyPrice() == null)
                    throw new BanLiShopGoodsSetPayException(1, "请指定价格");
            } else if (pay.getPayType() == BanLiShopGoodsSetsPay.PAY_TYPE_MONEY) {
                if (pay.getMoneyPrice() == null)
                    throw new BanLiShopGoodsSetPayException(1, "请指定价格");
            }
            if (pay.getCreateTime() == null)
                pay.setCreateTime(new Date());
            banLiShopGoodsSetsPayMapper.insertSelective(pay);
            if (pay.getWeight() == null) {// 权重更新
                BanLiShopGoodsSetsPay update = new BanLiShopGoodsSetsPay();
                update.setId(pay.getId());
                update.setWeight((int) pay.getId().longValue());
                banLiShopGoodsSetsPayMapper.updateByPrimaryKeySelective(update);
            }
        } else {// 修改
            updateSelectiveByPrimaryKey(pay);
        }
    }
    @Override
    public void updateSelectiveByPrimaryKey(BanLiShopGoodsSetsPay pay) {
        if (pay.getId() == null)
            return;
        if (pay.getUpdateTime() == null)
            pay.setUpdateTime(new Date());
        banLiShopGoodsSetsPayMapper.updateByPrimaryKeySelective(pay);
    }
    @Transactional
    @Override
    public void delete(List<Long> idsList) {
        if (idsList != null)
            for (Long id : idsList)
                deleteByPrimaryKey(id);
    }
    @Override
    public void deleteByPrimaryKey(Long id) {
        banLiShopGoodsSetsPayMapper.deleteByPrimaryKey(id);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsSetServiceImpl.java
New file
@@ -0,0 +1,130 @@
package com.yeshi.fanli.service.impl.shop;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.yeshi.fanli.dao.mybatis.shop.BanLiShopGoodsSetsMapper;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsSets;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsSetsPay;
import com.yeshi.fanli.exception.shop.BanLiShopGoodsSetException;
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.util.StringUtil;
@Service
public class BanLiShopGoodsSetServiceImpl implements BanLiShopGoodsSetService {
    @Resource
    private BanLiShopGoodsSetPayService banLiShopGoodsSetPayService;
    @Resource
    private BanLiShopGoodsSetsMapper banLiShopGoodsSetsMapper;
    @Override
    public List<BanLiShopGoodsSets> listByGoodsId(Long goodsId) {
        return banLiShopGoodsSetsMapper.listByGoodsId(goodsId);
    }
    @Override
    public int countByGoodsId(Long goodsId) {
        return (int) banLiShopGoodsSetsMapper.countByGoodsId(goodsId);
    }
    @Override
    public BanLiShopGoodsSets selectByPrimaryKey(Long id) {
        return banLiShopGoodsSetsMapper.selectByPrimaryKey(id);
    }
    @Transactional
    @Override
    public void addSet(BanLiShopGoodsSets set) throws BanLiShopGoodsSetException, BanLiShopGoodsSetPayException {
        if (set.getId() == null)// 添加
        {
            if (set.getGoods() == null || set.getGoods().getId() == null) {
                throw new BanLiShopGoodsSetException(1, "请指定商品");
            }
            if (StringUtil.isNullOrEmpty(set.getName()))
                throw new BanLiShopGoodsSetException(1, "缺少套餐名字");
            if (set.getOriginalPrice() == null || set.getZkPrice() == null) {
                throw new BanLiShopGoodsSetException(1, "价格信息不完整");
            }
            if (set.getStock() == null) {
                throw new BanLiShopGoodsSetException(1, "缺少库存信息");
            }
            if (set.getSalesCount() == null)
                set.setSalesCount(0L);
            if (set.getCreateTime() == null)
                set.setCreateTime(new Date());
            banLiShopGoodsSetsMapper.insertSelective(set);
            if (set.getWeight() == null) {// 权重更新
                BanLiShopGoodsSets update = new BanLiShopGoodsSets();
                update.setId(set.getId());
                update.setWeight((int) set.getId().longValue());
                banLiShopGoodsSetsMapper.updateByPrimaryKeySelective(update);
            }
            if (set.getPayList() != null && set.getPayList().size() > 0) {
                for (BanLiShopGoodsSetsPay pay : set.getPayList())// 添加支付方式
                {
                    pay.setGoodsSet(set);
                    banLiShopGoodsSetPayService.addSetPay(pay);
                }
            }
        } else {// 修改
            if (set.getUpdateTime() == null) {
                set.setUpdateTime(new Date());
            }
            banLiShopGoodsSetsMapper.updateByPrimaryKeySelective(set);
            // 更新支付方式
            if (set.getPayList() != null && set.getPayList().size() > 0) {
                for (BanLiShopGoodsSetsPay pay : set.getPayList())// 更新支付方式
                    banLiShopGoodsSetPayService.addSetPay(pay);
            }
        }
    }
    @Override
    public void updateSelectiveByPrimaryKey(BanLiShopGoodsSets set) {
        if (set.getId() == null)
            return;
        if (set.getUpdateTime() == null)
            set.setUpdateTime(new Date());
        banLiShopGoodsSetsMapper.updateByPrimaryKeySelective(set);
    }
    @Transactional
    @Override
    public void delete(List<Long> idsList) {
        if (idsList != null)
            for (Long id : idsList)
                deleteByPrimaryKey(id);
    }
    @Transactional
    @Override
    public void deleteByPrimaryKey(Long id) {
        banLiShopGoodsSetsMapper.deleteByPrimaryKey(id);
        List<BanLiShopGoodsSetsPay> payList = banLiShopGoodsSetPayService.listByGoodsSetId(id);
        if (payList != null)
            for (BanLiShopGoodsSetsPay pay : payList) {// 删除支付方式
                banLiShopGoodsSetPayService.deleteByPrimaryKey(pay.getId());
            }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopOrderPayServiceImpl.java
New file
@@ -0,0 +1,155 @@
package com.yeshi.fanli.service.impl.shop;
import java.math.BigDecimal;
import java.util.Date;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.yeshi.fanli.entity.redpack.RedPackDetail;
import com.yeshi.fanli.entity.shop.BanLiShopGoods;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsClass;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsSets;
import com.yeshi.fanli.entity.shop.BanLiShopOrder;
import com.yeshi.fanli.exception.redpack.RedPackBalanceException;
import com.yeshi.fanli.exception.redpack.RedPackDetailException;
import com.yeshi.fanli.exception.shop.BanLiShopOrderException;
import com.yeshi.fanli.service.inter.redpack.RedPackBalanceService;
import com.yeshi.fanli.service.inter.redpack.RedPackDetailService;
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsClassService;
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsService;
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsSetService;
import com.yeshi.fanli.service.inter.shop.BanLiShopOrderPayService;
import com.yeshi.fanli.service.inter.shop.BanLiShopOrderService;
import com.yeshi.fanli.util.factory.RedPackDetailFactory;
@Service
public class BanLiShopOrderPayServiceImpl implements BanLiShopOrderPayService {
    @Resource
    private BanLiShopGoodsSetService banLiShopGoodsSetService;
    @Resource
    private BanLiShopGoodsService banLiShopGoodsService;
    @Resource
    private BanLiShopGoodsClassService banLiShopGoodsClassService;
    @Resource
    private RedPackBalanceService redPackBalanceService;
    @Resource
    private BanLiShopOrderService banLiShopOrderService;
    @Resource
    private RedPackDetailService redPackDetailService;
    @Transactional
    @Override
    public void payOrderByHongBao(Long orderId) throws BanLiShopOrderException, RedPackBalanceException {
        BanLiShopOrder order = banLiShopOrderService.selectByPrimaryKeyForUpdate(orderId);
        if (order == null) {
            throw new BanLiShopOrderException(1, "订单不存在");
        }
        if (order.getHongBaoPayment() == null)
            throw new BanLiShopOrderException(2, "不需要采用红包支付");
        if (order.getHongBaoPaymentState() != null && order.getHongBaoPaymentState() == BanLiShopOrder.PAY_STATE_PAID) {
            throw new BanLiShopOrderException(3, "重复支付");
        }
        BanLiShopGoods goods = banLiShopGoodsService.selectByPrimaryKey(order.getGoods().getId());
        BanLiShopGoodsClass goodsClass = banLiShopGoodsClassService.selectByPrimaryKey(goods.getGoodsClass().getId());
        BanLiShopGoodsSets set = banLiShopGoodsSetService.selectByPrimaryKey(order.getGoodsSet().getId());
        RedPackDetail detail = null;
        try {
            detail = RedPackDetailFactory.createUseByShopOrder(orderId, order.getUid(), goodsClass.getName(),
                    set.getName(), order.getHongBaoPayment());
        } catch (RedPackDetailException e) {
            e.printStackTrace();
        }
        if (detail == null)
            throw new RedPackBalanceException(4, "红包详情失败");
        redPackBalanceService.subRedPack(order.getUid(), order.getHongBaoPayment(), detail);
        BanLiShopOrder update = new BanLiShopOrder();
        update.setId(order.getId());
        update.setHongBaoPaymentState(BanLiShopOrder.PAY_STATE_PAID);
        // 判断其他待支付项是否已经支付
        update.setUpdateTime(new Date());
        if (order.getState() == BanLiShopOrder.STATE_NO_PAY)
            if ((order.getBalancePaymentState() == null
                    || order.getBalancePaymentState() == BanLiShopOrder.PAY_STATE_PAID)
                    && (order.getMoneyPaymentState() == null
                            || order.getMoneyPaymentState() == BanLiShopOrder.PAY_STATE_PAID))// 其他待支付项已经支付
                update.setState(BanLiShopOrder.STATE_PAID);
        banLiShopOrderService.udpateSelectiveByPrimaryKey(update);
        if (update.getState() != null && update.getState() == BanLiShopOrder.STATE_PAID) {
            paySuccess(order);
        }
    }
    @Transactional
    @Override
    public void payOrderByMoney(Long orderId, BigDecimal money) throws BanLiShopOrderException {
        BanLiShopOrder order = banLiShopOrderService.selectByPrimaryKeyForUpdate(orderId);
        if (order == null) {
            throw new BanLiShopOrderException(1, "订单不存在");
        }
        if (order.getMoneyPayment() == null)
            throw new BanLiShopOrderException(2, "不需要采用现金支付");
        if (order.getMoneyPaymentState() != null && order.getMoneyPaymentState() == BanLiShopOrder.PAY_STATE_PAID) {
            throw new BanLiShopOrderException(3, "重复支付");
        }
        if (order.getMoneyPayment().compareTo(money) > 0) {
            throw new BanLiShopOrderException(4, "支付金额不够");
        }
        // 支付成功
        BanLiShopOrder update = new BanLiShopOrder();
        update.setId(order.getId());
        update.setMoneyPaymentState(BanLiShopOrder.PAY_STATE_PAID);
        // 判断其他待支付项是否已经支付
        update.setUpdateTime(new Date());
        if (order.getState() == BanLiShopOrder.STATE_NO_PAY)
            if ((order.getBalancePaymentState() == null
                    || order.getBalancePaymentState() == BanLiShopOrder.PAY_STATE_PAID)
                    && (order.getHongBaoPaymentState() == null
                            || order.getHongBaoPaymentState() == BanLiShopOrder.PAY_STATE_PAID))// 其他待支付项已经支付
                update.setState(BanLiShopOrder.STATE_PAID);
        banLiShopOrderService.udpateSelectiveByPrimaryKey(update);
        if (update.getState() != null && update.getState() == BanLiShopOrder.STATE_PAID) {
            paySuccess(order);
        }
    }
    /**
     * 支付成功
     */
    private void paySuccess(BanLiShopOrder order) {
        // 将红包明细外显
        RedPackDetail detail = null;
        try {
            detail = RedPackDetailFactory.createUseByShopOrder(order.getId(), order.getUid(), "", "",
                    order.getHongBaoPayment());
        } catch (RedPackDetailException e) {
            e.printStackTrace();
        }
        if (detail != null) {
            RedPackDetail oldDetail = redPackDetailService.getByIdentifyCode(detail.getIdentifyCode());
            if (oldDetail != null) {// 外显红包详情
                RedPackDetail update = new RedPackDetail();
                update.setId(oldDetail.getId());
                update.setDisplay(true);
                redPackDetailService.updateByPrimaryKeySelective(update);
            }
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopOrderServiceImpl.java
New file
@@ -0,0 +1,198 @@
package com.yeshi.fanli.service.impl.shop;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.yeshi.fanli.dao.mybatis.shop.BanLiShopOrderMapper;
import com.yeshi.fanli.entity.redpack.RedPackDetail;
import com.yeshi.fanli.entity.shop.BanLiShopGoods;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsClass;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsSets;
import com.yeshi.fanli.entity.shop.BanLiShopOrder;
import com.yeshi.fanli.exception.redpack.RedPackBalanceException;
import com.yeshi.fanli.exception.redpack.RedPackDetailException;
import com.yeshi.fanli.exception.shop.BanLiShopOrderException;
import com.yeshi.fanli.service.inter.redpack.RedPackBalanceService;
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsClassService;
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsService;
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsSetService;
import com.yeshi.fanli.service.inter.shop.BanLiShopOrderService;
import com.yeshi.fanli.util.factory.RedPackDetailFactory;
import com.yeshi.fanli.util.shop.BanLiShopUtil;
@Service
public class BanLiShopOrderServiceImpl implements BanLiShopOrderService {
    @Resource
    private BanLiShopOrderMapper banLiShopOrderMapper;
    @Resource
    private BanLiShopGoodsSetService banLiShopGoodsSetService;
    @Resource
    private BanLiShopGoodsService banLiShopGoodsService;
    @Resource
    private BanLiShopGoodsClassService banLiShopGoodsClassService;
    @Resource
    private RedPackBalanceService redPackBalanceService;
    @Transactional
    @Override
    public void addOrder(BanLiShopOrder order) throws BanLiShopOrderException {
        // 查询必要的参数是否添加
        if (order.getGoodsSet() == null || order.getGoodsSet().getId() == null || order.getGoods() == null
                || order.getGoods().getId() == null)
            throw new BanLiShopOrderException(1, "未选择商品");
        if (order.getUid() == null)
            throw new BanLiShopOrderException(1, "缺少用户ID");
        if (order.getHongBaoPayment() == null || order.getBalancePayment() == null || order.getMoneyPayment() == null) {
            throw new BanLiShopOrderException(1, "未选择支付方式");
        }
        if (order.getHongBaoPayment() != null) {
            order.setHongBaoPaymentState(BanLiShopOrder.PAY_STATE_NOPAY);
        }
        if (order.getBalancePayment() != null) {
            order.setBalancePaymentState(BanLiShopOrder.PAY_STATE_NOPAY);
        }
        if (order.getMoneyPayment() != null) {
            order.setMoneyPaymentState(BanLiShopOrder.PAY_STATE_NOPAY);
        }
        order.setState(BanLiShopOrder.STATE_NO_PAY);
        // 判断商品套餐是否存在
        BanLiShopGoodsSets set = banLiShopGoodsSetService.selectByPrimaryKey(order.getGoodsSet().getId());
        if (set == null) {
            throw new BanLiShopOrderException(1, "商品套餐不存在");
        }
        BanLiShopGoods goods = banLiShopGoodsService.selectByPrimaryKey(order.getGoods().getId());
        if (goods == null) {
            throw new BanLiShopOrderException(1, "商品已下线");
        }
        if (goods.getCreateTime() == null)
            goods.setCreateTime(new Date());
        banLiShopOrderMapper.insertSelective(order);
        // 添加订单号
        String orderNo = BanLiShopUtil.createOrderNo(order.getId());
        // 更新订单号
        BanLiShopOrder update = new BanLiShopOrder();
        update.setId(order.getId());
        update.setOrderNo(orderNo);
        banLiShopOrderMapper.updateByPrimaryKeySelective(update);
    }
    @Override
    public List<BanLiShopOrder> listByUid(Long uid, int page, int pageSize) {
        return null;
    }
    @Override
    public long countByUid(Long uid) {
        return 0;
    }
    @Override
    public BanLiShopOrder selectByPrimaryKey(Long id) {
        return null;
    }
    @Override
    public void udpateSelectiveByPrimaryKey(BanLiShopOrder order) {
    }
    @Transactional
    @Override
    public void payOrderByHongBao(Long orderId) throws BanLiShopOrderException, RedPackBalanceException {
        BanLiShopOrder order = banLiShopOrderMapper.selectByPrimaryKeyForUpdate(orderId);
        if (order == null) {
            throw new BanLiShopOrderException(1, "订单不存在");
        }
        if (order.getHongBaoPayment() == null)
            throw new BanLiShopOrderException(2, "不需要采用红包支付");
        if (order.getHongBaoPaymentState() != null && order.getHongBaoPaymentState() == BanLiShopOrder.PAY_STATE_PAID) {
            throw new BanLiShopOrderException(3, "重复支付");
        }
        BanLiShopGoods goods = banLiShopGoodsService.selectByPrimaryKey(order.getGoods().getId());
        BanLiShopGoodsClass goodsClass = banLiShopGoodsClassService.selectByPrimaryKey(goods.getGoodsClass().getId());
        BanLiShopGoodsSets set = banLiShopGoodsSetService.selectByPrimaryKey(order.getGoodsSet().getId());
        RedPackDetail detail = null;
        try {
            detail = RedPackDetailFactory.createUseByShopOrder(orderId, order.getUid(), goodsClass.getName(),
                    set.getName(), order.getHongBaoPayment());
        } catch (RedPackDetailException e) {
            e.printStackTrace();
        }
        if (detail == null)
            throw new RedPackBalanceException(4, "红包详情失败");
        redPackBalanceService.subRedPack(order.getUid(), order.getHongBaoPayment(), detail);
        BanLiShopOrder update = new BanLiShopOrder();
        update.setHongBaoPaymentState(BanLiShopOrder.PAY_STATE_PAID);
        // 判断其他待支付项是否已经支付
        update.setUpdateTime(new Date());
        if (order.getState() == BanLiShopOrder.PAY_STATE_NOPAY)
            if ((order.getBalancePaymentState() == null
                    || order.getBalancePaymentState() == BanLiShopOrder.PAY_STATE_PAID)
                    && (order.getMoneyPaymentState() == null
                            || order.getMoneyPaymentState() == BanLiShopOrder.PAY_STATE_PAID))// 其他待支付项已经支付
                update.setState(BanLiShopOrder.PAY_STATE_PAID);
        banLiShopOrderMapper.updateByPrimaryKeySelective(update);
    }
    @Override
    public void payOrderByMoney(Long orderId, BigDecimal money) throws BanLiShopOrderException {
        BanLiShopOrder order = banLiShopOrderMapper.selectByPrimaryKeyForUpdate(orderId);
        if (order == null) {
            throw new BanLiShopOrderException(1, "订单不存在");
        }
        if (order.getMoneyPayment() == null)
            throw new BanLiShopOrderException(2, "不需要采用现金支付");
        if (order.getMoneyPaymentState() != null && order.getMoneyPaymentState() == BanLiShopOrder.PAY_STATE_PAID) {
            throw new BanLiShopOrderException(3, "重复支付");
        }
        if (order.getMoneyPayment().compareTo(money) > 0) {
            throw new BanLiShopOrderException(4, "支付金额不够");
        }
        // 支付成功
        BanLiShopOrder update = new BanLiShopOrder();
        update.setMoneyPaymentState(BanLiShopOrder.PAY_STATE_PAID);
        // 判断其他待支付项是否已经支付
        update.setUpdateTime(new Date());
        if (order.getState() == BanLiShopOrder.PAY_STATE_NOPAY)
            if ((order.getBalancePaymentState() == null
                    || order.getBalancePaymentState() == BanLiShopOrder.PAY_STATE_PAID)
                    && (order.getHongBaoPaymentState() == null
                            || order.getHongBaoPaymentState() == BanLiShopOrder.PAY_STATE_PAID))// 其他待支付项已经支付
                update.setState(BanLiShopOrder.PAY_STATE_PAID);
        banLiShopOrderMapper.updateByPrimaryKeySelective(update);
    }
    @Override
    public BanLiShopOrder selectByPrimaryKeyForUpdate(Long id) {
        return banLiShopOrderMapper.selectByPrimaryKeyForUpdate(id);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopGoodsClassService.java
New file
@@ -0,0 +1,15 @@
package com.yeshi.fanli.service.inter.shop;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsClass;
/**
 * 板栗商城商品分类服务
 *
 * @author Administrator
 *
 */
public interface BanLiShopGoodsClassService {
    public BanLiShopGoodsClass selectByPrimaryKey(Long id);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopGoodsImgService.java
New file
@@ -0,0 +1,59 @@
package com.yeshi.fanli.service.inter.shop;
import java.util.List;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsImg;
/**
 * 板栗商城图片服务
 *
 * @author Administrator
 *
 */
public interface BanLiShopGoodsImgService {
    /**
     * 添加图片
     *
     * @param pictureUrl
     */
    public void addImg(String pictureUrl, Long goodsId);
    /**
     * 根据商品ID查询图片
     *
     * @param goodsId
     * @return
     */
    public List<BanLiShopGoodsImg> listByGoodsId(Long goodsId);
    /**
     * 根据主键检索
     *
     * @param id
     * @return
     */
    public BanLiShopGoodsImg selectByPrimaryKey(Long id);
    /**
     * 按主键更新
     *
     * @param goods
     */
    public void updateSelectiveByPrimaryKey(BanLiShopGoodsImg img);
    /**
     * 批量删除
     *
     * @param idsList
     */
    public void delete(List<Long> idsList);
    /**
     * 按主键删除
     *
     * @param id
     */
    public void deleteByPrimaryKey(Long id);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopGoodsService.java
New file
@@ -0,0 +1,81 @@
package com.yeshi.fanli.service.inter.shop;
import java.util.List;
import com.yeshi.fanli.entity.shop.BanLiShopGoods;
import com.yeshi.fanli.exception.shop.BanLiShopGoodsException;
import com.yeshi.fanli.exception.shop.BanLiShopGoodsSetException;
import com.yeshi.fanli.exception.shop.BanLiShopGoodsSetPayException;
/**
 * 板栗商城商品服务
 *
 * @author Administrator
 *
 */
public interface BanLiShopGoodsService {
    /**
     * 商品列表
     *
     * @param key
     * @param page
     * @param pageSize
     * @return
     */
    public List<BanLiShopGoods> listGoods(String key, Integer state, int page, int pageSize);
    /**
     * 查询商品数量
     *
     * @param key
     * @param state
     * @return
     */
    public long countGoods(String key, Integer state);
    /**
     * 获取商品详情
     *
     * @param goodsId
     * @return
     */
    public BanLiShopGoods getGoodsDetail(Long goodsId);
    /**
     * 主键检索
     *
     * @param id
     * @return
     */
    public BanLiShopGoods selectByPrimaryKey(Long id);
    /**
     * 添加商品
     *
     * @param goods
     * @throws BanLiShopGoodsException
     */
    public void addGoods(BanLiShopGoods goods)
            throws BanLiShopGoodsException, BanLiShopGoodsSetException, BanLiShopGoodsSetPayException;
    /**
     * 按主键更新
     *
     * @param goods
     */
    public void updateSelectiveByPrimaryKey(BanLiShopGoods goods);
    /**
     * 批量删除
     *
     * @param idsList
     */
    public void delete(List<Long> idsList);
    /**
     * 按主键删除
     *
     * @param id
     */
    public void deleteByPrimaryKey(Long id);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopGoodsSetPayService.java
New file
@@ -0,0 +1,68 @@
package com.yeshi.fanli.service.inter.shop;
import java.util.List;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsSetsPay;
import com.yeshi.fanli.exception.shop.BanLiShopGoodsSetPayException;
/**
 * 板栗商城商品套餐支付方式配置服务
 *
 * @author Administrator
 *
 */
public interface BanLiShopGoodsSetPayService {
    /**
     * 查询商品下的所有套餐
     *
     * @param goodsId
     * @return
     */
    public List<BanLiShopGoodsSetsPay> listByGoodsSetId(Long goodsSetId);
    /**
     * 计算商品下的套餐数量
     *
     * @param goodsId
     * @return
     */
    public int countByGoodsSetId(Long goodsSetId);
    /**
     * 主键查询
     *
     * @param id
     * @return
     */
    public BanLiShopGoodsSetsPay selectByPrimaryKey(Long id);
    /**
     * 添加套餐
     *
     * @param set
     */
    public void addSetPay(BanLiShopGoodsSetsPay pay) throws BanLiShopGoodsSetPayException;
    /**
     * 按主键更新
     *
     * @param set
     */
    public void updateSelectiveByPrimaryKey(BanLiShopGoodsSetsPay pay);
    /**
     * 批量删除
     *
     * @param idsList
     */
    public void delete(List<Long> idsList);
    /**
     * 按主键删除
     *
     * @param id
     */
    public void deleteByPrimaryKey(Long id);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopGoodsSetService.java
New file
@@ -0,0 +1,69 @@
package com.yeshi.fanli.service.inter.shop;
import java.util.List;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsSets;
import com.yeshi.fanli.exception.shop.BanLiShopGoodsSetException;
import com.yeshi.fanli.exception.shop.BanLiShopGoodsSetPayException;
/**
 * 板栗商城商品套餐服务
 *
 * @author Administrator
 *
 */
public interface BanLiShopGoodsSetService {
    /**
     * 查询商品下的所有套餐
     *
     * @param goodsId
     * @return
     */
    public List<BanLiShopGoodsSets> listByGoodsId(Long goodsId);
    /**
     * 计算商品下的套餐数量
     *
     * @param goodsId
     * @return
     */
    public int countByGoodsId(Long goodsId);
    /**
     * 主键查询
     *
     * @param id
     * @return
     */
    public BanLiShopGoodsSets selectByPrimaryKey(Long id);
    /**
     * 添加套餐
     *
     * @param set
     */
    public void addSet(BanLiShopGoodsSets set) throws BanLiShopGoodsSetException, BanLiShopGoodsSetPayException;
    /**
     * 按主键更新
     *
     * @param set
     */
    public void updateSelectiveByPrimaryKey(BanLiShopGoodsSets set);
    /**
     * 批量删除
     *
     * @param idsList
     */
    public void delete(List<Long> idsList);
    /**
     * 按主键删除
     *
     * @param id
     */
    public void deleteByPrimaryKey(Long id);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopOrderPayService.java
New file
@@ -0,0 +1,32 @@
package com.yeshi.fanli.service.inter.shop;
import java.math.BigDecimal;
import com.yeshi.fanli.exception.redpack.RedPackBalanceException;
import com.yeshi.fanli.exception.shop.BanLiShopOrderException;
/**
 * 板栗商城订单服务
 *
 * @author Administrator
 *
 */
public interface BanLiShopOrderPayService {
    /**
     * 订单支付(用红包)
     *
     * @param orderId
     * @throws BanLiShopOrderException
     * @throws RedPackBalanceException
     */
    public void payOrderByHongBao(Long orderId) throws BanLiShopOrderException, RedPackBalanceException;
    /**
     * 订单支付(用现金)
     *
     * @param orderId
     * @throws BanLiShopOrderException
     */
    public void payOrderByMoney(Long orderId, BigDecimal money) throws BanLiShopOrderException;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopOrderService.java
New file
@@ -0,0 +1,79 @@
package com.yeshi.fanli.service.inter.shop;
import java.math.BigDecimal;
import java.util.List;
import com.yeshi.fanli.entity.shop.BanLiShopOrder;
import com.yeshi.fanli.exception.redpack.RedPackBalanceException;
import com.yeshi.fanli.exception.shop.BanLiShopOrderException;
/**
 * 板栗商城订单服务
 *
 * @author Administrator
 *
 */
public interface BanLiShopOrderService {
    /**
     * 添加订单
     *
     * @param order
     * @throws BanLiShopOrderException
     */
    public void addOrder(BanLiShopOrder order) throws BanLiShopOrderException;
    /**
     * 订单支付(用红包)
     *
     * @param orderId
     * @throws BanLiShopOrderException
     * @throws RedPackBalanceException
     */
    public void payOrderByHongBao(Long orderId) throws BanLiShopOrderException, RedPackBalanceException;
    /**
     * 订单支付(用现金)
     *
     * @param orderId
     * @throws BanLiShopOrderException
     */
    public void payOrderByMoney(Long orderId,BigDecimal money) throws BanLiShopOrderException;
    public BanLiShopOrder selectByPrimaryKeyForUpdate(Long id);
    /**
     * 根据用户ID检索
     *
     * @param uid
     * @param page
     * @param pageSize
     * @return
     */
    public List<BanLiShopOrder> listByUid(Long uid, int page, int pageSize);
    /**
     * 根据用户ID计算
     *
     * @param uid
     * @return
     */
    public long countByUid(Long uid);
    /**
     * 根据主键检索
     *
     * @param id
     * @return
     */
    public BanLiShopOrder selectByPrimaryKey(Long id);
    /**
     * 根据主键更新
     *
     * @param order
     */
    public void udpateSelectiveByPrimaryKey(BanLiShopOrder order);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/taobao/dataoke/DaTaoKeGoodsDetailV2Service.java
@@ -6,7 +6,6 @@
import com.yeshi.fanli.dto.dataoke.DingDongQiangDTO;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
/**
fanli/src/main/java/com/yeshi/fanli/util/factory/RedPackDetailFactory.java
@@ -13,7 +13,7 @@
public class RedPackDetailFactory {
    /**
     *  红包提现
     * 红包提现
     * 
     * @param extract
     * @return
@@ -21,10 +21,10 @@
    public static RedPackDetail createExchange(RedPackExchange exchange) throws RedPackDetailException {
        if (exchange == null)
            throw new RedPackDetailException(1, "提现记录不能为空");
        RedPackDetail detail = new RedPackDetail();
        detail.setDisplay(false);
        detail.setDesc( "等待人工审核");
        detail.setDesc("等待人工审核");
        detail.setUid(exchange.getUid());
        detail.setMoney(new BigDecimal("-" + exchange.getMoney()));
        detail.setType(RedPackDetailTypeEnum.redExchange);
@@ -34,9 +34,8 @@
        return detail;
    }
    /**
     *  红包提现通过
     * 红包提现通过
     * 
     * @param extract
     * @return
@@ -44,10 +43,10 @@
    public static RedPackDetail updateExchangePass(Long id, RedPackExchange exchange) throws RedPackDetailException {
        if (id == null)
            throw new RedPackDetailException(1, "明细ID不能为空");
        if (exchange == null)
            throw new RedPackDetailException(1, "提现记录不能为空");
        RedPackDetail detail = new RedPackDetail();
        detail.setId(id);
        detail.setDisplay(true);
@@ -57,10 +56,9 @@
        detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.redExchangePass.name() + ":" + exchange.getId()));
        return detail;
    }
    /**
     *  红包提现拒绝
     * 红包提现拒绝
     * 
     * @param extract
     * @return
@@ -68,7 +66,7 @@
    public static RedPackDetail createExchangeReject(RedPackExchange exchange) throws RedPackDetailException {
        if (exchange == null)
            throw new RedPackDetailException(1, "提现记录不能为空");
        // 红包明细- 退回红包
        RedPackDetail detail = new RedPackDetail();
        detail.setDisplay(false);
@@ -81,11 +79,10 @@
        detail.setCreateTime(new Date());
        return detail;
    }
    /**
     * 赠送好友明细
     *
     * @param giveRecord
     * @return
     * @throws RedPackDetailException
@@ -103,15 +100,17 @@
        detail.setCreateTime(new Date());
        return detail;
    }
    /**
     * 赠送成功
     *
     * @param id
     * @param giveRecord
     * @return
     * @throws RedPackDetailException
     */
    public static RedPackDetail createGiveOthersSucceed(Long id, RedPackGiveRecord giveRecord) throws RedPackDetailException {
    public static RedPackDetail createGiveOthersSucceed(Long id, RedPackGiveRecord giveRecord)
            throws RedPackDetailException {
        if (giveRecord == null)
            throw new RedPackDetailException(1, "赠送记录不能为空");
        RedPackDetail detail = new RedPackDetail();
@@ -119,14 +118,15 @@
        detail.setDisplay(true);
        detail.setType(RedPackDetailTypeEnum.giveOthersSucceed);
        detail.setTitle(RedPackDetailTypeEnum.giveOthersSucceed.getDesc());
        detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.giveOthersSucceed.name() + ":" + giveRecord.getId()));
        detail.setIdentifyCode(
                StringUtil.Md5(RedPackDetailTypeEnum.giveOthersSucceed.name() + ":" + giveRecord.getId()));
        detail.setCreateTime(new Date());
        return detail;
    }
    /**
     * 赠送失败
     *
     * @param giveRecord
     * @return
     * @throws RedPackDetailException
@@ -144,10 +144,10 @@
        detail.setCreateTime(new Date());
        return detail;
    }
    /**
     * 赠送失败
     *
     * @param giveRecord
     * @return
     * @throws RedPackDetailException
@@ -161,11 +161,34 @@
        detail.setMoney(giveRecord.getAmount());
        detail.setType(RedPackDetailTypeEnum.giveOthersReceive);
        detail.setTitle(RedPackDetailTypeEnum.giveOthersReceive.getDesc());
        detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.giveOthersReceive.name() + ":" + giveRecord.getId()));
        detail.setIdentifyCode(
                StringUtil.Md5(RedPackDetailTypeEnum.giveOthersReceive.name() + ":" + giveRecord.getId()));
        detail.setCreateTime(new Date());
        return detail;
    }
    /**
     *
     * @param giveRecord
     * @return
     * @throws RedPackDetailException
     */
    public static RedPackDetail createUseByShopOrder(Long orderId, Long uid, String title, String setName,
            BigDecimal money) throws RedPackDetailException {
        if (orderId == null)
            throw new RedPackDetailException(1, "订单ID不能为空");
        if (uid == null)
            throw new RedPackDetailException(1, "用户ID不能为空");
        RedPackDetail detail = new RedPackDetail();
        detail.setDisplay(false);
        detail.setUid(uid);
        detail.setMoney(money);
        detail.setType(RedPackDetailTypeEnum.useByShopOrder);
        detail.setTitle(title);
        detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.useByShopOrder.name() + "-" + orderId));
        detail.setCreateTime(new Date());
        detail.setDesc(setName);
        return detail;
    }
}
fanli/src/main/java/com/yeshi/fanli/util/mybatishandler/shop/ChargeTypeEnumHandler.java
New file
@@ -0,0 +1,53 @@
package com.yeshi.fanli.util.mybatishandler.shop;
import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.apache.ibatis.type.BaseTypeHandler;
import org.apache.ibatis.type.JdbcType;
import com.yeshi.fanli.entity.shop.ChargeTypeEnum;
public class ChargeTypeEnumHandler extends BaseTypeHandler<ChargeTypeEnum> {
    @Override
    public ChargeTypeEnum getNullableResult(ResultSet arg0, String arg1) throws SQLException {
        String key = arg0.getString(arg1);
        if (arg0.wasNull()) {
            return null;
        } else {
            return ChargeTypeEnum.valueOf(key);
        }
    }
    @Override
    public ChargeTypeEnum getNullableResult(ResultSet arg0, int arg1) throws SQLException {
        String key = arg0.getString(arg1);
        if (arg0.wasNull()) {
            return null;
        } else {
            // 根据数据库中的key值,定位SexEnum子类
            return ChargeTypeEnum.valueOf(key);
        }
    }
    @Override
    public ChargeTypeEnum getNullableResult(CallableStatement arg0, int arg1) throws SQLException {
        String key = arg0.getString(arg1);
        if (arg0.wasNull()) {
            return null;
        } else {
            // 根据数据库中的key值,定位SexEnum子类
            return ChargeTypeEnum.valueOf(key);
        }
    }
    @Override
    public void setNonNullParameter(PreparedStatement arg0, int arg1, ChargeTypeEnum arg2, JdbcType arg3)
            throws SQLException {
        arg0.setString(arg1, arg2.name());
    }
}
fanli/src/main/java/com/yeshi/fanli/util/shop/BanLiShopUtil.java
New file
@@ -0,0 +1,24 @@
package com.yeshi.fanli.util.shop;
import com.yeshi.fanli.util.TimeUtil;
public class BanLiShopUtil {
    /**
     * 制造订单号
     *
     * @param orderId
     * @return
     */
    public static String createOrderNo(Long orderId) {
        String orderNo = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyyMMdd");
        String orderIdStr = orderId + "";
        int length = 8 - orderIdStr.length();
        for (int i = 0; i < length; i++) {
            orderIdStr = "0" + orderIdStr;
        }
        orderNo += orderIdStr;
        return orderNo;
    }
}