admin
2019-04-19 7da75926f4f910a0fa23ab96f2af637d0a9578a0
用户资金偿还系统初步建立
12个文件已修改
15个文件已添加
1159 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/AuthCallBackController.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserMoneyController.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/money/UserMoneyDebtMapper.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/money/UserMoneyDebtReturnHistoryMapper.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/jd/JDCategoryInfo.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/jd/JDCommissionInfo.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/jd/JDCouponInfo.java 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/jd/JDPingouInfo.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/jd/JDSearchFilter.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/jd/JDShopInfo.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/jd/JDGoods.java 187 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/money/UserMoneyDebt.java 120 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/money/UserMoneyDebtReturnHistory.java 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/money/UserMoneyDebtException.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/money/UserMoneyDebtMapper.xml 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/money/UserMoneyDebtReturnHistoryMapper.xml 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserExtraTaoBaoInfoMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/money/UserMoneyDebtServiceImpl.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgOtherDetailServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/ExtractServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/money/UserMoneyDebtService.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/jd/JDUtil.java 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/mybatishandler/money/UserMoneyDetailTypeEnumHandler.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeOrderApiUtil.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/AuthCallBackController.java
@@ -23,6 +23,7 @@
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TaoBaoConstant;
import com.yeshi.fanli.util.ThreadUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import net.sf.json.JSONObject;
@@ -99,6 +100,7 @@
                nickName = URLDecoder.decode(nickName, "UTF-8");
            } catch (Exception e) {
            }
            final String name=nickName;
            // LogHelper.test("uid:" + uid + "\n accessToken:" + accessToken);
            // 获取渠道ID与会员ID
@@ -113,6 +115,24 @@
                    LogHelper.test(e.getMsg());
                    errCode = 5;
                }
                //异步申请会员ID
                ThreadUtil.run(new Runnable() {
                    @Override
                    public void run() {
                        String specialId = TaoKeApiUtil.getSpecialId(accessToken, TaoBaoConstant.TAOBAO_AUTH_APPKEY,
                                TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
                        if (StringUtil.isNullOrEmpty(specialId))
                            LogHelper.test(uid + "会员备案失败");
                        try {
                            userExtraTaoBaoInfoService.addSpecialId(uid, specialId, taoBaoUid, name, true);
                        } catch (UserExtraTaoBaoInfoException e) {
                            LogHelper.test(e.getMsg());
                        }
                    }
                });
            } else if ("zigou".equalsIgnoreCase(source)) {
                String specialId = TaoKeApiUtil.getSpecialId(accessToken, TaoBaoConstant.TAOBAO_AUTH_APPKEY,
                        TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
@@ -125,6 +145,25 @@
                    LogHelper.test(e.getMsg());
                    errCode = 5;
                }
                //异步申请渠道ID
                ThreadUtil.run(new Runnable() {
                    @Override
                    public void run() {
                        String relationId = TaoKeApiUtil.getRelationId(accessToken, TaoBaoConstant.TAOBAO_AUTH_APPKEY,
                                TaoBaoConstant.TAOBAO_AUTH_APPSECRET);// 渠道ID
                        if (StringUtil.isNullOrEmpty(relationId))
                            LogHelper.test(uid + "渠道备案失败");
                        try {
                            userExtraTaoBaoInfoService.addRelationId(uid, relationId, taoBaoUid, name, true);
                        } catch (UserExtraTaoBaoInfoException e) {
                            LogHelper.test(e.getMsg());
                        }
                    }
                });
            } else if ("bind".equalsIgnoreCase(source)) {
                boolean bindInfo = true;
fanli/src/main/java/com/yeshi/fanli/controller/client/UserMoneyController.java
@@ -13,6 +13,7 @@
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.yeshi.utils.BigDecimalUtil;
import org.yeshi.utils.JsonUtil;
import com.google.gson.Gson;
@@ -124,7 +125,8 @@
                if (value == null) {
                    return new JsonPrimitive("");
                } else {
                    return new JsonPrimitive(MoneyBigDecimalUtil.getWithNoZera(value).toString());
                    value = value.setScale(2);
                    return new JsonPrimitive(value.toString());
                }
            }
        });
@@ -271,8 +273,21 @@
        // 全部未到账
        minDate = new Date(0);
        vo.setTotalUnRecievedMoney(hongBaoV2Service.getUnRecievedMoneyWithCreateTime(uid, minDate, maxDate));
        Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create();
        out.print(JsonUtil.loadTrueResult(gson.toJson(vo)));
        GsonBuilder builder = new GsonBuilder();
        builder.registerTypeAdapter(BigDecimal.class, new JsonSerializer<BigDecimal>() {
            @Override
            public JsonElement serialize(BigDecimal value, Type theType, JsonSerializationContext context) {
                if (value == null) {
                    return new JsonPrimitive("");
                } else {
                    // 保留2位小数
                    value = value.setScale(2);
                    return new JsonPrimitive(value.toString());
                }
            }
        });
        out.print(JsonUtil.loadTrueResult(builder.create().toJson(vo)));
    }
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/money/UserMoneyDebtMapper.java
New file
@@ -0,0 +1,19 @@
package com.yeshi.fanli.dao.mybatis.money;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.money.UserMoneyDebt;
public interface UserMoneyDebtMapper extends BaseMapper<UserMoneyDebt> {
    /**
     * 根据用户ID与sourceId查询记录
     *
     * @param uid
     * @param sourceId
     * @return
     */
    UserMoneyDebt selectByUidAndSourceId(@Param("uid")Long uid,@Param("sourceId") Long sourceId);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/money/UserMoneyDebtReturnHistoryMapper.java
New file
@@ -0,0 +1,8 @@
package com.yeshi.fanli.dao.mybatis.money;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.money.UserMoneyDebtReturnHistory;
public interface UserMoneyDebtReturnHistoryMapper extends BaseMapper<UserMoneyDebtReturnHistory> {
}
fanli/src/main/java/com/yeshi/fanli/dto/jd/JDCategoryInfo.java
New file
@@ -0,0 +1,46 @@
package com.yeshi.fanli.dto.jd;
public class JDCategoryInfo {
private Long cid1;
private Long cid2;
private Long cid3;
private String cid1Name;
private String cid2Name;
private String cid3Name;
public Long getCid1() {
    return cid1;
}
public void setCid1(Long cid1) {
    this.cid1 = cid1;
}
public Long getCid2() {
    return cid2;
}
public void setCid2(Long cid2) {
    this.cid2 = cid2;
}
public Long getCid3() {
    return cid3;
}
public void setCid3(Long cid3) {
    this.cid3 = cid3;
}
public String getCid1Name() {
    return cid1Name;
}
public void setCid1Name(String cid1Name) {
    this.cid1Name = cid1Name;
}
public String getCid2Name() {
    return cid2Name;
}
public void setCid2Name(String cid2Name) {
    this.cid2Name = cid2Name;
}
public String getCid3Name() {
    return cid3Name;
}
public void setCid3Name(String cid3Name) {
    this.cid3Name = cid3Name;
}
}
fanli/src/main/java/com/yeshi/fanli/dto/jd/JDCommissionInfo.java
New file
@@ -0,0 +1,24 @@
package com.yeshi.fanli.dto.jd;
import java.math.BigDecimal;
public class JDCommissionInfo {
private BigDecimal commission;//佣金
private BigDecimal commissionShare;//佣金比例
public BigDecimal getCommissionShare() {
    return commissionShare;
}
public void setCommissionShare(BigDecimal commissionShare) {
    this.commissionShare = commissionShare;
}
public BigDecimal getCommission() {
    return commission;
}
public void setCommission(BigDecimal commission) {
    this.commission = commission;
}
}
fanli/src/main/java/com/yeshi/fanli/dto/jd/JDCouponInfo.java
New file
@@ -0,0 +1,70 @@
package com.yeshi.fanli.dto.jd;
import java.math.BigDecimal;
public class JDCouponInfo {
    private Integer bindType;//券种类 (优惠券种类:0 - 全品类,1 - 限品类(自营商品),2 - 限店铺,3 - 店铺限商品券)
    private BigDecimal discount;//券面额
    private String link;//券链接
    private Integer platformType;//券使用平台 (平台类型:0 - 全平台券,1 - 限平台券)
    private BigDecimal quota;//券消费限额
    private Long getStartTime;//领取开始时间(时间戳,毫秒)
    private Long getEndTime;//券领取结束时间(时间戳,毫秒)
    private Long useStartTime;//券有效使用开始时间(时间戳,毫秒)
    private Long useEndTime;//券有效使用结束时间(时间戳,毫秒)
    public Integer getBindType() {
        return bindType;
    }
    public void setBindType(Integer bindType) {
        this.bindType = bindType;
    }
    public BigDecimal getDiscount() {
        return discount;
    }
    public void setDiscount(BigDecimal discount) {
        this.discount = discount;
    }
    public String getLink() {
        return link;
    }
    public void setLink(String link) {
        this.link = link;
    }
    public Integer getPlatformType() {
        return platformType;
    }
    public void setPlatformType(Integer platformType) {
        this.platformType = platformType;
    }
    public BigDecimal getQuota() {
        return quota;
    }
    public void setQuota(BigDecimal quota) {
        this.quota = quota;
    }
    public Long getGetStartTime() {
        return getStartTime;
    }
    public void setGetStartTime(Long getStartTime) {
        this.getStartTime = getStartTime;
    }
    public Long getGetEndTime() {
        return getEndTime;
    }
    public void setGetEndTime(Long getEndTime) {
        this.getEndTime = getEndTime;
    }
    public Long getUseStartTime() {
        return useStartTime;
    }
    public void setUseStartTime(Long useStartTime) {
        this.useStartTime = useStartTime;
    }
    public Long getUseEndTime() {
        return useEndTime;
    }
    public void setUseEndTime(Long useEndTime) {
        this.useEndTime = useEndTime;
    }
}
fanli/src/main/java/com/yeshi/fanli/dto/jd/JDPingouInfo.java
New file
@@ -0,0 +1,49 @@
package com.yeshi.fanli.dto.jd;
import java.math.BigDecimal;
public class JDPingouInfo {
    private BigDecimal pingouPrice;
    private Long pingouTmCount;
    private String pingouUrl;
    private Long pingouStartTime;
    private Long pingouEndTime;
    private Long totalCount;
    public BigDecimal getPingouPrice() {
        return pingouPrice;
    }
    public void setPingouPrice(BigDecimal pingouPrice) {
        this.pingouPrice = pingouPrice;
    }
    public Long getPingouTmCount() {
        return pingouTmCount;
    }
    public void setPingouTmCount(Long pingouTmCount) {
        this.pingouTmCount = pingouTmCount;
    }
    public String getPingouUrl() {
        return pingouUrl;
    }
    public void setPingouUrl(String pingouUrl) {
        this.pingouUrl = pingouUrl;
    }
    public Long getPingouStartTime() {
        return pingouStartTime;
    }
    public void setPingouStartTime(Long pingouStartTime) {
        this.pingouStartTime = pingouStartTime;
    }
    public Long getPingouEndTime() {
        return pingouEndTime;
    }
    public void setPingouEndTime(Long pingouEndTime) {
        this.pingouEndTime = pingouEndTime;
    }
    public Long getTotalCount() {
        return totalCount;
    }
    public void setTotalCount(Long totalCount) {
        this.totalCount = totalCount;
    }
}
fanli/src/main/java/com/yeshi/fanli/dto/jd/JDSearchFilter.java
@@ -1,9 +1,58 @@
package com.yeshi.fanli.dto.jd;
public class JDSearchFilter {
    private String key;// 关键字
    Integer isZY;// 是否为自营 1-自营
    Integer hasCoupon;// 是否有券 1-有券
    Integer categoryId;// 分类ID
    int pageNo;// 页码
    int pageSize;// 每页的数量
    public Integer getIsZY() {
        return isZY;
    }
    public void setIsZY(Integer isZY) {
        this.isZY = isZY;
    }
    public Integer getHasCoupon() {
        return hasCoupon;
    }
    public void setHasCoupon(Integer hasCoupon) {
        this.hasCoupon = hasCoupon;
    }
    public Integer getCategoryId() {
        return categoryId;
    }
    public void setCategoryId(Integer categoryId) {
        this.categoryId = categoryId;
    }
    public int getPageNo() {
        return pageNo;
    }
    public void setPageNo(int pageNo) {
        this.pageNo = pageNo;
    }
    public int getPageSize() {
        return pageSize;
    }
    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }
    public String getKey() {
        return key;
    }
    public void setKey(String key) {
        this.key = key;
    }
}
fanli/src/main/java/com/yeshi/fanli/dto/jd/JDShopInfo.java
New file
@@ -0,0 +1,20 @@
package com.yeshi.fanli.dto.jd;
public class JDShopInfo {
    private Integer shopId;
    private String shopName;
    public Integer getShopId() {
        return shopId;
    }
    public void setShopId(Integer shopId) {
        this.shopId = shopId;
    }
    public String getShopName() {
        return shopName;
    }
    public void setShopName(String shopName) {
        this.shopName = shopName;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/jd/JDGoods.java
@@ -1,5 +1,190 @@
package com.yeshi.fanli.entity.jd;
public class JDGoods {
import java.math.BigDecimal;
import java.util.List;
import com.yeshi.fanli.dto.jd.JDCategoryInfo;
import com.yeshi.fanli.dto.jd.JDCommissionInfo;
import com.yeshi.fanli.dto.jd.JDCouponInfo;
import com.yeshi.fanli.dto.jd.JDPingouInfo;
import com.yeshi.fanli.dto.jd.JDShopInfo;
/**
 * 京东商品
 *
 * @author Administrator
 *
 */
public class JDGoods {
    private JDCategoryInfo categoryInfo;// 类目信息
    private Long comments;// 评论数
    private JDCommissionInfo commissionInfo;// 佣金信息
    private JDCouponInfo couponInfo;// 优惠券信息,返回内容为空说明该SKU无可用优惠券
    private BigDecimal goodCommentsShare;// 商品好评率
    private List<String> imageList;// 图片信息
    private Long inOrderCount30Days;// 30天引单数量
    private String materialUrl;// 商品落地页
    private BigDecimal price;// 价格信息
    private JDShopInfo shopInfo;// 店铺信息
    private Long skuId;// 商品ID
    private String skuName;// 商品名称
    private Integer isHot;// 是否爆款,1:是,0:否
    private Long spuid;// spuid,其值为同款商品的主skuid
    private String brandCode;// 品牌code
    private String brandName;// 品牌名
    private String owner;// g=自营,p=pop
    private JDPingouInfo pinGouInfo;// 拼购信息
    private Long totalCount;// 有效商品总数量
    public JDCategoryInfo getCategoryInfo() {
        return categoryInfo;
    }
    public void setCategoryInfo(JDCategoryInfo categoryInfo) {
        this.categoryInfo = categoryInfo;
    }
    public Long getComments() {
        return comments;
    }
    public void setComments(Long comments) {
        this.comments = comments;
    }
    public JDCommissionInfo getCommissionInfo() {
        return commissionInfo;
    }
    public void setCommissionInfo(JDCommissionInfo commissionInfo) {
        this.commissionInfo = commissionInfo;
    }
    public JDCouponInfo getCouponInfo() {
        return couponInfo;
    }
    public void setCouponInfo(JDCouponInfo couponInfo) {
        this.couponInfo = couponInfo;
    }
    public BigDecimal getGoodCommentsShare() {
        return goodCommentsShare;
    }
    public void setGoodCommentsShare(BigDecimal goodCommentsShare) {
        this.goodCommentsShare = goodCommentsShare;
    }
    public List<String> getImageList() {
        return imageList;
    }
    public void setImageList(List<String> imageList) {
        this.imageList = imageList;
    }
    public Long getInOrderCount30Days() {
        return inOrderCount30Days;
    }
    public void setInOrderCount30Days(Long inOrderCount30Days) {
        this.inOrderCount30Days = inOrderCount30Days;
    }
    public String getMaterialUrl() {
        return materialUrl;
    }
    public void setMaterialUrl(String materialUrl) {
        this.materialUrl = materialUrl;
    }
    public BigDecimal getPrice() {
        return price;
    }
    public void setPrice(BigDecimal price) {
        this.price = price;
    }
    public JDShopInfo getShopInfo() {
        return shopInfo;
    }
    public void setShopInfo(JDShopInfo shopInfo) {
        this.shopInfo = shopInfo;
    }
    public Long getSkuId() {
        return skuId;
    }
    public void setSkuId(Long skuId) {
        this.skuId = skuId;
    }
    public String getSkuName() {
        return skuName;
    }
    public void setSkuName(String skuName) {
        this.skuName = skuName;
    }
    public Integer getIsHot() {
        return isHot;
    }
    public void setIsHot(Integer isHot) {
        this.isHot = isHot;
    }
    public Long getSpuid() {
        return spuid;
    }
    public void setSpuid(Long spuid) {
        this.spuid = spuid;
    }
    public String getBrandCode() {
        return brandCode;
    }
    public void setBrandCode(String brandCode) {
        this.brandCode = brandCode;
    }
    public String getBrandName() {
        return brandName;
    }
    public void setBrandName(String brandName) {
        this.brandName = brandName;
    }
    public String getOwner() {
        return owner;
    }
    public void setOwner(String owner) {
        this.owner = owner;
    }
    public JDPingouInfo getPinGouInfo() {
        return pinGouInfo;
    }
    public void setPinGouInfo(JDPingouInfo pinGouInfo) {
        this.pinGouInfo = pinGouInfo;
    }
    public Long getTotalCount() {
        return totalCount;
    }
    public void setTotalCount(Long totalCount) {
        this.totalCount = totalCount;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/money/UserMoneyDebt.java
New file
@@ -0,0 +1,120 @@
package com.yeshi.fanli.entity.money;
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_user_debt")
public class UserMoneyDebt {
    public enum UserMoneyDebtTypeEnum {
        hongBao("返利退款"), other("其他");
        private final String desc;
        private UserMoneyDebtTypeEnum(String desc) {
            this.desc = desc;
        }
        public String getDesc() {
            return desc;
        }
    }
    @Column(name = "ud_id")
    private Long id;
    @Column(name = "ud_uid")
    private Long uid;
    @Column(name = "ud_origin_money")
    private BigDecimal originMoney;
    @Column(name = "ud_left_money")
    private BigDecimal leftMoney;
    @Column(name = "ud_type")
    private UserMoneyDebtTypeEnum type;
    @Column(name = "ud_source_id")
    private Long sourceId;
    @Column(name = "ud_beizhu")
    private String beiZhu;
    @Column(name = "ud_create_time")
    private Date createTime;
    @Column(name = "ud_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 BigDecimal getOriginMoney() {
        return originMoney;
    }
    public void setOriginMoney(BigDecimal originMoney) {
        this.originMoney = originMoney;
    }
    public BigDecimal getLeftMoney() {
        return leftMoney;
    }
    public void setLeftMoney(BigDecimal leftMoney) {
        this.leftMoney = leftMoney;
    }
    public UserMoneyDebtTypeEnum getType() {
        return type;
    }
    public void setType(UserMoneyDebtTypeEnum type) {
        this.type = type;
    }
    public Long getSourceId() {
        return sourceId;
    }
    public void setSourceId(Long sourceId) {
        this.sourceId = sourceId;
    }
    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/money/UserMoneyDebtReturnHistory.java
New file
@@ -0,0 +1,77 @@
package com.yeshi.fanli.entity.money;
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_user_debt_return_history")
public class UserMoneyDebtReturnHistory {
    @Column(name = "udrh_id")
    private Long id;
    @Column(name = "udrh_debt_id")
    private UserMoneyDebt debt;
    @Column(name = "udrh_money")
    private BigDecimal money;
    @Column(name = "udrh_uid")
    private Long uid;
    @Column(name = "udrh_beizhu")
    private String beiZhu;
    @Column(name = "udrh_create_time")
    private Date createTime;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public UserMoneyDebt getDebt() {
        return debt;
    }
    public void setDebt(UserMoneyDebt debt) {
        this.debt = debt;
    }
    public BigDecimal getMoney() {
        return money;
    }
    public void setMoney(BigDecimal money) {
        this.money = money;
    }
    public Long getUid() {
        return uid;
    }
    public void setUid(Long uid) {
        this.uid = uid;
    }
    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;
    }
}
fanli/src/main/java/com/yeshi/fanli/exception/money/UserMoneyDebtException.java
New file
@@ -0,0 +1,30 @@
package com.yeshi.fanli.exception.money;
public class UserMoneyDebtException extends Exception {
    private static final long serialVersionUID = 572112205824229000L;
    private int code;
    private String msg;
    public UserMoneyDebtException() {
    }
    public UserMoneyDebtException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public int getCode() {
        return code;
    }
    public String getMsg() {
        return msg;
    }
    @Override
    public String getMessage() {
        return this.msg;
    }
}
fanli/src/main/java/com/yeshi/fanli/mapping/money/UserMoneyDebtMapper.xml
New file
@@ -0,0 +1,95 @@
<?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.money.UserMoneyDebtMapper">
    <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.money.UserMoneyDebt">
        <id column="ud_id" property="id" jdbcType="BIGINT" />
        <result column="ud_uid" property="uid" jdbcType="BIGINT" />
        <result column="ud_origin_money" property="originMoney"
            jdbcType="DECIMAL" />
        <result column="ud_left_money" property="leftMoney" jdbcType="DECIMAL" />
        <result column="ud_type" property="type" jdbcType="VARCHAR"
            typeHandler="com.yeshi.fanli.util.mybatishandler.money.UserMoneyDetailTypeEnumHandler" />
        <result column="ud_source_id" property="sourceId" jdbcType="BIGINT" />
        <result column="ud_beizhu" property="beiZhu" jdbcType="VARCHAR" />
        <result column="ud_create_time" property="createTime" jdbcType="TIMESTAMP" />
        <result column="ud_update_time" property="updateTime" jdbcType="TIMESTAMP" />
    </resultMap>
    <sql id="Base_Column_List">ud_id,ud_uid,ud_origin_money,ud_left_money,ud_type,ud_source_id,ud_beizhu,ud_create_time,ud_update_time
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_user_debt where ud_id = #{id,jdbcType=BIGINT}
    </select>
        <select id="selectByUidAndSourceId" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_user_debt where ud_uid = #{uid} and ud_source_id=#{sourceId}  limit 1 for update
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_user_debt where ud_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.money.UserMoneyDebt"
        useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_debt
        (ud_id,ud_uid,ud_origin_money,ud_left_money,ud_type,ud_source_id,ud_beizhu,ud_create_time,ud_update_time)
        values
        (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{originMoney,jdbcType=DECIMAL},#{leftMoney,jdbcType=DECIMAL},#{type,jdbcType=VARCHAR},#{sourceId,jdbcType=BIGINT},#{beiZhu,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.money.UserMoneyDebt"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_user_debt
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">ud_id,</if>
            <if test="uid != null">ud_uid,</if>
            <if test="originMoney != null">ud_origin_money,</if>
            <if test="leftMoney != null">ud_left_money,</if>
            <if test="type != null">ud_type,</if>
            <if test="sourceId != null">ud_source_id,</if>
            <if test="beiZhu != null">ud_beizhu,</if>
            <if test="createTime != null">ud_create_time,</if>
            <if test="updateTime != null">ud_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="originMoney != null">#{originMoney,jdbcType=DECIMAL},</if>
            <if test="leftMoney != null">#{leftMoney,jdbcType=DECIMAL},</if>
            <if test="type != null">#{type,jdbcType=VARCHAR},</if>
            <if test="sourceId != null">#{sourceId,jdbcType=BIGINT},</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.money.UserMoneyDebt">update
        yeshi_ec_user_debt set ud_uid = #{uid,jdbcType=BIGINT},ud_origin_money
        = #{originMoney,jdbcType=DECIMAL},ud_left_money =
        #{leftMoney,jdbcType=DECIMAL},ud_type =
        #{type,jdbcType=VARCHAR},ud_source_id =
        #{sourceId,jdbcType=BIGINT},ud_beizhu =
        #{beiZhu,jdbcType=VARCHAR},ud_create_time =
        #{createTime,jdbcType=TIMESTAMP},ud_update_time =
        #{updateTime,jdbcType=TIMESTAMP} where ud_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.money.UserMoneyDebt">
        update yeshi_ec_user_debt
        <set>
            <if test="uid != null">ud_uid=#{uid,jdbcType=BIGINT},</if>
            <if test="originMoney != null">ud_origin_money=#{originMoney,jdbcType=DECIMAL},</if>
            <if test="leftMoney != null">ud_left_money=#{leftMoney,jdbcType=DECIMAL},</if>
            <if test="type != null">ud_type=#{type,jdbcType=VARCHAR},</if>
            <if test="sourceId != null">ud_source_id=#{sourceId,jdbcType=BIGINT},</if>
            <if test="beiZhu != null">ud_beizhu=#{beiZhu,jdbcType=VARCHAR},</if>
            <if test="createTime != null">ud_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">ud_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
        </set>
        where ud_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/money/UserMoneyDebtReturnHistoryMapper.xml
New file
@@ -0,0 +1,82 @@
<?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.money.UserMoneyDebtReturnHistoryMapper">
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.money.UserMoneyDebtReturnHistory">
        <id column="udrh_id" property="id" jdbcType="BIGINT" />
        <result column="udrh_money" property="money" jdbcType="DECIMAL" />
        <result column="udrh_uid" property="uid" jdbcType="BIGINT" />
        <result column="udrh_beizhu" property="beiZhu" jdbcType="VARCHAR" />
        <result column="udrh_create_time" property="createTime"
            jdbcType="TIMESTAMP" />
        <association property="debt" column="udrh_debt_id"
            javaType="com.yeshi.fanli.entity.money.UserMoneyDebt">
            <id column="udrh_debt_id" property="id" jdbcType="BIGINT" />
        </association>
    </resultMap>
    <sql id="Base_Column_List">udrh_id,udrh_debt_id,udrh_money,udrh_uid,udrh_beizhu,udrh_create_time
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_user_debt_return_history where udrh_id =
        #{id,jdbcType=BIGINT}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_user_debt_return_history where udrh_id =
        #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert"
        parameterType="com.yeshi.fanli.entity.money.UserMoneyDebtReturnHistory"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_user_debt_return_history
        (udrh_id,udrh_debt_id,udrh_money,udrh_uid,udrh_beizhu,udrh_create_time)
        values
        (#{id,jdbcType=BIGINT},#{debt.id,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{uid,jdbcType=BIGINT},#{beiZhu,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective"
        parameterType="com.yeshi.fanli.entity.money.UserMoneyDebtReturnHistory"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_user_debt_return_history
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">udrh_id,</if>
            <if test="debt != null">udrh_debt_id,</if>
            <if test="money != null">udrh_money,</if>
            <if test="uid != null">udrh_uid,</if>
            <if test="beiZhu != null">udrh_beizhu,</if>
            <if test="createTime != null">udrh_create_time,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="debt != null">#{debt.id,jdbcType=BIGINT},</if>
            <if test="money != null">#{money,jdbcType=DECIMAL},</if>
            <if test="uid != null">#{uid,jdbcType=BIGINT},</if>
            <if test="beiZhu != null">#{beiZhu,jdbcType=VARCHAR},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey"
        parameterType="com.yeshi.fanli.entity.money.UserMoneyDebtReturnHistory">update yeshi_ec_user_debt_return_history set
        udrh_debt_id = #{debt.id,jdbcType=BIGINT},udrh_money =
        #{money,jdbcType=DECIMAL},udrh_uid =
        #{uid,jdbcType=BIGINT},udrh_beizhu =
        #{beiZhu,jdbcType=VARCHAR},udrh_create_time =
        #{createTime,jdbcType=TIMESTAMP} where udrh_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective"
        parameterType="com.yeshi.fanli.entity.money.UserMoneyDebtReturnHistory">
        update yeshi_ec_user_debt_return_history
        <set>
            <if test="debt != null">udrh_debt_id=#{debt.id,jdbcType=BIGINT},</if>
            <if test="money != null">udrh_money=#{money,jdbcType=DECIMAL},</if>
            <if test="uid != null">udrh_uid=#{uid,jdbcType=BIGINT},</if>
            <if test="beiZhu != null">udrh_beizhu=#{beiZhu,jdbcType=VARCHAR},</if>
            <if test="createTime != null">udrh_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
        </set>
        where udrh_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserExtraTaoBaoInfoMapper.xml
@@ -46,7 +46,7 @@
    
    <select id="listByTaoBaoUid" resultMap="BaseResultMap" parameterType="java.lang.String">
        SELECT * FROM yeshi_ec_user_info_extra_taobao tb
        WHERE  tb.`uiet_taobao_uid` = #{0} AND tb.`uiet_uid` IS NOT NULL
        WHERE  tb.`uiet_taobao_uid` = #{0}
    </select>
fanli/src/main/java/com/yeshi/fanli/service/impl/money/UserMoneyDebtServiceImpl.java
New file
@@ -0,0 +1,47 @@
package com.yeshi.fanli.service.impl.money;
import java.util.Date;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.money.UserMoneyDebtMapper;
import com.yeshi.fanli.entity.money.UserMoneyDebt;
import com.yeshi.fanli.entity.money.UserMoneyDebt.UserMoneyDebtTypeEnum;
import com.yeshi.fanli.exception.money.UserMoneyDebtException;
import com.yeshi.fanli.service.inter.money.UserMoneyDebtService;
@Service
public class UserMoneyDebtServiceImpl implements UserMoneyDebtService {
    @Resource
    private UserMoneyDebtMapper userMoneyDebtMapper;
    @Override
    public void addUserMoneyDebt(UserMoneyDebt debt) throws UserMoneyDebtException {
        if (debt == null)
            return;
        if (debt.getType() == UserMoneyDebtTypeEnum.hongBao) {
            if (debt.getSourceId() == null)
                throw new UserMoneyDebtException(1, "sourceId为空");
            if (debt.getUid() == null || debt.getOriginMoney() == null)
                throw new UserMoneyDebtException(2, "信息不完整");
            if (debt.getLeftMoney() == null)
                debt.setLeftMoney(debt.getOriginMoney());
            if (debt.getCreateTime() == null)
                debt.setCreateTime(new Date());
            UserMoneyDebt old = userMoneyDebtMapper.selectByUidAndSourceId(debt.getUid(), debt.getSourceId());
            if (old != null) {
                throw new UserMoneyDebtException(3, "对应用户的红包已经存在");
            }
            userMoneyDebtMapper.insertSelective(debt);
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgOtherDetailServiceImpl.java
@@ -21,7 +21,7 @@
    @Resource
    private MsgOtherDetailMapper msgOtherDetailMapper;
    @Resource
    private UserMsgReadStateService userMsgReadStateService;
@@ -34,7 +34,8 @@
            if (detail.getCoupnContent() == null)
                throw new MsgOtherDetailException(1, "内容为空");
            detail.setContent(new Gson().toJson(detail.getCoupnContent()));
            detail.setCreateTime(new Date());
            if (detail.getCreateTime() == null)
                detail.setCreateTime(new Date());
            msgOtherDetailMapper.insertSelective(detail);
            userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
        }
@@ -50,6 +51,7 @@
            if (detail.getCoupnContent() == null)
                throw new MsgOtherDetailException(1, "内容为空");
            detail.setContent(new Gson().toJson(detail.getCoupnContent()));
            if(detail.getUpdateTime()==null)
            detail.setUpdateTime(new Date());
            msgOtherDetailMapper.updateByPrimaryKeySelective(detail);
        }
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java
@@ -5,10 +5,10 @@
import javax.annotation.Resource;
import org.omg.CORBA.PERSIST_STORE;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dto.msg.MsgOtherCouponContentDTO;
import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail;
import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
@@ -111,10 +111,12 @@
        if (coupon == null || coupon.getUid() == null)
            return;
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory
                .createWelfareCouponAlreadyOutOfDate(coupon.getSource(),coupon.getStartTime(), coupon.getEndTime());
                .createWelfareCouponAlreadyOutOfDate(coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, "参与其他活动可获得更多免单券"));
            MsgOtherDetail detail = MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), coupon.getId(), dto,
                    MsgTypeOtherTypeEnum.couponWelfareMianDan, "参与其他活动可获得更多免单券");
            detail.setCreateTime(coupon.getEndTime());
            msgOtherDetailService.addMsgOtherDetail(detail);
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
@@ -195,10 +197,13 @@
        if (coupon == null || coupon.getUid() == null)
            return;
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory
                .createWelfareCouponAlreadyOutOfDate(coupon.getSource(),coupon.getStartTime(), coupon.getEndTime());
                .createWelfareCouponAlreadyOutOfDate(coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponMianDan, "参与其他活动可获得更多免单券"));
            MsgOtherDetail detail = MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), coupon.getId(), dto,
                    MsgTypeOtherTypeEnum.couponMianDan, "参与其他活动可获得更多免单券");
            detail.setCreateTime(coupon.getEndTime());
            msgOtherDetailService.addMsgOtherDetail(detail);
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
@@ -268,8 +273,10 @@
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory
                .createRewardCouponAlreadyOutOfDate(coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, "参与活动可获取更多奖励券"));
            MsgOtherDetail detail = MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), coupon.getId(), dto,
                    MsgTypeOtherTypeEnum.couponReward, "参与活动可获取更多奖励券");
            detail.setCreateTime(coupon.getEndTime());
            msgOtherDetailService.addMsgOtherDetail(detail);
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java
@@ -557,6 +557,8 @@
        if (order.getJieSuanTime().getTime() >= TimeUtil.convertToTimeTemp("2018-08-05", "yyyy-MM-dd")) {
            return;
        }
        // TODO 处理维权成功但是已到账的订单
    }
    @Override
fanli/src/main/java/com/yeshi/fanli/service/impl/user/ExtractServiceImpl.java
@@ -237,7 +237,7 @@
                .getLatestHistory(extract.getUserInfo().getId(), UserAccountBindingHistory.TYPE_PHONE);
        // 手机号更换绑定的7天内不能提现
        if (history != null && !history.getFirst()
                && (System.currentTimeMillis() - history.getCreateTime().getTime()) > 1000 * 60 * 60 * 24 * 7L)
                && (System.currentTimeMillis() - history.getCreateTime().getTime()) < 1000 * 60 * 60 * 24 * 7L)
            return 111;
        final String autoExtract = configService.get("extract_way"); // 是否自动转账
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountServiceImpl.java
@@ -931,7 +931,7 @@
                throw new UserAccountException(1, "验证码错误,重新输入");
            }
        }
        JSONObject logInfo = new JSONObject();
        logInfo.put("appId", appId);
        logInfo.put("phone", phone);
@@ -944,13 +944,11 @@
        if (identifyCode1 != null && identifyCode1.getEffective() != null && identifyCode1.getEffective()) {
            throw new UserAccountException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
        }
        // 清空限制
        redisManager.clearSMSFrequencyLimit(phone, SMSHistory.TYPE_LOGIN);
        // 清理次数
        redisManager.removeCommonString("sendMSNLoginCount" + phone);
        // 查询是否存在该电话历史用户
        UserInfo userInfo = userInfoMapper.getEffectiveUserInfoByPhone(phone);
@@ -1007,9 +1005,13 @@
        UserInfo userInfo = userInfoMapper.getEffectiveUserInfoByWXUnionId(weiXinUser.getUnionid());
        // 直接用的微信登录
        if (userInfo != null) {
            LogHelper.test("微信unionID存在:"+weiXinUser.getUnionid());
            // 更新账户登录信息
            updateLonginInfo(userInfo, loginType, request);
            // 删除邀请分享图
            spreadUserImgService.deleteImgUrl(userInfo.getId());
        } else {
            LogHelper.test("微信unionID不存在:"+weiXinUser.getUnionid());
            // 创建新账户
            userInfo = new UserInfo();
            userInfo.setPortrait(weiXinUser.getHeadimgurl());
fanli/src/main/java/com/yeshi/fanli/service/inter/money/UserMoneyDebtService.java
New file
@@ -0,0 +1,15 @@
package com.yeshi.fanli.service.inter.money;
import com.yeshi.fanli.entity.money.UserMoneyDebt;
import com.yeshi.fanli.exception.money.UserMoneyDebtException;
public interface UserMoneyDebtService {
    /**
     * 添加用户借钱记录
     *
     * @param debt
     * @throws UserMoneyDebtException
     */
    public void addUserMoneyDebt(UserMoneyDebt debt) throws UserMoneyDebtException;
}
fanli/src/main/java/com/yeshi/fanli/util/jd/JDUtil.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.util.jd;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
@@ -12,6 +13,11 @@
import org.jsoup.select.Elements;
import org.yeshi.utils.HttpUtil;
import com.yeshi.fanli.dto.jd.JDCommissionInfo;
import com.yeshi.fanli.dto.jd.JDCouponInfo;
import com.yeshi.fanli.dto.jd.JDSearchFilter;
import com.yeshi.fanli.dto.jd.JDShopInfo;
import com.yeshi.fanli.entity.jd.JDGoods;
import com.yeshi.fanli.util.StringUtil;
import net.sf.json.JSONObject;
@@ -86,18 +92,18 @@
    }
    @SuppressWarnings("deprecation")
    public static void searchByKey(String key) {
    public static void searchByKey(JDSearchFilter searchFilter) {
        JSONObject params = new JSONObject();
        params.put("pageNo", 1);
        params.put("pageSize", 20);
        params.put("pageNo", searchFilter.getPageNo());
        params.put("pageSize", searchFilter.getPageSize());
        params.put("searchUUID", StringUtil.Md5(System.currentTimeMillis() + ""));
        JSONObject data = new JSONObject();
        data.put("deliveryType", "0");
        data.put("hasCoupon", "0");
        data.put("hasCoupon", searchFilter.getHasCoupon());
        data.put("isCare", "0");
        data.put("isPinGou", "0");
        data.put("isZY", "0");
        data.put("key", key);
        data.put("isZY", searchFilter.getIsZY());
        data.put("key", searchFilter.getKey());
        data.put("keywordType", "kt1");
        data.put("lock", "");
        data.put("orientationFlag", "");
@@ -118,4 +124,42 @@
        }
    }
    private static JDGoods parseGoods(String data) {
        JDGoods goods = new JDGoods();
        JSONObject json = JSONObject.fromObject(data);
        goods.setSkuId(json.optLong("skuId"));
        goods.setSkuName(json.optString("skuName"));
        JDShopInfo shopInfo = new JDShopInfo();
        shopInfo.setShopId(json.optInt("shopId"));
        shopInfo.setShopName(json.optString("shopName"));
        goods.setShopInfo(shopInfo);
        goods.setPrice(new BigDecimal(json.optString("finalPrice")));
        goods.setGoodCommentsShare(new BigDecimal(json.optString("goodCommentsShare")));
        goods.setInOrderCount30Days(json.optLong("inOrderCount30Days"));
        if (json.optInt("isZY") == 1)
            goods.setOwner("g");
        else
            goods.setOwner("p");
        goods.setMaterialUrl(json.optString("materialUrl"));
        JDCommissionInfo commission = new JDCommissionInfo();
        commission.setCommission(new BigDecimal(json.optString("wlCommission")));
        commission.setCommissionShare(new BigDecimal(json.optString("wlCommissionRatio")));
        goods.setCommissionInfo(commission);
        goods.setGoodCommentsShare(new BigDecimal(json.optString("goodCommentsShare")));
        if (json.optString("hasCoupon") != null && json.optInt("hasCoupon") == 1
                && json.optInt("couponRemainCnt") > 0) {
            // 有券
            JDCouponInfo coupon = new JDCouponInfo();
            coupon.setDiscount(new BigDecimal(json.optString("couponDiscount")));
            coupon.setQuota(new BigDecimal(json.optString("couponQuota")));
            coupon.setLink("https:" + json.optString("couponLink"));
            goods.setCouponInfo(coupon);
        } else {
            // 无券
        }
        return goods;
    }
}
fanli/src/main/java/com/yeshi/fanli/util/mybatishandler/money/UserMoneyDetailTypeEnumHandler.java
New file
@@ -0,0 +1,53 @@
package com.yeshi.fanli.util.mybatishandler.money;
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.money.UserMoneyDetail.UserMoneyDetailTypeEnum;
public class UserMoneyDetailTypeEnumHandler extends BaseTypeHandler<UserMoneyDetailTypeEnum> {
    @Override
    public UserMoneyDetailTypeEnum getNullableResult(ResultSet arg0, String arg1) throws SQLException {
        String key = arg0.getString(arg1);
        if (arg0.wasNull()) {
            return null;
        } else {
            return UserMoneyDetailTypeEnum.valueOf(key);
        }
    }
    @Override
    public UserMoneyDetailTypeEnum getNullableResult(ResultSet arg0, int arg1) throws SQLException {
        String key = arg0.getString(arg1);
        if (arg0.wasNull()) {
            return null;
        } else {
            // 根据数据库中的key值,定位SexEnum子类
            return UserMoneyDetailTypeEnum.valueOf(key);
        }
    }
    @Override
    public UserMoneyDetailTypeEnum getNullableResult(CallableStatement arg0, int arg1) throws SQLException {
        String key = arg0.getString(arg1);
        if (arg0.wasNull()) {
            return null;
        } else {
            // 根据数据库中的key值,定位SexEnum子类
            return UserMoneyDetailTypeEnum.valueOf(key);
        }
    }
    @Override
    public void setNonNullParameter(PreparedStatement arg0, int arg1, UserMoneyDetailTypeEnum arg2, JdbcType arg3)
            throws SQLException {
        arg0.setString(arg1, arg2.name());
    }
}
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeOrderApiUtil.java
@@ -177,6 +177,11 @@
        map.put("page_no", "1");
        map.put("page_size", "20");
        map.put("start_time", "2019-01-01 00:00:00");
        map.put("tb_trade_parent_id", "370829441412331676");
        map.put("punish_status", "2");
        map.put("violation_type", "2");
        // map.put("start_time", "2019-01-01 00:00:00");
        TaoKeAppInfo app = new TaoKeAppInfo();
        app.setAppKey(TaoBaoConstant.TAOBAO_AUTH_APPKEY);