admin
2019-06-25 a0a5b70e0d0df9357d09542f20dc6633a986f328
Merge remote-tracking branch 'origin/master'
63个文件已修改
53个文件已添加
7054 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsClassAdminCotroller.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/HomeNavbarAdminController.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/SpecialCardAdminController.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java 73 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/GoodsController.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/HomeNavbarController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java 183 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java 241 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserAccountController.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserInfoController.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/HomeNavbarControllerV2.java 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/TaoLiJinControllerV2.java 555 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/h5/H5RecommendController.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/GoodsClassMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/FloatADMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/HomeNavbarMapper.java 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/SpecialMapper.java 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/tlj/ConfigTaoLiJinMapper.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/tlj/UserTaoLiJinDetailMapper.java 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/tlj/UserTaoLiJinOriginMapper.java 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/tlj/UserTaoLiJinRecordMapper.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/tlj/UserTaoLiJinReportMapper.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserInfoExtraMapper.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserMoneyExtraMapper.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/tlj/DeviceTaoLiJinRecordDao.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/tlj/GoodsTaoLiJinRateDao.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/user/DeviceSexDao.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/msg/MsgOtherTaoLiJinContentDTO.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/clazz/GoodsClass.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/DeviceSex.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/FloatAD.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/HomeNavbar.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/Special.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgOtherDetail.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/tlj/ConfigTaoLiJin.java 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/tlj/DeviceTaoLiJinRecord.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/tlj/GoodsTaoLiJinRate.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/tlj/UserTaoLiJinDetail.java 138 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/tlj/UserTaoLiJinOrigin.java 142 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/tlj/UserTaoLiJinRecord.java 173 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/tlj/UserTaoLiJinReport.java 163 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserCustomSettings.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserMoneyExtra.java 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/goods/ShareGoodsTextTemplate.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/taobao/TaoBaoGoodsBriefExtra.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/tlj/UserTaoLiJinOriginException.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/tlj/UserTaoLiJinRecordException.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/TaoLiJinJob.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/GoodsClassMapper.xml 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/goods/ShareGoodsTextTemplateMapper.xml 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/FloatADMapper.xml 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/HomeNavbarMapper.xml 165 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SpecialMapper.xml 120 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/lable/QualityFactoryMapper.xml 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/tlj/ConfigTaoLiJinMapper.xml 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/tlj/UserTaoLiJinDetailMapper.xml 140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/tlj/UserTaoLiJinOriginMapper.xml 133 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/tlj/UserTaoLiJinRecordMapper.xml 120 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/tlj/UserTaoLiJinReportMapper.xml 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserInfoExtraMapper.xml 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserMoneyExtraMapper.xml 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsClassServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/ShareGoodsServiceImpl.java 143 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/ShareGoodsTextTemplateServiceImpl.java 86 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/DeviceSexServiceImpl.java 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/FloatADServiceImpl.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/HomeNavbarServiceImpl.java 75 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/HomeNavbarUserServiceImpl.java 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialCardServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/ThreeSaleSerivceImpl.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgOtherDetailServiceImpl.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/ConfigTaoLiJinServiceImpl.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/DeviceTaoLiJinRecordServiceImpl.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/GoodsTaoLiJinRateServiceImpl.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinDetailServiceImpl.java 224 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinOriginServiceImpl.java 462 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinRecordServiceImpl.java 404 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinReportServiceImpl.java 137 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserCustomSettingsServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserMoneyExtraServiceImpl.java 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/GoodsClassService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/ShareGoodsService.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/ShareGoodsTextTemplateService.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/DeviceSexService.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/FloatADService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/HomeNavbarService.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/HomeNavbarUserService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SpecialService.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/msg/UserOtherMsgNotificationService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/tlj/ConfigTaoLiJinService.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/tlj/DeviceTaoLiJinRecordService.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/tlj/GoodsTaoLiJinRateService.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/tlj/UserTaoLiJinDetailService.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/tlj/UserTaoLiJinOriginService.java 122 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/tlj/UserTaoLiJinRecordService.java 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/tlj/UserTaoLiJinReportService.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInfoExtraService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserMoneyExtraService.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/Constant.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOtherDetailFactory.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/mybatishandler/tlj/TaoLiJinDetailTypeEnumHandler.java 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/mybatishandler/tlj/TaoLiJinOriginEnumHandler.java 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java 71 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/tlj/SpreadHongBao.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/tlj/TaoLiJinDetailVO.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/tlj/TaoLiJinMonthVO.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/user/UserSettingsVO.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/user/UserTaoLiJinRecordVO.java 150 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/ehcache.xml 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/log4j.properties 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/src/main/java/org/yeshi/utils/HttpUtil.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsClassAdminCotroller.java
@@ -51,10 +51,10 @@
    private BusinessSystemService businessSystemService;
    @RequestMapping(value = "queryAll")
    public void listquery(String callback, PrintWriter out) {
    public void listquery(String callback, Integer sex, PrintWriter out) {
        try {
            List<GoodsClass> goodsClassList = goodsClassService.listquery();
            List<GoodsClass> goodsClassList = goodsClassService.listquery(sex);
            if (goodsClassList == null || goodsClassList.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/HomeNavbarAdminController.java
@@ -69,9 +69,9 @@
     * @param out
     */
    @RequestMapping(value = "updateOrder")
    public void updateOrder(String callback, Long id, Integer moveType, PrintWriter out) {
    public void updateOrder(String callback, Long id, Integer moveType, Integer sex, PrintWriter out) {
        try {
            homeNavbarService.updateOrder(id, moveType);
            homeNavbarService.updateOrder(id, moveType, sex);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
        } catch (HomeNavbarException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
@@ -92,7 +92,7 @@
     * @param out
     */
    @RequestMapping(value = "query")
    public void query(String callback, Integer pageIndex, Integer pageSize, String key, PrintWriter out) {
    public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer sex, PrintWriter out) {
        if (pageIndex == null || pageIndex < 1) {
            pageIndex = 1;
@@ -103,14 +103,14 @@
        }
        try {
            List<HomeNavbar> list = homeNavbarService.listQuery((pageIndex - 1) * pageSize, pageSize, key);
            List<HomeNavbar> list = homeNavbarService.listQuery((pageIndex - 1) * pageSize, pageSize, key, sex);
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
                return;
            }
            
            long count = homeNavbarService.countlistQuery(key);
            long count = homeNavbarService.countlistQuery(key, sex);
            
            int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
            PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/SpecialCardAdminController.java
@@ -225,13 +225,10 @@
     * @param out
     */
    @RequestMapping(value = "saveSpecialOrder")
    public void saveSpecialOrder(String callback, Long id,Integer moveType, PrintWriter out) {
    public void saveSpecialOrder(String callback, Long id, Integer moveType, Integer sex, PrintWriter out) {
        try {
            specialService.updateOrder(id, moveType);
            specialService.updateOrder(id, moveType, sex);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
        } catch (SpecialException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
        } catch (Exception e) {
@@ -249,7 +246,8 @@
     * @param out
     */
    @RequestMapping(value = "querySpecial")
    public void querySpecial(String callback, Integer pageIndex, Integer pageSize, String key, Long cardId, PrintWriter out) {
    public void querySpecial(String callback, Integer pageIndex, Integer pageSize, String key,
        Long cardId, Integer sex, PrintWriter out) {
        if (pageIndex == null || pageIndex < 1) {
            pageIndex = 1;
@@ -266,14 +264,14 @@
        
        try {
            
            List<Special> list = specialService.listQueryByCard((pageIndex - 1) * pageSize, pageSize, cardId, key);
            List<Special> list = specialService.listQueryByCard((pageIndex - 1) * pageSize, pageSize, cardId, key, sex);
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
                return;
            }
            
            long count = specialService.countlistQueryByCard(cardId, key);
            long count = specialService.countlistQueryByCard(cardId, key, sex);
            
            int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
            PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java
@@ -13,6 +13,9 @@
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.homemodule.FloatAD;
import com.yeshi.fanli.entity.bus.msg.MsgDeviceReadState;
import com.yeshi.fanli.entity.bus.tlj.DeviceTaoLiJinRecord;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin.TaoLiJinOriginEnum;
import com.yeshi.fanli.entity.config.AppHomeFloatImg;
import com.yeshi.fanli.entity.taobao.ClientTBPid;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
@@ -20,6 +23,8 @@
import com.yeshi.fanli.service.inter.homemodule.FloatADService;
import com.yeshi.fanli.service.inter.msg.MsgDeviceReadStateService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
import com.yeshi.fanli.service.inter.tlj.DeviceTaoLiJinRecordService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
import com.yeshi.fanli.service.inter.user.TBPidService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.util.Constant;
@@ -59,6 +64,14 @@
    @Resource
    private MsgDeviceReadStateService msgDeviceReadStateService;
    @Resource
    private UserTaoLiJinOriginService uerTaoLiJinOriginService;
    @Resource
    private DeviceTaoLiJinRecordService deviceTaoLiJinRecordService;
    /**
     * 首页配置信息
     * 
@@ -82,8 +95,25 @@
            data.put("floatNotifyImg", notifyImg);
        }
        // 悬浮大图 1.5.2 -2019.3.20
        FloatAD floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX);
        FloatAD floatAD = null;
        if (uid == null) {
            DeviceTaoLiJinRecord deviceRecord = deviceTaoLiJinRecordService.getByDevice(acceptData.getDevice());
            if (deviceRecord == null) {
                floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX, 1);
            }
        } else {
            UserTaoLiJinOrigin userTaoLiJin = uerTaoLiJinOriginService.getByUidAndOrigin(uid, TaoLiJinOriginEnum.newbiesWin.name());
            if (userTaoLiJin == null) {
                floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX, 1);
            }
        }
        // 无新人弹框 则查询默认
        if (floatAD == null) {
            floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX, 0);
        }
        if (floatAD != null) {
            JSONObject detail = new JSONObject();
            detail.put("img", floatAD.getPicture());
@@ -91,13 +121,7 @@
            detail.put("params", floatAD.getParams());
            detail.put("showTime", floatAD.getShowMode());
            detail.put("accountLogin", floatAD.isJumpNeedLogin());
            if (uid != null && userInfoExtraService.isNewUser(uid)) {
                // 新用户
                data.put("floatImgDetail", detail);
            } else {
                data.put("floatImgDetail", detail);
            }
            data.put("floatImgDetail", detail);
        }
        // 领券帮助链接,1.5.2后生效
@@ -113,6 +137,37 @@
        out.print(JsonUtil.loadTrueResult(data));
    }
    /**
     * 消息中心弹框
     * @param acceptData
     * @param uid
     * @param out
     */
    @RequestMapping(value = "getMSGConfig", method = RequestMethod.POST)
    public void getMSGConfig(AcceptData acceptData, Long uid, PrintWriter out) {
        JSONObject data = new JSONObject();
        boolean show = false;
        if (uid != null ) {
            show = uerTaoLiJinOriginService.hasRankHongBao(uid);
        }
        if (show) {
            FloatAD floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_MSGCENTER, null);
            if (floatAD != null) {
                JSONObject detail = new JSONObject();
                detail.put("img", floatAD.getPicture());
                detail.put("jumpDetail", floatAD.getJumpDetail());
                detail.put("params", floatAD.getParams());
                detail.put("showTime", floatAD.getShowMode());
                detail.put("accountLogin", floatAD.isJumpNeedLogin());
                data.put("floatImgDetail", detail);
            }
        }
        out.print(JsonUtil.loadTrueResult(data));
    }
    @RequestMapping(value = "getTaoBaoCartConfig", method = RequestMethod.POST)
    public void getTaoBaoCartConfig(AcceptData acceptData, String position, Long uid, PrintWriter out) {
        if (uid == null || uid <= 0) {
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/GoodsController.java
@@ -79,8 +79,8 @@
     * @param out
     */
    @RequestMapping(value = "gettaobaolink")
    public void getTaoBaoLink(AcceptData acceptData, Long uid, Long auctionId, String from, HttpServletRequest request,
            PrintWriter out) {
    public void getTaoBaoLink(AcceptData acceptData, Long uid, Long auctionId, String from, String source,
            HttpServletRequest request,    PrintWriter out) {
        if (uid == null || uid <= 0) {
            out.print(JsonUtil.loadFalseResult(1, "用户ID不能为空"));
            return;
@@ -153,7 +153,11 @@
            // 是返利商品库的商品
            if (specialConvert) {
                if (!StringUtil.isNullOrEmpty(specialId)) {
                    taoBaoLink = shareGoodsService.getTaoBaoLinkForBuyWithSpecial(uid, specialId, auctionId);
                    if (source != null && "taolijin".equals(source)) {
                        taoBaoLink = shareGoodsService.getTaoLiJinLinkForBuy(uid, specialId, auctionId);
                    } else {
                        taoBaoLink = shareGoodsService.getTaoBaoLinkForBuyWithSpecial(uid, specialId, auctionId);
                    }
                    data.put("native", true);
                } else {
                    if (!specialConvert && !isNative) {
@@ -250,8 +254,10 @@
            businessEmergent110Service.buyTaoBaoGoodsError(StringUtil.Md5(auctionId + ""));
        }
    }
    }
    /**
     * 是否在参与推广
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/HomeNavbarController.java
@@ -33,7 +33,7 @@
     */
    @RequestMapping(value = "gethomenavbar", method = RequestMethod.POST)
    public void gethomenavbar(AcceptData acceptData, PrintWriter out) {
        List<HomeNavbar> listNavbar = homeNavbarService.listQueryDefaultNavbar();
        List<HomeNavbar> listNavbar = homeNavbarService.listQueryDefaultNavbar(0);
        if (listNavbar == null) {
            listNavbar = new ArrayList<HomeNavbar>();
        }
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java
@@ -41,6 +41,7 @@
import com.yeshi.fanli.entity.bus.user.Order;
import com.yeshi.fanli.entity.bus.user.ShamUser;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserMoneyExtra;
import com.yeshi.fanli.entity.common.ImageInfo;
import com.yeshi.fanli.entity.common.JumpDetail;
import com.yeshi.fanli.entity.common.JumpDetailV2;
@@ -79,8 +80,9 @@
import com.yeshi.fanli.service.inter.goods.SuperRecommendBannerV2Service;
import com.yeshi.fanli.service.inter.goods.SuperRecommendSpecialService;
import com.yeshi.fanli.service.inter.goods.TaoBaoCouponService;
import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
import com.yeshi.fanli.service.inter.goods.recommend.RecommendGoodsDeleteHistoryService;
import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
import com.yeshi.fanli.service.inter.homemodule.DeviceSexService;
import com.yeshi.fanli.service.inter.goods.recommend.RecommendGoodsDeleteHistoryService;
import com.yeshi.fanli.service.inter.homemodule.SpecialService;
import com.yeshi.fanli.service.inter.homemodule.SuperSpecialService;
import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
@@ -94,12 +96,18 @@
import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
import com.yeshi.fanli.service.inter.tlj.DeviceTaoLiJinRecordService;
import com.yeshi.fanli.service.inter.tlj.GoodsTaoLiJinRateService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinRecordService;
import com.yeshi.fanli.service.inter.user.ShamUserService;
import com.yeshi.fanli.service.inter.user.TBPidService;
import com.yeshi.fanli.service.inter.user.UserCustomSettingsService;
import com.yeshi.fanli.service.inter.user.UserGoodsStorageService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.service.inter.user.UserMoneyExtraService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.RedisManager;
@@ -114,6 +122,7 @@
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
import com.yeshi.fanli.vo.tlj.SpreadHongBao;
import com.yeshi.fanli.vo.user.UserSettingsVO;
import net.sf.json.JSONArray;
@@ -230,6 +239,30 @@
    @Resource
    private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
    @Resource
    private GoodsTaoLiJinRateService goodsTaoLiJinRateService;
    @Resource
    private UserMoneyExtraService userMoneyExtraService;
    @Resource
    private UserTaoLiJinOriginService userTaoLiJinOriginService;
    @Resource
    private ConfigTaoLiJinService configTaoLiJinService;
    @Resource
    private DeviceTaoLiJinRecordService deviceTaoLiJinRecordService;
    @Resource
    private DeviceSexService deviceSexService;
    @Resource
    private UserTaoLiJinRecordService userTaoLiJinRecordService;
    @Resource
    private RecommendGoodsDeleteHistoryService recommendGoodsDeleteHistoryService;
@@ -1593,8 +1626,11 @@
    @RequestMapping(value = "getRecommendIndex")
    public void getRecommendIndex(AcceptData acceptData, Long uid, PrintWriter out) {
        try {
            // 获取设备定义性别
            int deviceSex = deviceSexService.getDeviceSex(acceptData.getDevice());
            // 1、专题模块
            JSONObject root = specialService.listCacheSpecialToIndex(acceptData);
            JSONObject root = specialService.listCacheSpecialToIndex(acceptData, deviceSex);
            // 2、顶部轮播图
            List<SwiperPicture> topPicList = getSwiperByCard("index_top");
@@ -1798,13 +1834,9 @@
     * @param out
     */
    @RequestMapping(value = "getgoodsinfo", method = RequestMethod.POST)
    public void getGoodsInfo(AcceptData acceptData, String id, String uid, String from, PrintWriter out) {
    public void getGoodsInfo(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) {
        if ("0".equalsIgnoreCase(uid)) {
            uid = "";
        }
        if (StringUtil.isNullOrEmpty(id)) {
        if (id == null) {
            out.print(JsonUtil.loadFalseResult(1, "请上传id"));
            return;
        }
@@ -1848,14 +1880,14 @@
        if (!convertInServer) {
            try {
                goods = taoBaoGoodsCacheUtil.getCommonTaoBaoGoodsInfo(Long.parseLong(id));
                goods = taoBaoGoodsCacheUtil.getCommonTaoBaoGoodsInfo(id);
                if (goods == null) {
                    TaoKeAppInfo app = new TaoKeAppInfo();
                    app.setAppKey(TaoBaoConstant.TAOBAO_COMMON_APPKEY);
                    app.setAppSecret(TaoBaoConstant.TAOBAO_COMMON_APPSECRET);
                    app.setPid(TaoBaoConstant.TAOBAO_COMMON_PID);
                    app.setAdzoneId(TaoBaoConstant.TAOBAO_COMMON_PID.split("_")[3]);
                    goods = TaoKeApiUtil.searchGoodsDetail(Long.parseLong(id), app);
                    goods = TaoKeApiUtil.searchGoodsDetail(id, app);
                    final TaoBaoGoodsBrief finalGoods = goods;
                    if (goods != null) {
                        ThreadUtil.run(new Runnable() {
@@ -1870,7 +1902,7 @@
                // 商品下架
                ThreadUtil.run(new Runnable() {
                    public void run() {
                        taoBaoGoodsUpdateService.offlineTaoBaoGoods(Long.parseLong(id));
                        taoBaoGoodsUpdateService.offlineTaoBaoGoods(id);
                    }
                });
@@ -1887,7 +1919,7 @@
            app.setPid(clientPid);
            try {
                goods = TaoKeApiUtil.searchGoodsDetail(Long.parseLong(id), app);
                goods = TaoKeApiUtil.searchGoodsDetail(id, app);
                if (goods != null) {
                    ticket.put("clickUrl", goods.getAuctionUrl());
                    // 测试使用
@@ -1909,7 +1941,7 @@
            } catch (TaobaoGoodsDownException e) {
                ThreadUtil.run(new Runnable() {
                    public void run() {
                        taoBaoGoodsUpdateService.offlineTaoBaoGoods(Long.parseLong(id));
                        taoBaoGoodsUpdateService.offlineTaoBaoGoods(id);
                    }
                });
            }
@@ -1983,11 +2015,10 @@
        }
        // 判断收藏
        if (StringUtil.isNullOrEmpty(uid)) {
        if (uid == null) {
            data.put("collected", false);
        } else {
            CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(Long.parseLong(uid),
                    Long.parseLong(id));
            CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid,    id);
            data.put("collected", collectionGoods != null ? true : false);
        }
@@ -2120,26 +2151,23 @@
            goodsJson.put("shopInfo", tbShopInfo);
        }
        goodsJson.put("fanliValid", true);// 是否有返利
        // 分享路径
        String shareUrl = String.format("%s?id=" + tb.getAuctionId(), Constant.systemCommonConfig.getAppShareInfoUrl());
        // 是否加入选品库: 0未加入 1 已加入
        boolean storageState = false;
        if (uid != null && uid.trim().length() > 0) {
            storageState = userGoodsStorageService.isExistStorage(Long.parseLong(uid), Long.parseLong(id));
        if (uid != null) {
            storageState = userGoodsStorageService.isExistStorage(uid, id);
        }
        data.put("storageState", storageState);
        data.put("shareUrl", shareUrl);
        data.put("goods", goodsJson);
        data.put("shareUsers", listShareUser);
        data.put("couponUsers", listCouponUser);
        data.put("detailWebUrl", "http://apph5.yeshitv.com/apppage/goods_img.html?id=" + id);
        data.put("noRebateHelpLink", configService.get("no_rebate_help_link"));
        String noRebateHelpLink = null;
        // 商品链接
        String h5Url = String.format("http://%s%s?id=%s&appType=flq", configService.getH5Host(),
@@ -2149,7 +2177,85 @@
        } catch (Exception e) {
            data.put("h5Url", h5Url);
        }
        // 是否有返利
        boolean fanliValid = true;
        //资金类型 1-返  2-奖
        int moneyType = 1;
        // 推广红包
        if (from != null && from.equals("taolijin")) {
            BigDecimal spreadMoney = goodsTaoLiJinRateService.getGoodsSpreadMoney(goods);
            // 推广红包 不能小于1
            if (spreadMoney.compareTo(new BigDecimal(1)) < 0) {
                out.print(JsonUtil.loadFalseResult(2, "商品不存在"));
                return;
            }
            // 是否为新用户
            boolean isNewUser = userInfoExtraService.isNewUser(uid);
            if (isNewUser) {
                // 判定为老用户: 新人只要使用了新人红包,也就是那1块钱,那么,他看到的分享爆款中的商品-就只能分享。
                long countRecord = userTaoLiJinRecordService.countRecordByUid(uid);
                if (countRecord > 0) {
                    isNewUser = false;
                }
            }
            SpreadHongBao spreadHongBao = new SpreadHongBao();
            if (isNewUser) {
                spreadHongBao.setMoney("1");
            } else {
                spreadHongBao.setMoney(spreadMoney.toString());
                moneyType = 2;
                fanliValid = false;
                ClientTextStyleVO textStyleVO1 = new ClientTextStyleVO();
                textStyleVO1.setContent("分享");
                textStyleVO1.setColor("#666666");
                ClientTextStyleVO textStyleVO2 = new ClientTextStyleVO();
                textStyleVO2.setContent("赚奖金");
                textStyleVO2.setColor("#F14242");
                ClientTextStyleVO textStyleVO3 = new ClientTextStyleVO();
                textStyleVO3.setContent(",好友");
                textStyleVO3.setColor("#666666");
                ClientTextStyleVO textStyleVO4 = new ClientTextStyleVO();
                textStyleVO4.setContent("领红包");
                textStyleVO4.setColor("#F14242");
                List<ClientTextStyleVO> listText = new ArrayList<ClientTextStyleVO>();
                listText.add(textStyleVO1);
                listText.add(textStyleVO2);
                listText.add(textStyleVO3);
                listText.add(textStyleVO4);
                data.put("listTip", listText);
            }
            spreadHongBao.setTip("当日领取,两天内使用,过时无效");
            goodsJson.put("spreadHongBao", spreadHongBao);
            // 用户剩余可以淘礼金验证
            UserMoneyExtra userMoneyExtra = userMoneyExtraService.selectByPrimaryKey(uid);
            if (userMoneyExtra == null ||  userMoneyExtra.getTlj() == null) {
                data.put("userHongbao", new BigDecimal(0).setScale(2));
            } else {
                data.put("userHongbao", userMoneyExtra.getTlj().setScale(2));
            }
            noRebateHelpLink = configTaoLiJinService.getValueByKey("share_goods_help_link");
        }
        goodsJson.put("moneyType", moneyType);
        goodsJson.put("fanliValid", fanliValid);
        data.put("goods", goodsJson);
        if (!StringUtil.isNullOrEmpty(noRebateHelpLink)) {
            data.put("noRebateHelpLink", noRebateHelpLink);
        } else {
            data.put("noRebateHelpLink", configService.get("no_rebate_help_link"));
        }
        // 取消分享活动
        // if (!StringUtil.isNullOrEmpty(uid)
        // &&
@@ -2170,15 +2276,12 @@
        out.print(JsonUtil.loadTrueResult(data));
        final String tempUid = uid;
        final TaoBaoGoodsBrief goodsInfo = tb;
        ThreadUtil.run(new Runnable() {
            public void run() {
                // 添加浏览记录
                try {
                    scanHistoryV2Service.addScanHistory(
                            StringUtil.isNullOrEmpty(tempUid) ? null : Long.parseLong(tempUid), acceptData.getDevice(),
                            goodsInfo);
                    scanHistoryV2Service.addScanHistory(uid, acceptData.getDevice(),goodsInfo);
                } catch (Exception e) {
                    e.printStackTrace();
                }
@@ -2385,6 +2488,28 @@
            if (listSpecial == null) {
                listSpecial = new ArrayList<Special>();
            }
            for (Special special: listSpecial) {
                JumpDetailV2 jumpDetail = special.getJumpDetail();
                if (jumpDetail != null) {
                    jumpDetail.setNeedLogin(special.isJumpLogin());
                    special.setJumpDetail(jumpDetail);
                }
                String name = special.getName();
                if (StringUtil.isNullOrEmpty(name)) {
                    continue;
                }
                // 是否需要弹出框
                if (name.equals("账户等级特权")) {
                    if (uid != null) {
                        special.setElastic(userTaoLiJinOriginService.hasRankHongBao(uid));
                    }
                }
            }
            JSONObject root = new JSONObject();
            root.put("special", JsonUtil.getApiCommonGson().toJson(listSpecial));
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java
@@ -22,6 +22,7 @@
import com.yeshi.fanli.entity.bus.share.UserShareGoodsGroup;
import com.yeshi.fanli.entity.bus.share.UserShareGoodsHistory;
import com.yeshi.fanli.entity.bus.share.UserShareGoodsRecord;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinRecord;
import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
@@ -37,6 +38,7 @@
import com.yeshi.fanli.exception.goods.ShareGoodsTextTemplateException;
import com.yeshi.fanli.exception.share.UserShareGoodsRecordException;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
import com.yeshi.fanli.exception.tlj.UserTaoLiJinRecordException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.config.SystemClientParamsService;
@@ -47,6 +49,9 @@
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.monitor.BusinessEmergent110Service;
import com.yeshi.fanli.service.inter.monitor.MonitorService;
import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
import com.yeshi.fanli.service.inter.tlj.GoodsTaoLiJinRateService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinRecordService;
import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
@@ -126,6 +131,16 @@
    @Resource
    private BusinessEmergent110Service businessEmergent110Service;
    @Resource
    private ConfigTaoLiJinService configTaoLiJinService;
    @Resource
    private GoodsTaoLiJinRateService goodsTaoLiJinRateService;
    @Resource
    private UserTaoLiJinRecordService userTaoLiJinRecordService;
    // 获取商品分享链接
    @RequestMapping(value = "getGoodsShareUrl")
@@ -144,8 +159,9 @@
     * @param out
     */
    @RequestMapping(value = "gettaobaosharelink")
    public void getTaobaoShareLink(AcceptData acceptData, Long uid, Long auctionId, HttpServletRequest request,
            PrintWriter out) {
    public void getTaobaoShareLink(AcceptData acceptData, Long uid, Long auctionId, String source, Integer totalNum,
            HttpServletRequest request, PrintWriter out) {
        if (uid == null || uid <= 0) {
            out.print(JsonUtil.loadFalseResult(1, "用户ID不能为空"));
            return;
@@ -168,13 +184,56 @@
            if (extraInfo != null && extraInfo.getRelationId() != null && extraInfo.getRelationValid() != null
                    && extraInfo.getRelationValid() == true)
                relationId = extraInfo.getRelationId();
            TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, auctionId, relationId);
            TaoBaoLink taoBaoLink  = new TaoBaoLink();
            if (source != null && "taolijin".equals(source)) {
                taoBaoLink = shareGoodsService.getTaoLiJinLinkForShare(uid, auctionId, relationId);
            } else {
                taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, auctionId, relationId);
            }
            JSONObject data = new JSONObject();
            String url = String.format("http://%s%s?uid=%s&id=%s&appType=flq", configService.getH5Host(),
                    Constant.systemCommonConfig.getShareGoodsPagePath(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY),
                    auctionId + "");
            if (source != null && "taolijin".equals(source)) {
                BigDecimal spreadMoney = goodsTaoLiJinRateService.getGoodsSpreadMoney(taoBaoLink.getGoods());
                // 推广红包 不能小于1
                if (spreadMoney.compareTo(new BigDecimal(1)) < 0) {
                    out.print(JsonUtil.loadFalseResult(1, "该商品淘礼金不足1元"));
                    return;
                }
                data.put("spreadMoney", "淘礼金 ¥" + spreadMoney.toString());
                String taoLiJinLink = null;
                try {
                    UserTaoLiJinRecord record = userTaoLiJinRecordService.createShareTaoLiJin(uid, totalNum, taoBaoLink.getGoods());
                    taoLiJinLink = record.getSendUrl();
                    data.put("tljId", record.getId());
                    data.put("surplusMoney", record.getSurplusMoney());
                } catch (UserTaoLiJinRecordException e) {
                    out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
                    return;
                }
                // 创建淘口令
                TaoBaoGoodsBrief goods = taoBaoLink.getGoods();
                if (!StringUtil.isNullOrEmpty(taoLiJinLink)) {// 通过立即推广方式获取淘口令成功
                    String quanToken = TaoKeApiUtil.getTKToken(goods.getPictUrl(), goods.getTitle(), taoLiJinLink);
                    if (!StringUtil.isNullOrEmpty(quanToken)) {
                        taoBaoLink.setTaoToken(quanToken);
                    }
                } else if (!StringUtil.isNullOrEmpty(taoBaoLink.getClickUrl())) {
                    String quanToken = TaoKeApiUtil.getTKToken(goods.getPictUrl(), goods.getTitle(), taoBaoLink.getClickUrl());
                    if (!StringUtil.isNullOrEmpty(quanToken)) {
                        taoBaoLink.setTaoToken(quanToken);
                    }
                }
            }
            String shortLink = HttpUtil.getShortLink(url);
            if (!StringUtil.isNullOrEmpty(shortLink)) {
                url = shortLink;
@@ -190,6 +249,7 @@
            // 无券
            String shopType = taoBaoLink.getGoods().getUserType() == 0 ? "淘宝价" : "天猫价";
            if (StringUtil.isNullOrEmpty(taoBaoLink.getGoods().getCouponInfo())) {
                String text = shareGoodsTextTemplateService.getCommonTemplate(uid);
                if (StringUtil.isNullOrEmpty(text))
@@ -198,16 +258,33 @@
                        MoneyBigDecimalUtil.getWithNoZera(taoBaoLink.getGoods().getZkPrice()) + "");
            } else// 有券
            {
                String text = shareGoodsTextTemplateService.geteCouponTemplate(uid);
                if (StringUtil.isNullOrEmpty(text))
                    text = configService.get("goods_share_text_coupon");
                shareText = text.replace("{标题}", taoBaoLink.getGoods().getTitle())
                        .replace("{商品原价}", MoneyBigDecimalUtil.getWithNoZera(taoBaoLink.getGoods().getZkPrice()) + "")
                        .replace("{优惠券面额}",
                                MoneyBigDecimalUtil.getWithNoZera(taoBaoLink.getGoods().getCouponAmount()).toString())
                        .replace("{优惠券价}", TaoBaoUtil.getAfterUseCouplePrice(taoBaoLink.getGoods()) + "");
                if (source != null && "taolijin".equals(source)) {
                    String text = shareGoodsTextTemplateService.getTaoLiJinTemplate(uid);
                    if (StringUtil.isNullOrEmpty(text))
                        text = configTaoLiJinService.getValueByKey("goods_share_text");
                    shareText = text.replace("{标题}", taoBaoLink.getGoods().getTitle())
                            .replace("{商品原价}", MoneyBigDecimalUtil.getWithNoZera(taoBaoLink.getGoods().getZkPrice()) + "")
                            .replace("{优惠券面额}",
                                    MoneyBigDecimalUtil.getWithNoZera(taoBaoLink.getGoods().getCouponAmount()).toString())
                            .replace("{淘礼金面额}", MoneyBigDecimalUtil.getWithNoZera(goodsTaoLiJinRateService.getGoodsSpreadMoney(taoBaoLink.getGoods())).toString())
                            .replace("{优惠券价}", TaoBaoUtil.getAfterUseCouplePrice(taoBaoLink.getGoods()) + "");
                } else {
                    String text = shareGoodsTextTemplateService.geteCouponTemplate(uid);
                    if (StringUtil.isNullOrEmpty(text))
                        text = configService.get("goods_share_text_coupon");
                    shareText = text.replace("{标题}", taoBaoLink.getGoods().getTitle())
                            .replace("{商品原价}", MoneyBigDecimalUtil.getWithNoZera(taoBaoLink.getGoods().getZkPrice()) + "")
                            .replace("{优惠券面额}",
                                    MoneyBigDecimalUtil.getWithNoZera(taoBaoLink.getGoods().getCouponAmount()).toString())
                            .replace("{优惠券价}", TaoBaoUtil.getAfterUseCouplePrice(taoBaoLink.getGoods()) + "");
                }
            }
            shareText = shareText.replace("{店铺类型}", shopType)
                    .replace("{月销量}", TaoBaoUtil.getSaleCount(taoBaoLink.getGoods().getBiz30day()))
                    .replace("{领券短链}", shortLink).replace("{淘口令}", taoBaoLink.getTaoToken());
@@ -241,6 +318,7 @@
            }
            out.print(JsonUtil.loadTrueResult(data));
            final TaoBaoLink taobaoLink = taoBaoLink;
            // 异步操作
            com.yeshi.fanli.util.ThreadUtil.run(new Runnable() {
                @Override
@@ -251,13 +329,13 @@
                    history.setHongbao(shareMoney);
                    history.setCreateTime(new Date());
                    history.setGoodsType(UserShareGoodsHistory.TYPE_TAOBAO);
                    history.setTkCode(taoBaoLink.getTaoToken());
                    history.setLink(taoBaoLink.getClickUrl());
                    history.setQuanLink(taoBaoLink.getCouponLink());
                    history.setGoodsId(taoBaoLink.getGoods().getAuctionId());
                    history.setPostPicture(taoBaoLink.getGoods().getPictUrl());
                    history.setTkCode(taobaoLink.getTaoToken());
                    history.setLink(taobaoLink.getClickUrl());
                    history.setQuanLink(taobaoLink.getCouponLink());
                    history.setGoodsId(taobaoLink.getGoods().getAuctionId());
                    history.setPostPicture(taobaoLink.getGoods().getPictUrl());
                    List<String> imgList = taoBaoLink.getGoods().getImgList();
                    List<String> imgList = taobaoLink.getGoods().getImgList();
                    if (imgList == null) {
                        imgList = new ArrayList<>();
                    }
@@ -455,7 +533,7 @@
     * @param out
     */
    @RequestMapping(value = "viewShareTextTemplate", method = RequestMethod.POST)
    public void preViewShareTextTemplate(AcceptData acceptData, Long uid, String template, Long goodsId,
    public void preViewShareTextTemplate(AcceptData acceptData, Long uid, String template, Long goodsId, Long tljId,
            Boolean hasCoupon, PrintWriter out) {
        if (uid == null) {
            out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
@@ -479,20 +557,28 @@
            out.print(JsonUtil.loadFalseResult(4, "商品已下架"));
            return;
        }
        if (StringUtil.isNullOrEmpty(template))
            template = getShareTemplate(uid, hasCoupon);
            template = getShareTemplate(uid, hasCoupon, tljId);
        // 校验券模板是否正确
        if (hasCoupon) {
            // 有券商品
            try {
                shareGoodsTextTemplateService.isCouponTemplateRight(template);
            } catch (ShareGoodsTextTemplateException e) {
                out.print(JsonUtil.loadFalseResult(5, e.getMsg()));
                return;
            if (tljId != null) {
                try {
                    shareGoodsTextTemplateService.isTaoLiJinTemplateRight(template);
                } catch (ShareGoodsTextTemplateException e) {
                    out.print(JsonUtil.loadFalseResult(5, e.getMsg()));
                    return;
                }
            } else {
                try {
                    shareGoodsTextTemplateService.isCouponTemplateRight(template);
                } catch (ShareGoodsTextTemplateException e) {
                    out.print(JsonUtil.loadFalseResult(5, e.getMsg()));
                    return;
                }
            }
        } else {
            // 普通商品
            try {
@@ -503,12 +589,25 @@
            }
        }
        String url = null;
        if (tljId != null) {
            UserTaoLiJinRecord userTaoLiJinRecord = userTaoLiJinRecordService.selectByPrimaryKey(tljId);
            if (userTaoLiJinRecord == null) {
                out.print(JsonUtil.loadFalseResult(5, "淘礼金领取链接不存在"));
                return;
            }
            url = userTaoLiJinRecord.getSendUrl();
        } else {
            url = String.format("http://%s%s?uid=%s&id=%s&appType=flq", configService.getH5Host(),
                    Constant.systemCommonConfig.getShareGoodsPagePath(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY),
                    goods.getAuctionId() + "");
        }
        String shortLink = HttpUtil.getShortLink(url);
        // 查询是否有分享
        UserShareGoodsHistory userShareHistory = shareGoodsService.getShareGoodsHistory(uid, goods.getAuctionId());
        String url = String.format("http://%s%s?uid=%s&id=%s&appType=flq", configService.getH5Host(),
                Constant.systemCommonConfig.getShareGoodsPagePath(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY),
                goods.getAuctionId() + "");
        String shortLink = HttpUtil.getShortLink(url);
        String token = "";
        if (userShareHistory != null) {
            token = userShareHistory.getTkCode();
@@ -527,7 +626,7 @@
                                : goodsLink.getCouponLink());
        }
        String content = shareGoodsTextTemplateService.createContentByTemplate(template, uid, goods, token, shortLink,
                hasCoupon);
                hasCoupon, tljId);
        JSONObject data = new JSONObject();
        data.put("content", content);
        out.print(JsonUtil.loadTrueResult(data));
@@ -543,7 +642,7 @@
     * @param out
     */
    @RequestMapping(value = "saveShareTextTemplate", method = RequestMethod.POST)
    public void saveShareTextTemplate(AcceptData acceptData, Long uid, Boolean hasCoupon, String template,
    public void saveShareTextTemplate(AcceptData acceptData, Long uid, Long tljId, Boolean hasCoupon, String template,
            PrintWriter out) {
        if (StringUtil.isNullOrEmpty(template)) {
            out.print(JsonUtil.loadFalseResult(1, "分享模板为空"));
@@ -552,15 +651,25 @@
        // 校验券模板是否正确
        if (hasCoupon) {
            // 有券商品
            try {
                shareGoodsTextTemplateService.isCouponTemplateRight(template);
                shareGoodsTextTemplateService.saveCouponTemplate(uid, template);
                out.print(JsonUtil.loadTrueResult(""));
            } catch (ShareGoodsTextTemplateException e) {
                out.print(JsonUtil.loadFalseResult(5, e.getMsg()));
                return;
            if (tljId != null) {
                try {
                    shareGoodsTextTemplateService.isTaoLiJinTemplateRight(template);
                    shareGoodsTextTemplateService.saveTaoLiJinTemplate(uid, template);
                    out.print(JsonUtil.loadTrueResult(""));
                } catch (ShareGoodsTextTemplateException e) {
                    out.print(JsonUtil.loadFalseResult(5, e.getMsg()));
                    return;
                }
            } else {
                try {
                    shareGoodsTextTemplateService.isCouponTemplateRight(template);
                    shareGoodsTextTemplateService.saveCouponTemplate(uid, template);
                    out.print(JsonUtil.loadTrueResult(""));
                } catch (ShareGoodsTextTemplateException e) {
                    out.print(JsonUtil.loadFalseResult(5, e.getMsg()));
                    return;
                }
            }
        } else {
            // 普通商品
            try {
@@ -585,32 +694,46 @@
     * @param out
     */
    @RequestMapping(value = "resetShareTextTemplate", method = RequestMethod.POST)
    public void resetShareTextTemplate(AcceptData acceptData, Long uid, Long goodsId, Boolean hasCoupon,
    public void resetShareTextTemplate(AcceptData acceptData, Long uid, Long goodsId, Long tljId, Boolean hasCoupon,
            PrintWriter out) {
        if (uid == null) {
            out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
        }
        if (hasCoupon) {
            shareGoodsTextTemplateService.resetCouponTemplate(uid);
            if (tljId != null) {
                shareGoodsTextTemplateService.resetTaoLijinTemplate(uid);
            } else {
                shareGoodsTextTemplateService.resetCouponTemplate(uid);
            }
        } else {
            shareGoodsTextTemplateService.resetCommonTemplate(uid);
        }
        if (goodsId != null) {
            preViewShareTextTemplate(acceptData, uid, null, goodsId, hasCoupon, out);
            preViewShareTextTemplate(acceptData, uid, null, goodsId, tljId, hasCoupon, out);
            return;
        }
        out.print(JsonUtil.loadTrueResult(""));
    }
    private String getShareTemplate(Long uid, boolean hasCoupon) {
    private String getShareTemplate(Long uid, boolean hasCoupon, Long tljId) {
        if (hasCoupon) {
            String template = shareGoodsTextTemplateService.geteCouponTemplate(uid);
            if (StringUtil.isNullOrEmpty(template))
                template = configService.get("goods_share_text_coupon");
            return template;
            if (tljId != null) {
                String template = shareGoodsTextTemplateService.getTaoLiJinTemplate(uid);
                if (StringUtil.isNullOrEmpty(template))
                    template = configTaoLiJinService.getValueByKey("goods_share_text");
                return template;
            } else {
                String template = shareGoodsTextTemplateService.geteCouponTemplate(uid);
                if (StringUtil.isNullOrEmpty(template))
                    template = configService.get("goods_share_text_coupon");
                return template;
            }
        } else {
            String template = shareGoodsTextTemplateService.getCommonTemplate(uid);
            if (StringUtil.isNullOrEmpty(template))
@@ -628,13 +751,19 @@
     * @param out
     */
    @RequestMapping(value = "getShareTextTemplate", method = RequestMethod.POST)
    public void getShareTextTemplate(AcceptData acceptData, Long uid, Boolean hasCoupon, PrintWriter out) {
    public void getShareTextTemplate(AcceptData acceptData, Long uid, Long tljId, Boolean hasCoupon, PrintWriter out) {
        if (uid == null) {
            out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
        }
        if (hasCoupon == null) {
            out.print(JsonUtil.loadFalseResult(1, "是否有券字段为空"));
            return;
        }
        JSONObject data = new JSONObject();
        data.put("template", getShareTemplate(uid, hasCoupon));
        data.put("template", getShareTemplate(uid, hasCoupon, tljId));
        out.print(JsonUtil.loadTrueResult(data));
    }
@@ -645,8 +774,12 @@
     * @param out
     */
    @RequestMapping(value = "getShareTextTemplateRules", method = RequestMethod.POST)
    public void getShareTextTemplateRules(AcceptData acceptData, PrintWriter out) {
        out.print(JsonUtil.loadTrueResult(configService.get("share_goods_template_rules")));
    public void getShareTextTemplateRules(AcceptData acceptData, Long tljId, PrintWriter out) {
        if (tljId != null) {
            out.print(JsonUtil.loadTrueResult( configTaoLiJinService.getValueByKey("share_goods_rules")));
        } else {
            out.print(JsonUtil.loadTrueResult(configService.get("share_goods_template_rules")));
        }
    }
    /**
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserAccountController.java
@@ -41,6 +41,7 @@
import com.yeshi.fanli.service.inter.order.OrderService;
import com.yeshi.fanli.service.inter.push.DeviceTokenHWService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
import com.yeshi.fanli.service.inter.user.BindingAccountService;
import com.yeshi.fanli.service.inter.user.ExtractService;
import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
@@ -145,6 +146,10 @@
    
    @Resource
    private UserInfoDeleteRecordService userInfoDeleteRecordService;
    @Resource
    private UserTaoLiJinOriginService userTaoLiJinOriginService;
    private static final String PASSWORD_MAX_ERROR = "password_max_error";
    private static final String EXTRACT_MIN_MONEY = "extract_min_money";
@@ -1161,8 +1166,8 @@
                            LogHelper.errorDetailInfo(e);
                        }
                        
                        /* 同步未登录之前设备抽奖数据 */
                        try {
                            /* 同步未登录之前设备抽奖数据 */
                            int platformType = 0;
                            String platform = acceptData.getPlatform();
                            if ("android".equals(platform)) {
@@ -1174,6 +1179,16 @@
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                        /* 新人红包 */
                        try {
                            userTaoLiJinOriginService.synchDeviceHongbao(uuser.getId(),  device);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    }
                });
            }
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserInfoController.java
@@ -84,6 +84,7 @@
import com.yeshi.fanli.service.inter.order.HongBaoOrderService;
import com.yeshi.fanli.service.inter.order.LostOrderService;
import com.yeshi.fanli.service.inter.order.OrderService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinDetailService;
import com.yeshi.fanli.service.inter.user.AccountMessageService;
import com.yeshi.fanli.service.inter.user.BindingAccountService;
import com.yeshi.fanli.service.inter.user.ExtractRecordService;
@@ -209,6 +210,9 @@
    
    @Resource
    private MaskKeyService maskKeyService;
    @Resource
    private UserTaoLiJinDetailService userTaoLiJinDetailService;
    
    private static final String PASSWORD_MAX_ERROR = "password_max_error";
@@ -578,7 +582,9 @@
        if (mySettings.getNoInvitationBonus() == null) {
            mySettings.setNoInvitationBonus(0);
        }
        if (mySettings.getOpenSpreadHongBao() == null) {
            mySettings.setOpenSpreadHongBao(0);
        }
        data.put("moduleState", mySettings);
        int welfareCenterNews = 0;
@@ -2088,7 +2094,18 @@
            if (mySettings.getNoInvitationBonus() == null) {
                mySettings.setNoInvitationBonus(0);
            }
            if (mySettings.getOpenSpreadHongBao() == null) {
                if(userTaoLiJinDetailService.countDetail(uid) > 0) {
                    mySettings.setOpenSpreadHongBao(1);
                } else {
                    mySettings.setOpenSpreadHongBao(0);
                }
            }
            data.put("moduleState", mySettings);
            int welfareCenterNews = 0;
            String invitCode = null;
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/HomeNavbarControllerV2.java
@@ -18,6 +18,7 @@
import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar.NavbarTypeEnum;
import com.yeshi.fanli.entity.bus.homemodule.HomeNavbarUser;
import com.yeshi.fanli.exception.homemodule.HomeNavbarUserException;
import com.yeshi.fanli.service.inter.homemodule.DeviceSexService;
import com.yeshi.fanli.service.inter.homemodule.HomeNavbarService;
import com.yeshi.fanli.service.inter.homemodule.HomeNavbarUserService;
import com.yeshi.fanli.util.StringUtil;
@@ -33,20 +34,52 @@
    @Resource
    private HomeNavbarUserService homeNavbarUserService;
    @Resource
    private DeviceSexService deviceSexService;
    /**
     * 获取导航栏内容
     *
     * 改变性别
     * @param acceptData
     * @param sex
     * @param out
     */
    @RequestMapping(value = "changeSex", method = RequestMethod.POST)
    public void changeSex(AcceptData acceptData, Integer sex, PrintWriter out) {
        try {
            // 获取设备定义性别
            int deviceSex = deviceSexService.changeDeviceSex(sex, acceptData.getDevice());
            JSONObject data = new JSONObject();
            data.put("sex", deviceSex);
            out.print(JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult("切换失败"));
        }
    }
    /**
     * 获取导航栏内容
     * @param acceptData
     * @param uid
     * @param sex 0通用 1男 2女
     * @param out
     */
    @RequestMapping(value = "getHomeItems", method = RequestMethod.POST)
    public void getHomeItems(AcceptData acceptData, Long uid, PrintWriter out) {
        List<HomeNavbar> listNavbar = homeNavbarUserService.listEffectiveNavbar(uid, acceptData.getDevice());
        // 获取设备定义性别
        int deviceSex = deviceSexService.getDeviceSex(acceptData.getDevice());
        List<HomeNavbar> listNavbar = homeNavbarUserService.listEffectiveNavbar(uid, acceptData.getDevice(), deviceSex);
        if (listNavbar == null) {
            listNavbar = new ArrayList<HomeNavbar>();
        }
        JSONObject data = new JSONObject();
        data.put("sex", deviceSex);
        data.put("count", listNavbar.size());
        data.put("listNavbar", JsonUtil.getApiCommonGson().toJson(listNavbar));
        out.print(JsonUtil.loadTrueResult(data));
@@ -85,14 +118,14 @@
                    }
                    if (homeNavbar.getIsDefault()) {
                        listExist.add(homeNavbar);
                        if (homeNavbar.getIsFixed()) {
                            nonCount++;
                        }
                        listExist.add(homeNavbar);
                        listItems.remove(homeNavbar);
                        i--;
                        continue;
                    }
                }
@@ -183,6 +216,10 @@
            homeNavbarUserService.addNavbarUser(uid, acceptData.getDevice(), list);
            out.print(JsonUtil.loadTrueResult("保存成功"));
            // 设置为通用
            deviceSexService.changeDeviceSex(0, acceptData.getDevice());
        } catch (HomeNavbarUserException e) {
            out.print(JsonUtil.loadFalseResult(1, e.getMsg()));
        }
@@ -201,7 +238,8 @@
            int nonCount = 0;
            List<HomeNavbar> listExist = new ArrayList<HomeNavbar>();
            List<HomeNavbar> listItems = new ArrayList<HomeNavbar>();
            List<HomeNavbar> listNavbar = homeNavbarUserService.restoreSystemDefault(uid, acceptData.getDevice());
            if (listNavbar != null && listNavbar.size() > 0) {
                listItems.addAll(listNavbar);
@@ -220,13 +258,15 @@
                if (!homeNavbar.getIsDefault()) {
                    break;
                } else {
                    // 固定个数
                    if (homeNavbar.getIsFixed()) {
                        nonCount++;
                    }
                    // 默认项
                    listExist.add(homeNavbar);
                    listItems.remove(homeNavbar);
                    i--;
                    continue;
                }
            }
@@ -235,6 +275,10 @@
            data.put("listExist", JsonUtil.getApiCommonGson().toJson(listExist));
            data.put("listItems", JsonUtil.getApiCommonGson().toJson(listItems));
            out.print(JsonUtil.loadTrueResult(data));
            // 设置为通用
            deviceSexService.changeDeviceSex(0, acceptData.getDevice());
        } catch (HomeNavbarUserException e) {
            out.print(JsonUtil.loadFalseResult(1, e.getMsg()));
        }
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/TaoLiJinControllerV2.java
New file
@@ -0,0 +1,555 @@
package com.yeshi.fanli.controller.client.v2;
import java.io.IOException;
import java.io.PrintWriter;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.core.task.TaskExecutor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.JsonUtil;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.lable.QualityFactory;
import com.yeshi.fanli.entity.bus.tlj.DeviceTaoLiJinRecord;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail.TaoLiJinDetailTypeEnum;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin.TaoLiJinOriginEnum;
import com.yeshi.fanli.entity.bus.user.UserMoneyExtra;
import com.yeshi.fanli.entity.bus.user.UserRank;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
import com.yeshi.fanli.exception.tlj.UserTaoLiJinOriginException;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
import com.yeshi.fanli.service.inter.goods.ShareGoodsTextTemplateService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.lable.QualityGoodsService;
import com.yeshi.fanli.service.inter.monitor.BusinessEmergent110Service;
import com.yeshi.fanli.service.inter.monitor.MonitorService;
import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
import com.yeshi.fanli.service.inter.tlj.DeviceTaoLiJinRecordService;
import com.yeshi.fanli.service.inter.tlj.GoodsTaoLiJinRateService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinDetailService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinRecordService;
import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.service.inter.user.UserMoneyExtraService;
import com.yeshi.fanli.service.inter.user.UserShareGoodsRecordService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
import com.yeshi.fanli.vo.tlj.TaoLiJinDetailVO;
import com.yeshi.fanli.vo.user.UserTaoLiJinRecordVO;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@Controller
@RequestMapping("api/v2/taolijin")
public class TaoLiJinControllerV2 {
    @Resource
    private UserTaoLiJinRecordService userTaoLiJinRecordService;
    @Resource
    private ConfigService configService;
    @Resource
    private ShareGoodsService shareGoodsService;
    @Resource
    private UserInfoService userInfoService;
    @Resource
    private UserShareGoodsRecordService userShareGoodsRecordService;
    @Resource
    private HongBaoManageService hongBaoManageService;
    @Resource
    private ShareGoodsTextTemplateService shareGoodsTextTemplateService;
    @Resource
    private BusinessEmergent110Service businessEmergent110Service;
    @Resource
    private MonitorService monitorService;
    @Resource
    private UserInfoExtraService userInfoExtraService;
    @Resource
    private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
    @Resource
    private UserTaoLiJinOriginService userTaoLiJinOriginService;
    @Resource
    private UserTaoLiJinDetailService userTaoLiJinDetailService;
    @Resource
    private UserMoneyExtraService userMoneyExtraService;
    @Resource
    private ConfigTaoLiJinService configTaoLiJinService;
    @Resource
    private QualityGoodsService qualityGoodsService;
    @Resource
    private GoodsTaoLiJinRateService goodsTaoLiJinRateService;
    @Resource
    private DeviceTaoLiJinRecordService deviceTaoLiJinRecordService;
    @Resource
    private JumpDetailV2Service jumpDetailV2Service;
    @Resource(name = "taskExecutor")
    private TaskExecutor executor;
    /**
     * 获取淘礼金分享记录
     *
     * @param acceptData
     * @param uid
     * @param page
     * @param out
     */
    @RequestMapping(value = "getShareRecord", method = RequestMethod.POST)
    public void getShareRecord(AcceptData acceptData, Long uid, Integer page, PrintWriter out) {
        if (uid == null || uid <= 0) {
            out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
        }
        if (page == null || page < 1) {
            page = 1;
        }
        long count = 0;
        int pageSize = Constant.PAGE_SIZE;
        List<UserTaoLiJinRecordVO> list = userTaoLiJinRecordService.getRecordByUid((page - 1) * pageSize, pageSize,    uid);
        if (list == null) {
            list = new ArrayList<UserTaoLiJinRecordVO>();
        } else if (list.size() > 0) {
            count = userTaoLiJinRecordService.countRecordByUid(uid);
        }
        GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
        gsonBuilder.registerTypeAdapter(Date.class, new JsonSerializer<Date>() {
            @Override
            public JsonElement serialize(Date value, Type theType, JsonSerializationContext context) {
                if (value == null) {
                    return new JsonPrimitive("");
                } else {
                    return new JsonPrimitive(TimeUtil.getGernalTime(value.getTime(), "yyyy.MM.dd HH:mm"));
                }
            }
        });
        Gson gson = gsonBuilder.create();
        JSONObject data = new JSONObject();
        data.put("count", count);
        data.put("list", gson.toJson(list));
        out.print(JsonUtil.loadTrueResult(data));
    }
    /**
     * 统计淘礼金
     * @param acceptData
     * @param uid
     * @param out
     */
    @RequestMapping(value = "countHongBao", method = RequestMethod.POST)
    public void countHongBao(AcceptData acceptData, Long uid, PrintWriter out) {
        if (uid == null || uid <= 0) {
            out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
        }
        // 过期
        userTaoLiJinOriginService.overdueHongBao(uid);
        // 我的淘礼金
        BigDecimal tlj = null;
        UserMoneyExtra userMoneyExtra = userMoneyExtraService.selectByPrimaryKey(uid);
        if (userMoneyExtra != null) {
            tlj = userMoneyExtra.getTlj();
        } else {
            tlj = new BigDecimal(0);
        }
        // 今日分享个数
        long countShare = userTaoLiJinRecordService.countTodayNum(uid);
        // 获得
        BigDecimal todayWin = userTaoLiJinOriginService.countMoneyByDate(uid, 1);
        BigDecimal yesterdayWin = userTaoLiJinOriginService.countMoneyByDate(uid, 2);
        BigDecimal thisMonthWin = userTaoLiJinOriginService.countMoneyByDate(uid, 3);
        BigDecimal lastMonthWin = userTaoLiJinOriginService.countMoneyByDate(uid, 4);
        // 消耗
        BigDecimal todayUse = userTaoLiJinDetailService.countUseMoneyByDate(uid, 1);
        BigDecimal yesterdayUse = userTaoLiJinDetailService.countUseMoneyByDate(uid, 2);
        BigDecimal thisMonthUse = userTaoLiJinDetailService.countUseMoneyByDate(uid, 3);
        BigDecimal lastMonthUse = userTaoLiJinDetailService.countUseMoneyByDate(uid, 4);
        // 问号链接
        String helpLink = configTaoLiJinService.getValueByKey("hongbao_help_link");
        JSONObject data = new JSONObject();
        data.put("tlj",  tlj.setScale(2).toString());
        data.put("helpLink", helpLink);
        data.put("countShare", countShare);
        data.put("todayWin", todayWin.setScale(2).toString());
        data.put("yesterdayWin", yesterdayWin.setScale(2).toString());
        data.put("thisMonthWin", thisMonthWin.setScale(2).toString());
        data.put("lastMonthWin", lastMonthWin.setScale(2).toString());
        data.put("todayUse", todayUse.setScale(2).toString().replaceAll("-", ""));
        data.put("yesterdayUse", yesterdayUse.setScale(2).toString().replaceAll("-", ""));
        data.put("thisMonthUse", thisMonthUse.setScale(2).toString().replaceAll("-", ""));
        data.put("lastMonthUse", lastMonthUse.setScale(2).toString().replaceAll("-", ""));
        // IOS 分享个数
        ClientTextStyleVO textVo1 = new ClientTextStyleVO();
        textVo1.setContent("今日创建分享");
        textVo1.setColor("#888888");
        ClientTextStyleVO textVo2 = new ClientTextStyleVO();
        textVo2.setContent(countShare + "");
        textVo2.setColor("#E5005C");
        ClientTextStyleVO textVo3 = new ClientTextStyleVO();
        textVo3.setContent("个");
        textVo3.setColor("#888888");
        List<ClientTextStyleVO> listCountShare = new ArrayList<ClientTextStyleVO>();
        listCountShare.add(textVo1);
        listCountShare.add(textVo2);
        listCountShare.add(textVo3);
        data.put("listShare", listCountShare);
        out.print(JsonUtil.loadTrueResult(data));
    }
    /**
     * 获取淘礼金明细详情
     *
     * @param acceptData
     * @param uid
     * @param index
     *            List最末的主键ID
     * @param year
     *            年份
     * @param month
     *            月份
     * @param out
     */
    @RequestMapping(value = "getMoneyDetails")
    public void getMoneyDetails(AcceptData acceptData, Long uid, Long index, Integer year, Integer month,
            PrintWriter out) {
        if (uid == null || uid == 0) {
            out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
        }
        if ((year == null && month != null) || (year != null && month == null)) {
            out.print(JsonUtil.loadFalseResult(1, "日期不完整"));
            return;
        }
        Date date = null;
        if (year != null && month != null) {
            date = new Date(TimeUtil.convertToTimeTemp(year + "-" + month, "yyyy-M"));
            Calendar ca = Calendar.getInstance();
            ca.setTime(date);
            ca.add(Calendar.MONTH, 1);
            date = new Date(ca.getTimeInMillis() - 1);
        }
        // 查询列表
        List<TaoLiJinDetailVO> list = userTaoLiJinDetailService.listUserMoneyDetailForClient(uid, index, date);
        // 统计总条数
        long count = userTaoLiJinDetailService.countUserMoneyDetailForClient(uid, index, date);
        GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
        gsonBuilder.registerTypeAdapter(TaoLiJinDetailTypeEnum.class, new TypeAdapter<TaoLiJinDetailTypeEnum>() {
            @Override
            public TaoLiJinDetailTypeEnum read(JsonReader arg0) throws IOException {
                return null;
            }
            @Override
            public void write(JsonWriter out, TaoLiJinDetailTypeEnum arg1) throws IOException {
                out.beginObject();
                out.name("portrait").value(arg1.getPicture());
                out.endObject();
            }
        }).registerTypeAdapter(Date.class, new JsonSerializer<Date>() {
            @Override
            public JsonElement serialize(Date value, Type theType, JsonSerializationContext context) {
                if (value == null) {
                    return new JsonPrimitive("");
                } else {
                    return new JsonPrimitive(TimeUtil.getGernalTime(value.getTime(), "yyyy.MM.dd HH:mm"));
                }
            }
        });
        Gson gson = gsonBuilder.create();
        JSONObject data = new JSONObject();
        data.put("count", count);
        data.put("data", gson.toJson(list));
        out.print(JsonUtil.loadTrueResult(data));
    }
    /**
     *   红包领取详情
     * @param acceptData
     * @param uid
     * @param type
     * @param out
     */
    @RequestMapping(value = "getHongbaoDetails", method = RequestMethod.POST)
    public void getHongbaoDetails(AcceptData acceptData, Long uid, String type, PrintWriter out) {
        if (StringUtil.isNullOrEmpty(type)) {
            out.print(JsonUtil.loadFalseResult(1, "类型不能为空"));
            return;
        }
        // 用户未登录时  设备领取新红包
        if (uid == null || uid <= 0) {
            BigDecimal money = null;
            DeviceTaoLiJinRecord deviceRecord = deviceTaoLiJinRecordService.getByDevice(acceptData.getDevice());
            if (deviceRecord != null) {
                // 已领取
                money = deviceRecord.getMoney();
            } else {
                String value = configTaoLiJinService.getValueByKey("hongbao_newbies");
                if (StringUtil.isNullOrEmpty(value)) {
                    out.print(JsonUtil.loadFalseResult(1, "系统红包不存在"));
                    return;
                }
                money = new BigDecimal(value);
                deviceTaoLiJinRecordService.save(acceptData.getDevice(), money);
            }
            JSONObject data = new JSONObject();
            data.put("icon", configTaoLiJinService.getValueByKey("taolijin_system_icon"));
            data.put("title", "新人红包");
            data.put("content", "自购直接抵现,优惠真实可见!");
            data.put("type", 1);
            data.put("money", money.setScale(2).toString());
            data.put("usage", "领取成功,已存入“我的-推广红包");
            data.put("jumpName", "去使用");
            data.put("jumpDetail", jumpDetailV2Service.getByTypeCache("share_taolijin_goods"));
            data.put("tip", configTaoLiJinService.getValueByKey("hongbao_newbies_tip"));
            data.put("rules", configTaoLiJinService.getValueByKey("taolijin_rules"));
            out.print(JsonUtil.loadTrueResult(data));
            return;
        }
        // 登录用户
        JSONObject data = new JSONObject();
        data.put("rules", configTaoLiJinService.getValueByKey("taolijin_rules"));
        data.put("icon", configTaoLiJinService.getValueByKey("taolijin_system_icon"));
        if (type.equals(TaoLiJinOriginEnum.newbiesWin.name())) {
            BigDecimal hasMoney = null;
            UserTaoLiJinOrigin userTaoLiJin = userTaoLiJinOriginService.getByUidAndOrigin(uid, type);
            if (userTaoLiJin != null) { // 已领取
                hasMoney = userTaoLiJin.getMoney();
            } else {
                try {
                    UserTaoLiJinOrigin origin = userTaoLiJinOriginService.addNewbiesWinMoney(uid);
                    hasMoney = origin.getMoney();
                } catch (UserTaoLiJinOriginException e) {
                    out.print(JsonUtil.loadFalseResult(e.getMsg()));
                    return;
                }
            }
            data.put("title", "新人红包");
            data.put("content", "自购直接抵现,优惠真实可见!");
            data.put("type", 1);
            data.put("money", hasMoney.setScale(2).toString());
            data.put("usage", "领取成功,已存入“我的-推广红包");
            data.put("jumpName", "去使用");
            data.put("jumpDetail", jumpDetailV2Service.getByTypeCache("share_taolijin_goods"));
            data.put("tip", configTaoLiJinService.getValueByKey("hongbao_newbies_tip"));
        } else if(type.equals(TaoLiJinOriginEnum.rankWin.name())) {
            boolean isRank = false;
            BigDecimal hasMoney = null;
            UserTaoLiJinOrigin userTaoLiJin = userTaoLiJinOriginService.getRankByThisMonth(uid, type);
            if (userTaoLiJin != null) { // 已领取
                isRank = true;
                hasMoney = userTaoLiJin.getMoney();
            } else {
                isRank = false;
                UserRank userRank = userInfoExtraService.gerUserRank(uid);
                if (userRank != null) {
                    try {
                        UserTaoLiJinOrigin origin = userTaoLiJinOriginService.addRankWinMoney(uid, userRank);
                        hasMoney = origin.getMoney();
                        isRank = true;
                    } catch (UserTaoLiJinOriginException e) {
                        if (e.getCode() != 2) {
                            isRank = false;
                            out.print(JsonUtil.loadFalseResult(e.getMsg()));
                            return;
                        }
                    }
                }
            }
            // 等级不足
            if (!isRank) {
                data.put("title", "账户等级福利");
                data.put("content", "推广红包,好友福利!");
                data.put("type", 2);
                data.put("money", "本月账户等级未达到\r\n继续加油");
                data.put("jumpName", "去查看");
                data.put("jumpDetail", jumpDetailV2Service.getByTypeCache("user_rank"));
                data.put("tip", configTaoLiJinService.getValueByKey("hongbao_rank_not_enough_tip"));
                out.print(JsonUtil.loadTrueResult(data));
                return;
            } else {
                data.put("title", "账户等级福利");
                data.put("content", "推广红包,好友福利!");
                data.put("type", 1);
                data.put("money", hasMoney.setScale(2).toString());
                data.put("usage", "领取成功,已存入“我的-推广红包");
                data.put("jumpName", "去使用");
                data.put("jumpDetail", jumpDetailV2Service.getByTypeCache("share_taolijin_goods"));
                data.put("tip", configTaoLiJinService.getValueByKey("hongbao_rank_tip"));
            }
        } else {
            out.print(JsonUtil.loadFalseResult(1, "类型不匹配"));
            return;
        }
        out.print(JsonUtil.loadTrueResult(data));
    }
    /**
     * 分享爆款商品-限于淘礼金
     * @param acceptData
     * @param uid
     * @param out
     */
    @RequestMapping(value = "getShareGoods", method = RequestMethod.POST)
    public void getShareGoods(AcceptData acceptData, Long uid, Integer page, PrintWriter out) {
        if (uid == null || uid <= 0) {
            out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
        }
        if (page == null || page < 1) {
            page = 1;
        }
        int pageSize = 10;
        List<QualityFactory> listFreeGoods = qualityGoodsService.listFreeGoods((page - 1) * pageSize, pageSize);
        if (listFreeGoods == null) {
            listFreeGoods = new ArrayList<QualityFactory>();
        }
        long count = listFreeGoods.size();
        JSONArray array = new JSONArray();
        Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
        boolean isNewUser = userInfoExtraService.isNewUser(uid);
        if (isNewUser) {
            // 判定为老用户: 新人只要使用了新人红包,也就是那1块钱,那么,他看到的分享爆款中的商品-就只能分享。
            long countRecord = userTaoLiJinRecordService.countRecordByUid(uid);
            if (countRecord > 0) {
                isNewUser = false;
            }
        }
        BigDecimal proportion = hongBaoManageService.getFanLiRate();
        for (QualityFactory qualityFactory : listFreeGoods) {
            TaoBaoGoodsBrief taoBaoGoodsBrief = qualityFactory.getTaoBaoGoodsBrief();
            if (taoBaoGoodsBrief == null) {
                continue;
            }
            TaoBaoGoodsBriefExtra extra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null);
            BigDecimal spreadMoney = goodsTaoLiJinRateService.getGoodsSpreadMoney(taoBaoGoodsBrief);
            // 推广红包 不能小于1
            if (spreadMoney.compareTo(new BigDecimal(1)) < 0) {
                continue;
            }
            // 去掉标签
            extra.setLabels(null);
            // 显示类型
            if (isNewUser) {
                extra.setMoneyType(1);
                extra.setSpreadMoney("推广红包 ¥"+ 1);
            } else {
                extra.setMoneyType(2);
                extra.setSpreadMoney("推广红包 ¥"+ spreadMoney);
            }
            array.add(gson.toJson(extra));
        }
        executor.execute(new Runnable() {
            @Override
            public void run() {
                // 过期
                userTaoLiJinOriginService.overdueHongBao(uid);
            }
        });
        JSONObject data = new JSONObject();
        data.put("count", count);
        data.put("list", array);
        out.print(JsonUtil.loadTrueResult(data));
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/h5/H5RecommendController.java
@@ -37,6 +37,7 @@
import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinRecordService;
import com.yeshi.fanli.service.inter.user.TBPidService;
import com.yeshi.fanli.service.inter.user.UserShareGoodsGroupService;
import com.yeshi.fanli.util.AESUtil;
@@ -89,6 +90,10 @@
    @Resource
    private UserShareGoodsGroupService userShareGoodsGroupService;
    @Resource
    private UserTaoLiJinRecordService userTaoLiJinRecordService;
    /**
     * 
@@ -360,6 +365,14 @@
            // 老版本兼容
            data.put("quan", true);
        }
        // 查询商品淘礼金
        BigDecimal taoLiJin = userTaoLiJinRecordService.getShareHongBaoByUidAndGoodsId(Long.parseLong(uid), Long.parseLong(id));
        if (taoLiJin != null && taoLiJin.compareTo(new BigDecimal(0)) == 1) {
            data.put("taoLiJin", "可获淘礼金红包 ¥" + taoLiJin);
        }
        out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
        final String tempUid = uid;
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/GoodsClassMapper.java
@@ -47,7 +47,7 @@
    GoodsClass getByAdjoinOrder(@Param("order") Integer order, @Param("type") Integer type);
    
    
    List<GoodsClass> getGoodsClassAll();
    List<GoodsClass> getGoodsClassAll(@Param("sex")Integer sex);
    
    /**
     * 获取最大排序值
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/FloatADMapper.java
@@ -58,7 +58,7 @@
     * @param position
     * @return
     */
    FloatAD getEffectiveFloatAD(@Param("position") String position);
    FloatAD getEffectiveFloatAD(@Param("position") String position, @Param("type") Integer type);
}
    
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/HomeNavbarMapper.java
@@ -18,11 +18,27 @@
    int deleteBatchByPrimaryKey(List<Long> list);
    
    /**
     * 获取最大的排序值
     *   默认最大的排序值
     * @param card
     * @return
     */
    int getMaxOrder();
    int getDefaultMaxOrder();
    /**
     *   默认最大的排序值
     * @param card
     * @return
     */
    int getManMaxOrder();
    /**
     *   默认最大的排序值
     * @param card
     * @return
     */
    int getWomanMaxOrder();
    
    /**
     * 查询交换排序对象
@@ -30,7 +46,26 @@
     * @param order 排序值
     * @return
     */
    HomeNavbar getChangeOrder(@Param("type") Integer type, @Param("order") Integer order);
    HomeNavbar getDefaultChangeOrder(@Param("type") Integer type, @Param("order") Integer order);
    /**
     * 查询交换排序对象
     * @param type
     * @param order 排序值
     * @return
     */
    HomeNavbar getManChangeOrder(@Param("type") Integer type, @Param("order") Integer order);
    /**
     * 查询交换排序对象
     * @param type
     * @param order 排序值
     * @return
     */
    HomeNavbar getWomanChangeOrder(@Param("type") Integer type, @Param("order") Integer order);
    
    /**
     * 后端列表查询
@@ -39,9 +74,9 @@
     * @param key
     * @return
     */
    List<HomeNavbar> listQuery(@Param("start") long start, @Param("count") int count, @Param("key") String key);
    List<HomeNavbar> listQuery(@Param("start") long start, @Param("count") int count, @Param("key") String key, @Param("sex") Integer sex);
    
    long countListQuery(@Param("key") String key);
    long countListQuery(@Param("key") String key, @Param("sex") Integer sex);
    
    /**
     * 查询有效导航栏
@@ -54,7 +89,7 @@
     * 默认导航栏
     * @return
     */
    List<HomeNavbar> listQueryDefaultNavbar();
    List<HomeNavbar> listQueryDefaultNavbar(@Param("sex") Integer sex);
    
    
    /**
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/SpecialMapper.java
@@ -34,20 +34,47 @@
     * @param order
     * @return
     */
    Special getOrderByCardID(@Param("cardId") Long cardId, @Param("type") Integer type,@Param("order") Integer order);
    Special getOrderByCardID(@Param("cardId") Long cardId, @Param("type") Integer type,
            @Param("order") Integer order, @Param("sex")Integer sex);
    
    List<Special> listQueryByCard(@Param("start") long start, @Param("count") int count,
            @Param("cardId") Long card, @Param("key") String key);
    long countlistQueryByCard(@Param("cardId") Long card, @Param("key") String key);
    
    /**
     * 获取最大的排序值
     * 后端查询列表
     * @param start
     * @param count
     * @param card
     * @param key
     * @param sex
     * @return
     */
    List<Special> listQueryByCard(@Param("start") long start, @Param("count") int count,
            @Param("cardId") Long card, @Param("key") String key, @Param("sex")Integer sex);
    long countlistQueryByCard(@Param("cardId") Long card, @Param("key") String key, @Param("sex")Integer sex);
    /**
     *   默认最大的排序值
     * @param card
     * @return
     */
    int getMaxOrderByCard(@Param("cardId") Long cardId);
    int getDefaultMaxOrder(@Param("cardId") Long cardId);
    /**
     *   默认最大的排序值
     * @param card
     * @return
     */
    int getManMaxOrder(@Param("cardId") Long cardId);
    /**
     *   默认最大的排序值
     * @param card
     * @return
     */
    int getWomanMaxOrder(@Param("cardId") Long cardId);
    
    /**
     * 根据标识、系统查询启用专题
@@ -73,6 +100,6 @@
     * @param systemId
     * @return
     */
    List<Special> listByPlaceKey(@Param("placeKey") String placeKey);
    List<Special> listByPlaceKey(@Param("placeKey") String placeKey, @Param("sex")Integer sex);
    
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/tlj/ConfigTaoLiJinMapper.java
New file
@@ -0,0 +1,16 @@
package com.yeshi.fanli.dao.mybatis.tlj;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.bus.tlj.ConfigTaoLiJin;
public interface ConfigTaoLiJinMapper extends BaseMapper<ConfigTaoLiJin> {
    /**
     * 根据key值查询
     * @param key
     * @return
     */
    ConfigTaoLiJin getByKey(@Param("key") String key);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/tlj/UserTaoLiJinDetailMapper.java
New file
@@ -0,0 +1,91 @@
package com.yeshi.fanli.dao.mybatis.tlj;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail;
import com.yeshi.fanli.vo.tlj.TaoLiJinMonthVO;
public interface UserTaoLiJinDetailMapper extends BaseMapper<UserTaoLiJinDetail> {
    /**
     * 统计条数
     * @param uid
     * @param dateType 1今日 、2昨日、3本月、4上月
     * @return
     */
    long countDetail(@Param("uid")long uid);
    /**
     * 根据日期类型统计消耗金额
     * @param uid
     * @param dateType 1今日 、2昨日、3本月、4上月
     * @return
     */
    BigDecimal countUseMoneyByDate(@Param("uid")long uid, @Param("dateType")int dateType);
    /**
     * 按最大的创建时间和用户ID检索列表
     *
     * @param uid
     * @param date
     * @return
     */
    List<UserTaoLiJinDetail> selectByMaxCreateTime(@Param("uid") Long uid, @Param("date") Date date, @Param("count") int count);
    /**
     * 通过用户ID和返回的最大时间的详情ID来获取下一页的数据
     *
     * @param uid
     * @param id
     * @param count
     * @return
     */
    List<UserTaoLiJinDetail> selectByUidWithIndexId(@Param("uid") Long uid, @Param("id") Long id, @Param("count") int count);
    /**
     * 统计某个月份的收入与支出
     *
     * @param uid
     * @param dateFormat
     * @return
     */
    List<TaoLiJinMonthVO> selectMonthMoneyByUid(@Param("uid") Long uid, @Param("dateFormat") List<String> dateFormat);
    /**
     * 获取用户总共有多少记录数据
     *
     * @param uid
     * @return
     */
    Long selectCountByUid(@Param("uid") Long uid);
    /**
     * 按用户ID和最大时间检索月份的数量
     *
     * @param uid
     * @param maxDate
     * @return
     */
    int selectMonthCountByUid(@Param("uid") Long uid, @Param("date") Date maxDate);
    /**
     * 按最大的创建时间和用户ID检索数量
     *
     * @param uid
     * @param date
     * @return
     */
    Long selectCountByUidAndMaxCreateTime(@Param("uid") Long uid, @Param("date") Date date);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/tlj/UserTaoLiJinOriginMapper.java
New file
@@ -0,0 +1,95 @@
package com.yeshi.fanli.dao.mybatis.tlj;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin;
public interface UserTaoLiJinOriginMapper extends BaseMapper<UserTaoLiJinOrigin> {
    /**
     * 根据日期类型统计金额
     * @param uid
     * @param dateType 1今日 、2昨日、3本月、4上月
     * @return
     */
    BigDecimal countMoneyByDate(@Param("uid")long uid, @Param("dateType")int dateType);
    /**
     * 根据用户、来源统计
     * @param uid
     * @param origin
     * @return
     */
    long countByUidAndOrigin(@Param("uid")long uid, @Param("origin")String origin);
    /**
     * 根据用户、来源统计
     * @param uid
     * @param origin
     * @return
     */
    UserTaoLiJinOrigin getByUidAndOrigin(@Param("uid")long uid, @Param("origin")String origin);
    /**
     *  统计本月等级红包
     * @param uid
     * @param origin
     * @return
     */
    long countRankByThisMonth(@Param("uid")long uid);
    /**
     *  统计本月等级红包
     * @param uid
     * @param origin
     * @return
     */
    UserTaoLiJinOrigin  getRankByThisMonth(@Param("uid")long uid, @Param("type")String type);
    /**
     * 查询过期的红包
     * @param date
     * @return
     */
    List<UserTaoLiJinOrigin> getOverdueTaoLiJin(@Param("uid")long uid, @Param("date")Date date);
    /**
     * 查询剩余淘礼金
     * @param uid
     * @return
     */
    List<UserTaoLiJinOrigin> getSurplusLiJin(@Param("uid")long uid);
    /**
     * 统计用户红包记录
     * @param uid
     * @return
     */
    long countByUidAndType(@Param("uid")long uid, @Param("type")String type);
    /**
     * 统计金额
     * @param rightsId
     * @param origin
     * @return
     */
    BigDecimal countMoneyByOrigin(@Param("rightsId")String rightsId, @Param("origin")String origin);
    /**
     * 根据淘礼金id查询
     * @param rightsId
     * @return
     */
    UserTaoLiJinOrigin getOriginByRightsId(@Param("rightsId")String rightsId);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/tlj/UserTaoLiJinRecordMapper.java
New file
@@ -0,0 +1,45 @@
package com.yeshi.fanli.dao.mybatis.tlj;
import java.math.BigDecimal;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinRecord;
import com.yeshi.fanli.vo.user.UserTaoLiJinRecordVO;
public interface UserTaoLiJinRecordMapper extends BaseMapper<UserTaoLiJinRecord> {
    /**
     * 查询分享记录
     * @return
     */
    List<UserTaoLiJinRecordVO> getRecordByUid(@Param("start")long start,@Param("count")int count, @Param("uid")long uid);
    long countRecordByUid(@Param("uid")Long uid);
    /**
     * 今日创建分享红包个数
     * @param uid
     * @return
     */
    long countTodayNum(@Param("uid")Long uid);
    /**
     * 查询用户分享
     * @param uid
     * @param goodsId
     * @return
     */
    BigDecimal getShareHongBaoByUidAndGoodsId(@Param("uid")Long uid, @Param("goodsId")Long goodsId);
    /**
     * 根据淘礼金id查询
     * @param rightsId
     * @return
     */
    UserTaoLiJinRecord getByRightsId(@Param("rightsId")String rightsId);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/tlj/UserTaoLiJinReportMapper.java
New file
@@ -0,0 +1,20 @@
package com.yeshi.fanli.dao.mybatis.tlj;
import java.util.List;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinReport;
public interface UserTaoLiJinReportMapper extends BaseMapper<UserTaoLiJinReport> {
    int deleteByPrimaryKey(String id);
    UserTaoLiJinReport selectByPrimaryKey(String id);
    /**
     * 查询更新的报告
     * @return
     */
    List<UserTaoLiJinReport> needUpdateReport();
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserInfoExtraMapper.java
@@ -36,4 +36,12 @@
     */
    long countByRankId(Long rankId);
    
    /**
     * 获取用户附加信息
     * @param uid
     * @return
     */
    UserInfoExtra gerUserRank(Long uid);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserMoneyExtraMapper.java
New file
@@ -0,0 +1,8 @@
package com.yeshi.fanli.dao.mybatis.user;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.bus.user.UserMoneyExtra;
public interface UserMoneyExtraMapper extends BaseMapper<UserMoneyExtra> {
}
fanli/src/main/java/com/yeshi/fanli/dao/tlj/DeviceTaoLiJinRecordDao.java
New file
@@ -0,0 +1,11 @@
package com.yeshi.fanli.dao.tlj;
import org.springframework.stereotype.Repository;
import com.yeshi.fanli.dao.MongodbBaseDao;
import com.yeshi.fanli.entity.bus.tlj.DeviceTaoLiJinRecord;
@Repository
public class DeviceTaoLiJinRecordDao extends MongodbBaseDao<DeviceTaoLiJinRecord> {
}
fanli/src/main/java/com/yeshi/fanli/dao/tlj/GoodsTaoLiJinRateDao.java
New file
@@ -0,0 +1,13 @@
package com.yeshi.fanli.dao.tlj;
import org.springframework.stereotype.Repository;
import com.yeshi.fanli.dao.MongodbBaseDao;
import com.yeshi.fanli.entity.bus.tlj.GoodsTaoLiJinRate;
@Repository
public class GoodsTaoLiJinRateDao extends MongodbBaseDao<GoodsTaoLiJinRate> {
}
fanli/src/main/java/com/yeshi/fanli/dao/user/DeviceSexDao.java
New file
@@ -0,0 +1,12 @@
package com.yeshi.fanli.dao.user;
import org.springframework.stereotype.Repository;
import com.yeshi.fanli.dao.MongodbBaseDao;
import com.yeshi.fanli.entity.bus.homemodule.DeviceSex;
@Repository
public class DeviceSexDao extends MongodbBaseDao<DeviceSex> {
}
fanli/src/main/java/com/yeshi/fanli/dto/msg/MsgOtherTaoLiJinContentDTO.java
New file
@@ -0,0 +1,40 @@
package com.yeshi.fanli.dto.msg;
import java.math.BigDecimal;
/**
 * 其他消息里面的淘礼金相关的内容
 *
 * @author Administrator
 *
 */
public class MsgOtherTaoLiJinContentDTO {
    private String state;
    private String source;// 来源
    private BigDecimal money;// 面额
    public String getState() {
        return state;
    }
    public void setState(String state) {
        this.state = state;
    }
    public String getSource() {
        return source;
    }
    public void setSource(String source) {
        this.source = source;
    }
    public BigDecimal getMoney() {
        return money;
    }
    public void setMoney(BigDecimal money) {
        this.money = money;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/clazz/GoodsClass.java
@@ -21,6 +21,15 @@
     * 
     */
    private static final long serialVersionUID = 1L;
    public final static int SEX_DEFAULT = 0;  // 通用
    public final static int SEX_WOMAN = 1;  // 女
    public final static int SEX_MAN = 2;  //  男
    public final static int SEX_DEFAULT_WOMAN = 10;  // 女+ 通用
    public final static int SEX_DEFAULT_MAN = 20;  // 男+ 通用
    public final static int SEX_MAN_WOMAN = 12;  // 男+ 女
    public final static int SEX_ALL = 120;  // 男+ 女 + 通用
    @Expose
    @Column(name = "id")
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/DeviceSex.java
New file
@@ -0,0 +1,51 @@
package com.yeshi.fanli.entity.bus.homemodule;
import java.util.Date;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
/**
 *     设备性别
 *
 * @author Administrator
 *
 */
@Document(collection = "device_sex")
public class DeviceSex {
    @Id
    private String id;
    @Field("sex")
    private Integer sex; //男女 1-女  2-男
    @Field("createTime")
    private Date createTime;
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public Integer getSex() {
        return sex;
    }
    public void setSex(Integer sex) {
        this.sex = sex;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/FloatAD.java
@@ -26,7 +26,9 @@
    
    // 展示位置 -首页
    public static String POSITION_INDEX = "index";
    // 展示位置 - 消息中心
    public static String POSITION_MSGCENTER = "msgCenter";
    
    @Column(name = "fa_id")
    private Long id;
@@ -77,6 +79,10 @@
    // 排序-优先权
    @Column(name = "fa_order")
    private Integer order;
    // 适用类型 1新人
    @Column(name = "fa_type")
    private Integer type;
    // 启用状态
    @Column(name = "fa_state")
@@ -224,6 +230,13 @@
    public void setEndTime_str(String endTime_str) {
        this.endTime_str = endTime_str;
    }
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/HomeNavbar.java
@@ -70,6 +70,13 @@
    // 排序
    @Column(name = "br_orderby")
    private Integer orderby;
    // 排序
    @Column(name = "br_order_man")
    private Integer orderMan;
    // 排序
    @Column(name = "br_order_woman")
    private Integer orderWoman;
    //起始时间
    @Column(name = "br_start_time")
@@ -112,6 +119,8 @@
    private String swiperName;
    // 分类名称
    private String className;
    private Integer sex;
    
    
    public HomeNavbar() {}
@@ -280,4 +289,28 @@
    public void setIsFixed(Boolean isFixed) {
        this.isFixed = isFixed;
    }
    public Integer getSex() {
        return sex;
    }
    public void setSex(Integer sex) {
        this.sex = sex;
    }
    public Integer getOrderMan() {
        return orderMan;
    }
    public void setOrderMan(Integer orderMan) {
        this.orderMan = orderMan;
    }
    public Integer getOrderWoman() {
        return orderWoman;
    }
    public void setOrderWoman(Integer orderWoman) {
        this.orderWoman = orderWoman;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/Special.java
@@ -16,11 +16,25 @@
 *
 * @date 2018年10月23日
 */
/**
 * @author Administrator
 *
 */
@Table("yeshi_ec_special")
public class Special implements Serializable {
    private static final long serialVersionUID = 1L;
    public final static int SEX_DEFAULT = 0;  // 通用
    public final static int SEX_WOMAN = 1;  // 女
    public final static int SEX_MAN = 2;  // 男
    public final static int SEX_DEFAULT_WOMAN = 10;  // 女+ 通用
    public final static int SEX_DEFAULT_MAN = 20;  // 男+ 通用
    public final static int SEX_MAN_WOMAN = 12;  // 男+ 女
    public final static int SEX_ALL = 120;  // 男+女+通用
    @Expose
    @Column(name = "b_id")
    private Long id;
@@ -72,9 +86,21 @@
    @Column(name = "b_orderby")
    private Integer orderby;
    
    // 排序
    @Column(name = "b_order_man")
    private Integer orderMan;
    // 排序
    @Column(name = "b_order_woman")
    private Integer orderWoman;
    // 状态
    @Column(name = "b_state")
    private Long state;
    // 性别区分
    @Column(name = "b_sex")
    private Integer sex;
    
    // 显示类型:圆形图 、大图
    @Expose
@@ -100,6 +126,11 @@
    private Boolean delIcon;
    private Boolean delPicture;
    private Boolean delSubPicture;
    // 是否弹框
    @Expose
    private boolean elastic;
    public Long getId() {
        return id;
@@ -261,5 +292,37 @@
    public void setDelSubPicture(Boolean delSubPicture) {
        this.delSubPicture = delSubPicture;
    }
    public boolean isElastic() {
        return elastic;
    }
    public void setElastic(boolean elastic) {
        this.elastic = elastic;
    }
    public Integer getSex() {
        return sex;
    }
    public void setSex(Integer sex) {
        this.sex = sex;
    }
    public Integer getOrderMan() {
        return orderMan;
    }
    public void setOrderMan(Integer orderMan) {
        this.orderMan = orderMan;
    }
    public Integer getOrderWoman() {
        return orderWoman;
    }
    public void setOrderWoman(Integer orderWoman) {
        this.orderWoman = orderWoman;
    }
    
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgOtherDetail.java
@@ -6,6 +6,7 @@
import org.yeshi.utils.mybatis.Table;
import com.yeshi.fanli.dto.msg.MsgOtherCouponContentDTO;
import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
import com.yeshi.fanli.entity.bus.user.UserInfo;
/**
@@ -17,7 +18,9 @@
@Table("yeshi_ec_msg_other")
public class MsgOtherDetail {
    public enum MsgTypeOtherTypeEnum {
        couponMianDan("免单券"), couponWelfareMianDan("福利免单券"), couponReward("奖励券");
        couponMianDan("免单券"), couponWelfareMianDan("福利免单券"), couponReward("奖励券"),
        taoLiJin("推广红包");
        private final String desc;
        private MsgTypeOtherTypeEnum(String desc) {
@@ -51,6 +54,10 @@
    // 券内容
    private MsgOtherCouponContentDTO coupnContent;
    // 淘礼金参数
    private MsgOtherTaoLiJinContentDTO taoLiJinContent;
    public MsgOtherCouponContentDTO getCoupnContent() {
        return coupnContent;
    }
@@ -130,4 +137,12 @@
    public void setSourceId(Long sourceId) {
        this.sourceId = sourceId;
    }
    public MsgOtherTaoLiJinContentDTO getTaoLiJinContent() {
        return taoLiJinContent;
    }
    public void setTaoLiJinContent(MsgOtherTaoLiJinContentDTO taoLiJinContent) {
        this.taoLiJinContent = taoLiJinContent;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/tlj/ConfigTaoLiJin.java
New file
@@ -0,0 +1,83 @@
package com.yeshi.fanli.entity.bus.tlj;
import java.util.Date;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
/**
 *    淘礼金参数
 *
 * @author Administrator
 *
 */
@Table("yeshi_ec_config_taolijin")
public class ConfigTaoLiJin {
    @Column(name = "ct_id")
    private Long id;
    @Column(name = "ct_name")
    private String name; // 名称
    @Column(name = "ct_key")
    private String key; // 唯一值
    @Column(name = "ct_value")
    private String value; // 值
    @Column(name = "ct_beizhu")
    private String beizhu; // 备注
    @Column(name = "ct_create_time")
    private Date createTime;
    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 getKey() {
        return key;
    }
    public void setKey(String key) {
        this.key = key;
    }
    public String getValue() {
        return value;
    }
    public void setValue(String value) {
        this.value = value;
    }
    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/entity/bus/tlj/DeviceTaoLiJinRecord.java
New file
@@ -0,0 +1,53 @@
package com.yeshi.fanli.entity.bus.tlj;
import java.math.BigDecimal;
import java.util.Date;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
/**
 * 设备新人红包领取记录
 *
 * @author Administrator
 *
 */
@Document(collection = "device_taolijin_record")
public class DeviceTaoLiJinRecord {
    @Id
    private String id; // 设备信息
    @Field("money")
    private BigDecimal money; // 金额
    @Field("createTime")
    private Date createTime;
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public BigDecimal getMoney() {
        return money;
    }
    public void setMoney(BigDecimal money) {
        this.money = money;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/tlj/GoodsTaoLiJinRate.java
New file
@@ -0,0 +1,62 @@
package com.yeshi.fanli.entity.bus.tlj;
import java.util.Date;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
/**
 *    淘礼金参数
 *
 * @author Administrator
 *
 */
@Document(collection = "goods_taolijin_rate")
public class GoodsTaoLiJinRate {
    @Id
    private String goodId;
    @Field("rate")
    private Integer rate; // 比例
    @Field("createTime")
    private Date createTime;
    @Field("updateTime")
    private Date updateTime;
    public String getGoodId() {
        return goodId;
    }
    public void setGoodId(String goodId) {
        this.goodId = goodId;
    }
    public Integer getRate() {
        return rate;
    }
    public void setRate(Integer rate) {
        this.rate = rate;
    }
    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/bus/tlj/UserTaoLiJinDetail.java
New file
@@ -0,0 +1,138 @@
package com.yeshi.fanli.entity.bus.tlj;
import java.math.BigDecimal;
import java.util.Date;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.google.gson.annotations.Expose;
/**
 *   用户淘礼金明细
 *
 * @author Administrator
 *
 */
@Table("yeshi_ec_user_taolijin_detail")
public class UserTaoLiJinDetail {
    public enum TaoLiJinDetailTypeEnum {
        add("红包增加", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        reduce("成功使用扣除", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        sendBack("长期未使用收回", "http://img.flqapp.com/img/tlj/icon_tlj.png"),
        refund("未使用成功退回", "http://img.flqapp.com/img/tlj/icon_tlj.png");
        private final String desc;
        private final String picture;
        private TaoLiJinDetailTypeEnum(String desc, String picture) {
            this.desc = desc;
            this.picture = picture;
        }
        public String getDesc() {
            return desc;
        }
        public String getPicture() {
            return picture;
        }
    }
    @Expose
    @Column(name = "utd_id")
    private Long id;
    @Column(name = "utd_uid")
    private Long uid; // 用户id
    @Expose
    @Column(name = "utd_money")
    private BigDecimal money; // 获得金额
    @Expose
    @Column(name = "utd_title")
    private String title; // 操作内容
    @Expose
    @Column(name = "utd_type")
    private TaoLiJinDetailTypeEnum type; //
    @Expose
    @Column(name = "utd_desc_info")
    private String descInfo; // 详细信息
    @Expose
    @Column(name = "utd_remark")
    private String remark; // 备注
    @Expose
    @Column(name = "utd_create_time")
    private Date createTime;
    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 getMoney() {
        return money;
    }
    public void setMoney(BigDecimal money) {
        this.money = money;
    }
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    public TaoLiJinDetailTypeEnum getType() {
        return type;
    }
    public void setType(TaoLiJinDetailTypeEnum type) {
        this.type = type;
    }
    public String getDescInfo() {
        return descInfo;
    }
    public void setDescInfo(String descInfo) {
        this.descInfo = descInfo;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/tlj/UserTaoLiJinOrigin.java
New file
@@ -0,0 +1,142 @@
package com.yeshi.fanli.entity.bus.tlj;
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_taolijin_origin")
public class UserTaoLiJinOrigin {
    public enum TaoLiJinOriginEnum {
        newbiesWin("新人红包"), shareWin("推广红包福利"), rankWin("账户等级福利"), inviteWin("邀请队员奖励"), refund("失效回退");
        private final String desc;
        private TaoLiJinOriginEnum(String desc) {
            this.desc = desc;
        }
        public String getDesc() {
            return desc;
        }
    }
    @Column(name = "uto_id")
    private Long id;
    @Column(name = "uto_uid")
    private Long uid; // 用户id
    @Column(name = "uto_rights_id")
    private String rightsId; // 淘礼金id
    @Column(name = "uto_money")
    private BigDecimal money; // 获得金额
    @Column(name = "uto_money_surplus")
    private BigDecimal moneySurplus; // 剩余-未核销
    @Column(name = "uto_type")
    private Integer type; //  类型:1仅分享、2均可以
    @Column(name = "uto_origin")
    private TaoLiJinOriginEnum origin; // 来源
    @Column(name = "uto_remark")
    private String remark; // 备注
    @Column(name = "uto_create_time")
    private Date createTime;
    @Column(name = "uto_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 getMoney() {
        return money;
    }
    public void setMoney(BigDecimal money) {
        this.money = money;
    }
    public BigDecimal getMoneySurplus() {
        return moneySurplus;
    }
    public void setMoneySurplus(BigDecimal moneySurplus) {
        this.moneySurplus = moneySurplus;
    }
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    public TaoLiJinOriginEnum getOrigin() {
        return origin;
    }
    public void setOrigin(TaoLiJinOriginEnum origin) {
        this.origin = origin;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    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 String getRightsId() {
        return rightsId;
    }
    public void setRightsId(String rightsId) {
        this.rightsId = rightsId;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/tlj/UserTaoLiJinRecord.java
New file
@@ -0,0 +1,173 @@
package com.yeshi.fanli.entity.bus.tlj;
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_taolijin_record")
public class UserTaoLiJinRecord {
    @Column(name = "utlj_id")
    private Long id;
    @Column(name = "utlj_uid")
    private Long uid; // 用户id
    @Column(name = "utlj_goods_id")
    private Long goodsId; // 商品id
    @Column(name = "utlj_total_num")
    private Integer totalNum; // 淘礼金总个数
    @Column(name = "utlj_name")
    private String name; // 淘礼金名称
    @Column(name = "utlj_per_face")
    private BigDecimal perFace; // 单个淘礼金面额,单位元
    @Column(name = "utlj_send_start_time")
    private Date sendStartTime; // 发放开始时间
    @Column(name = "utlj_send_end_time")
    private Date sendEndTime; // 发放截止时间
    @Column(name = "utlj_use_start_time")
    private Date useStartTime; // 使用开始日期
    @Column(name = "utlj_use_end_time")
    private Date useEndTime; // 使用结束日期
    @Column(name = "utlj_rights_id")
    private String rightsId; // 淘礼金Id
    @Column(name = "utlj_send_url")
    private String sendUrl; // 淘礼金领取url
    @Column(name = "utlj_create_time")
    private Date createTime;
    // 剩余余额
    private BigDecimal surplusMoney;
    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 Long getGoodsId() {
        return goodsId;
    }
    public void setGoodsId(Long goodsId) {
        this.goodsId = goodsId;
    }
    public Integer getTotalNum() {
        return totalNum;
    }
    public void setTotalNum(Integer totalNum) {
        this.totalNum = totalNum;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public BigDecimal getPerFace() {
        return perFace;
    }
    public void setPerFace(BigDecimal perFace) {
        this.perFace = perFace;
    }
    public Date getSendStartTime() {
        return sendStartTime;
    }
    public void setSendStartTime(Date sendStartTime) {
        this.sendStartTime = sendStartTime;
    }
    public Date getSendEndTime() {
        return sendEndTime;
    }
    public void setSendEndTime(Date sendEndTime) {
        this.sendEndTime = sendEndTime;
    }
    public Date getUseStartTime() {
        return useStartTime;
    }
    public void setUseStartTime(Date useStartTime) {
        this.useStartTime = useStartTime;
    }
    public Date getUseEndTime() {
        return useEndTime;
    }
    public void setUseEndTime(Date useEndTime) {
        this.useEndTime = useEndTime;
    }
    public String getRightsId() {
        return rightsId;
    }
    public void setRightsId(String rightsId) {
        this.rightsId = rightsId;
    }
    public String getSendUrl() {
        return sendUrl;
    }
    public void setSendUrl(String sendUrl) {
        this.sendUrl = sendUrl;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public BigDecimal getSurplusMoney() {
        return surplusMoney;
    }
    public void setSurplusMoney(BigDecimal surplusMoney) {
        this.surplusMoney = surplusMoney;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/tlj/UserTaoLiJinReport.java
New file
@@ -0,0 +1,163 @@
package com.yeshi.fanli.entity.bus.tlj;
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_taolijin_report")
public class UserTaoLiJinReport {
    @Column(name = "utr_id")
    private String id; // 淘礼金Id
    @Column(name = "utr_unfreeze_amount")
    private BigDecimal unfreezeAmount; // 解冻金额
    @Column(name = "utr_unfreeze_num")
    private Integer unfreezeNum; // 解冻红包个数
    @Column(name = "utr_refund_amount")
    private BigDecimal refundAmount; // 失效回退金额
    @Column(name = "utr_refund_num")
    private Integer refundNum; // 失效回退红包个数
    @Column(name = "utr_alipay_amount")
    private BigDecimal alipayAmount; // 引导成交金额
    @Column(name = "utr_use_amount")
    private BigDecimal useAmount; // 红包核销金额
    @Column(name = "utr_use_num")
    private Integer useNum; // 红包核销个数
    @Column(name = "utr_win_amount")
    private BigDecimal winAmount; // 红包领取金额
    @Column(name = "utr_win_num")
    private Integer winNum; // 红包领取个数
    @Column(name = "utr_pre_commission_amount")
    private BigDecimal preCommissionAmount; // 引导预估佣金金额
    @Column(name = "utr_create_time")
    private Date createTime;
    @Column(name = "utr_update_time")
    private Date updateTime;
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public BigDecimal getUnfreezeAmount() {
        return unfreezeAmount;
    }
    public void setUnfreezeAmount(BigDecimal unfreezeAmount) {
        this.unfreezeAmount = unfreezeAmount;
    }
    public Integer getUnfreezeNum() {
        return unfreezeNum;
    }
    public void setUnfreezeNum(Integer unfreezeNum) {
        this.unfreezeNum = unfreezeNum;
    }
    public BigDecimal getRefundAmount() {
        return refundAmount;
    }
    public void setRefundAmount(BigDecimal refundAmount) {
        this.refundAmount = refundAmount;
    }
    public Integer getRefundNum() {
        return refundNum;
    }
    public void setRefundNum(Integer refundNum) {
        this.refundNum = refundNum;
    }
    public BigDecimal getAlipayAmount() {
        return alipayAmount;
    }
    public void setAlipayAmount(BigDecimal alipayAmount) {
        this.alipayAmount = alipayAmount;
    }
    public BigDecimal getUseAmount() {
        return useAmount;
    }
    public void setUseAmount(BigDecimal useAmount) {
        this.useAmount = useAmount;
    }
    public Integer getUseNum() {
        return useNum;
    }
    public void setUseNum(Integer useNum) {
        this.useNum = useNum;
    }
    public BigDecimal getWinAmount() {
        return winAmount;
    }
    public void setWinAmount(BigDecimal winAmount) {
        this.winAmount = winAmount;
    }
    public Integer getWinNum() {
        return winNum;
    }
    public void setWinNum(Integer winNum) {
        this.winNum = winNum;
    }
    public BigDecimal getPreCommissionAmount() {
        return preCommissionAmount;
    }
    public void setPreCommissionAmount(BigDecimal preCommissionAmount) {
        this.preCommissionAmount = preCommissionAmount;
    }
    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/bus/user/UserCustomSettings.java
@@ -16,7 +16,7 @@
    // 消息类型的枚举
    public enum UserSettingTypeEnum {
        cancelNotice("通知免打扰(20:00-8:00)"), noNewsRedDot("不看消息红点提醒"), noBonusCount("不看奖金统计"),
        noShareRecordAndStorage("不看分享记录和选品库"),noInvitationBonus("不看邀请拿奖金");
        noShareRecordAndStorage("不看分享记录和选品库"),noInvitationBonus("不看邀请拿奖金"), openSpreadHongBao("开启推广红包");
        
        private final String desc;
@@ -43,7 +43,7 @@
    // 状态: 默认0  1选中
    @Column(name = "ucs_state")
    private Integer state;
    // 创建时间
    @Column(name = "ucs_create_time")
    private Date createTime;
@@ -99,5 +99,4 @@
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserMoneyExtra.java
New file
@@ -0,0 +1,76 @@
package com.yeshi.fanli.entity.bus.user;
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_money_extra")
public class UserMoneyExtra {
    @Column(name = "um_uid")
    private Long uid; // 用户id
    @Column(name = "um_tlj")
    private BigDecimal tlj; // 淘礼金余额
    @Column(name = "um_tlj_self")
    private BigDecimal tljSelf; // 可自购淘礼金
    @Column(name = "um_create_time")
    private Date createTime;
    @Column(name = "um_update_time")
    private Date updateTime;
    public Long getUid() {
        return uid;
    }
    public void setUid(Long uid) {
        this.uid = uid;
    }
    public BigDecimal getTlj() {
        return tlj;
    }
    public void setTlj(BigDecimal tlj) {
        this.tlj = tlj;
    }
    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 BigDecimal getTljSelf() {
        return tljSelf;
    }
    public void setTljSelf(BigDecimal tljSelf) {
        this.tljSelf = tljSelf;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/goods/ShareGoodsTextTemplate.java
@@ -21,6 +21,8 @@
    private String shareTextTemplate;// 普通商品分享模板
    @Column(name = "st_share_coupon_text_template")
    private String shareCouponTextTemplate;// 券分享模板
    @Column(name = "st_share_taolijin_text_template")
    private String shareTaoLiJinTextTemplate;// 淘礼金分享模板
    @Column(name = "st_create_time")
    private Date createTime;
    @Column(name = "st_update_time")
@@ -73,4 +75,12 @@
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    public String getShareTaoLiJinTextTemplate() {
        return shareTaoLiJinTextTemplate;
    }
    public void setShareTaoLiJinTextTemplate(String shareTaoLiJinTextTemplate) {
        this.shareTaoLiJinTextTemplate = shareTaoLiJinTextTemplate;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/taobao/TaoBaoGoodsBriefExtra.java
@@ -31,7 +31,7 @@
    private int collected; // 0-没有收藏 1-已收藏
    
    @Expose
    private int moneyType;////资金类型1-返  2-奖
    private int moneyType;// 资金类型 1-返  2-奖
    
    @Expose
    private List<ClientTextStyleVO> labels;////标签
@@ -44,6 +44,9 @@
    
    @Expose
    private boolean recommend; // 是否推荐
    @Expose
    private String spreadMoney;// 推广红包
    
    public int getMoneyType() {
@@ -150,4 +153,12 @@
        this.recommend = recommend;
    }
    public String getSpreadMoney() {
        return spreadMoney;
    }
    public void setSpreadMoney(String spreadMoney) {
        this.spreadMoney = spreadMoney;
    }
}
fanli/src/main/java/com/yeshi/fanli/exception/tlj/UserTaoLiJinOriginException.java
New file
@@ -0,0 +1,32 @@
package com.yeshi.fanli.exception.tlj;
public class UserTaoLiJinOriginException extends Exception {
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    private int code;
    private String msg;
    public int getCode() {
        return code;
    }
    public String getMsg() {
        return msg;
    }
    public UserTaoLiJinOriginException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public UserTaoLiJinOriginException() {
    }
    @Override
    public String getMessage() {
        return this.msg;
    }
}
fanli/src/main/java/com/yeshi/fanli/exception/tlj/UserTaoLiJinRecordException.java
New file
@@ -0,0 +1,32 @@
package com.yeshi.fanli.exception.tlj;
public class UserTaoLiJinRecordException extends Exception {
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    private int code;
    private String msg;
    public int getCode() {
        return code;
    }
    public String getMsg() {
        return msg;
    }
    public UserTaoLiJinRecordException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public UserTaoLiJinRecordException() {
    }
    @Override
    public String getMessage() {
        return this.msg;
    }
}
fanli/src/main/java/com/yeshi/fanli/job/TaoLiJinJob.java
New file
@@ -0,0 +1,44 @@
package com.yeshi.fanli.job;
import javax.annotation.Resource;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinReportService;
import com.yeshi.fanli.util.Constant;
@Component
public class TaoLiJinJob {
    @Resource
    private UserTaoLiJinReportService userTaoLiJinReportService;
    /**
     *  更新报告
     */
    @Scheduled(cron = "0 0 0 * * ?")
    public void insetDynamicInfo() {
        if (!Constant.IS_TASK) {
            return;
        }
        try {
            userTaoLiJinReportService.needUpdateReport();
        } catch (Exception e) {
            try {
                LogHelper.errorDetailInfo(e);
            } catch (Exception e1) {
                e1.printStackTrace();
            }
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/mapping/GoodsClassMapper.xml
@@ -117,8 +117,22 @@
        </if>
        LIMIT 1
    </select>
    <select id="getGoodsClassAll" resultMap="BaseResultMap">SELECT * FROM
        yeshi_ec_class rs ORDER BY rs.`orderby`
    <select id="getGoodsClassAll" resultMap="BaseResultMap">
        SELECT * FROM yeshi_ec_class c
        where 1=1
         <!-- 通用版 -->
        <if test="sex == 0">
            AND (c.`sex`= 120 OR c.`sex` = 0 OR c.`sex` = 10 OR c.`sex` = 20)
        </if>
        <!-- 女版 -->
        <if test="sex == 1">
            AND (c.`sex`= 120 OR c.`sex` = 1 OR c.`sex` = 10 OR c.`sex` = 12)
        </if>
        <!-- 男版 -->
        <if test="sex == 2">
            AND (c.`sex`= 120 OR c.`sex` = 2 OR c.`sex` = 20 OR c.`sex` = 12)
        </if>
        ORDER BY c.orderby
    </select>
    <select id="listByName" resultMap="BaseResultMap">SELECT * from yeshi_ec_class
        rs WHERE rs.name like '%#{name}%' LIMIT ${start},${count}</select>
fanli/src/main/java/com/yeshi/fanli/mapping/goods/ShareGoodsTextTemplateMapper.xml
@@ -10,10 +10,13 @@
            jdbcType="VARCHAR" />
        <result column="st_share_coupon_text_template" property="shareCouponTextTemplate"
            jdbcType="VARCHAR" />
        <result column="st_share_taolijin_text_template" property="shareTaoLiJinTextTemplate" jdbcType="VARCHAR" />
        <result column="st_create_time" property="createTime" jdbcType="TIMESTAMP" />
        <result column="st_update_time" property="updateTime" jdbcType="TIMESTAMP" />
    </resultMap>
    <sql id="Base_Column_List">st_id,st_uid,st_share_text_template,st_share_coupon_text_template,st_create_time,st_update_time
    <sql id="Base_Column_List">st_id,st_uid,st_share_text_template,st_share_coupon_text_template,st_share_taolijin_text_template,st_create_time,st_update_time
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
@@ -35,9 +38,9 @@
    <insert id="insert" parameterType="com.yeshi.fanli.entity.goods.ShareGoodsTextTemplate"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_share_template
        (st_id,st_uid,st_share_text_template,st_share_coupon_text_template,st_create_time,st_update_time)
        (st_id,st_uid,st_share_text_template,st_share_coupon_text_template,st_share_taolijin_text_template,st_create_time,st_update_time)
        values
        (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{shareTextTemplate,jdbcType=VARCHAR},#{shareCouponTextTemplate,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
        (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{shareTextTemplate,jdbcType=VARCHAR},#{shareCouponTextTemplate,jdbcType=VARCHAR},#{shareTaoLiJinTextTemplate,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.goods.ShareGoodsTextTemplate"
        useGeneratedKeys="true" keyProperty="id">
@@ -47,6 +50,7 @@
            <if test="uid != null">st_uid,</if>
            <if test="shareTextTemplate != null">st_share_text_template,</if>
            <if test="shareCouponTextTemplate != null">st_share_coupon_text_template,</if>
            <if test="shareTaoLiJinTextTemplate != null">st_share_taolijin_text_template,</if>
            <if test="createTime != null">st_create_time,</if>
            <if test="updateTime != null">st_update_time,</if>
        </trim>
@@ -56,6 +60,7 @@
            <if test="uid != null">#{uid,jdbcType=BIGINT},</if>
            <if test="shareTextTemplate != null">#{shareTextTemplate,jdbcType=VARCHAR},</if>
            <if test="shareCouponTextTemplate != null">#{shareCouponTextTemplate,jdbcType=VARCHAR},</if>
            <if test="shareTaoLiJinTextTemplate != null">#{shareTaoLiJinTextTemplate,jdbcType=VARCHAR},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
        </trim>
@@ -64,7 +69,8 @@
        yeshi_ec_share_template set st_uid =
        #{uid,jdbcType=BIGINT},st_share_text_template =
        #{shareTextTemplate,jdbcType=VARCHAR},st_share_coupon_text_template =
        #{shareCouponTextTemplate,jdbcType=VARCHAR},st_create_time =
        #{shareCouponTextTemplate,jdbcType=VARCHAR},st_share_taolijin_text_template =
        #{shareTaoLiJinTextTemplate,jdbcType=VARCHAR},st_create_time =
        #{createTime,jdbcType=TIMESTAMP},st_update_time =
        #{updateTime,jdbcType=TIMESTAMP} where st_id = #{id,jdbcType=BIGINT}
    </update>
@@ -76,6 +82,8 @@
            </if>
            <if test="shareCouponTextTemplate != null">st_share_coupon_text_template=#{shareCouponTextTemplate,jdbcType=VARCHAR},
            </if>
            <if test="shareTaoLiJinTextTemplate != null">st_share_taolijin_text_template=#{shareTaoLiJinTextTemplate,jdbcType=VARCHAR},
            </if>
            <if test="createTime != null">st_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">st_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
        </set>
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/FloatADMapper.xml
@@ -14,6 +14,7 @@
    <result column="fa_end_time" property="endTime" jdbcType="TIMESTAMP"/>
    <result column="fa_position" property="position" jdbcType="VARCHAR"/>
    <result column="fa_order" property="order" jdbcType="INTEGER"/>
    <result column="fa_type" property="type" jdbcType="INTEGER"/>
    <result column="fa_state" property="state" jdbcType="INTEGER"/>
    <result column="fa_create_time" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="fa_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
@@ -23,12 +24,12 @@
    </association>
    
  </resultMap>
  <sql id="Base_Column_List">fa_id,fa_name,fa_picture,fa_show_mode,fa_jumpid,fa_params,fa_jump_need_login,fa_start_time,fa_end_time,fa_position,fa_order,fa_state,fa_create_time,fa_update_time</sql>
  <sql id="Base_Column_List">fa_id,fa_name,fa_picture,fa_show_mode,fa_jumpid,fa_params,fa_jump_need_login,fa_start_time,fa_end_time,fa_position,fa_order,fa_type,fa_state,fa_create_time,fa_update_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_float_ad where fa_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_float_ad where fa_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_float_ad (fa_id,fa_name,fa_picture,fa_show_mode,fa_jumpid,fa_params,fa_jump_need_login,fa_start_time,fa_end_time,fa_position,fa_order,fa_state,fa_create_time,fa_update_time) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{showMode,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{jumpNeedLogin,jdbcType=VARCHAR},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{position,jdbcType=VARCHAR},#{order,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_float_ad (fa_id,fa_name,fa_picture,fa_show_mode,fa_jumpid,fa_params,fa_jump_need_login,fa_start_time,fa_end_time,fa_position,fa_order,fa_type,fa_state,fa_create_time,fa_update_time) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{showMode,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{jumpNeedLogin,jdbcType=VARCHAR},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{position,jdbcType=VARCHAR},#{order,jdbcType=INTEGER},#{type,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_float_ad
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">fa_id,</if>
@@ -42,6 +43,7 @@
      <if test="endTime != null">fa_end_time,</if>
      <if test="position != null">fa_position,</if>
      <if test="order != null">fa_order,</if>
      <if test="type != null">fa_type,</if>
      <if test="state != null">fa_state,</if>
      <if test="createTime != null">fa_create_time,</if>
      <if test="updateTime != null">fa_update_time,</if>
@@ -58,12 +60,13 @@
      <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if>
      <if test="position != null">#{position,jdbcType=VARCHAR},</if>
      <if test="order != null">#{order,jdbcType=INTEGER},</if>
      <if test="type != null">#{type,jdbcType=INTEGER},</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>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD">update yeshi_ec_float_ad set fa_name = #{name,jdbcType=VARCHAR},fa_picture = #{picture,jdbcType=VARCHAR},fa_show_mode = #{showMode,jdbcType=VARCHAR},fa_jumpid = #{jumpDetail.id,jdbcType=BIGINT},fa_params = #{params,jdbcType=VARCHAR},fa_jump_need_login = #{jumpNeedLogin,jdbcType=VARCHAR},fa_start_time = #{startTime,jdbcType=TIMESTAMP},fa_end_time = #{endTime,jdbcType=TIMESTAMP},fa_position = #{position,jdbcType=VARCHAR},fa_order = #{order,jdbcType=INTEGER},fa_state = #{state,jdbcType=INTEGER},fa_create_time = #{createTime,jdbcType=TIMESTAMP},fa_update_time = #{updateTime,jdbcType=TIMESTAMP} where fa_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD">update yeshi_ec_float_ad set fa_name = #{name,jdbcType=VARCHAR},fa_picture = #{picture,jdbcType=VARCHAR},fa_show_mode = #{showMode,jdbcType=VARCHAR},fa_jumpid = #{jumpDetail.id,jdbcType=BIGINT},fa_params = #{params,jdbcType=VARCHAR},fa_jump_need_login = #{jumpNeedLogin,jdbcType=VARCHAR},fa_start_time = #{startTime,jdbcType=TIMESTAMP},fa_end_time = #{endTime,jdbcType=TIMESTAMP},fa_position = #{position,jdbcType=VARCHAR},fa_order = #{order,jdbcType=INTEGER},fa_type = #{type,jdbcType=INTEGER},fa_state = #{state,jdbcType=INTEGER},fa_create_time = #{createTime,jdbcType=TIMESTAMP},fa_update_time = #{updateTime,jdbcType=TIMESTAMP} where fa_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD">update yeshi_ec_float_ad
    <set>
      <if test="name != null">fa_name=#{name,jdbcType=VARCHAR},</if>
@@ -76,6 +79,7 @@
      <if test="endTime != null">fa_end_time=#{endTime,jdbcType=TIMESTAMP},</if>
      <if test="position != null">fa_position=#{position,jdbcType=VARCHAR},</if>
      <if test="order != null">fa_order=#{order,jdbcType=INTEGER},</if>
      <if test="type != null">fa_type=#{type,jdbcType=INTEGER},</if>
      <if test="state != null">fa_state=#{state,jdbcType=INTEGER},</if>
      <if test="createTime != null">fa_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updateTime != null">fa_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
@@ -144,9 +148,12 @@
   
       <select id="getEffectiveFloatAD" resultMap="BaseResultMap">
           SELECT * FROM yeshi_ec_float_ad fd 
        WHERE fd.`fa_position` = 'index' AND fd.`fa_state` = 1
        WHERE fd.`fa_position` = #{position} AND fd.`fa_state` = 1
               AND IF(fd.`fa_start_time` IS NULL,TRUE,fd.`fa_start_time` <![CDATA[<=]]> NOW()) 
               AND IF(fd.`fa_end_time` IS NULL,TRUE,fd.`fa_end_time` <![CDATA[>=]]> NOW())
               <if test="type != null">
                   AND fa_type = #{type}
               </if>
        ORDER BY fd.`fa_order` 
        LIMIT 1
       </select>
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/HomeNavbarMapper.xml
@@ -11,6 +11,8 @@
    <result column="br_url" property="url" jdbcType="VARCHAR"/>
    <result column="br_type" property="type" jdbcType="VARCHAR"/>
    <result column="br_orderby" property="orderby" jdbcType="INTEGER"/>
    <result column="br_order_man" property="orderMan" jdbcType="INTEGER"/>
    <result column="br_order_woman" property="orderWoman" jdbcType="INTEGER"/>
    <result column="br_start_time" property="startTime" jdbcType="TIMESTAMP"/>
    <result column="br_end_time" property="endTime" jdbcType="TIMESTAMP"/>
    <result column="br_state" property="state" jdbcType="INTEGER"/>
@@ -19,66 +21,161 @@
    <result column="br_createtime" property="createtime" jdbcType="TIMESTAMP"/>
    <result column="br_updatetime" property="updatetime" jdbcType="TIMESTAMP"/>
    <result column="br_type" property="type" typeHandler="com.yeshi.fanli.util.mybatishandler.NavbarTypeEnumHandler"/>
    <result column="sex" property="sex" jdbcType="INTEGER"/>
  </resultMap>
  
  <sql id="Base_Column_List">br_id,br_name,br_picture,br_class_id,br_swiper_banner_id,br_url,br_type,br_orderby,br_start_time,br_end_time,br_state,br_is_default,br_is_fixed,br_createtime,br_updatetime</sql>
  <sql id="Base_Column_List">br_id,br_name,br_picture,br_class_id,br_swiper_banner_id,br_url,br_type,br_orderby,br_order_man,br_order_woman,br_start_time,br_end_time,br_state,br_is_default,br_is_fixed,br_createtime,br_updatetime</sql>
  
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_home_navbar where br_id = #{id,jdbcType=BIGINT}
  </select>
  
  <select id="getMaxOrder" resultType="java.lang.Integer">
        SELECT IFNULL(MAX(br_orderby),0) FROM yeshi_ec_home_navbar
  <select id="getDefaultMaxOrder" resultType="java.lang.Integer">
       SELECT IFNULL(MAX(br_orderby),0) FROM yeshi_ec_home_navbar
       order by br_orderby desc
  </select>
  
  <select id="getChangeOrder" resultMap="BaseResultMap">
        SELECT  <include refid="Base_Column_List" /> FROM yeshi_ec_home_navbar
        WHERE 1=1
        <if test="type == -1">
            <![CDATA[and br_orderby < #{order}]]>
            order by br_orderby desc
  <select id="getManMaxOrder" resultType="java.lang.Integer">
       SELECT IFNULL(MAX(br_order_man),0) FROM yeshi_ec_home_navbar
       order by br_order_man desc
  </select>
  <select id="getWomanMaxOrder" resultType="java.lang.Integer">
       SELECT IFNULL(MAX(br_order_woman),0) FROM yeshi_ec_home_navbar
       order by br_order_woman desc
  </select>
   <select id="getDefaultChangeOrder" resultType="java.lang.Integer">
       SELECT h.* FROM yeshi_ec_home_navbar h
       LEFT JOIN `yeshi_ec_class` c ON c.`id` = h.`br_class_id`
    WHERE 1=1 and h.br_orderby is not null
        <if test="type == -1">
               <![CDATA[and h.br_orderby < #{order}]]>
               order by h.br_orderby  desc
        </if>
        <if test="type == 1">
            <![CDATA[and br_orderby > #{order} ]]>
            order by br_orderby
            <![CDATA[and h.br_orderby > #{order}]]>
            order by h.br_orderby
        </if>
         LIMIT 1
   </select>
     LIMIT 1
  </select>
  <select id="getManChangeOrder" resultType="java.lang.Integer">
       SELECT h.* FROM yeshi_ec_home_navbar h
       LEFT JOIN `yeshi_ec_class` c ON c.`id` = h.`br_class_id`
    WHERE 1=1 and h.br_order_man is  not null
        <if test="type == -1">
               <![CDATA[and h.br_order_man < #{order}]]>
               order by h.br_order_man  desc
        </if>
        <if test="type == 1">
            <![CDATA[and h.br_order_man > #{order}]]>
            order by h.br_order_man
        </if>
     LIMIT 1
  </select>
  <select id="getWomanChangeOrder" resultType="java.lang.Integer">
       SELECT h.* FROM yeshi_ec_home_navbar h
       LEFT JOIN `yeshi_ec_class` c ON c.`id` = h.`br_class_id`
    WHERE 1=1 and h.br_order_woman is not null
        <if test="type == -1">
               <![CDATA[and h.br_order_woman < #{order}]]>
               order by h.br_order_woman  desc
        </if>
        <if test="type == 1">
            <![CDATA[and h.br_order_woman > #{order}]]>
            order by h.br_order_woman
        </if>
     LIMIT 1
  </select>
   
   <select id="listQuery" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />  FROM yeshi_ec_home_navbar
        SELECT h.*,c.sex AS sex  FROM yeshi_ec_home_navbar h
        LEFT JOIN `yeshi_ec_class` c ON c.`id` = h.`br_class_id`
        WHERE 1=1
           <if test='key != null and key != ""'>
                  AND (br_name like '%${key}%')
                  AND (h.br_name like '%${key}%')
           </if>
           ORDER BY br_orderby
           <!-- 通用版 -->
            <if test="sex == 0">
                AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 0 OR c.`sex` = 10 OR c.`sex` = 20))
                ORDER BY h.br_orderby
            </if>
            <!-- 女版 -->
            <if test="sex == 1">
                AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 1 OR c.`sex` = 10 OR c.`sex` = 12))
                ORDER BY h.br_order_woman
            </if>
            <!-- 男版 -->
            <if test="sex == 2">
                AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 2 OR c.`sex` = 20 OR c.`sex` = 12))
                ORDER BY h.br_order_man
            </if>
        LIMIT ${start},${count}
   </select>
   
   <select id="countListQuery" resultType="java.lang.Long">
        SELECT IFNULL(count(br_id),0)  FROM yeshi_ec_home_navbar
        SELECT IFNULL(count(br_id),0)  FROM yeshi_ec_home_navbar h
        LEFT JOIN `yeshi_ec_class` c ON c.`id` = h.`br_class_id`
        WHERE 1=1
           <if test='key != null and key != ""'>
                  AND (br_name like '%${key}%')
                  AND (h.br_name like '%${key}%')
           </if>
           <!-- 通用版 -->
            <if test="sex == 0">
                AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 0 OR c.`sex` = 10 OR c.`sex` = 20))
                ORDER BY h.br_orderby
            </if>
            <!-- 女版 -->
            <if test="sex == 1">
                AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 1 OR c.`sex` = 10 OR c.`sex` = 12))
                ORDER BY h.br_order_woman
            </if>
            <!-- 男版 -->
            <if test="sex == 2">
                AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 2 OR c.`sex` = 20 OR c.`sex` = 12))
                ORDER BY h.br_order_man
            </if>
   </select>
      
   <select id="listQueryEffective" resultMap="BaseResultMap">
      SELECT * FROM    yeshi_ec_home_navbar
      WHERE br_state = 1
              AND IF(br_start_time IS NULL,TRUE, br_start_time<![CDATA[<=]]> NOW())
              AND IF(br_end_time IS NULL,TRUE, br_end_time <![CDATA[>=]]> NOW())
      ORDER BY br_orderby
      SELECT h.*,c.sex AS sex FROM yeshi_ec_home_navbar h
      LEFT JOIN `yeshi_ec_class` c ON c.`id` = h.`br_class_id`
      WHERE h.br_state = 1
              AND IF(h.br_start_time IS NULL,TRUE, h.br_start_time<![CDATA[<=]]> NOW())
              AND IF(h.br_end_time IS NULL,TRUE, h.br_end_time <![CDATA[>=]]> NOW())
            ORDER BY h.br_orderby
   </select>
   
   
   <select id="listQueryDefaultNavbar" resultMap="BaseResultMap">
      SELECT * FROM    yeshi_ec_home_navbar
      WHERE br_state = 1 AND br_is_default = 1
              AND IF(br_start_time IS NULL,TRUE, br_start_time<![CDATA[<=]]> NOW())
              AND IF(br_end_time IS NULL,TRUE, br_end_time <![CDATA[>=]]> NOW())
      ORDER BY br_orderby
      SELECT h.*,c.sex AS sex FROM    yeshi_ec_home_navbar h
      LEFT JOIN `yeshi_ec_class` c ON c.`id` = h.`br_class_id`
      WHERE h.br_state = 1 AND br_is_default = 1
              AND IF(h.br_start_time IS NULL,TRUE, h.br_start_time<![CDATA[<=]]> NOW())
              AND IF(h.br_end_time IS NULL,TRUE, h.br_end_time <![CDATA[>=]]> NOW())
               <!-- 通用版 -->
            <if test="sex == 0">
                AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 0 OR c.`sex` = 10 OR c.`sex` = 20))
                ORDER BY h.br_orderby
            </if>
            <!-- 女版 -->
            <if test="sex == 1">
                AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 1 OR c.`sex` = 10 OR c.`sex` = 12))
                ORDER BY h.br_order_woman
            </if>
            <!-- 男版 -->
            <if test="sex == 2">
                AND (c.`id` is null OR (c.`sex`= 120 OR c.`sex` = 2 OR c.`sex` = 20 OR c.`sex` = 12))
                ORDER BY h.br_order_man
            </if>
   </select>
   
   <select id="listQueryFixedNavbar" resultMap="BaseResultMap">
@@ -105,7 +202,7 @@
      delete from yeshi_ec_home_navbar where br_id = #{id,jdbcType=BIGINT}
  </delete>
  
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_home_navbar (br_id,br_name,br_picture,br_class_id,br_swiper_banner_id,br_url,br_type,br_orderby,br_start_time,br_end_time,br_state,br_is_default,br_is_fixed,br_createtime,br_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{classId,jdbcType=BIGINT},#{swiperBannerId,jdbcType=BIGINT},#{url,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{isDefault,jdbcType=VARCHAR},#{isFixed,jdbcType=VARCHAR},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_home_navbar (br_id,br_name,br_picture,br_class_id,br_swiper_banner_id,br_url,br_type,br_orderby,br_order_man,br_order_woman,br_start_time,br_end_time,br_state,br_is_default,br_is_fixed,br_createtime,br_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{classId,jdbcType=BIGINT},#{swiperBannerId,jdbcType=BIGINT},#{url,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{orderMan,jdbcType=INTEGER},#{orderWoman,jdbcType=INTEGER},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{isDefault,jdbcType=VARCHAR},#{isFixed,jdbcType=VARCHAR},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert>
  
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_home_navbar
    <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -117,6 +214,8 @@
      <if test="url != null">br_url,</if>
      <if test="type != null">br_type,</if>
      <if test="orderby != null">br_orderby,</if>
      <if test="orderMan != null">br_order_man,</if>
      <if test="orderWoman != null">br_order_woman,</if>
      <if test="startTime != null">br_start_time,</if>
      <if test="endTime != null">br_end_time,</if>
      <if test="state != null">br_state,</if>
@@ -134,6 +233,8 @@
      <if test="url != null">#{url,jdbcType=VARCHAR},</if>
      <if test="type != null">#{type,jdbcType=VARCHAR},</if>
      <if test="orderby != null">#{orderby,jdbcType=INTEGER},</if>
      <if test="orderMan != null">#{orderMan,jdbcType=INTEGER},</if>
      <if test="orderWoman != null">#{orderWoman,jdbcType=INTEGER},</if>
      <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if>
      <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if>
      <if test="state != null">#{state,jdbcType=INTEGER},</if>
@@ -144,7 +245,7 @@
    </trim>
  </insert>
  
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar">update yeshi_ec_home_navbar set br_name = #{name,jdbcType=VARCHAR},br_picture = #{picture,jdbcType=VARCHAR},br_class_id = #{classId,jdbcType=BIGINT},br_swiper_banner_id = #{swiperBannerId,jdbcType=BIGINT},br_url = #{url,jdbcType=VARCHAR},br_type = #{type,jdbcType=VARCHAR},br_orderby = #{orderby,jdbcType=INTEGER},br_start_time = #{startTime,jdbcType=TIMESTAMP},br_end_time = #{endTime,jdbcType=TIMESTAMP},br_state = #{state,jdbcType=INTEGER},br_is_default = #{isDefault,jdbcType=VARCHAR},br_is_fixed = #{isFixed,jdbcType=VARCHAR},br_createtime = #{createtime,jdbcType=TIMESTAMP},br_updatetime = #{updatetime,jdbcType=TIMESTAMP} where br_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar">update yeshi_ec_home_navbar set br_name = #{name,jdbcType=VARCHAR},br_picture = #{picture,jdbcType=VARCHAR},br_class_id = #{classId,jdbcType=BIGINT},br_swiper_banner_id = #{swiperBannerId,jdbcType=BIGINT},br_url = #{url,jdbcType=VARCHAR},br_type = #{type,jdbcType=VARCHAR},br_orderby = #{orderby,jdbcType=INTEGER},br_order_man = #{orderMan,jdbcType=INTEGER},br_order_woman = #{orderWoman,jdbcType=INTEGER},br_start_time = #{startTime,jdbcType=TIMESTAMP},br_end_time = #{endTime,jdbcType=TIMESTAMP},br_state = #{state,jdbcType=INTEGER},br_is_default = #{isDefault,jdbcType=VARCHAR},br_is_fixed = #{isFixed,jdbcType=VARCHAR},br_createtime = #{createtime,jdbcType=TIMESTAMP},br_updatetime = #{updatetime,jdbcType=TIMESTAMP} where br_id = #{id,jdbcType=BIGINT}</update>
 
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar">update yeshi_ec_home_navbar
    <set>
@@ -155,6 +256,8 @@
      <if test="url != null">br_url=#{url,jdbcType=VARCHAR},</if>
      <if test="type != null">br_type=#{type,jdbcType=VARCHAR},</if>
      <if test="orderby != null">br_orderby=#{orderby,jdbcType=INTEGER},</if>
      <if test="orderMan != null">br_order_man=#{orderMan,jdbcType=INTEGER},</if>
      <if test="orderWoman != null">br_order_woman=#{orderWoman,jdbcType=INTEGER},</if>
      <if test="startTime != null">br_start_time=#{startTime,jdbcType=TIMESTAMP},</if>
      <if test="endTime != null">br_end_time=#{endTime,jdbcType=TIMESTAMP},</if>
      <if test="state != null">br_state=#{state,jdbcType=INTEGER},</if>
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SpecialMapper.xml
@@ -13,7 +13,10 @@
    <result column="b_params" property="params" jdbcType="VARCHAR"/>
    <result column="b_jump_login" property="jumpLogin" jdbcType="VARCHAR"/>
    <result column="b_orderby" property="orderby" jdbcType="INTEGER"/>
    <result column="b_order_man" property="orderMan" jdbcType="INTEGER"/>
    <result column="b_order_woman" property="orderWoman" jdbcType="INTEGER"/>
    <result column="b_state" property="state" jdbcType="BIGINT"/>
    <result column="b_sex" property="sex" jdbcType="INTEGER"/>
    <result column="b_show_type" property="showType" jdbcType="VARCHAR"/>
    <result column="b_remark" property="remark" jdbcType="VARCHAR"/>
    <result column="b_createtime" property="createtime" jdbcType="TIMESTAMP"/>
@@ -27,12 +30,12 @@
    </association>
    
  </resultMap>
  <sql id="Base_Column_List">b_id,b_name,b_card,b_card_id,b_main_picture,b_icon,b_sub_picture,b_jumpid,b_params,b_jump_login,b_orderby,b_state,b_show_type,b_remark,b_createtime,b_updatetime</sql>
  <sql id="Base_Column_List">b_id,b_name,b_card,b_card_id,b_main_picture,b_icon,b_sub_picture,b_jumpid,b_params,b_jump_login,b_orderby,b_order_man,b_order_woman,b_state,b_sex,b_show_type,b_remark,b_createtime,b_updatetime</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_special where b_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_special where b_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special (b_id,b_name,b_card,b_card_id,b_main_picture,b_icon,b_sub_picture,b_jumpid,b_params,b_jump_login,b_orderby,b_state,b_show_type,b_remark,b_createtime,b_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{card,jdbcType=VARCHAR},#{cardId,jdbcType=BIGINT},#{picture,jdbcType=VARCHAR},#{icon,jdbcType=VARCHAR},#{subPicture,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{jumpLogin,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{state,jdbcType=BIGINT},#{showType,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special (b_id,b_name,b_card,b_card_id,b_main_picture,b_icon,b_sub_picture,b_jumpid,b_params,b_jump_login,b_orderby,b_order_man,b_order_woman,b_state,b_sex,b_show_type,b_remark,b_createtime,b_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{card,jdbcType=VARCHAR},#{cardId,jdbcType=BIGINT},#{picture,jdbcType=VARCHAR},#{icon,jdbcType=VARCHAR},#{subPicture,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{jumpLogin,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{orderMan,jdbcType=INTEGER},#{orderWoman,jdbcType=INTEGER},#{state,jdbcType=BIGINT},#{sex,jdbcType=INTEGER},#{showType,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">b_id,</if>
@@ -46,7 +49,10 @@
      <if test="params != null">b_params,</if>
      <if test="jumpLogin != null">b_jump_login,</if>
      <if test="orderby != null">b_orderby,</if>
      <if test="orderMan != null">b_order_man,</if>
      <if test="orderWoman != null">b_order_woman,</if>
      <if test="state != null">b_state,</if>
      <if test="sex != null">b_sex,</if>
      <if test="showType != null">b_show_type,</if>
      <if test="remark != null">b_remark,</if>
      <if test="createtime != null">b_createtime,</if>
@@ -64,14 +70,17 @@
      <if test="params != null">#{params,jdbcType=VARCHAR},</if>
      <if test="jumpLogin != null">#{jumpLogin,jdbcType=VARCHAR},</if>
      <if test="orderby != null">#{orderby,jdbcType=INTEGER},</if>
      <if test="orderMan != null">#{orderMan,jdbcType=INTEGER},</if>
      <if test="orderWoman != null">#{orderWoman,jdbcType=INTEGER},</if>
      <if test="state != null">#{state,jdbcType=BIGINT},</if>
      <if test="sex != null">#{sex,jdbcType=INTEGER},</if>
      <if test="showType != null">#{showType,jdbcType=VARCHAR},</if>
      <if test="remark != null">#{remark,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.bus.homemodule.Special">update yeshi_ec_special set b_name = #{name,jdbcType=VARCHAR},b_card = #{card,jdbcType=VARCHAR},b_card_id = #{cardId,jdbcType=BIGINT},b_main_picture = #{picture,jdbcType=VARCHAR},b_icon = #{icon,jdbcType=VARCHAR},b_sub_picture = #{subPicture,jdbcType=VARCHAR},b_jumpid = #{jumpDetail.id,jdbcType=BIGINT},b_params = #{params,jdbcType=VARCHAR},b_jump_login = #{jumpLogin,jdbcType=VARCHAR},b_orderby = #{orderby,jdbcType=INTEGER},b_state = #{state,jdbcType=BIGINT},b_show_type = #{showType,jdbcType=VARCHAR},b_remark = #{remark,jdbcType=VARCHAR},b_createtime = #{createtime,jdbcType=TIMESTAMP},b_updatetime = #{updatetime,jdbcType=TIMESTAMP} where b_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special">update yeshi_ec_special set b_name = #{name,jdbcType=VARCHAR},b_card = #{card,jdbcType=VARCHAR},b_card_id = #{cardId,jdbcType=BIGINT},b_main_picture = #{picture,jdbcType=VARCHAR},b_icon = #{icon,jdbcType=VARCHAR},b_sub_picture = #{subPicture,jdbcType=VARCHAR},b_jumpid = #{jumpDetail.id,jdbcType=BIGINT},b_params = #{params,jdbcType=VARCHAR},b_jump_login = #{jumpLogin,jdbcType=VARCHAR},b_orderby = #{orderby,jdbcType=INTEGER},b_order_man = #{orderMan,jdbcType=INTEGER},b_order_woman = #{orderWoman,jdbcType=INTEGER},b_state = #{state,jdbcType=BIGINT},b_show_type = #{showType,jdbcType=VARCHAR},b_remark = #{remark,jdbcType=VARCHAR},b_createtime = #{createtime,jdbcType=TIMESTAMP},b_updatetime = #{updatetime,jdbcType=TIMESTAMP} where b_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special">update yeshi_ec_special
    <set>
      <if test="name != null">b_name=#{name,jdbcType=VARCHAR},</if>
@@ -84,13 +93,35 @@
      <if test="params != null">b_params=#{params,jdbcType=VARCHAR},</if>
      <if test="jumpLogin != null">b_jump_login=#{jumpLogin,jdbcType=VARCHAR},</if>
      <if test="orderby != null">b_orderby=#{orderby,jdbcType=INTEGER},</if>
      <if test="orderMan != null">b_order_man=#{orderMan,jdbcType=INTEGER},</if>
      <if test="orderWoman != null">b_order_woman=#{orderWoman,jdbcType=INTEGER},</if>
      <if test="state != null">b_state=#{state,jdbcType=BIGINT},</if>
      <if test="sex != null">b_sex=#{orderby,jdbcType=INTEGER},</if>
      <if test="showType != null">b_show_type=#{showType,jdbcType=VARCHAR},</if>
      <if test="remark != null">b_remark=#{remark,jdbcType=VARCHAR},</if>
      <if test="createtime != null">b_createtime=#{createtime,jdbcType=TIMESTAMP},</if>
      <if test="updatetime != null">b_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if>
    </set> where b_id = #{id,jdbcType=BIGINT}
  </update>
  <sql id="Sex_Screen">
    <!-- 通用版 -->
    <if test="sex == 0">
        AND (sp.`b_sex`= 120 OR sp.`b_sex`= 0 OR sp.`b_sex` = 10 OR sp.`b_sex` = 20)
        ORDER BY sp.`b_orderby`
    </if>
    <!-- 女版 -->
    <if test="sex == 1">
        AND (sp.`b_sex`= 120 OR sp.`b_sex`= 1 OR sp.`b_sex` = 10 OR sp.`b_sex` = 12)
        ORDER BY sp.`b_order_woman`
    </if>
    <!-- 男版 -->
    <if test="sex == 2">
        AND (sp.`b_sex`= 120 OR sp.`b_sex`= 2 OR sp.`b_sex` = 20 OR sp.`b_sex` = 12)
        ORDER BY sp.`b_order_man`
    </if>
  </sql>
  
  <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List">
        delete from yeshi_ec_special WHERE b_id in
@@ -119,40 +150,80 @@
   </select>
   
   <select id="listQueryByCard" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" /> FROM  `yeshi_ec_special` pp
        WHERE pp.`b_card_id` = #{cardId}
        SELECT <include refid="Base_Column_List" /> FROM  `yeshi_ec_special` sp
        WHERE sp.`b_card_id` = #{cardId}
           <if test='key != null and key != ""'>
                  AND b_name like '%${key}%'
                  AND sp.b_name like '%${key}%'
           </if>
        ORDER BY pp.b_orderby
           <include refid="Sex_Screen"/>
        LIMIT ${start},${count}
   </select>
   
   <select id="countlistQueryByCard" resultType="java.lang.Long">
        SELECT IFNULL(count(b_id),0) FROM  `yeshi_ec_special` pp
        WHERE pp.`b_card_id` = #{cardId}
        SELECT IFNULL(count(b_id),0) FROM  `yeshi_ec_special` sp
        WHERE sp.`b_card_id` = #{cardId}
           <if test='key != null and key != ""'>
                  AND b_name like '%${key}%'
                  AND sp.b_name like '%${key}%'
           </if>
           <include refid="Sex_Screen"/>
   </select>
  
   <select id="getMaxOrderByCard" resultType="java.lang.Integer">
   <select id="getDefaultMaxOrder" resultType="java.lang.Integer">
        SELECT IFNULL(MAX(pp.b_orderby),0) FROM yeshi_ec_special pp 
        WHERE pp.`b_card_id` = #{cardId}
   </select>
  
  <select id="getManMaxOrder" resultType="java.lang.Integer">
        SELECT IFNULL(MAX(pp.b_order_man),0) FROM yeshi_ec_special pp
        WHERE pp.`b_card_id` = #{cardId}
   </select>
  <select id="getWomanMaxOrder" resultType="java.lang.Integer">
        SELECT IFNULL(MAX(pp.b_order_woman),0) FROM yeshi_ec_special pp
        WHERE pp.`b_card_id` = #{cardId}
   </select>
   <select id="getOrderByCardID" resultMap="BaseResultMap">
        SELECT  <include refid="Base_Column_List" /> FROM yeshi_ec_special
        WHERE b_card_id = #{cardId}
        <if test="type == -1">
            <![CDATA[and b_orderby < #{order}]]>
            order by b_orderby desc
        </if>
        <if test="type == 1">
            <![CDATA[and b_orderby > #{order} ]]>
            order by b_orderby
        </if>
        SELECT  <include refid="Base_Column_List" /> FROM yeshi_ec_special sp
        WHERE sp.b_card_id = #{cardId}
        <!-- 通用版 -->
        <if test="sex == 0 or sex == 120">
            AND (sp.`b_sex`= 120 OR sp.`b_sex`= 0 OR sp.`b_sex` = 10 OR sp.`b_sex` = 20)
            <if test="type == -1">
                <![CDATA[and sp.b_orderby < #{order}]]>
                order by sp.b_orderby desc
            </if>
            <if test="type == 1">
                <![CDATA[and sp.b_orderby > #{order} ]]>
                order by sp.b_orderby
            </if>
        </if>
        <!-- 女版 -->
        <if test="sex == 1">
            AND (sp.`b_sex`= 120 OR sp.`b_sex`= 1 OR sp.`b_sex` = 10 OR sp.`b_sex` = 12)
            <if test="type == -1">
                <![CDATA[and sp.b_order_woman < #{order}]]>
                order by sp.b_order_woman desc
            </if>
            <if test="type == 1">
                <![CDATA[and sp.b_order_woman > #{order} ]]>
                order by sp.b_order_woman
            </if>
        </if>
        <!-- 男版 -->
        <if test="sex == 2">
            AND (sp.`b_sex`= 120 OR sp.`b_sex`= 2 OR sp.`b_sex` = 20 OR sp.`b_sex` = 12)
            <if test="type == -1">
                <![CDATA[and sp.b_order_man < #{order}]]>
                order by sp.b_order_man desc
            </if>
            <if test="type == 1">
                <![CDATA[and sp.b_order_man > #{order} ]]>
                order by sp.b_order_man
            </if>
        </if>
        limit 1
   </select>
   
@@ -181,9 +252,8 @@
            AND IF(c.`cd_start_time` IS NULL,TRUE, c.`cd_start_time`<![CDATA[<=]]>NOW()) 
            AND IF(c.`cd_end_time` IS NULL,TRUE,c.`cd_end_time`<![CDATA[>=]]>NOW())
            AND pc.`sp_key` = #{placeKey}
            ORDER BY c.`cd_start_time` DESC
            LIMIT 1)c ON  sp.`b_card_id` = c.`cd_id`
        WHERE sp.`b_state` = 0
        ORDER BY sp.`b_orderby`
        WHERE sp.`b_state` = 0
            <include refid="Sex_Screen"/>
   </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/lable/QualityFactoryMapper.xml
@@ -1341,18 +1341,13 @@
     <select id="listFreeGoods" resultMap="GoodsResultMap">
         SELECT * FROM `yeshi_ec_quality_factory` h
        SELECT * FROM `yeshi_ec_quality_factory` h
        LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id`
        WHERE tb.`couponAmount` > 0 AND tb.`couponTotalCount` > 0
             AND IF(tb.`zkPrice` - tb.`couponStartFee`>=0, TRUE, FALSE)
             <!-- 在售价  209.9 -->
             AND tb.`zkPrice` <![CDATA[<=]]> 209.9
             <!--  券后价范围  0~9.9 -->
             AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[>]]> 0
             AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[<= ]]> 9.9
             <!-- 比例  20 -->
             AND  tb.`tkRate` <![CDATA[>=]]> 20
        ORDER BY h.sg_weight desc
        WHERE tb.`couponAmount` > 0 AND tb.`couponTotalCount` <![CDATA[>]]> 0
      AND IF(tb.`zkPrice` - tb.`couponStartFee`<![CDATA[>=]]>0, TRUE, FALSE)
      AND (tb.`zkPrice` - tb.`couponAmount`) <![CDATA[>]]> 0
      AND  tb.`tkRate` * (tb.`zkPrice` - tb.`couponAmount`) *0.05*0.01 <![CDATA[>]]> 1
      ORDER BY h.sg_weight desc
        LIMIT ${start},${count}
    </select>
fanli/src/main/java/com/yeshi/fanli/mapping/tlj/ConfigTaoLiJinMapper.xml
New file
@@ -0,0 +1,53 @@
<?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.tlj.ConfigTaoLiJinMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.tlj.ConfigTaoLiJin">
    <id column="ct_id" property="id" jdbcType="BIGINT"/>
    <result column="ct_name" property="name" jdbcType="VARCHAR"/>
    <result column="ct_key" property="key" jdbcType="VARCHAR"/>
    <result column="ct_value" property="value" jdbcType="VARCHAR"/>
    <result column="ct_beizhu" property="beizhu" jdbcType="VARCHAR"/>
    <result column="ct_create_time" property="createTime" jdbcType="TIMESTAMP"/>
  </resultMap>
  <sql id="Base_Column_List">ct_id,ct_name,ct_key,ct_value,ct_beizhu,ct_create_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_config_taolijin where ct_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_config_taolijin where ct_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.tlj.ConfigTaoLiJin" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_config_taolijin (ct_id,ct_name,ct_key,ct_value,ct_beizhu,ct_create_time) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{key,jdbcType=VARCHAR},#{value,jdbcType=VARCHAR},#{beizhu,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.tlj.ConfigTaoLiJin" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_config_taolijin
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">ct_id,</if>
      <if test="name != null">ct_name,</if>
      <if test="key != null">ct_key,</if>
      <if test="value != null">ct_value,</if>
      <if test="beizhu != null">ct_beizhu,</if>
      <if test="createTime != null">ct_create_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="key != null">#{key,jdbcType=VARCHAR},</if>
      <if test="value != null">#{value,jdbcType=VARCHAR},</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.bus.tlj.ConfigTaoLiJin">update yeshi_ec_config_taolijin set ct_name = #{name,jdbcType=VARCHAR},ct_key = #{key,jdbcType=VARCHAR},ct_value = #{value,jdbcType=VARCHAR},ct_beizhu = #{beizhu,jdbcType=VARCHAR},ct_create_time = #{createTime,jdbcType=TIMESTAMP} where ct_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.tlj.ConfigTaoLiJin">update yeshi_ec_config_taolijin
    <set>
      <if test="name != null">ct_name=#{name,jdbcType=VARCHAR},</if>
      <if test="key != null">ct_key=#{key,jdbcType=VARCHAR},</if>
      <if test="value != null">ct_value=#{value,jdbcType=VARCHAR},</if>
      <if test="beizhu != null">ct_beizhu=#{beizhu,jdbcType=VARCHAR},</if>
      <if test="createTime != null">ct_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
    </set> where ct_id = #{id,jdbcType=BIGINT}
  </update>
  <select id="getByKey" resultMap="BaseResultMap">
    SELECT * FROM yeshi_ec_config_taolijin t
    WHERE t.`ct_key` = #{key}
  </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/tlj/UserTaoLiJinDetailMapper.xml
New file
@@ -0,0 +1,140 @@
<?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.tlj.UserTaoLiJinDetailMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail">
    <id column="utd_id" property="id" jdbcType="BIGINT"/>
    <result column="utd_uid" property="uid" jdbcType="BIGINT"/>
    <result column="utd_money" property="money" jdbcType="DECIMAL"/>
    <result column="utd_title" property="title" jdbcType="VARCHAR"/>
    <result column="utd_type" property="type" typeHandler="com.yeshi.fanli.util.mybatishandler.tlj.TaoLiJinDetailTypeEnumHandler"/>
    <result column="utd_desc_info" property="descInfo" jdbcType="VARCHAR"/>
    <result column="utd_remark" property="remark" jdbcType="INTEGER"/>
    <result column="utd_create_time" property="createTime" jdbcType="TIMESTAMP"/>
  </resultMap>
  <resultMap id="UserMonthMoneyMap" type="com.yeshi.fanli.vo.tlj.TaoLiJinMonthVO">
        <result column="expend" property="expend" jdbcType="DECIMAL" />
        <result column="income" property="income" jdbcType="DECIMAL" />
        <result column="dateFormate" property="dateFormate" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List">utd_id,utd_uid,utd_money,utd_title,utd_type,utd_desc_info,utd_remark,utd_create_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_user_taolijin_detail where utd_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_taolijin_detail where utd_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_taolijin_detail (utd_id,utd_uid,utd_money,utd_title,utd_type,utd_desc_info,utd_remark,utd_create_time) values (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{title,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{descInfo,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_taolijin_detail
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">utd_id,</if>
      <if test="uid != null">utd_uid,</if>
      <if test="money != null">utd_money,</if>
      <if test="title != null">utd_title,</if>
      <if test="type != null">utd_type,</if>
      <if test="descInfo != null">utd_desc_info,</if>
      <if test="remark != null">utd_remark,</if>
      <if test="createTime != null">utd_create_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="money != null">#{money,jdbcType=DECIMAL},</if>
      <if test="title != null">#{title,jdbcType=VARCHAR},</if>
      <if test="type != null">#{type,jdbcType=VARCHAR},</if>
      <if test="descInfo != null">#{descInfo,jdbcType=VARCHAR},</if>
      <if test="remark != null">#{remark,jdbcType=VARCHAR},</if>
      <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail">update yeshi_ec_user_taolijin_detail set utd_uid = #{uid,jdbcType=BIGINT},utd_money = #{money,jdbcType=DECIMAL},utd_title = #{title,jdbcType=VARCHAR},utd_type = #{type,jdbcType=VARCHAR},utd_desc_info = #{descInfo,jdbcType=VARCHAR},utd_remark = #{remark,jdbcType=VARCHAR},utd_create_time = #{createTime,jdbcType=TIMESTAMP} where utd_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail">update yeshi_ec_user_taolijin_detail
    <set>
      <if test="uid != null">utd_uid=#{uid,jdbcType=BIGINT},</if>
      <if test="money != null">utd_money=#{money,jdbcType=DECIMAL},</if>
      <if test="title != null">utd_title=#{title,jdbcType=VARCHAR},</if>
      <if test="type != null">utd_type=#{type,jdbcType=VARCHAR},</if>
      <if test="descInfo != null">utd_desc_info=#{descInfo,jdbcType=VARCHAR},</if>
      <if test="remark != null">utd_remark=#{remark,jdbcType=VARCHAR},</if>
      <if test="createTime != null">utd_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
    </set> where utd_id = #{id,jdbcType=BIGINT}
  </update>
  <select id="countDetail" resultType="Long">
      SELECT IFNULL(count(t.utd_id),0) FROM `yeshi_ec_user_taolijin_detail` t
    WHERE t.`utd_uid` = #{uid}
  </select>
  <select id="countUseMoneyByDate" resultType="java.math.BigDecimal">
      SELECT IFNULL(SUM(t.`utd_money`),0) FROM `yeshi_ec_user_taolijin_detail` t
    WHERE t.`utd_uid` = #{uid} AND t.`utd_type` <![CDATA[<>]]>'overdue'
          AND t.`utd_money` <![CDATA[<]]> 0
        <if test="dateType == 1"> <!-- 今日  -->
            AND TO_DAYS(t.`utd_create_time`) =  TO_DAYS(NOW());
        </if>
        <if test="dateType == 2"> <!-- 昨日  -->
          AND TO_DAYS(NOW()) - TO_DAYS(t.`utd_create_time`) = 1
        </if>
           <if test="dateType == 3"> <!-- 本月  -->
          AND DATE_FORMAT(t.`utd_create_time`, '%Y%m') =DATE_FORMAT(CURDATE(), '%Y%m')
        </if>
        <if test="dateType == 4"> <!--上月  -->
          AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'),DATE_FORMAT(t.`utd_create_time`, '%Y%m')) = 1
        </if>
  </select>
  <select id="selectByMaxCreateTime" resultMap="BaseResultMap">
    SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_user_taolijin_detail t
    WHERE t.`utd_uid`=#{uid} AND t.`utd_create_time`<![CDATA[<=]]> #{date}
    ORDER BY t.`utd_create_time` DESC,t.utd_id DESC
    LIMIT #{count}
  </select>
  <select id="selectByUidWithIndexId" resultMap="BaseResultMap">
    SELECT <include refid="Base_Column_List" />    FROM yeshi_ec_user_taolijin_detail t
    WHERE t.`utd_uid`=#{uid}
        AND t.`utd_create_time`<![CDATA[<=]]>(SELECT utd_create_time FROM yeshi_ec_user_taolijin_detail WHERE utd_id =#{id})
    ORDER BY t.`utd_create_time` DESC,t.utd_id DESC
    LIMIT #{count}
  </select>
  <select id="selectMonthMoneyByUid" resultMap="UserMonthMoneyMap">
        <foreach collection="dateFormat" index="index" item="item"
            separator="UNION ALL">
            <trim prefix="(" suffix=")">
                SELECT c.time AS dateFormate , IF(a.money IS NULL,0,a.money) AS income ,IF(b.money IS NULL,0,b.money) AS expend
                FROM (SELECT  #{item} AS `time`) c
                LEFT JOIN (SELECT DATE_FORMAT(d.`utd_create_time`,'%Y-%m') AS `time`,SUM(d.`utd_money`)AS money
                               FROM `yeshi_ec_user_taolijin_detail` d
                               WHERE d.`utd_uid`=#{uid} AND  d.`utd_money`<![CDATA[>=]]>0 AND DATE_FORMAT(d.`utd_create_time`,'%Y-%m')=#{item}
                               GROUP BY DATE_FORMAT(d.`utd_create_time`,'%Y-%m')
                               ) a ON a.time=c.time
                LEFT JOIN(SELECT DATE_FORMAT(d.`utd_create_time`,'%Y-%m') AS `time`,SUM(d.`utd_money`) AS money
                              FROM `yeshi_ec_user_taolijin_detail` d
                            WHERE d.`utd_uid`=#{uid} AND d.`utd_money` <![CDATA[<]]>0 AND DATE_FORMAT(d.`utd_create_time`,'%Y-%m')=#{item}
                              GROUP BY DATE_FORMAT(d.`utd_create_time`,'%Y-%m')
                              ) b ON c.time=b.time
           </trim>
       </foreach>
  </select>
  <select id="selectCountByUid" resultType="java.lang.Long"  parameterType="java.lang.Long">
    SELECT count(utd_id) FROM yeshi_ec_user_taolijin_detail
    WHERE utd_uid=#{uid}
  </select>
  <select id="selectMonthCountByUid" resultType="java.lang.Integer">
    SELECT COUNT(*) FROM
            (SELECT * FROM yeshi_ec_user_taolijin_detail d
             WHERE d.`utd_uid`=#{uid} AND d.`utd_create_time` <![CDATA[<=]]> #{date}
             GROUP BY DATE_FORMAT(d.`utd_create_time`,'%y-%m')
             ) a
  </select>
  <select id="selectCountByUidAndMaxCreateTime" resultType="java.lang.Long">
    SELECT count(utd_id) FROM yeshi_ec_user_taolijin_detail
    WHERE utd_uid=#{uid} and `utd_create_time`<![CDATA[<=]]>#{date}
 </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/tlj/UserTaoLiJinOriginMapper.xml
New file
@@ -0,0 +1,133 @@
<?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.tlj.UserTaoLiJinOriginMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin">
    <id column="uto_id" property="id" jdbcType="BIGINT"/>
    <result column="uto_uid" property="uid" jdbcType="BIGINT"/>
    <result column="uto_rights_id" property="rightsId" jdbcType="VARCHAR"/>
    <result column="uto_money" property="money" jdbcType="DECIMAL"/>
    <result column="uto_money_surplus" property="moneySurplus" jdbcType="DECIMAL"/>
    <result column="uto_type" property="type" jdbcType="INTEGER"/>
    <result column="uto_origin" property="origin" typeHandler="com.yeshi.fanli.util.mybatishandler.tlj.TaoLiJinOriginEnumHandler"/>
    <result column="uto_remark" property="remark" jdbcType="VARCHAR"/>
    <result column="uto_create_time" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="uto_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
  </resultMap>
  <sql id="Base_Column_List">uto_id,uto_uid,uto_rights_id,uto_money,uto_money_surplus,uto_type,uto_origin,uto_remark,uto_create_time,uto_update_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_user_taolijin_origin where uto_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_taolijin_origin where uto_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_taolijin_origin (uto_id,uto_uid,uto_rights_id,uto_money,uto_money_surplus,uto_type,uto_origin,uto_remark,uto_create_time,uto_update_time) values (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{rightsId,jdbcType=VARCHAR},#{money,jdbcType=DECIMAL},#{moneySurplus,jdbcType=DECIMAL},#{type,jdbcType=INTEGER},#{origin,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_taolijin_origin
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">uto_id,</if>
      <if test="uid != null">uto_uid,</if>
      <if test="rightsId != null">uto_rights_id,</if>
      <if test="money != null">uto_money,</if>
      <if test="moneySurplus != null">uto_money_surplus,</if>
      <if test="type != null">uto_type,</if>
      <if test="origin != null">uto_origin,</if>
      <if test="remark != null">uto_remark,</if>
      <if test="createTime != null">uto_create_time,</if>
      <if test="updateTime != null">uto_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="rightsId != null">#{rightsId,jdbcType=VARCHAR},</if>
      <if test="money != null">#{money,jdbcType=DECIMAL},</if>
      <if test="moneySurplus != null">#{moneySurplus,jdbcType=DECIMAL},</if>
      <if test="type != null">#{type,jdbcType=INTEGER},</if>
      <if test="origin != null">#{origin,jdbcType=VARCHAR},</if>
      <if test="remark != null">#{remark,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.bus.tlj.UserTaoLiJinOrigin">update yeshi_ec_user_taolijin_origin set uto_uid = #{uid,jdbcType=BIGINT},uto_rights_id = #{rightsId,jdbcType=VARCHAR},uto_money = #{money,jdbcType=DECIMAL},uto_money_surplus = #{moneySurplus,jdbcType=DECIMAL},uto_type = #{type,jdbcType=INTEGER},uto_origin = #{origin,jdbcType=VARCHAR},uto_remark = #{remark,jdbcType=VARCHAR},uto_create_time = #{createTime,jdbcType=TIMESTAMP},uto_update_time = #{updateTime,jdbcType=TIMESTAMP} where uto_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin">update yeshi_ec_user_taolijin_origin
    <set>
      <if test="uid != null">uto_uid=#{uid,jdbcType=BIGINT},</if>
      <if test="rightsId != null">uto_rights_id=#{rightsId,jdbcType=VARCHAR},</if>
      <if test="money != null">uto_money=#{money,jdbcType=DECIMAL},</if>
      <if test="moneySurplus != null">uto_money_surplus=#{moneySurplus,jdbcType=DECIMAL},</if>
      <if test="type != null">uto_type=#{type,jdbcType=INTEGER},</if>
      <if test="origin != null">uto_origin=#{origin,jdbcType=VARCHAR},</if>
      <if test="remark != null">uto_remark=#{remark,jdbcType=VARCHAR},</if>
      <if test="createTime != null">uto_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updateTime != null">uto_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
    </set> where uto_id = #{id,jdbcType=BIGINT}
  </update>
  <select id="countMoneyByDate" resultType="java.math.BigDecimal">
      SELECT IFNULL(SUM(t.`uto_money`),0) FROM `yeshi_ec_user_taolijin_origin` t
    WHERE t.`uto_uid` = #{uid} AND t.`uto_origin` <![CDATA[<>]]>'refund'
        <if test="dateType == 1"> <!-- 今日  -->
            AND TO_DAYS(t.`uto_create_time`) =  TO_DAYS(NOW());
        </if>
        <if test="dateType == 2"> <!-- 昨日  -->
          AND TO_DAYS(NOW()) - TO_DAYS(t.`uto_create_time`) = 1
        </if>
           <if test="dateType == 3"> <!-- 本月  -->
          AND DATE_FORMAT(t.`uto_create_time`, '%Y%m') =DATE_FORMAT(CURDATE(), '%Y%m')
        </if>
        <if test="dateType == 4"> <!--上月  -->
          AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'),DATE_FORMAT(t.`uto_create_time`, '%Y%m')) = 1
        </if>
  </select>
  <select id="countByUidAndOrigin" resultType="Long">
     SELECT IFNULL(COUNT(t.`uto_id`),0) FROM yeshi_ec_user_taolijin_origin t
    WHERE t.`uto_uid` = #{uid} AND t.`uto_origin` = #{origin}
  </select>
   <select id="getByUidAndOrigin" resultMap="BaseResultMap">
     SELECT * FROM yeshi_ec_user_taolijin_origin t
    WHERE t.`uto_uid` = #{uid} AND t.`uto_origin` = #{origin}
    LIMIT 1
  </select>
  <select id="countRankByThisMonth" resultType="Long">
     SELECT IFNULL(COUNT(t.`uto_id`),0) FROM yeshi_ec_user_taolijin_origin t
    WHERE t.`uto_uid` = #{uid} AND t.`uto_origin` = 'rankWin'
          AND DATE_FORMAT(t.`uto_create_time`, '%Y%m') =DATE_FORMAT(CURDATE(), '%Y%m')
  </select>
   <select id="getRankByThisMonth" resultMap="BaseResultMap">
     SELECT * FROM yeshi_ec_user_taolijin_origin t
    WHERE t.`uto_uid` = #{uid} AND t.`uto_origin` = #{type}
          AND DATE_FORMAT(t.`uto_create_time`, '%Y%m') =DATE_FORMAT(CURDATE(), '%Y%m')
    LIMIT 1
  </select>
  <select id="getOverdueTaoLiJin" resultMap="BaseResultMap" >
     SELECT * FROM yeshi_ec_user_taolijin_origin t
    WHERE t.`uto_uid` = #{uid} AND t.`uto_create_time`<![CDATA[<=]]> #{date}
          AND t.`uto_money_surplus`<![CDATA[>]]> 0
  </select>
  <select id="getSurplusLiJin" resultMap="BaseResultMap" >
     SELECT * FROM yeshi_ec_user_taolijin_origin t
    WHERE t.`uto_uid` = #{uid} AND t.`uto_money_surplus`<![CDATA[>]]> 0
  </select>
  <select id="countByUidAndType" resultType="Long">
     SELECT IFNULL(COUNT(t.`uto_id`),0) FROM yeshi_ec_user_taolijin_origin t
    WHERE t.`uto_uid` = #{uid} AND t.`uto_origin` = #{type}
  </select>
  <select id="countMoneyByOrigin" resultType="java.math.BigDecimal">
     SELECT IFNULL(SUM(t.`uto_money`),0) FROM yeshi_ec_user_taolijin_origin t
    WHERE t.`uto_rights_id` = #{rightsId}  AND t.`uto_origin` = #{origin}
  </select>
  <select id="getOriginByRightsId" resultMap="BaseResultMap" >
     SELECT * FROM yeshi_ec_user_taolijin_origin t
    WHERE t.`uto_rights_id` = #{rightsId}
    LIMIT 1
  </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/tlj/UserTaoLiJinRecordMapper.xml
New file
@@ -0,0 +1,120 @@
<?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.tlj.UserTaoLiJinRecordMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinRecord">
    <id column="utlj_id" property="id" jdbcType="BIGINT"/>
    <result column="utlj_uid" property="uid" jdbcType="BIGINT"/>
    <result column="utlj_goods_id" property="goodsId" jdbcType="BIGINT"/>
    <result column="utlj_total_num" property="totalNum" jdbcType="INTEGER"/>
    <result column="utlj_name" property="name" jdbcType="VARCHAR"/>
    <result column="utlj_per_face" property="perFace" jdbcType="DECIMAL"/>
    <result column="utlj_send_start_time" property="sendStartTime" jdbcType="TIMESTAMP"/>
    <result column="utlj_send_end_time" property="sendEndTime" jdbcType="TIMESTAMP"/>
    <result column="utlj_use_start_time" property="useStartTime" jdbcType="TIMESTAMP"/>
    <result column="utlj_use_end_time" property="useEndTime" jdbcType="TIMESTAMP"/>
    <result column="utlj_rights_id" property="rightsId" jdbcType="VARCHAR"/>
    <result column="utlj_send_url" property="sendUrl" jdbcType="VARCHAR"/>
    <result column="utlj_create_time" property="createTime" jdbcType="TIMESTAMP"/>
  </resultMap>
  <resultMap id="ResultVOMap" type="com.yeshi.fanli.vo.user.UserTaoLiJinRecordVO">
    <result column="utlj_goods_id" property="auctionId" jdbcType="BIGINT"/>
    <result column="utlj_total_num" property="totalNum" jdbcType="INTEGER"/>
    <result column="utlj_create_time" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="utr_refund_num" property="refundNum" jdbcType="INTEGER"/>
    <result column="utr_use_num" property="useNum" jdbcType="INTEGER"/>
    <result column="utr_win_num" property="winNum" jdbcType="INTEGER"/>
    <result column="utr_pre_commission_amount" property="commission" jdbcType="DECIMAL"/>
  </resultMap>
  <sql id="Base_Column_List">utlj_id,utlj_uid,utlj_goods_id,utlj_total_num,utlj_name,utlj_per_face,utlj_send_start_time,utlj_send_end_time,utlj_use_start_time,utlj_use_end_time,utlj_rights_id,utlj_send_url,utlj_create_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_user_taolijin_record where utlj_id = #{id,jdbcType=BIGINT}
  </select>
  <select id="getRecordByUid" resultMap="ResultVOMap">
      SELECT * FROM yeshi_ec_user_taolijin_record d
    LEFT JOIN yeshi_ec_user_taolijin_report p ON d.`utlj_rights_id` = p.`utr_id`
    WHERE d.`utlj_uid` = #{uid}
    ORDER BY d.`utlj_create_time` DESC
    LIMIT ${start},${count}
  </select>
  <select id="countRecordByUid" resultType="Long">
      SELECT IFNULL(COUNT(d.`utlj_id`),0) FROM yeshi_ec_user_taolijin_record d
    WHERE d.`utlj_uid` = #{uid}
  </select>
  <select id="countTodayNum" resultType="Long">
      SELECT  IFNULL(count(d.utlj_id),0) FROM `yeshi_ec_user_taolijin_record` d
    WHERE   d.`utlj_uid` = #{uid} AND TO_DAYS(d.`utlj_create_time`) = TO_DAYS(NOW());
  </select>
  <select id="getShareHongBaoByUidAndGoodsId" resultType="java.math.BigDecimal">
      SELECT utlj_per_face FROM `yeshi_ec_user_taolijin_record` d
    WHERE d.`utlj_uid` =#{uid}  AND d.`utlj_goods_id`=#{goodsId}
    LIMIT 1
  </select>
  <select id="getByRightsId" resultMap="ResultVOMap">
      SELECT * FROM `yeshi_ec_user_taolijin_record` d
    WHERE d.`utlj_rights_id` =#{rightsId}
    LIMIT 1
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_taolijin_record where utlj_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_taolijin_record (utlj_id,utlj_uid,utlj_goods_id,utlj_total_num,utlj_name,utlj_per_face,utlj_send_start_time,utlj_send_end_time,utlj_use_start_time,utlj_use_end_time,utlj_rights_id,utlj_send_url,utlj_create_time) values (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{goodsId,jdbcType=BIGINT},#{totalNum,jdbcType=INTEGER},#{name,jdbcType=VARCHAR},#{perFace,jdbcType=DECIMAL},#{sendStartTime,jdbcType=TIMESTAMP},#{sendEndTime,jdbcType=TIMESTAMP},#{useStartTime,jdbcType=TIMESTAMP},#{useEndTime,jdbcType=TIMESTAMP},#{rightsId,jdbcType=VARCHAR},#{sendUrl,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_taolijin_record
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">utlj_id,</if>
      <if test="uid != null">utlj_uid,</if>
      <if test="goodsId != null">utlj_goods_id,</if>
      <if test="totalNum != null">utlj_total_num,</if>
      <if test="name != null">utlj_name,</if>
      <if test="perFace != null">utlj_per_face,</if>
      <if test="sendStartTime != null">utlj_send_start_time,</if>
      <if test="sendEndTime != null">utlj_send_end_time,</if>
      <if test="useStartTime != null">utlj_use_start_time,</if>
      <if test="useEndTime != null">utlj_use_end_time,</if>
      <if test="rightsId != null">utlj_rights_id,</if>
      <if test="sendUrl != null">utlj_send_url,</if>
      <if test="createTime != null">utlj_create_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="goodsId != null">#{goodsId,jdbcType=BIGINT},</if>
      <if test="totalNum != null">#{totalNum,jdbcType=INTEGER},</if>
      <if test="name != null">#{name,jdbcType=VARCHAR},</if>
      <if test="perFace != null">#{perFace,jdbcType=DECIMAL},</if>
      <if test="sendStartTime != null">#{sendStartTime,jdbcType=TIMESTAMP},</if>
      <if test="sendEndTime != null">#{sendEndTime,jdbcType=TIMESTAMP},</if>
      <if test="useStartTime != null">#{useStartTime,jdbcType=TIMESTAMP},</if>
      <if test="useEndTime != null">#{useEndTime,jdbcType=TIMESTAMP},</if>
      <if test="rightsId != null">#{rightsId,jdbcType=VARCHAR},</if>
      <if test="sendUrl != null">#{sendUrl,jdbcType=VARCHAR},</if>
      <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinRecord">update yeshi_ec_user_taolijin_record set utlj_uid = #{uid,jdbcType=BIGINT},utlj_goods_id = #{goodsId,jdbcType=BIGINT},utlj_total_num = #{totalNum,jdbcType=INTEGER},utlj_name = #{name,jdbcType=VARCHAR},utlj_per_face = #{perFace,jdbcType=DECIMAL},utlj_send_start_time = #{sendStartTime,jdbcType=TIMESTAMP},utlj_send_end_time = #{sendEndTime,jdbcType=TIMESTAMP},utlj_use_start_time = #{useStartTime,jdbcType=TIMESTAMP},utlj_use_end_time = #{useEndTime,jdbcType=TIMESTAMP},utlj_rights_id = #{rightsId,jdbcType=VARCHAR},utlj_send_url = #{sendUrl,jdbcType=VARCHAR},utlj_create_time = #{createTime,jdbcType=TIMESTAMP} where utlj_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinRecord">update yeshi_ec_user_taolijin_record
    <set>
      <if test="uid != null">utlj_uid=#{uid,jdbcType=BIGINT},</if>
      <if test="goodsId != null">utlj_goods_id=#{goodsId,jdbcType=BIGINT},</if>
      <if test="totalNum != null">utlj_total_num=#{totalNum,jdbcType=INTEGER},</if>
      <if test="name != null">utlj_name=#{name,jdbcType=VARCHAR},</if>
      <if test="perFace != null">utlj_per_face=#{perFace,jdbcType=DECIMAL},</if>
      <if test="sendStartTime != null">utlj_send_start_time=#{sendStartTime,jdbcType=TIMESTAMP},</if>
      <if test="sendEndTime != null">utlj_send_end_time=#{sendEndTime,jdbcType=TIMESTAMP},</if>
      <if test="useStartTime != null">utlj_use_start_time=#{useStartTime,jdbcType=TIMESTAMP},</if>
      <if test="useEndTime != null">utlj_use_end_time=#{useEndTime,jdbcType=TIMESTAMP},</if>
      <if test="rightsId != null">utlj_rights_id=#{rightsId,jdbcType=VARCHAR},</if>
      <if test="sendUrl != null">utlj_send_url=#{sendUrl,jdbcType=VARCHAR},</if>
      <if test="createTime != null">utlj_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
    </set> where utlj_id = #{id,jdbcType=BIGINT}
  </update>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/tlj/UserTaoLiJinReportMapper.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.tlj.UserTaoLiJinReportMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinReport">
    <id column="utr_id" property="id" jdbcType="VARCHAR"/>
    <result column="utr_unfreeze_amount" property="unfreezeAmount" jdbcType="DECIMAL"/>
    <result column="utr_unfreeze_num" property="unfreezeNum" jdbcType="INTEGER"/>
    <result column="utr_refund_amount" property="refundAmount" jdbcType="DECIMAL"/>
    <result column="utr_refund_num" property="refundNum" jdbcType="INTEGER"/>
    <result column="utr_alipay_amount" property="alipayAmount" jdbcType="DECIMAL"/>
    <result column="utr_use_amount" property="useAmount" jdbcType="DECIMAL"/>
    <result column="utr_use_num" property="useNum" jdbcType="INTEGER"/>
    <result column="utr_win_amount" property="winAmount" jdbcType="DECIMAL"/>
    <result column="utr_win_num" property="winNum" jdbcType="INTEGER"/>
    <result column="utr_pre_commission_amount" property="preCommissionAmount" jdbcType="DECIMAL"/>
    <result column="utr_create_time" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="utr_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
  </resultMap>
  <sql id="Base_Column_List">utr_id,utr_unfreeze_amount,utr_unfreeze_num,utr_refund_amount,utr_refund_num,utr_alipay_amount,utr_use_amount,utr_use_num,utr_win_amount,utr_win_num,utr_pre_commission_amount,utr_create_time,utr_update_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_user_taolijin_report where utr_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_taolijin_report where utr_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinReport" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_taolijin_report (utr_id,utr_unfreeze_amount,utr_unfreeze_num,utr_refund_amount,utr_refund_num,utr_alipay_amount,utr_use_amount,utr_use_num,utr_win_amount,utr_win_num,utr_pre_commission_amount,utr_create_time,utr_update_time) values (#{id,jdbcType=VARCHAR},#{unfreezeAmount,jdbcType=DECIMAL},#{unfreezeNum,jdbcType=INTEGER},#{refundAmount,jdbcType=DECIMAL},#{refundNum,jdbcType=INTEGER},#{alipayAmount,jdbcType=DECIMAL},#{useAmount,jdbcType=DECIMAL},#{useNum,jdbcType=INTEGER},#{winAmount,jdbcType=DECIMAL},#{winNum,jdbcType=INTEGER},#{preCommissionAmount,jdbcType=DECIMAL},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinReport" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_taolijin_report
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">utr_id,</if>
      <if test="unfreezeAmount != null">utr_unfreeze_amount,</if>
      <if test="unfreezeNum != null">utr_unfreeze_num,</if>
      <if test="refundAmount != null">utr_refund_amount,</if>
      <if test="refundNum != null">utr_refund_num,</if>
      <if test="alipayAmount != null">utr_alipay_amount,</if>
      <if test="useAmount != null">utr_use_amount,</if>
      <if test="useNum != null">utr_use_num,</if>
      <if test="winAmount != null">utr_win_amount,</if>
      <if test="winNum != null">utr_win_num,</if>
      <if test="preCommissionAmount != null">utr_pre_commission_amount,</if>
      <if test="createTime != null">utr_create_time,</if>
      <if test="updateTime != null">utr_update_time,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=VARCHAR},</if>
      <if test="unfreezeAmount != null">#{unfreezeAmount,jdbcType=DECIMAL},</if>
      <if test="unfreezeNum != null">#{unfreezeNum,jdbcType=INTEGER},</if>
      <if test="refundAmount != null">#{refundAmount,jdbcType=DECIMAL},</if>
      <if test="refundNum != null">#{refundNum,jdbcType=INTEGER},</if>
      <if test="alipayAmount != null">#{alipayAmount,jdbcType=DECIMAL},</if>
      <if test="useAmount != null">#{useAmount,jdbcType=DECIMAL},</if>
      <if test="useNum != null">#{useNum,jdbcType=INTEGER},</if>
      <if test="winAmount != null">#{winAmount,jdbcType=DECIMAL},</if>
      <if test="winNum != null">#{winNum,jdbcType=INTEGER},</if>
      <if test="preCommissionAmount != null">#{preCommissionAmount,jdbcType=DECIMAL},</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.bus.tlj.UserTaoLiJinReport">update yeshi_ec_user_taolijin_report set utr_unfreeze_amount = #{unfreezeAmount,jdbcType=DECIMAL},utr_unfreeze_num = #{unfreezeNum,jdbcType=INTEGER},utr_refund_amount = #{refundAmount,jdbcType=DECIMAL},utr_refund_num = #{refundNum,jdbcType=INTEGER},utr_alipay_amount = #{alipayAmount,jdbcType=DECIMAL},utr_use_amount = #{useAmount,jdbcType=DECIMAL},utr_use_num = #{useNum,jdbcType=INTEGER},utr_win_amount = #{winAmount,jdbcType=DECIMAL},utr_win_num = #{winNum,jdbcType=INTEGER},utr_pre_commission_amount = #{preCommissionAmount,jdbcType=DECIMAL},utr_create_time = #{createTime,jdbcType=TIMESTAMP},utr_update_time = #{updateTime,jdbcType=TIMESTAMP} where utr_id = #{id,jdbcType=VARCHAR}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinReport">update yeshi_ec_user_taolijin_report
    <set>
      <if test="unfreezeAmount != null">utr_unfreeze_amount=#{unfreezeAmount,jdbcType=DECIMAL},</if>
      <if test="unfreezeNum != null">utr_unfreeze_num=#{unfreezeNum,jdbcType=INTEGER},</if>
      <if test="refundAmount != null">utr_refund_amount=#{refundAmount,jdbcType=DECIMAL},</if>
      <if test="refundNum != null">utr_refund_num=#{refundNum,jdbcType=INTEGER},</if>
      <if test="alipayAmount != null">utr_alipay_amount=#{alipayAmount,jdbcType=DECIMAL},</if>
      <if test="useAmount != null">utr_use_amount=#{useAmount,jdbcType=DECIMAL},</if>
      <if test="useNum != null">utr_use_num=#{useNum,jdbcType=INTEGER},</if>
      <if test="winAmount != null">utr_win_amount=#{winAmount,jdbcType=DECIMAL},</if>
      <if test="winNum != null">utr_win_num=#{winNum,jdbcType=INTEGER},</if>
      <if test="preCommissionAmount != null">utr_pre_commission_amount=#{preCommissionAmount,jdbcType=DECIMAL},</if>
      <if test="createTime != null">utr_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updateTime != null">utr_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
    </set> where utr_id = #{id,jdbcType=VARCHAR}
  </update>
  <select id="needUpdateReport" resultMap="BaseResultMap">
      SELECT * FROM  yeshi_ec_user_taolijin_report t
    WHERE DATE_SUB(CURDATE(), INTERVAL 3 DAY) <![CDATA[<=]]>DATE(t.`utr_create_time`)
  </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserInfoExtraMapper.xml
@@ -45,6 +45,29 @@
          
  </resultMap>
  
  <resultMap id="AllResultMap" type="com.yeshi.fanli.entity.bus.user.UserInfoExtra">
  <id column="uie_id" property="id" jdbcType="BIGINT"/>
    <result column="uie_rank_source" property="rankSource" jdbcType="INTEGER"/>
    <result column="uie_rank_order_num" property="rankOrderNum" jdbcType="INTEGER"/>
    <result column="uie_rank_update_time" property="rankUpdateTime" jdbcType="TIMESTAMP"/>
    <result column="uie_invite_code" property="inviteCode" jdbcType="VARCHAR"/>
    <result column="uie_lottery_newbies" property="lotteryNewbies" jdbcType="INTEGER"/>
    <result column="uie_coupon_news" property="couponNews" jdbcType="INTEGER"/>
    <result column="uie_synch_navbar" property="synchNavbar" jdbcType="VARCHAR"/>
    <result column="uie_first_login_time" property="firstLoginTime" jdbcType="TIMESTAMP"/>
    <result column="uie_create_time" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="uie_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
    <association property="userInfo" column="uie_uid" javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
        <id column="uie_uid" property="id" jdbcType="BIGINT" />
    </association>
    <association property="userRank" column="uie_rank_id"
         resultMap="com.yeshi.fanli.dao.mybatis.user.UserRankMapper.BaseResultMap"/>
  </resultMap>
  <sql id="Base_Column_List">uie_id,uie_uid,uie_rank_id,uie_rank_source,uie_rank_order_num,uie_rank_update_time,uie_invite_code,uie_lottery_newbies,uie_coupon_news,uie_synch_navbar,uie_first_login_time,uie_create_time,uie_update_time</sql>
 
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
@@ -140,5 +163,9 @@
        WHERE  t.`uie_rank_id` = #{rankId}
   </select>
    
   <select id="gerUserRank" resultMap="AllResultMap">
        SELECT * FROM yeshi_ec_user_info_extra ue
        LEFT JOIN yeshi_ec_user_rank rk ON rk.`ur_id` = ue.`uie_rank_id`
        WHERE ue.`uie_uid` = #{uid}
   </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserMoneyExtraMapper.xml
New file
@@ -0,0 +1,43 @@
<?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.user.UserMoneyExtraMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.UserMoneyExtra">
    <id column="um_uid" property="uid" jdbcType="BIGINT"/>
    <result column="um_tlj" property="tlj" jdbcType="DECIMAL"/>
    <result column="um_tlj_self" property="tljSelf" jdbcType="DECIMAL"/>
    <result column="um_create_time" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="um_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
  </resultMap>
  <sql id="Base_Column_List">um_uid,um_tlj,um_tlj_self,um_create_time,um_update_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_user_money_extra where um_uid = #{uid,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_money_extra where um_uid = #{uid,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserMoneyExtra" useGeneratedKeys="true" keyProperty="uid">insert into yeshi_ec_user_money_extra (um_uid,um_tlj,um_tlj_self,um_create_time,um_update_time) values (#{uid,jdbcType=BIGINT},#{tlj,jdbcType=DECIMAL},#{tljSelf,jdbcType=DECIMAL},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserMoneyExtra" useGeneratedKeys="true" keyProperty="uid">insert into yeshi_ec_user_money_extra
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="uid != null">um_uid,</if>
      <if test="tlj != null">um_tlj,</if>
      <if test="tljSelf != null">um_tlj_self,</if>
      <if test="createTime != null">um_create_time,</if>
      <if test="updateTime != null">um_update_time,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="uid != null">#{uid,jdbcType=BIGINT},</if>
      <if test="tlj != null">#{tlj,jdbcType=DECIMAL},</if>
      <if test="tljSelf != null">#{tljSelf,jdbcType=DECIMAL},</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.bus.user.UserMoneyExtra">update yeshi_ec_user_money_extra set um_tlj = #{tlj,jdbcType=DECIMAL},um_tlj_self = #{tljSelf,jdbcType=DECIMAL},um_create_time = #{createTime,jdbcType=TIMESTAMP},um_update_time = #{updateTime,jdbcType=TIMESTAMP} where um_uid = #{uid,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.UserMoneyExtra">update yeshi_ec_user_money_extra
    <set>
      <if test="tlj != null">um_tlj=#{tlj,jdbcType=DECIMAL},</if>
      <if test="tljSelf != null">um_tlj_self=#{tljSelf,jdbcType=DECIMAL},</if>
      <if test="createTime != null">um_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updateTime != null">um_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
    </set> where um_uid = #{uid,jdbcType=BIGINT}
  </update>
</mapper>
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsClassServiceImpl.java
@@ -81,9 +81,9 @@
    }
    @Override
    public List<GoodsClass> listquery() throws Exception {
    public List<GoodsClass> listquery(Integer sex) throws Exception {
        List<GoodsClass> list = goodsClassMapper.getGoodsClassAll();
        List<GoodsClass> list = goodsClassMapper.getGoodsClassAll(sex);
        if (list != null && list.size() == 0) {
            return list;
@@ -135,7 +135,7 @@
    }
    public List<GoodsClass> getGoodsClassAll() {
        return goodsClassMapper.getGoodsClassAll();
        return goodsClassMapper.getGoodsClassAll(null);
    }
    @Override
@@ -146,7 +146,12 @@
        if (name == null || name.trim().length() == 0) {
            throw new GoodsClassException(1, "分类名称不能为空");
        }
        Integer sex = record.getSex();
        if (sex == null) {
            throw new GoodsClassException(1, "性别设置不能为空");
        }
        // 图片上传
        String picture = null;
        if (file != null) {
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/ShareGoodsServiceImpl.java
@@ -24,7 +24,9 @@
import com.yeshi.fanli.dao.mybatis.UserShareGoodsHistoryMapper;
import com.yeshi.fanli.dao.mybatis.share.PidUserMapper;
import com.yeshi.fanli.entity.bus.share.UserShareGoodsHistory;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinRecord;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserMoneyExtra;
import com.yeshi.fanli.entity.taobao.PidUser;
import com.yeshi.fanli.entity.taobao.TBPid;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
@@ -33,14 +35,18 @@
import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
import com.yeshi.fanli.exception.ShareGoodsException;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
import com.yeshi.fanli.exception.tlj.UserTaoLiJinRecordException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
import com.yeshi.fanli.service.inter.tlj.GoodsTaoLiJinRateService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinRecordService;
import com.yeshi.fanli.service.inter.user.TBPidService;
import com.yeshi.fanli.service.inter.user.UserAccountService;
import com.yeshi.fanli.service.inter.user.UserMoneyExtraService;
import com.yeshi.fanli.service.inter.user.UserShareGoodsRecordService;
import com.yeshi.fanli.util.AESUtil;
import com.yeshi.fanli.util.Constant;
@@ -91,6 +97,16 @@
    @Resource
    private CommonGoodsService commonGoodsService;
    @Resource
    private UserMoneyExtraService userMoneyExtraService;
    @Resource
    private GoodsTaoLiJinRateService goodsTaoLiJinRateService;
    @Resource
    private UserTaoLiJinRecordService userTaoLiJinRecordService;
    @Override
    public void addShareGoodsHistory(UserShareGoodsHistory history) {
        UserShareGoodsHistory userShareGoodsHistory = userShareGoodsHistoryMapper
@@ -548,6 +564,7 @@
        return taoBaoLink;
    }
    @Override
    public UserShareGoodsHistory getShareGoodsHistory(Long uid, Long auctionId) {
        return userShareGoodsHistoryMapper.selectByUidAndAuctionId(uid, auctionId);
@@ -643,4 +660,130 @@
        return tbLink;
    }
    @Override
    public TaoBaoLink getTaoLiJinLinkForBuy(Long uid, String specialId, Long auctionId) throws ShareGoodsException {
        if (uid == null || uid <= 0) {
            throw new ShareGoodsException(1, "用户ID不能为空");
        }
        if (auctionId == null || auctionId <= 0) {
            throw new ShareGoodsException(2, "商品ID不能为空");
        }
        // 用户剩余可以淘礼金验证
        UserMoneyExtra userMoneyExtra = userMoneyExtraService.selectByPrimaryKey(uid);
        if (userMoneyExtra == null ||  userMoneyExtra.getTlj() == null) {
            throw new ShareGoodsException(101, "红包余额不足");
        }
        TaoKeAppInfo app = new TaoKeAppInfo();
        app.setAppKey(TaoBaoConstant.TAOBAO_AUTH_APPKEY);
        app.setAppSecret(TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
        app.setPid(TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT);
        TaoBaoGoodsBrief goods = TaoKeApiUtil.specialConvertCoupon(auctionId, app);
        if (goods == null) {
            throw new ShareGoodsException(1, "");
        }
        String taoLiJinLink = null;
        try {
             goods.setAuctionId(auctionId);
             UserTaoLiJinRecord createUserTaoLiJin = userTaoLiJinRecordService.createSelfBuyTaoLiJin(uid, 1, goods);
             taoLiJinLink = createUserTaoLiJin.getSendUrl();
        } catch (UserTaoLiJinRecordException e) {
            throw new ShareGoodsException(e.getCode(), e.getMsg());
        }
        TaoBaoLink taoBaoLink = new TaoBaoLink();
        taoBaoLink.setAuctionId(auctionId);
        taoBaoLink.setClickUrl(goods.getAuctionUrl());
        taoBaoLink.setCouponLink(taoLiJinLink);
        taoBaoLink.setGoods(goods);
        return taoBaoLink;
    }
    @Override
    public TaoBaoLink getTaoLiJinLinkForShare(Long uid, Long auctionId, String relationId) throws ShareGoodsException {
        if (uid == null || uid <= 0) {
            throw new ShareGoodsException(1, "用户ID不能为空");
        }
        if (auctionId == null || auctionId <= 0) {
            throw new ShareGoodsException(2, "商品ID不能为空");
        }
        TaoKeAppInfo info = new TaoKeAppInfo();
        if (!StringUtil.isNullOrEmpty(relationId)) {
            String pid = TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT;
            String appId = pid.split("_")[2];
            String adzoneId = pid.split("_")[3];
            TaoBaoUnionConfig taoBaoUnionConfig = taoBaoUnionConfigService.getConfigByAppIdCache(appId);
            info.setAdzoneId(adzoneId);
            info.setAppKey(taoBaoUnionConfig.getAppKey());
            info.setAppSecret(taoBaoUnionConfig.getAppSecret());
            info.setPid(pid);
        } else {
            TBPid tbPid = tbPidService.getTBPid(uid, PidUser.TYPE_SHARE_GOODS);
            if (tbPid == null) {
                throw new ShareGoodsException(3, "获取推广位失败");
            }
            String appId = tbPid.getPid().split("_")[2];
            TaoBaoUnionConfig taoBaoUnionConfig = taoBaoUnionConfigService.getConfigByAppIdCache(appId);
            String adzoneId = tbPid.getPid().split("_")[3];
            info.setAdzoneId(adzoneId);
            info.setAppKey(taoBaoUnionConfig.getAppKey());
            info.setAppSecret(taoBaoUnionConfig.getAppSecret());
            info.setPid(tbPid.getPid());
        }
        TaoBaoGoodsBrief goods = null;
        try {
            goods = TaoKeApiUtil.searchGoodsDetail(auctionId, info);
        } catch (TaobaoGoodsDownException e) {
            throw new ShareGoodsException(4, "商品已下架");
        } finally {
        }
        if (goods == null) {
            throw new ShareGoodsException(5, "获取商品详情失败");
        }
        if (StringUtil.isNullOrEmpty(goods.getCouponLink()) && !goods.getAuctionUrl().contains("s.click.taobao.com")) {
            TaoBaoUnionConfig taoBaoUnionConfig = taoBaoUnionConfigService
                    .getConfigByAppIdCache(info.getPid().split("_")[2]);
            TaoBaoGoodsBrief taoBaoLink = TaoKeApiUtil.specialConvertCoupon(auctionId, info);
            if (taoBaoLink == null) {
                throw new ShareGoodsException(201, "商品转链失败");
            }
            goods.setCouponLink(taoBaoLink.getCouponLink());
            goods.setAuctionUrl(taoBaoLink.getAuctionUrl());
        }
        if (!StringUtil.isNullOrEmpty(relationId)) {
            if (!StringUtil.isNullOrEmpty(goods.getAuctionUrl()))
                goods.setAuctionUrl(goods.getAuctionUrl() + "&relationId=" + relationId);
            if (!StringUtil.isNullOrEmpty(goods.getCouponLink()))
                goods.setCouponLink(goods.getCouponLink() + "&relationId=" + relationId);
        }
        // 保存商品详情
        // 创建淘口令
        TaoBaoLink tbLink = new TaoBaoLink();
        tbLink.setAuctionId(goods.getAuctionId());
        tbLink.setClickUrl(goods.getAuctionUrl());
        tbLink.setCouponLink(goods.getCouponLink());
        tbLink.setGoods(goods);
        // 存储分享商品的信息,用于加快分享网页接口请求速度
        if (Constant.IS_OUTNET)
            redisManager.saveTaoBaoGoodsBriefTemp(goods);
        return tbLink;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/ShareGoodsTextTemplateServiceImpl.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.service.impl.goods;
import java.math.BigDecimal;
import java.util.Date;
import javax.annotation.Resource;
@@ -7,7 +8,6 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.yeshi.utils.BigDecimalUtil;
import org.yeshi.utils.HttpUtil;
import com.yeshi.fanli.dao.mybatis.goods.ShareGoodsTextTemplateMapper;
import com.yeshi.fanli.entity.goods.ShareGoodsTextTemplate;
@@ -15,11 +15,8 @@
import com.yeshi.fanli.exception.goods.ShareGoodsTextTemplateException;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.goods.ShareGoodsTextTemplateService;
import com.yeshi.fanli.util.AESUtil;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.service.inter.tlj.GoodsTaoLiJinRateService;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
/**
 * 分享商品模板
@@ -35,6 +32,9 @@
    @Resource
    private ConfigService configService;
    @Resource
    private GoodsTaoLiJinRateService goodsTaoLiJinRateService;
    @Override
    public void saveCommonTemplate(Long uid, String template) throws ShareGoodsTextTemplateException {
@@ -67,7 +67,9 @@
    @Transactional
    @Override
    public void saveCouponTemplate(Long uid, String template) throws ShareGoodsTextTemplateException {
        isCouponTemplateRight(template);
        // 格式验证
        isTaoLiJinTemplateRight(template);
        ShareGoodsTextTemplate old = shareGoodsTextTemplateMapper.selectByUid(uid);
        if (old != null) {
            ShareGoodsTextTemplate update = new ShareGoodsTextTemplate();
@@ -82,9 +84,32 @@
            textTemplate.setUid(uid);
            shareGoodsTextTemplateMapper.insertSelective(textTemplate);
        }
    }
    @Transactional
    @Override
    public void saveTaoLiJinTemplate(Long uid, String template) throws ShareGoodsTextTemplateException {
        isCouponTemplateRight(template);
        ShareGoodsTextTemplate old = shareGoodsTextTemplateMapper.selectByUid(uid);
        if (old != null) {
            ShareGoodsTextTemplate update = new ShareGoodsTextTemplate();
            update.setId(old.getId());
            update.setShareTaoLiJinTextTemplate(template);
            update.setUpdateTime(new Date());
            shareGoodsTextTemplateMapper.updateByPrimaryKeySelective(update);
        } else {
            ShareGoodsTextTemplate textTemplate = new ShareGoodsTextTemplate();
            textTemplate.setCreateTime(new Date());
            textTemplate.setShareTaoLiJinTextTemplate(template);
            textTemplate.setUid(uid);
            shareGoodsTextTemplateMapper.insertSelective(textTemplate);
        }
    }
    @Override
    public String geteCouponTemplate(Long uid) {
        ShareGoodsTextTemplate template = shareGoodsTextTemplateMapper.selectByUid(uid);
@@ -93,6 +118,15 @@
        return null;
    }
    @Override
    public String getTaoLiJinTemplate(Long uid) {
        ShareGoodsTextTemplate template = shareGoodsTextTemplateMapper.selectByUid(uid);
        if (template != null)
            return template.getShareTaoLiJinTextTemplate();
        return null;
    }
    @Override
    public void isCommonTemplateRight(String template) throws ShareGoodsTextTemplateException {
        String[] keys = new String[] { "{标题}", "{店铺类型}", "{商品原价}", "{月销量}", "{短链}", "{淘口令}" };
@@ -115,10 +149,32 @@
            throw new ShareGoodsTextTemplateException(1, "模板格式有误");
    }
    @Override
    public void isTaoLiJinTemplateRight(String template) throws ShareGoodsTextTemplateException {
        String[] keys = new String[] { "{标题}", "{店铺类型}", "{商品原价}", "{优惠券面额}", "{淘礼金面额}", "{优惠券价}", "{月销量}", "{领券短链}", "{淘口令}" };
        int keysCount = 0;
        for (String key : keys)
            if (template != null && template.contains(key))
                keysCount++;
        if (keysCount == 0)
            throw new ShareGoodsTextTemplateException(1, "模板格式有误");
    }
    @Override
    public String createContentByTemplate(String template, Long uid, TaoBaoGoodsBrief goods, String token,
            String shortLink, boolean hasCoupon) {
            String shortLink, boolean hasCoupon, Long tljId) {
        if (tljId != null) {
            BigDecimal spreadMoney = goodsTaoLiJinRateService.getGoodsSpreadMoney(goods);
            return template.replace("{标题}", goods.getTitle()).replace("{商品原价}", BigDecimalUtil.getWithNoZera( goods.getZkPrice()).toString())
                    .replace("{月销量}", TaoBaoUtil.getSaleCount(goods.getBiz30day())).replace("{领券短链}", shortLink)
                    .replace("{淘口令}", token).replace("{优惠券面额}", BigDecimalUtil.getWithNoZera(goods.getCouponAmount()).toString())
                    .replace("{淘礼金面额}", BigDecimalUtil.getWithNoZera(spreadMoney).toString()).replace("{优惠券价}", BigDecimalUtil.getWithNoZera( TaoBaoUtil.getAfterUseCouplePrice(goods)).toString())
                    .replace("{店铺类型}", goods.getUserType() == 1 ? "天猫价" : "淘宝价");
        }
        if (!hasCoupon) {
            return template.replace("{标题}", goods.getTitle()).replace("{商品原价}",  BigDecimalUtil.getWithNoZera(goods.getZkPrice()).toString())
                    .replace("{月销量}", TaoBaoUtil.getSaleCount(goods.getBiz30day())).replace("{短链}", shortLink)
@@ -158,4 +214,16 @@
        }
    }
    @Override
    public void resetTaoLijinTemplate(Long uid) {
        ShareGoodsTextTemplate template = shareGoodsTextTemplateMapper.selectByUid(uid);
        if (template != null) {
            ShareGoodsTextTemplate update = new ShareGoodsTextTemplate();
            update.setId(template.getId());
            update.setShareTaoLiJinTextTemplate("");
            update.setUpdateTime(new Date());
            shareGoodsTextTemplateMapper.updateByPrimaryKeySelective(update);
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/DeviceSexServiceImpl.java
New file
@@ -0,0 +1,76 @@
package com.yeshi.fanli.service.impl.homemodule;
import java.util.Date;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.user.DeviceSexDao;
import com.yeshi.fanli.entity.bus.homemodule.DeviceSex;
import com.yeshi.fanli.service.inter.homemodule.DeviceSexService;
import com.yeshi.fanli.util.StringUtil;
@Service
public class DeviceSexServiceImpl implements DeviceSexService {
    @Resource
    private DeviceSexDao deviceSexDao;
    @Override
    public void save(String device, Integer sex) {
        if (StringUtil.isNullOrEmpty(device) || sex == null) {
            return;
        }
        DeviceSex deviceSex = new DeviceSex();
        deviceSex.setId(device);
        deviceSex.setSex(sex);
        deviceSex.setCreateTime(new Date());
        deviceSexDao.save(deviceSex);
    }
    @Override
    public Integer getSex(String device) {
        DeviceSex deviceSex = deviceSexDao.get(device);
        if (deviceSex != null) {
            return deviceSex.getSex();
        }
        return null;
    }
    @Override
    public void deleteSex(String device) {
        deviceSexDao.delete(device);
    }
    @Override
    public int changeDeviceSex(Integer sex, String device) {
        if (sex == null || sex < 0 || sex > 2) {
            sex = 0;
        }
        Integer sexDevice = getSex(device);
        if (sexDevice == null) {
            sexDevice = 0;
        }
        if (sex == 0 && sexDevice != 0) {
            deleteSex(device);
        }
        if(sex > 0 && sex != sexDevice) {
            save(device, sex);
        }
        return sex;
    }
    @Override
    public int getDeviceSex(String device) {
        Integer sexDevice = getSex(device);
        if (sexDevice == null) {
            sexDevice = 0;
        }
        return sexDevice;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/FloatADServiceImpl.java
@@ -93,6 +93,10 @@
                record.setState(0);
            }
            
            Integer type = record.getType();
            if (type == null) {
                record.setType(0);
            }
            record.setOrder(maxOrder + 1);
            record.setCreateTime(new Date());
            record.setUpdateTime(new Date());
@@ -113,6 +117,7 @@
                record.setPicture(resultObj.getPicture());
            }
            
            record.setType(resultObj.getType());
            record.setOrder(resultObj.getOrder());
            record.setCreateTime(resultObj.getCreateTime());
            record.setUpdateTime(new Date());
@@ -258,8 +263,8 @@
    }
    @Override
    public FloatAD getEffectiveFloatAD(String position) {
        FloatAD floatAD = floatADMapper.getEffectiveFloatAD(position);
    public FloatAD getEffectiveFloatAD(String position, Integer type) {
        FloatAD floatAD = floatADMapper.getEffectiveFloatAD(position, type);
        if (floatAD != null) {
            JumpDetailV2 jumpDetail = floatAD.getJumpDetail();
            
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/HomeNavbarServiceImpl.java
@@ -73,14 +73,24 @@
            throw new HomeNavbarException(1, "控制时间不能为空");
        }
        
        Integer sex = null;
        NavbarTypeEnum type = record.getType();
        if (NavbarTypeEnum.category.equals(type)) {
            Long classId = record.getClassId();
            if (classId == null) {
                throw new HomeNavbarException(1, "请选择分类");
            }
            record.setUrl(null);
            
            GoodsClass goodsClass = goodsClassService.getGoodsClass(record.getClassId());
            if (goodsClass == null) {
                throw new HomeNavbarException(1, "分类不存在");
            }
            sex = goodsClass.getSex();
            if (sex == null) {
                throw new HomeNavbarException(1, "分类未指定适用版本");
            }
            record.setUrl(null);
        } else if(NavbarTypeEnum.weex.equals(type) || NavbarTypeEnum.web.equals(type)) {
            String url = record.getUrl();
            if (url == null || url.trim().length() == 0) {
@@ -115,8 +125,11 @@
            if (state == null) {
                record.setState(0);
            }
            int maxOrder = homeNavbarMapper.getMaxOrder();
            record.setOrderby(maxOrder + 1);
            record.setOrderby(homeNavbarMapper.getDefaultMaxOrder() + 1);
            record.setOrderMan(homeNavbarMapper.getManMaxOrder() + 1);
            record.setOrderWoman(homeNavbarMapper.getWomanMaxOrder() + 1);
            record.setIsFixed(false);//目前无固定项
            homeNavbarMapper.insert(record);
        } else {
@@ -136,14 +149,16 @@
            }
            
            record.setOrderby(resultObj.getOrderby());
            record.setOrderMan(resultObj.getOrderMan());
            record.setOrderWoman(resultObj.getOrderWoman());
            record.setCreatetime(resultObj.getCreatetime());
            record.setUpdatetime(new Date());
            record.setIsFixed(false);//目前无固定项
            homeNavbarMapper.updateByPrimaryKey(record);
        }
    }
    /**
     * 上传图片
     * @param file
@@ -208,7 +223,7 @@
    }
    
    @Override
    public void updateOrder(Long id, Integer moveType) throws HomeNavbarException, Exception{
    public void updateOrder(Long id, Integer moveType, Integer sex) throws HomeNavbarException, Exception{
        if (moveType == null || (!moveType.equals(1) && !moveType.equals(-1))) {
            throw new HomeNavbarException(1, "传递的类型不正确");
@@ -218,32 +233,54 @@
            throw new HomeNavbarException(1, "ID不能为空");
        }
        
        HomeNavbar resultObj = homeNavbarMapper.selectByPrimaryKey(id);
        if (resultObj == null) {
            throw new HomeNavbarException(1, "操作数据已不存在");
        }
            
        Integer oldOrder = resultObj.getOrderby();
        HomeNavbar changeObj = homeNavbarMapper.getChangeOrder(moveType, oldOrder);
        if (sex == null) {
            sex = GoodsClass.SEX_DEFAULT;
        }
        HomeNavbar changeObj = null;
        if (GoodsClass.SEX_ALL == sex || GoodsClass.SEX_DEFAULT == sex) {
            changeObj = homeNavbarMapper.getDefaultChangeOrder(moveType,  resultObj.getOrderby());
            if (changeObj == null ) {
                throw new HomeNavbarException(1, "已经在最边缘,无可交换的位置");
            }
            resultObj.setOrderby(changeObj.getOrderby());
            changeObj.setOrderby(resultObj.getOrderby());
        } else if (GoodsClass.SEX_MAN == sex) {
            changeObj = homeNavbarMapper.getManChangeOrder(moveType,  resultObj.getOrderMan());
            if (changeObj == null ) {
                throw new HomeNavbarException(1, "已经在最边缘,无可交换的位置");
            }
            resultObj.setOrderMan(changeObj.getOrderMan());
            changeObj.setOrderMan( resultObj.getOrderMan());
        } else if (GoodsClass.SEX_WOMAN == sex) {
            changeObj = homeNavbarMapper.getWomanChangeOrder(moveType,  resultObj.getOrderWoman());
            if (changeObj == null ) {
                throw new HomeNavbarException(1, "已经在最边缘,无可交换的位置");
            }
            resultObj.setOrderWoman(changeObj.getOrderWoman());
            changeObj.setOrderWoman( resultObj.getOrderWoman());
        }
        
        if (changeObj == null ) {
            throw new HomeNavbarException(1, "已经在最边缘,无可交换的位置");
            throw new HomeNavbarException(1, "无可交换的位置");
        }
        // 交换排序序号
        resultObj.setOrderby(changeObj.getOrderby());
        changeObj.setOrderby(oldOrder);
        
        homeNavbarMapper.updateByPrimaryKeySelective(changeObj);
        homeNavbarMapper.updateByPrimaryKeySelective(resultObj);
    }
    
    @Override
    public List<HomeNavbar> listQuery(long start, int count, String key) {
    public List<HomeNavbar> listQuery(long start, int count, String key, Integer sex) {
        
        List<HomeNavbar> listObj = homeNavbarMapper.listQuery(start, count, key);
        List<HomeNavbar> listObj = homeNavbarMapper.listQuery(start, count, key, sex);
        if (listObj == null || listObj.size() == 0) {
            return null;
        }
@@ -297,8 +334,8 @@
    }
    
    @Override
    public long countlistQuery(String key) {
        return homeNavbarMapper.countListQuery(key);
    public long countlistQuery(String key, Integer sex) {
        return homeNavbarMapper.countListQuery(key, sex);
    }
    @Override
@@ -309,9 +346,9 @@
    
    
    @Override
    @Cacheable(value = "configCache", key = "'listQueryDefaultNavbar'")
    public List<HomeNavbar> listQueryDefaultNavbar() {
        return homeNavbarMapper.listQueryDefaultNavbar();
    @Cacheable(value = "configCache", key = "'listQueryDefaultNavbar-'+#sex")
    public List<HomeNavbar> listQueryDefaultNavbar(Integer sex) {
        return homeNavbarMapper.listQueryDefaultNavbar(sex);
    }
    
    
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/HomeNavbarUserServiceImpl.java
@@ -30,57 +30,67 @@
    @Resource
    private UserInfoExtraService userInfoExtraService;
    @Override
    public List<HomeNavbar> listEffectiveNavbar(Long uid, String device) {
    public List<HomeNavbar> listEffectiveNavbar(Long uid, String device, Integer sex) {
        List<HomeNavbar> list = new ArrayList<HomeNavbar>();
        if (uid != null || !StringUtil.isNullOrEmpty(device)) {
            if (uid != null) {
                device = null;
            }
            // 自定义导航
            List<HomeNavbarUser> listUserNavbar = homeNavbarUserMapper.listEffectiveNavbars(uid, device);
            if (listUserNavbar != null && listUserNavbar.size() > 0) {
                // 固定导航
                List<HomeNavbar> listFixed = homeNavbarService.listQueryFixedNavbar();
                if (listFixed != null && listFixed.size() > 0) {
                    list.addAll(listFixed);
        if (sex == null || sex == 0) {
            if (uid != null || !StringUtil.isNullOrEmpty(device)) {
                if (uid != null) {
                    device = null;
                }
                // 自定义导航
                List<HomeNavbarUser> listUserNavbar = homeNavbarUserMapper.listEffectiveNavbars(uid, device);
                
                // 遍历用户自定义
                for (HomeNavbarUser uomeNavbarUser : listUserNavbar) {
                    HomeNavbar homeNavbar = uomeNavbarUser.getHomeNavbar();
                    if (homeNavbar == null) {
                        continue;
                    }
                    // 是否是固定项
                    boolean notExist = true;
                if (listUserNavbar != null && listUserNavbar.size() > 0) {
                    // 固定导航
                    List<HomeNavbar> listFixed = homeNavbarService.listQueryFixedNavbar();
                    if (listFixed != null && listFixed.size() > 0) {
                        long id = homeNavbar.getId();
                        for (HomeNavbar fixedbar : listFixed) {
                            long fixedId = fixedbar.getId();
                            if (fixedId == id) {
                                notExist = false;
                                listFixed.remove(fixedbar);
                                break;
                        list.addAll(listFixed);
                    }
                    // 遍历用户自定义
                    for (HomeNavbarUser uomeNavbarUser : listUserNavbar) {
                        HomeNavbar homeNavbar = uomeNavbarUser.getHomeNavbar();
                        if (homeNavbar == null) {
                            continue;
                        }
                        // 是否是固定项
                        boolean notExist = true;
                        if (listFixed != null && listFixed.size() > 0) {
                            long id = homeNavbar.getId();
                            for (HomeNavbar fixedbar : listFixed) {
                                long fixedId = fixedbar.getId();
                                if (fixedId == id) {
                                    notExist = false;
                                    listFixed.remove(fixedbar);
                                    break;
                                }
                            }
                        }
                    }
                    if (notExist) {
                        list.add(homeNavbar);
                        if (notExist) {
                            list.add(homeNavbar);
                        }
                    }
                }
            }
        }
        if (list.size() == 0) {
            list = homeNavbarService.listQueryDefaultNavbar();
            if (list.size() == 0) {
                List<HomeNavbar> listDefault = homeNavbarService.listQueryDefaultNavbar(sex);
                if (listDefault != null) {
                    list.addAll(listDefault);
                }
            }
        } else {
            List<HomeNavbar> listDefault = homeNavbarService.listQueryDefaultNavbar(sex);
            if (listDefault != null) {
                list.addAll(listDefault);
            }
        }
        return list;
    }
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialCardServiceImpl.java
@@ -184,7 +184,7 @@
        }
        
        for (SpecialCard specialCard: listObj) {
            long totalSpecial= specialService.countlistQueryByCard(specialCard.getId(), null);
            long totalSpecial= specialService.countlistQueryByCard(specialCard.getId(), null, null);
            specialCard.setTotalSpecial(totalSpecial);
            
            Date startTime = specialCard.getStartTime();
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java
@@ -68,7 +68,12 @@
        if (name == null || name.trim().length() == 0) {
            throw new SpecialException(1, "专题名称不能为空");
        }
        Integer sex = record.getSex();
        if (sex == null) {
            throw new SpecialException(1, "性别不能为空");
        }
        String params = record.getParams();
        if (params == null || params.trim().length() == 0 || "null".equalsIgnoreCase(params)) {
            record.setParams(null);
@@ -76,6 +81,8 @@
            throw new SpecialException(1, "跳转参数非JSON格式");
        }
        if (!StringUtil.isNullOrEmpty(jumpType)) {
            List<JumpDetailV2> listByType = jumpDetailV2Service.listByType(jumpType);
            if (listByType != null && listByType.size() > 0) {
@@ -111,10 +118,12 @@
            record.setIcon(icon);
            record.setPicture(picture);
            record.setSubPicture(subPicture);
            int maxOrder = specialMapper.getMaxOrderByCard(cardId);
            record.setOrderby(maxOrder + 1);
            // 排序
            record.setOrderby(specialMapper.getDefaultMaxOrder(cardId) + 1);
            record.setOrderMan(specialMapper.getManMaxOrder(cardId) + 1);
            record.setOrderWoman(specialMapper.getWomanMaxOrder(cardId) + 1);
            record.setCreatetime(new Date());
            record.setUpdatetime(new Date());
            specialMapper.insert(record);
@@ -168,9 +177,12 @@
            } else {
                record.setIcon(resultObj.getIcon());
            }
            record.setOrderby(resultObj.getOrderby());
            record.setOrderMan(resultObj.getOrderMan());
            record.setOrderWoman(resultObj.getOrderWoman());
            record.setCreatetime(resultObj.getCreatetime());
            record.setUpdatetime(new Date());
            specialMapper.updateByPrimaryKey(record);
        }
@@ -212,9 +224,9 @@
    @Override
    @Transactional
    public void updateOrder(Long id, Integer moveType) throws SpecialException {
    public void updateOrder(Long id, Integer moveType, Integer sex) throws SpecialException {
        if (id == null || moveType == null || (!moveType.equals(1) && !moveType.equals(-1))) {
        if (id == null || moveType == null || (!moveType.equals(1) && !moveType.equals(-1)) || sex == null) {
            throw new SpecialException(1, "请传递正确参数");
        }
@@ -223,22 +235,41 @@
            throw new SpecialException(1, "此内容已不存在");
        }
        Integer order = resultObj.getOrderby();
        Long cardId = resultObj.getCardId();
        // 获取交换对象
        Special exchangeObject = specialMapper.getOrderByCardID(cardId, moveType, order);
        if (exchangeObject == null) {
            if (moveType == 1) {
                throw new SpecialException(1, "在相同使用地方中优先级已经最低了");
            } else {
                throw new SpecialException(1, "在相同使用地方中优先级已经最高了");
        Special exchangeObject = null;
        if (Special.SEX_ALL == sex || Special.SEX_DEFAULT == sex) {
            Integer orderby = resultObj.getOrderby();
            exchangeObject = specialMapper.getOrderByCardID(cardId, moveType, orderby, sex);
            if (exchangeObject == null) {
                throw new SpecialException(1, "没有找到可交换的位置");
            }
            resultObj.setOrderby(exchangeObject.getOrderby());
            exchangeObject.setOrderby(orderby);
        } else if (Special.SEX_MAN == sex ) {
            Integer orderMan = resultObj.getOrderMan();
            exchangeObject = specialMapper.getOrderByCardID(cardId, moveType, orderMan, sex);
            if (exchangeObject == null) {
                throw new SpecialException(1, "没有找到可交换的位置");
            }
            resultObj.setOrderMan(exchangeObject.getOrderMan());
            exchangeObject.setOrderMan(orderMan);
        } else if (Special.SEX_WOMAN == sex ) {
            Integer orderWoman = resultObj.getOrderWoman();
            exchangeObject = specialMapper.getOrderByCardID(cardId, moveType, orderWoman, sex);
            if (exchangeObject == null) {
                throw new SpecialException(1, "没有找到可交换的位置");
            }
            resultObj.setOrderWoman(exchangeObject.getOrderWoman());
            exchangeObject.setOrderWoman(orderWoman);
        } else {
            throw new SpecialException(1, "sex参数不正确");
        }
        resultObj.setOrderby(exchangeObject.getOrderby());
        exchangeObject.setOrderby(order);
        specialMapper.updateByPrimaryKey(resultObj);
        specialMapper.updateByPrimaryKey(exchangeObject);
    }
@@ -280,9 +311,9 @@
    }
    @Override
    public List<Special> listQueryByCard(long start, int count, Long card, String key) {
    public List<Special> listQueryByCard(long start, int count, Long card, String key, Integer sex) {
        List<Special> list = specialMapper.listQueryByCard(start, count, card, key);
        List<Special> list = specialMapper.listQueryByCard(start, count, card, key, sex);
        if (list == null || list.size() == 0) {
            return list;
        }
@@ -312,33 +343,34 @@
    }
    @Override
    public long countlistQueryByCard(Long card, String key) {
        return specialMapper.countlistQueryByCard(card, key);
    public long countlistQueryByCard(Long card, String key, Integer sex) {
        return specialMapper.countlistQueryByCard(card, key, sex);
    }
    @Override
    @Cacheable(value = "configCache", key = "'listBySystemAndCard-'+#card+'-'+#systemId")
    @Cacheable(value = "specialCache", key = "'listBySystemAndCard-'+#card+'-'+#systemId")
    public List<Special> listBySystemAndCard(String card, Long systemId) {
        return specialMapper.listBySystemAndCard(card, systemId);
    }
    @Override
    @Cacheable(value = "configCache", key = "'listPageBySystemAndCard-'+#start+'-'+#count+'-'+#card+'-'+#systemId")
    @Cacheable(value = "specialCache", key = "'listPageBySystemAndCard-'+#start+'-'+#count+'-'+#card+'-'+#systemId")
    public List<Special> listPageBySystemAndCard(long start, int count, String card, Long systemId) {
        return specialMapper.listPageBySystemAndCard(start, count, card, systemId);
    }
    @Override
    @Cacheable(value = "configCache", key = "'listCacheSpecialToIndex'+#acceptData.platform+'-'+#acceptData.version")
    public JSONObject listCacheSpecialToIndex(AcceptData acceptData) throws Exception {
    @Cacheable(value = "specialCache", key = "'listCacheSpecialToIndex'+#acceptData.platform+'-'+#acceptData.version+'-'+#sex")
    public JSONObject listCacheSpecialToIndex(AcceptData acceptData, Integer sex) throws Exception {
        // 首页-5圆形2排区域
        JSONObject arcMap = new JSONObject();
        String indexArc = "index_arc";
        if (VersionUtil.greaterThan_1_5_60(acceptData.getPlatform(), acceptData.getVersion()))
            indexArc = "index_arc_1.5.6";
        List<Special> listArc = specialMapper.listByPlaceKey(indexArc);
        List<Special> listArc = specialMapper.listByPlaceKey(indexArc, sex);
        if (listArc == null) {
            listArc = new ArrayList<Special>();
        } else if (listArc.size() > 0) {
@@ -373,7 +405,7 @@
                && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()))) {
            // 如果IOS当前版本处于审核状态就不返回
        } else {
            listActivity = specialMapper.listByPlaceKey("index_activity");
            listActivity = specialMapper.listByPlaceKey("index_activity", null);
        }
        if (listActivity == null) {
@@ -396,7 +428,7 @@
            indexBlock = "index_block_1.5.6";
        JSONObject blockJsonMap = new JSONObject();
        List<Special> listBlock = specialMapper.listByPlaceKey(indexBlock);
        List<Special> listBlock = specialMapper.listByPlaceKey(indexBlock, sex);
        if (listBlock == null) {
            listBlock = new ArrayList<Special>();
        } else if (listBlock.size() > 0) {
@@ -407,6 +439,7 @@
            }
        }
        // 品牌券
        // >=1.5.40后的版本可以用
        if (("android".equalsIgnoreCase(acceptData.getPlatform()) && Integer.parseInt(acceptData.getVersion()) > 39)
@@ -431,7 +464,7 @@
    @Override
    public List<Special> listByPlaceKey(String placeKey) {
        return specialMapper.listByPlaceKey(placeKey);
        return specialMapper.listByPlaceKey(placeKey, null);
    }
    /**
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/ThreeSaleSerivceImpl.java
@@ -17,10 +17,12 @@
import com.yeshi.fanli.entity.bus.user.ThreeSaleExtraInfo;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.exception.ThreeSaleException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
import com.yeshi.fanli.service.inter.msg.MsgInviteDetailService;
import com.yeshi.fanli.service.inter.msg.UserInviteMsgNotificationService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
@@ -49,6 +51,10 @@
    @Resource
    private MsgInviteDetailService msgInviteDetailService;
    @Resource
    private UserTaoLiJinOriginService userTaoLiJinOriginService;
    public UserInfo getBoss(final long uid) {
        return threeSaleMapper.selectBoss(uid);
@@ -519,6 +525,20 @@
        // 邀请消息
        userInviteMsgNotificationService.inviteSuccess(inviter.getId(), threeSale);
        // 奖励淘礼金红包
        try {
            String inviteName= invitee.getNickName();
            if (StringUtil.isNullOrEmpty(inviteName)) {
                UserInfo userInfo = userInfoService.selectByPKey(invitee.getId());
                if (userInfo != null) {
                    inviteName= userInfo.getNickName();
                }
            }
            userTaoLiJinOriginService.addInviteWinMoney(inviter.getId(), inviteName);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    @Override
@@ -572,6 +592,21 @@
        ThreeSaleCMQManager.getInstance().addThreeSaleMsg(threeSale);
        // 邀请消息
        userInviteMsgNotificationService.inviteSuccess(threeSale.getBoss().getId(), threeSale);
        // 奖励淘礼金红包
        try {
            String inviteName= invitee.getNickName();
            if (StringUtil.isNullOrEmpty(inviteName)) {
                UserInfo userInfo = userInfoService.selectByPKey(invitee.getId());
                if (userInfo != null) {
                    inviteName= userInfo.getNickName();
                }
            }
            userTaoLiJinOriginService.addInviteWinMoney(inviterId, inviteName);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    
    /**
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/MsgOtherDetailServiceImpl.java
@@ -27,7 +27,6 @@
    @Override
    public void addMsgOtherDetail(MsgOtherDetail detail) throws MsgOtherDetailException {
        if (detail.getType() == MsgTypeOtherTypeEnum.couponMianDan
                || detail.getType() == MsgTypeOtherTypeEnum.couponReward
                || detail.getType() == MsgTypeOtherTypeEnum.couponWelfareMianDan) {
@@ -38,6 +37,9 @@
                detail.setCreateTime(new Date());
            msgOtherDetailMapper.insertSelective(detail);
            userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
        } else if (detail.getType() == MsgTypeOtherTypeEnum.taoLiJin) {
            msgOtherDetailMapper.insertSelective(detail);
            userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
        }
    }
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java
@@ -1,13 +1,16 @@
package com.yeshi.fanli.service.impl.msg;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.google.gson.Gson;
import com.yeshi.fanli.dto.msg.MsgOtherCouponContentDTO;
import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
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;
@@ -282,4 +285,21 @@
        }
    }
    @Override
    public void taoLiJinMsg(Long uid, String beiZhu, MsgOtherTaoLiJinContentDTO content) {
        try {
            MsgOtherDetail detail = new MsgOtherDetail();
            detail.setBeiZhu(beiZhu);
            detail.setCreateTime(new Date());
            detail.setRead(false);
            detail.setUser(new UserInfo(uid));
            detail.setContent(new Gson().toJson(content));
            detail.setType(MsgTypeOtherTypeEnum.taoLiJin);
            msgOtherDetailService.addMsgOtherDetail(detail);
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/ConfigTaoLiJinServiceImpl.java
New file
@@ -0,0 +1,36 @@
package com.yeshi.fanli.service.impl.tlj;
import javax.annotation.Resource;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.tlj.ConfigTaoLiJinMapper;
import com.yeshi.fanli.entity.bus.tlj.ConfigTaoLiJin;
import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
@Service
public class ConfigTaoLiJinServiceImpl implements ConfigTaoLiJinService{
    @Resource
    private ConfigTaoLiJinMapper configTaoLiJinMapper;
    @Override
    public ConfigTaoLiJin getByKey(String key) {
        return configTaoLiJinMapper.getByKey(key);
    }
    @Override
    @Cacheable(value = "config", key = "'getValueByKey-' + #key")
    public String getValueByKey(String key) {
        ConfigTaoLiJin config = configTaoLiJinMapper.getByKey(key);
        if(config != null) {
            return config.getValue();
        }
        return null;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/DeviceTaoLiJinRecordServiceImpl.java
New file
@@ -0,0 +1,36 @@
package com.yeshi.fanli.service.impl.tlj;
import java.math.BigDecimal;
import java.util.Date;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.tlj.DeviceTaoLiJinRecordDao;
import com.yeshi.fanli.entity.bus.tlj.DeviceTaoLiJinRecord;
import com.yeshi.fanli.service.inter.tlj.DeviceTaoLiJinRecordService;
@Service
public class DeviceTaoLiJinRecordServiceImpl implements DeviceTaoLiJinRecordService{
    @Resource
    private DeviceTaoLiJinRecordDao deviceTaoLiJinRecordDao;
    @Override
    public DeviceTaoLiJinRecord getByDevice(String device) {
        return deviceTaoLiJinRecordDao.get(device);
    }
    @Override
    public void save(String device, BigDecimal money) {
        DeviceTaoLiJinRecord deviceRecord = new DeviceTaoLiJinRecord();
        deviceRecord.setId(device);
        deviceRecord.setMoney(money);
        deviceRecord.setCreateTime(new Date());
        deviceTaoLiJinRecordDao.save(deviceRecord);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/GoodsTaoLiJinRateServiceImpl.java
New file
@@ -0,0 +1,64 @@
package com.yeshi.fanli.service.impl.tlj;
import java.math.BigDecimal;
import java.util.Date;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.tlj.GoodsTaoLiJinRateDao;
import com.yeshi.fanli.entity.bus.tlj.GoodsTaoLiJinRate;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
import com.yeshi.fanli.service.inter.tlj.GoodsTaoLiJinRateService;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
@Service
public class GoodsTaoLiJinRateServiceImpl implements GoodsTaoLiJinRateService{
    @Resource
    private GoodsTaoLiJinRateDao goodsTaoLiJinRateDao;
    @Resource
    private ConfigTaoLiJinService configTaoLiJinService;
    @Override
    public GoodsTaoLiJinRate getById(Long goodId) {
        return goodsTaoLiJinRateDao.get(goodId.toString());
    }
    @Override
    public BigDecimal getGoodsSpreadMoney(TaoBaoGoodsBrief goods){
        // 商品本身的总返利
        BigDecimal goodsHongBao = TaoBaoUtil.getGoodsHongBaoMoney(goods,new BigDecimal(100));
        // 随机比例  % {5、6、7、8}
        int randomRate = 5;
        GoodsTaoLiJinRate taoLiJinRate = getById(goods.getAuctionId());
        if (taoLiJinRate == null) {
            randomRate = 5 + (int) (Math.random() * 4);
            taoLiJinRate = new GoodsTaoLiJinRate();
            taoLiJinRate.setGoodId(goods.getAuctionId().toString());
            taoLiJinRate.setRate(randomRate);
            taoLiJinRate.setCreateTime(new Date());
            taoLiJinRate.setUpdateTime(new Date());
            goodsTaoLiJinRateDao.save(taoLiJinRate);
        } else {
            randomRate = taoLiJinRate.getRate();
        }
        BigDecimal spreadMoney = MoneyBigDecimalUtil.mul(new BigDecimal(randomRate * 0.1), goodsHongBao);
        // 预警值
        String warningValue = configTaoLiJinService.getValueByKey("warning_value");
        // 计算公式:  淘礼金面额=(返利*利润预警值)*{0.5、0.6、0.7、0.8}≥1元
        spreadMoney = MoneyBigDecimalUtil.mul(new BigDecimal(Integer.parseInt(warningValue) * 0.01), spreadMoney);
        return  spreadMoney;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinDetailServiceImpl.java
New file
@@ -0,0 +1,224 @@
package com.yeshi.fanli.service.impl.tlj;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.tlj.UserTaoLiJinDetailMapper;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail.TaoLiJinDetailTypeEnum;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin.TaoLiJinOriginEnum;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinDetailService;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.vo.tlj.TaoLiJinDetailVO;
import com.yeshi.fanli.vo.tlj.TaoLiJinMonthVO;
@Service
public class UserTaoLiJinDetailServiceImpl implements UserTaoLiJinDetailService{
    @Resource
    private UserTaoLiJinDetailMapper userTaoLiJinDetailMapper;
    @Override
    public void insertSelective(UserTaoLiJinDetail record) {
        userTaoLiJinDetailMapper.insertSelective(record);
    }
    @Override
    public Long countDetail(long uid) {
        return userTaoLiJinDetailMapper.countDetail(uid);
    }
    @Override
    public BigDecimal countUseMoneyByDate(long uid, int dateType) {
        return userTaoLiJinDetailMapper.countUseMoneyByDate(uid, dateType);
    }
    @Override
    public List<TaoLiJinDetailVO> listUserMoneyDetailForClient(Long uid, Long detailId, Date maxTime) {
        List<TaoLiJinDetailVO> finalList = new ArrayList<>();
        List<UserTaoLiJinDetail> list = null;
        if (detailId == null) {// 首次请求
            if (maxTime == null)// 没有筛选时间
            {
                list = userTaoLiJinDetailMapper.selectByMaxCreateTime(uid,
                        new Date(System.currentTimeMillis() + 1000 * 60 * 60L), 20);
            } else {// 筛选了时间
                list = userTaoLiJinDetailMapper.selectByMaxCreateTime(uid, maxTime, 20);
            }
            if (list != null && list.size() > 0) {
                Calendar calendar = Calendar.getInstance();
                calendar.setTimeInMillis(list.get(0).getCreateTime().getTime());
                TaoLiJinDetailVO vo = new TaoLiJinDetailVO();
                vo.setMonth(new TaoLiJinMonthVO(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH) + 1));
                finalList.add(vo);
            } else {
                if (maxTime != null) {//
                    Calendar calendar = Calendar.getInstance();
                    calendar.setTimeInMillis(maxTime.getTime());
                    TaoLiJinDetailVO vo = new TaoLiJinDetailVO();
                    vo.setMonth(new TaoLiJinMonthVO(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH) + 1));
                    vo.getMonth().setExpend("0");
                    vo.getMonth().setIncome("0");
                    finalList.add(vo);
                }
            }
        } else {// 二次请求
            int size = 21;
            List<UserTaoLiJinDetail> tempList = userTaoLiJinDetailMapper.selectByUidWithIndexId(uid, detailId, size);
            Set<Date> dateSet = new HashSet<>();// 用于储存是否在同一时间上面(精确到秒)
            if (tempList.size() > 0) {
                for (UserTaoLiJinDetail umd : tempList) {
                    dateSet.add(umd.getCreateTime());
                }
                List<UserTaoLiJinDetail> tempList2 = new ArrayList<>();
                while (dateSet.size() == 1 && tempList2.size() != tempList.size() && size < 40) {// 只有一个时间点的数据
                    tempList = tempList2;
                    size += 10;
                    tempList2 = userTaoLiJinDetailMapper.selectByUidWithIndexId(uid, detailId, size);
                    dateSet.clear();
                    for (UserTaoLiJinDetail umd : tempList2) {
                        dateSet.add(umd.getCreateTime());
                    }
                }
                if (tempList2.size() > 0)
                    tempList = tempList2;
            }
            for (int i = 0; i < tempList.size(); i++) {
                if (tempList.get(i).getId().longValue() == detailId) {
                    tempList.remove(i);
                    break;
                } else {
                    tempList.remove(i);
                    i--;
                }
            }
            list = tempList;
        }
        if (list != null) {
            if (detailId != null && list.size() > 0) {
                UserTaoLiJinDetail umd = userTaoLiJinDetailMapper.selectByPrimaryKey(detailId);
                if (!TimeUtil.getGernalTime(umd.getCreateTime().getTime(), "yyyy-MM")
                        .equalsIgnoreCase(TimeUtil.getGernalTime(list.get(0).getCreateTime().getTime(), "yyyy-MM"))) {
                    Calendar calendar = Calendar.getInstance();
                    calendar.setTimeInMillis(list.get(0).getCreateTime().getTime());
                    TaoLiJinDetailVO vo = new TaoLiJinDetailVO();
                    vo.setMonth(new TaoLiJinMonthVO(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH) + 1));
                    finalList.add(vo);
                }
            }
            for (int i = 0; i < list.size(); i++) {
                if (i > 0 && !TimeUtil.getGernalTime(list.get(i - 1).getCreateTime().getTime(), "yyyy-MM")
                        .equalsIgnoreCase(TimeUtil.getGernalTime(list.get(i).getCreateTime().getTime(), "yyyy-MM"))) {// 本条数据与上条数据不是同一月则插入月份
                    Calendar calendar = Calendar.getInstance();
                    calendar.setTimeInMillis(list.get(i).getCreateTime().getTime());
                    TaoLiJinDetailVO vo = new TaoLiJinDetailVO();
                    vo.setMonth(new TaoLiJinMonthVO(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH) + 1));
                    finalList.add(vo);
                }
                TaoLiJinDetailVO vo = new TaoLiJinDetailVO();
                vo.setDetail(list.get(i));
                finalList.add(vo);
            }
        }
        // 统计月资金
        Map<Integer, TaoLiJinDetailVO> monthMap = new TreeMap<>();
        if (finalList.size() > 1)
            for (int i = 0; i < finalList.size(); i++) {
                if (finalList.get(i).getMonth() != null)
                    monthMap.put(i, finalList.get(i));
            }
        if (!monthMap.isEmpty()) {
            List<String> dateFormat = new ArrayList<>();
            Iterator<Integer> keys = monthMap.keySet().iterator();
            while (keys.hasNext()) {
                Integer key = keys.next();
                String date = "";
                date += monthMap.get(key).getMonth().getYear();
                date += "-";
                date += (monthMap.get(key).getMonth().getMonth() + "").length() < 2
                        ? "0" + monthMap.get(key).getMonth().getMonth() : monthMap.get(key).getMonth().getMonth();
                dateFormat.add(date);
            }
            List<TaoLiJinMonthVO> voList = userTaoLiJinDetailMapper.selectMonthMoneyByUid(uid, dateFormat);
            int p = 0;
            keys = monthMap.keySet().iterator();
            while (keys.hasNext()) {
                Integer key = keys.next();
                // 去除支出负号
                finalList.get(key).getMonth().setExpend(voList.get(p).getExpend().replace("-", ""));
                finalList.get(key).getMonth().setIncome(voList.get(p).getIncome());
                p++;
            }
        }
        return finalList;
    }
    @Override
    public long countUserMoneyDetailForClient(Long uid, Long detailId, Date maxTime) {
        long monthCount = 0L;
        long detailCount = 0L;
        // 未通过时间筛选,查询所有
        if (maxTime == null) {
            detailCount = userTaoLiJinDetailMapper.selectCountByUid(uid);
            // 用于表示当前所有
            monthCount = userTaoLiJinDetailMapper.selectMonthCountByUid(uid, new Date(System.currentTimeMillis() + 1000 * 60 * 60L));
        } else {// 通过时间筛选了的,需要查询所有
            detailCount = userTaoLiJinDetailMapper.selectCountByUidAndMaxCreateTime(uid, maxTime);
            monthCount = userTaoLiJinDetailMapper.selectMonthCountByUid(uid, maxTime);
        }
        return monthCount + detailCount;
    }
    @Override
    public void createAddDetail(UserTaoLiJinOrigin taoLiJinOrigin) {
        UserTaoLiJinDetail detail = new UserTaoLiJinDetail();
        detail.setUid(taoLiJinOrigin.getUid());
        detail.setMoney(taoLiJinOrigin.getMoney());
        // 红包退回
        if (taoLiJinOrigin.getOrigin().equals(TaoLiJinOriginEnum.refund)) {
            detail.setType(TaoLiJinDetailTypeEnum.reduce);
            detail.setTitle(TaoLiJinDetailTypeEnum.reduce.getDesc());
        } else {
            detail.setType(TaoLiJinDetailTypeEnum.add);
            detail.setTitle(TaoLiJinDetailTypeEnum.add.getDesc());
            String desc = taoLiJinOrigin.getOrigin().getDesc();
            if (taoLiJinOrigin.getOrigin().equals(TaoLiJinOriginEnum.newbiesWin) && taoLiJinOrigin.getType() == 1) {
                desc = "分享红包"; // 老用户看到的是分享红包
            }
            detail.setDescInfo("来源:" + desc);
        }
        detail.setCreateTime(new Date());
        userTaoLiJinDetailMapper.insertSelective(detail);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinOriginServiceImpl.java
New file
@@ -0,0 +1,462 @@
package com.yeshi.fanli.service.impl.tlj;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.core.task.TaskExecutor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.yeshi.utils.DateUtil;
import com.yeshi.fanli.dao.mybatis.tlj.UserTaoLiJinOriginMapper;
import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
import com.yeshi.fanli.entity.bus.tlj.DeviceTaoLiJinRecord;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail.TaoLiJinDetailTypeEnum;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin.TaoLiJinOriginEnum;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinRecord;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinReport;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.bus.user.UserRank;
import com.yeshi.fanli.exception.tlj.UserTaoLiJinOriginException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.msg.UserOtherMsgNotificationService;
import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
import com.yeshi.fanli.service.inter.tlj.DeviceTaoLiJinRecordService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinDetailService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinRecordService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.UserMoneyExtraService;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.StringUtil;
@Service
public class UserTaoLiJinOriginServiceImpl implements UserTaoLiJinOriginService{
    @Resource(name = "taskExecutor")
    private TaskExecutor executor;
    @Resource
    private UserTaoLiJinOriginMapper userTaoLiJinOriginMapper;
    @Resource
    private UserMoneyExtraService userMoneyExtraService;
    @Resource
    private UserInfoExtraService userInfoExtraService;
    @Resource
    private UserTaoLiJinDetailService userTaoLiJinDetailService;
    @Resource
    private DeviceTaoLiJinRecordService deviceTaoLiJinRecordService;
    @Resource
    private UserOtherMsgNotificationService userOtherMsgNotificationService;
    @Resource
    private ConfigTaoLiJinService configTaoLiJinService;
    @Resource
    private UserTaoLiJinRecordService userTaoLiJinRecordService;
    @Override
    public void updateByPrimaryKeySelective(UserTaoLiJinOrigin record) {
        userTaoLiJinOriginMapper.updateByPrimaryKeySelective(record);
    }
    @Override
    public BigDecimal countMoneyByDate(long uid, int dateType) {
        return userTaoLiJinOriginMapper.countMoneyByDate(uid, dateType);
    }
    @Override
    public long countByUidAndOrigin(long uid, String origin) {
        return userTaoLiJinOriginMapper.countByUidAndOrigin(uid, origin);
    }
    @Override
    public UserTaoLiJinOrigin getByUidAndOrigin(long uid, String origin) {
        return userTaoLiJinOriginMapper.getByUidAndOrigin(uid, origin);
    }
    @Override
    public UserTaoLiJinOrigin getRankByThisMonth(long uid, String type) {
        return userTaoLiJinOriginMapper.getRankByThisMonth(uid, type);
    }
    @Override
    public boolean hasRankHongBao(long uid) {
        UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
        if (userInfoExtra == null) {
            return false;
        }
        // 等级验证
        UserRank userRank = userInfoExtra.getUserRank();
        if (userRank == null || userRank.getId() <= 1) {
            return false;
        }
        // 是否已领取
        long countRan = userTaoLiJinOriginMapper.countRankByThisMonth(uid);
        if (countRan > 0) {
            return false;
        }
        return true;
    }
    @Override
    public void synchDeviceHongbao(long uid, String device) {
        // 是否已领取
        long count = userTaoLiJinOriginMapper.countByUidAndType(uid, TaoLiJinOriginEnum.newbiesWin.name());
        if (count > 0) {
            return;
        }
        // 设备是否已领取
        DeviceTaoLiJinRecord record = deviceTaoLiJinRecordService.getByDevice(device);
        if (record == null) {
            return;
        }
        try {
            addNewbiesWinMoney(uid);
        } catch (UserTaoLiJinOriginException e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    @Override
    @Transactional
    public UserTaoLiJinOrigin addNewbiesWinMoney(Long uid) throws UserTaoLiJinOriginException{
        if (uid == null) {
            throw new UserTaoLiJinOriginException(1, "参数不能为空");
        }
        String value = configTaoLiJinService.getValueByKey("hongbao_newbies");
        if (StringUtil.isNullOrEmpty(value)) {
            throw new UserTaoLiJinOriginException(1, "系统红包不存在");
        }
        BigDecimal money = new BigDecimal(value);
        // 是否可以自购
        boolean canSelfBuy = userInfoExtraService.isNewUser(uid);
        // 添加用户红包
        userMoneyExtraService.addTaoLiJin(uid, money, canSelfBuy);
        // 添加新增记录
        UserTaoLiJinOrigin origin = saveOrigin(uid, canSelfBuy?2:1, money, TaoLiJinOriginEnum.newbiesWin);
        // 红包明细
        userTaoLiJinDetailService.createAddDetail(origin);
        // 消息
        executor.execute(new Runnable() {
            @Override
            public void run() {
                try {
                    String source = "";
                    if(canSelfBuy) {
                        source = "新人红包";
                    } else {
                        source = "分享红包";
                    }
                    MsgOtherTaoLiJinContentDTO content = new MsgOtherTaoLiJinContentDTO();
                    content.setState("红包增加");
                    content.setSource(source);
                    content.setMoney(money);
                    userOtherMsgNotificationService.taoLiJinMsg(uid, "", content);
                } catch (Exception e) {
                    LogHelper.errorDetailInfo(e);
                }
            }
        });
        return origin;
    }
    @Override
    @Transactional
    public UserTaoLiJinOrigin  addRankWinMoney(Long uid, UserRank userRank) throws UserTaoLiJinOriginException{
        if (uid == null || userRank == null) {
            throw new UserTaoLiJinOriginException(1, "参数不能为空");
        }
        String key = "";
        if (userRank.getId() == 2) {
            key = "hongbao_rank_silver";
        } else if (userRank.getId() == 3) {
            key = "hongbao_rank_gold";
        } else if (userRank.getId() == 4) {
            key = "hongbao_rank_platinum";
        } else {
            throw new UserTaoLiJinOriginException(2, "用户等级不足");
        }
        String value = configTaoLiJinService.getValueByKey(key);
        if (StringUtil.isNullOrEmpty(value)) {
            throw new UserTaoLiJinOriginException(1, "系统红包不存在");
        }
        BigDecimal money = new BigDecimal(value);
        // 添加红包余额
        userMoneyExtraService.addTaoLiJin(uid, money, false);
        // 添加新增记录
        UserTaoLiJinOrigin origin = saveOrigin(uid, 1, money, TaoLiJinOriginEnum.rankWin);
        // 红包明细
        userTaoLiJinDetailService.createAddDetail(origin);
        // 消息
        executor.execute(new Runnable() {
            @Override
            public void run() {
                try {
                    String beizhu = "上月账户等级" + userRank.getName();
                    MsgOtherTaoLiJinContentDTO content = new MsgOtherTaoLiJinContentDTO();
                    content.setState("红包增加");
                    content.setSource("账户等级福利");
                    content.setMoney(money);
                    userOtherMsgNotificationService.taoLiJinMsg(uid, beizhu, content);
                } catch (Exception e) {
                    LogHelper.errorDetailInfo(e);
                }
            }
        });
        return origin;
    }
    @Override
    @Transactional
    public UserTaoLiJinOrigin addInviteWinMoney(Long uid, String inviteName) throws UserTaoLiJinOriginException{
        if (uid == null || StringUtil.isNullOrEmpty(inviteName)) {
            throw new UserTaoLiJinOriginException(1, "参数不能为空");
        }
        String value = configTaoLiJinService.getValueByKey("hongbao_invite");
        if (StringUtil.isNullOrEmpty(value)) {
            throw new UserTaoLiJinOriginException(1, "系统红包不存在");
        }
        BigDecimal money = new BigDecimal(value);
        // 添加用户红包
        userMoneyExtraService.addTaoLiJin(uid, money, false);
        // 添加新增记录
        UserTaoLiJinOrigin origin = saveOrigin(uid, 1, money, TaoLiJinOriginEnum.inviteWin);
        // 红包明细
        userTaoLiJinDetailService.createAddDetail(origin);
        // 消息
        executor.execute(new Runnable() {
            @Override
            public void run() {
                try {
                    String beizhu = "成功邀请队员" + inviteName;
                    MsgOtherTaoLiJinContentDTO content = new MsgOtherTaoLiJinContentDTO();
                    content.setState("红包增加");
                    content.setSource("邀请队员奖励");
                    content.setMoney(money);
                    userOtherMsgNotificationService.taoLiJinMsg(uid, beizhu, content);
                } catch (Exception e) {
                    LogHelper.errorDetailInfo(e);
                }
            }
        });
        return origin;
    }
    @Override
    @Transactional
    public UserTaoLiJinOrigin addShareWinMoney(Long uid) throws UserTaoLiJinOriginException{
        if (uid == null) {
            throw new UserTaoLiJinOriginException(1, "用户未登录");
        }
        String value = configTaoLiJinService.getValueByKey("hongbao_share");
        if (StringUtil.isNullOrEmpty(value)) {
            throw new UserTaoLiJinOriginException(1, "系统红包不存在");
        }
        BigDecimal money = new BigDecimal(value);
        // 添加用户红包
        userMoneyExtraService.addTaoLiJin(uid, money, false);
        // 添加新增记录
        UserTaoLiJinOrigin origin = saveOrigin(uid, 1, money, TaoLiJinOriginEnum.shareWin);
        // 红包明细
        userTaoLiJinDetailService.createAddDetail(origin);
        // 消息
        executor.execute(new Runnable() {
            @Override
            public void run() {
                try {
                    String beizhu = "近30天产生过分享(仅一次奖励)";
                    MsgOtherTaoLiJinContentDTO content = new MsgOtherTaoLiJinContentDTO();
                    content.setState("红包增加");
                    content.setSource("分享订单奖励");
                    content.setMoney(money);
                    userOtherMsgNotificationService.taoLiJinMsg(uid, beizhu, content);
                } catch (Exception e) {
                    LogHelper.errorDetailInfo(e);
                }
            }
        });
        return origin;
    }
    // 添加新增记录
    public UserTaoLiJinOrigin saveOrigin(Long uid, int type, BigDecimal money, TaoLiJinOriginEnum originEnum) {
        UserTaoLiJinOrigin taoLiJinOrigin = new UserTaoLiJinOrigin();
        taoLiJinOrigin.setUid(uid);
        taoLiJinOrigin.setType(type);
        taoLiJinOrigin.setOrigin(originEnum);
        taoLiJinOrigin.setMoney(money);
        taoLiJinOrigin.setMoneySurplus(money);
        taoLiJinOrigin.setCreateTime(new Date());
        taoLiJinOrigin.setUpdateTime(new Date());
        taoLiJinOrigin.setRemark(originEnum.getDesc());
        userTaoLiJinOriginMapper.insertSelective(taoLiJinOrigin);
        return taoLiJinOrigin;
    }
    @Override
    @Transactional
    public void  refundMoney(UserTaoLiJinReport report) throws UserTaoLiJinOriginException{
        if (report == null) {
            throw new UserTaoLiJinOriginException(1, "参数不能为空");
        }
        String rightsId = report.getId();
        BigDecimal refundAmount = report.getRefundAmount();
        // 已退回的金额
        BigDecimal moneyOrigin = userTaoLiJinOriginMapper.countMoneyByOrigin(rightsId, TaoLiJinOriginEnum.refund.name());
        if (refundAmount.compareTo(moneyOrigin) < 1) {
            return;
        }
        // 查询用户信息
        UserTaoLiJinRecord record = userTaoLiJinRecordService.getByRightsId(rightsId);
        if (record == null) {
            return;
        }
        Long uid = record.getUid();
        // 计算本次退回的金额
        BigDecimal money = MoneyBigDecimalUtil.sub(refundAmount, moneyOrigin);
        // 添加用户红包
        userMoneyExtraService.addTaoLiJin(uid, money, false);
        // 添加新增记录
        UserTaoLiJinOrigin taoLiJinOrigin = new UserTaoLiJinOrigin();
        taoLiJinOrigin.setUid(uid);
        taoLiJinOrigin.setType(1);
        taoLiJinOrigin.setRightsId(rightsId);
        taoLiJinOrigin.setMoney(money);
        taoLiJinOrigin.setMoneySurplus(money);
        taoLiJinOrigin.setOrigin(TaoLiJinOriginEnum.refund);
        taoLiJinOrigin.setRemark(TaoLiJinOriginEnum.refund.getDesc());
        taoLiJinOrigin.setCreateTime(new Date());
        taoLiJinOrigin.setUpdateTime(new Date());
        userTaoLiJinOriginMapper.insertSelective(taoLiJinOrigin);
        // 红包明细
        userTaoLiJinDetailService.createAddDetail(taoLiJinOrigin);
        // 消息
        executor.execute(new Runnable() {
            @Override
            public void run() {
                try {
                    String beizhu = "共创建:" + record.getTotalNum() + "个,已领取"+report.getWinNum()+"个,剩余"+report.getRefundNum()+ "个退回";
                    SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd hh.mm");
                    String time = sd.format(record.getCreateTime());
                    MsgOtherTaoLiJinContentDTO content = new MsgOtherTaoLiJinContentDTO();
                    content.setState("红包退回");
                    content.setSource(time + " 创建的分享记录");
                    content.setMoney(money);
                    userOtherMsgNotificationService.taoLiJinMsg(uid, beizhu, content);
                } catch (Exception e) {
                    LogHelper.errorDetailInfo(e);
                }
            }
        });
    }
    @Override
    public void overdueHongBao(Long uid) {
        // 15天前过期
        Date date = null;
        try {
            date = DateUtil.reduceDay(15, new Date());
        } catch (ParseException e) {
            e.printStackTrace();
        }
        if (date == null) {
            return;
        }
        List<UserTaoLiJinOrigin> list = userTaoLiJinOriginMapper.getOverdueTaoLiJin(uid, date);
        if (list == null || list.size() == 0) {
            return;
        }
        BigDecimal total = new BigDecimal(0);
        for (UserTaoLiJinOrigin userTaoLiJinOrigin: list) {
            UserTaoLiJinOrigin origin = new UserTaoLiJinOrigin();
            origin.setId(userTaoLiJinOrigin.getId());
            origin.setMoneySurplus(new BigDecimal(0));
            origin.setUpdateTime(new Date());
            userTaoLiJinOriginMapper.updateByPrimaryKeySelective(origin);
            total = MoneyBigDecimalUtil.add(total, userTaoLiJinOrigin.getMoneySurplus());
        }
        // 插入明细
        UserTaoLiJinDetail detail = new UserTaoLiJinDetail();
        detail.setUid(uid);
        detail.setMoney(new BigDecimal("-" + total.toString()));
        detail.setTitle(TaoLiJinDetailTypeEnum.sendBack.getDesc());
        detail.setType(TaoLiJinDetailTypeEnum.sendBack);
        detail.setCreateTime(date);
        userTaoLiJinDetailService.insertSelective(detail);
        // 消息
        final BigDecimal totalMoney = total;
        executor.execute(new Runnable() {
            @Override
            public void run() {
                try {
                    MsgOtherTaoLiJinContentDTO content = new MsgOtherTaoLiJinContentDTO();
                    content.setState("红包扣除");
                    content.setSource("15天内未产生过推广红包分享记录");
                    content.setMoney(totalMoney);
                    userOtherMsgNotificationService.taoLiJinMsg(uid, "清除后无法恢复", content);
                } catch (Exception e) {
                    LogHelper.errorDetailInfo(e);
                }
            }
        });
    }
    @Override
    public List<UserTaoLiJinOrigin> getSurplusLiJin(long uid) {
        return userTaoLiJinOriginMapper.getSurplusLiJin(uid);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinRecordServiceImpl.java
New file
@@ -0,0 +1,404 @@
package com.yeshi.fanli.service.impl.tlj;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.core.task.TaskExecutor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.yeshi.utils.BigDecimalUtil;
import com.yeshi.fanli.dao.mybatis.tlj.UserTaoLiJinRecordMapper;
import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
import com.yeshi.fanli.dto.taobao.TaoLiJinDTO;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail.TaoLiJinDetailTypeEnum;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinRecord;
import com.yeshi.fanli.entity.bus.user.UserMoneyExtra;
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.exception.tlj.UserTaoLiJinRecordException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.msg.UserOtherMsgNotificationService;
import com.yeshi.fanli.service.inter.tlj.GoodsTaoLiJinRateService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinDetailService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinRecordService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinReportService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.UserMoneyExtraService;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.factory.CommonGoodsFactory;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
import com.yeshi.fanli.vo.user.UserTaoLiJinRecordVO;
@Service
public class UserTaoLiJinRecordServiceImpl implements UserTaoLiJinRecordService {
    @Resource(name = "taskExecutor")
    private TaskExecutor executor;
    @Resource
    private RedisManager redisManager;
    @Resource
    private UserTaoLiJinRecordMapper userTaoLiJinRecordMapper;
    @Resource
    private CommonGoodsService commonGoodsService;
    @Resource
    private HongBaoManageService hongBaoManageService;
    @Resource
    private UserMoneyExtraService userMoneyExtraService;
    @Resource
    private UserTaoLiJinReportService userTaoLiJinReportService;
    @Resource
    private UserTaoLiJinDetailService userTaoLiJinDetailService;
    @Resource
    private UserTaoLiJinOriginService userTaoLiJinOriginService;
    @Resource
    private GoodsTaoLiJinRateService goodsTaoLiJinRateService;
    @Resource
    private UserOtherMsgNotificationService userOtherMsgNotificationService;
    @Resource
    private UserInfoExtraService userInfoExtraService;
    @Override
    public UserTaoLiJinRecord  selectByPrimaryKey(Long id){
        return userTaoLiJinRecordMapper.selectByPrimaryKey(id);
    }
    @Override
    public UserTaoLiJinRecord createSelfBuyTaoLiJin(Long uid, int totalNum, TaoBaoGoodsBrief goods) throws UserTaoLiJinRecordException{
        Date date = new Date();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        SimpleDateFormat formatStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String date_str = format.format(date);
        String sendEndTime_str = date_str + " 22:00:00";
        String useEndTime_str = date_str + " 23:59:59";
        /* 创建淘礼金 */
        String name = "自购淘礼金红包";
        // 发放开始时间
        Date sendStartTime = date;
        // 发放截止时间 - 分享当日22:00
        Date sendEndTime = null;
        // 使用结束日期 - 分享当日 23:59
        Date useEndTime = null;
        try {
            sendEndTime = formatStr.parse(sendEndTime_str);
            useEndTime = formatStr.parse(useEndTime_str);
        } catch (ParseException e2) {
            e2.printStackTrace();
        }
        // 新人红包 自购一元
        BigDecimal perface = new BigDecimal(1);
        return createUserTaoLiJin(1, uid, goods.getAuctionId(), perface, 1, name, sendStartTime,
                    sendEndTime, null, useEndTime);
    }
    @Override
    public UserTaoLiJinRecord createShareTaoLiJin(Long uid, int totalNum, TaoBaoGoodsBrief goods) throws UserTaoLiJinRecordException{
        Date date = new Date();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        SimpleDateFormat formatStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String date_str = format.format(date);
        String sendEndTime_str = date_str + " 22:00:00";
        String useEndTime_str = date_str + " 23:59:59";
        /* 创建淘礼金 */
        String name = "分享淘礼金红包";
        // 发放开始时间
        Date sendStartTime = date;
        // 发放截止时间 - 分享当日22:00
        Date sendEndTime = null;
        // 使用结束日期 - 分享当日 23:59
        Date useEndTime = null;
        try {
            sendEndTime = formatStr.parse(sendEndTime_str);
            useEndTime = formatStr.parse(useEndTime_str);
        } catch (ParseException e2) {
            e2.printStackTrace();
        }
        boolean isNewUser = userInfoExtraService.isNewUser(uid);
        if (isNewUser) {
            // 判定为老用户: 新人只要使用了新人红包,也就是那1块钱,那么,他看到的分享爆款中的商品-就只能分享。
            long countRecord = userTaoLiJinRecordMapper.countRecordByUid(uid);
            if (countRecord > 0) {
                isNewUser = false;
            }
        }
        BigDecimal perface = null;
        if (isNewUser) {
            perface = new BigDecimal(1);
        } else {
            perface = goodsTaoLiJinRateService.getGoodsSpreadMoney(goods);
        }
        return createUserTaoLiJin(2, uid, goods.getAuctionId(), perface, totalNum, name, sendStartTime,
                    sendEndTime, null, useEndTime);
    }
    @Override
    @Transactional
    public UserTaoLiJinRecord createUserTaoLiJin(int origin, Long uid, Long auctionId, BigDecimal perface, int totalNum, String name,
            Date sendStartTime, Date sendEndTime, Date useStartTime, Date useEndTime) throws UserTaoLiJinRecordException{
        // 用户剩余可以淘礼金验证
        UserMoneyExtra userMoneyExtra = userMoneyExtraService.selectByPrimaryKey(uid);
        if (userMoneyExtra == null || userMoneyExtra.getTlj() == null) {
            throw new UserTaoLiJinRecordException(101, "红包余额不足");
        }
        // 过期
        userTaoLiJinOriginService.overdueHongBao(uid);
        BigDecimal tlj = userMoneyExtra.getTlj();
        BigDecimal totalMoney = MoneyBigDecimalUtil.mul(perface, new BigDecimal(totalNum));
        if (totalMoney.compareTo(tlj) > 0) {
            throw new UserTaoLiJinRecordException(101, "红包余额不足");
        }
        // 创建淘礼金红包
        TaoLiJinDTO taoLiJinDTO = TaoKeApiUtil.createTaoLiJin(auctionId, name, perface, totalNum, sendStartTime, sendEndTime, useStartTime, useEndTime);
        if (taoLiJinDTO == null) {
            throw new UserTaoLiJinRecordException(101, "红包创建失败");
        }
        //  保存记录
        UserTaoLiJinRecord record = new UserTaoLiJinRecord();
        record.setUid(uid);
        record.setGoodsId(auctionId);
        record.setName(name);
        record.setPerFace(perface);
        record.setTotalNum(totalNum);
        record.setSendStartTime(sendStartTime);
        record.setSendEndTime(sendEndTime);
        record.setUseStartTime(useStartTime);
        record.setUseEndTime(useEndTime);
        record.setRightsId(taoLiJinDTO.getRightsId());
        record.setSendUrl(taoLiJinDTO.getSendUrl());
        record.setCreateTime(new Date());
        userTaoLiJinRecordMapper.insertSelective(record);
        // 剩余淘礼金
        BigDecimal surplusTlj = MoneyBigDecimalUtil.sub(tlj, totalMoney);
        UserMoneyExtra updateExtra = new UserMoneyExtra();
        updateExtra.setUid(uid);
        updateExtra.setTlj(surplusTlj);
        updateExtra.setUpdateTime(new Date());
        userMoneyExtraService.updateByPrimaryKeySelective(updateExtra);
        record.setSurplusMoney(surplusTlj);
        // 异步
        String rightsId = taoLiJinDTO.getRightsId();
        executor.execute(new Runnable() {
            @Override
            public void run() {
                try {
                    // 插入明细
                    UserTaoLiJinDetail detail = new UserTaoLiJinDetail();
                    detail.setUid(uid);
                    detail.setMoney(new BigDecimal("-" + totalMoney));
                    detail.setTitle(TaoLiJinDetailTypeEnum.reduce.getDesc());
                    detail.setType(TaoLiJinDetailTypeEnum.reduce);
                    detail.setCreateTime(new Date());
                    userTaoLiJinDetailService.insertSelective(detail);
                } catch (Exception e) {
                    LogHelper.errorDetailInfo(e);
                }
                // 成功使用红包
                try {
                    BigDecimal total = totalMoney;
                    BigDecimal lastMoney = null;
                    BigDecimal zero = new BigDecimal(0);
                    // 修改余额
                    List<UserTaoLiJinOrigin> list = userTaoLiJinOriginService.getSurplusLiJin(uid);
                    if (list != null && list.size() > 0) {
                        for (UserTaoLiJinOrigin taoLiJinOrigin: list) {
                            if (total.compareTo(zero) < 1 ) {
                                break;
                            }
                            BigDecimal moneySurplus = taoLiJinOrigin.getMoneySurplus();
                            lastMoney = total;
                            total = MoneyBigDecimalUtil.sub(total, moneySurplus);
                            if (total.compareTo(zero) >= 0 ) {
                                moneySurplus = zero;
                            } else {
                                moneySurplus = MoneyBigDecimalUtil.sub(moneySurplus, lastMoney);
                            }
                            UserTaoLiJinOrigin usertlj = new UserTaoLiJinOrigin();
                            usertlj.setId(taoLiJinOrigin.getId());
                            usertlj.setMoneySurplus(moneySurplus);
                            usertlj.setUpdateTime(new Date());
                            userTaoLiJinOriginService.updateByPrimaryKeySelective(usertlj);
                        }
                    }
                } catch (Exception e) {
                    LogHelper.errorDetailInfo(e);
                }
                // 使用成功消息
                try {
                    String beizhu = "未被领取/使用的部分将会退回";
                    SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd hh.mm");
                    String time = sd.format(new Date());
                    MsgOtherTaoLiJinContentDTO content = new MsgOtherTaoLiJinContentDTO();
                    content.setState("红包扣除");
                    content.setSource(time + " 创建的分享记录");
                    content.setMoney(totalMoney);
                    userOtherMsgNotificationService.taoLiJinMsg(uid, beizhu, content);
                } catch (Exception e) {
                    LogHelper.errorDetailInfo(e);
                }
                // 创建报告
                try {
                    userTaoLiJinReportService.insertDefault(rightsId);
                } catch (Exception e) {
                    LogHelper.errorDetailInfo(e);
                }
                // 检测商品是否存在
                try {
                    CommonGoods commonGoods = commonGoodsService.getCommonGoodsByGoodsIdAndGoodsType(auctionId, CommonGoods.GOODS_TYPE_TB);
                    if (commonGoods == null) {
                        TaoBaoGoodsBrief taoBaoGoodsBrief = redisManager.getTaoBaoGoodsBrief(auctionId);
                        if (taoBaoGoodsBrief != null) {
                            commonGoodsService.addCommonGoods(CommonGoodsFactory.create(taoBaoGoodsBrief));
                        }
                    }
                } catch (Exception e) {
                    LogHelper.errorDetailInfo(e);
                }
            }
        });
        return record;
    }
    @Override
    public List<UserTaoLiJinRecordVO> getRecordByUid(long start, int count, Long uid){
        List<UserTaoLiJinRecordVO> list = userTaoLiJinRecordMapper.getRecordByUid(start, count, uid);
        if (list == null || list.size() == 0) {
            return list;
        }
        List<Long> listGoodsId = new ArrayList<Long>();
        for (UserTaoLiJinRecordVO userTaoLiJinRecordVO: list) {
            listGoodsId.add(userTaoLiJinRecordVO.getAuctionId());
        }
        if (listGoodsId.size() == 0) {
            return null;
        }
        List<CommonGoods> listGoods = commonGoodsService.getByListGoodsId(listGoodsId);
        if (listGoods == null || listGoods.size() == 0) {
            return null;
        }
        // 组织相关数据
        for (UserTaoLiJinRecordVO userTaoLiJinRecordVO: list) {
            long auctionId = userTaoLiJinRecordVO.getAuctionId().longValue();
            // 商品信息
            for (int i = 0; i< listGoods.size(); i++) {
                CommonGoods commonGoods = listGoods.get(i);
                long goodsId = commonGoods.getGoodsId().longValue();
                if (auctionId == goodsId) {
                    userTaoLiJinRecordVO.setTitle(commonGoods.getTitle());
                    userTaoLiJinRecordVO.setPictUrl(commonGoods.getPicture());
                    if(CommonGoods.SHOP_TYPE_TB == commonGoods.getShopType()) {
                        userTaoLiJinRecordVO.setUserType(0);
                    } else {
                        userTaoLiJinRecordVO.setUserType(1);
                    }
                    listGoods.remove(i);
                    break;
                }
            }
            // 计算剩余未领取数量
            int winNum = userTaoLiJinRecordVO.getWinNum();
            int totalNum = userTaoLiJinRecordVO.getTotalNum();
            userTaoLiJinRecordVO.setSurplusNum(totalNum - winNum);
            // 计算分享奖金
            BigDecimal shareMoney = new BigDecimal(0);
            BigDecimal commission = userTaoLiJinRecordVO.getCommission();
            if (commission != null && commission.compareTo(shareMoney) > 1) {
                BigDecimal shareRate = hongBaoManageService.getShareRate();
                shareMoney = MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil.mul(commission, new BigDecimal("0.01")), MoneyBigDecimalUtil.div(shareRate, new BigDecimal(100)));
                shareMoney = BigDecimalUtil.getWithNoZera(shareMoney);
            }
            ClientTextStyleVO desc = new ClientTextStyleVO();
            desc.setColor("#FFFFFF");
            desc.setContent("预估分享奖金:¥" + shareMoney);
            desc.setBottomColor("#E8AE48");
            userTaoLiJinRecordVO.setDesc(desc);
        }
        return list;
    }
    @Override
    public long countRecordByUid(Long uid) {
        return userTaoLiJinRecordMapper.countRecordByUid(uid);
    }
    @Override
    public long countTodayNum(Long uid) {
        return userTaoLiJinRecordMapper.countTodayNum(uid);
    }
    @Override
    public BigDecimal getShareHongBaoByUidAndGoodsId(Long uid, Long goodsId) {
        return userTaoLiJinRecordMapper.getShareHongBaoByUidAndGoodsId(uid, goodsId);
    }
    @Override
    public UserTaoLiJinRecord getByRightsId(String rightsId) {
        return userTaoLiJinRecordMapper.getByRightsId(rightsId);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinReportServiceImpl.java
New file
@@ -0,0 +1,137 @@
package com.yeshi.fanli.service.impl.tlj;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.tlj.UserTaoLiJinReportMapper;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinReport;
import com.yeshi.fanli.exception.tlj.UserTaoLiJinOriginException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinReportService;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
@Service
public class UserTaoLiJinReportServiceImpl implements UserTaoLiJinReportService{
    @Resource
    private UserTaoLiJinReportMapper userTaoLiJinReportMapper;
    @Resource
    private UserTaoLiJinOriginService userTaoLiJinOriginService;
    @Override
    public void insertDefault(String rightsId) {
        if (StringUtil.isNullOrEmpty(rightsId)) {
            return;
        }
        UserTaoLiJinReport report = new UserTaoLiJinReport();
        report.setId(rightsId);
        report.setUnfreezeAmount(new BigDecimal(0));
        report.setUnfreezeNum(0);
        report.setRefundAmount(new BigDecimal(0));
        report.setRefundNum(0);
        report.setAlipayAmount(new BigDecimal(0));
        report.setUseAmount(new BigDecimal(0));
        report.setUseNum(0);
        report.setWinAmount(new BigDecimal(0));
        report.setWinNum(0);
        report.setPreCommissionAmount(new BigDecimal(0));
        report.setCreateTime(new Date());
        report.setUpdateTime(new Date());
        userTaoLiJinReportMapper.insertSelective(report);
    }
    @Override
    public void updateByPrimaryKeySelective(UserTaoLiJinReport record) {
        if (record == null || record.getId() == null) {
            return;
        }
        record.setUpdateTime(new Date());
        userTaoLiJinReportMapper.updateByPrimaryKeySelective(record);
    }
    @Override
    public void needUpdateReport() {
        List<UserTaoLiJinReport> list = userTaoLiJinReportMapper.needUpdateReport();
        if (list == null || list.size() == 0) {
            return;
        }
        for (UserTaoLiJinReport report: list) {
            UserTaoLiJinReport taoLiJinReport = null;
            try {
                taoLiJinReport = TaoKeApiUtil.getTaoLiJinEffective(report.getId());
            } catch (Exception e) {
                LogHelper.errorDetailInfo(e);
                continue;
            }
            if (taoLiJinReport == null) {
                continue;
            }
            // 是否需要更新
            boolean needUpdate = false;
            if(taoLiJinReport.getWinNum() != report.getWinNum()){
                needUpdate = true;
            }
            if(taoLiJinReport.getWinAmount() != report.getWinAmount()){
                needUpdate = true;
            }
            if(taoLiJinReport.getUnfreezeNum() != report.getUnfreezeNum()){
                needUpdate = true;
            }
            if(taoLiJinReport.getUnfreezeAmount() != report.getUnfreezeAmount()){
                needUpdate = true;
            }
            if(taoLiJinReport.getPreCommissionAmount() != report.getPreCommissionAmount()){
                needUpdate = true;
            }
            if(taoLiJinReport.getUseNum() != report.getUseNum()){
                needUpdate = true;
            }
            if(taoLiJinReport.getUseAmount() != report.getUseAmount()){
                needUpdate = true;
            }
            if(taoLiJinReport.getAlipayAmount() != report.getAlipayAmount()){
                needUpdate = true;
            }
            if(taoLiJinReport.getRefundNum() != report.getRefundNum()){
                needUpdate = true;
            }
            // 失效退回金额发生变化
            BigDecimal refundAmount = taoLiJinReport.getRefundAmount();
            if(refundAmount.compareTo(report.getRefundAmount()) > 0) {
                needUpdate = true;
                try {
                    userTaoLiJinOriginService.refundMoney(taoLiJinReport);
                } catch (UserTaoLiJinOriginException e) {
                    e.printStackTrace();
                }
            }
            // 更新报告
            if(needUpdate) {
                taoLiJinReport.setUpdateTime(new Date());
                userTaoLiJinReportMapper.updateByPrimaryKeySelective(taoLiJinReport);
            }
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserCustomSettingsServiceImpl.java
@@ -39,6 +39,8 @@
            mineTypeNum = UserSettingTypeEnum.noShareRecordAndStorage;
        } else if (type.equals(UserSettingTypeEnum.noInvitationBonus.name())) {
            mineTypeNum = UserSettingTypeEnum.noInvitationBonus;
        } else if (type.equals(UserSettingTypeEnum.openSpreadHongBao.name())) {
            mineTypeNum = UserSettingTypeEnum.openSpreadHongBao;
        } else {
            throw new UserCustomSettingsException(1, "参数类型不匹配");    
        }
@@ -113,6 +115,8 @@
                    userSettingsVO.setNoShareRecordAndStorage(state);
                } else if (typeEnum.equals(UserSettingTypeEnum.noInvitationBonus)){
                    userSettingsVO.setNoInvitationBonus(state);
                } else if (typeEnum.equals(UserSettingTypeEnum.openSpreadHongBao)){
                    userSettingsVO.setOpenSpreadHongBao(state);
                } 
                
            }
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java
@@ -566,4 +566,19 @@
        return isNew;
    }
    
    @Override
    public UserRank gerUserRank(Long uid) {
        if(uid == null) {
            return null;
        }
        UserInfoExtra userInfoExtra = userInfoExtraMapper.gerUserRank(uid);
        if (userInfoExtra == null) {
            return null;
        }
        return userInfoExtra.getUserRank();
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserMoneyExtraServiceImpl.java
New file
@@ -0,0 +1,67 @@
package com.yeshi.fanli.service.impl.user;
import java.math.BigDecimal;
import java.util.Date;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.user.UserMoneyExtraMapper;
import com.yeshi.fanli.entity.bus.user.UserMoneyExtra;
import com.yeshi.fanli.service.inter.user.UserMoneyExtraService;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
@Service
public class UserMoneyExtraServiceImpl implements UserMoneyExtraService {
    @Resource
    private UserMoneyExtraMapper userMoneyExtraMapper;
    @Override
    public UserMoneyExtra selectByPrimaryKey(Long uid) {
        return userMoneyExtraMapper.selectByPrimaryKey(uid);
    }
    @Override
    public void updateByPrimaryKeySelective(UserMoneyExtra record) {
        userMoneyExtraMapper.updateByPrimaryKeySelective(record);
    }
    @Override
    public void addTaoLiJin(Long uid, BigDecimal money, boolean canSelf) {
        if (uid == null || money == null) {
            return;
        }
        UserMoneyExtra record = new UserMoneyExtra();
        record.setUid(uid);
        UserMoneyExtra existExtra = userMoneyExtraMapper.selectByPrimaryKey(record.getUid());
        if (existExtra == null) {
            record.setTlj(money);
            if (canSelf) {
                record.setTljSelf(money);
            } else {
                record.setTljSelf(new BigDecimal(0));
            }
            record.setCreateTime(new Date());
            record.setUpdateTime(new Date());
            userMoneyExtraMapper.insertSelective(record);
        } else {
            BigDecimal tlj = existExtra.getTlj();
            record.setTlj(MoneyBigDecimalUtil.add(tlj, money));
            if (canSelf) {
                BigDecimal tljSelf = existExtra.getTljSelf();
                record.setTljSelf(MoneyBigDecimalUtil.add(tljSelf, money));
            }
            record.setUpdateTime(new Date());
            userMoneyExtraMapper.updateByPrimaryKeySelective(record);
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/GoodsClassService.java
@@ -47,7 +47,7 @@
    public void removePicture(GoodsClass record) throws Exception;
    
    
    public List<GoodsClass> listquery() throws Exception;
    public List<GoodsClass> listquery(Integer sex) throws Exception;
    
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/ShareGoodsService.java
@@ -110,4 +110,24 @@
     */
    public TaoBaoLink getTaoBaoLink(Long uid, Long auctionId, String pid) throws ShareGoodsException;
    /**
     * 淘礼金领取链接
     * @param uid
     * @param specialId
     * @param auctionId
     * @return
     * @throws ShareGoodsException
     */
    public TaoBaoLink getTaoLiJinLinkForBuy(Long uid, String specialId, Long auctionId) throws ShareGoodsException;
    /**
     * 淘礼金 链接
     * @param uid
     * @param auctionId
     * @param relationId
     * @return
     * @throws ShareGoodsException
     */
    public TaoBaoLink getTaoLiJinLinkForShare(Long uid, Long auctionId, String relationId) throws ShareGoodsException;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/ShareGoodsTextTemplateService.java
@@ -63,7 +63,8 @@
     * @param goods
     * @return
     */
    public String createContentByTemplate(String template, Long uid, TaoBaoGoodsBrief goods,String token,String shortLink, boolean hasCoupon);
    public String createContentByTemplate(String template, Long uid, TaoBaoGoodsBrief goods,String token,
            String shortLink, boolean hasCoupon, Long tljId);
    /**
     * 还原普通模板
@@ -78,4 +79,32 @@
     * @param uid
     */
    public void resetCouponTemplate(Long uid);
    /**
     * 淘礼金模板是否正确
     * @param template
     * @throws ShareGoodsTextTemplateException
     */
    public void isTaoLiJinTemplateRight(String template) throws ShareGoodsTextTemplateException;
    /**
     * 保存淘礼金模板
     * @param uid
     * @param template
     * @throws ShareGoodsTextTemplateException
     */
    public void saveTaoLiJinTemplate(Long uid, String template) throws ShareGoodsTextTemplateException;
    /**
     * 还原淘礼金模板
     * @param uid
     */
    public void resetTaoLijinTemplate(Long uid);
    /**
     * 淘礼金模板
     * @param uid
     * @return
     */
    public String getTaoLiJinTemplate(Long uid);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/DeviceSexService.java
New file
@@ -0,0 +1,43 @@
package com.yeshi.fanli.service.inter.homemodule;
public interface DeviceSexService {
    /**
     * 保存设置
     * @param device
     * @param sex
     */
    public void save(String device, Integer sex);
    /**
     * 获取设置
     * @param device
     * @return
     */
    public Integer getSex(String device);
    /**
     * 删除
     * @param device
     */
    public void deleteSex(String device);
    /**
     *  获取设备性别
     * @param sex
     * @param device
     * @return
     */
    public int getDeviceSex(String device);
    /**
     * 改变设备信息
     * @param sex
     * @param device
     * @return
     */
    public int changeDeviceSex(Integer sex, String device);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/FloatADService.java
@@ -56,7 +56,7 @@
     * 查询有效的悬浮大图
     * @return
     */
    public FloatAD getEffectiveFloatAD(String position);
    public FloatAD getEffectiveFloatAD(String position, Integer type);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/HomeNavbarService.java
@@ -42,7 +42,7 @@
     * @throws HomeNavbarException
     * @throws Exception
     */
    public void updateOrder(Long id, Integer moveType) throws HomeNavbarException, Exception;
    public void updateOrder(Long id, Integer moveType, Integer sex) throws HomeNavbarException, Exception;
    
    /**
@@ -52,9 +52,9 @@
     * @param key
     * @return
     */
    public List<HomeNavbar> listQuery(long start, int count, String key);
    public List<HomeNavbar> listQuery(long start, int count, String key,  Integer sex);
    
    public long countlistQuery(String key);
    public long countlistQuery(String key,  Integer sex);
    
    
    /**
@@ -75,7 +75,7 @@
     * 默认导航栏
     * @return
     */
    public List<HomeNavbar> listQueryDefaultNavbar();
    public List<HomeNavbar> listQueryDefaultNavbar(Integer sex);
    /**
     *  固定的导航栏
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/HomeNavbarUserService.java
@@ -12,7 +12,7 @@
     * 查询导航栏
     * @return
     */
    public List<HomeNavbar> listEffectiveNavbar(Long uid, String device);
    public List<HomeNavbar> listEffectiveNavbar(Long uid, String device, Integer sex);
    /**
     * 保存用户自定义
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SpecialService.java
@@ -22,9 +22,9 @@
    public Special selectByPrimaryKey(Long id);
    public List<Special> listQueryByCard(long start, int count, Long card, String key);
    public List<Special> listQueryByCard(long start, int count, Long card, String key, Integer sex);
    public long countlistQueryByCard(Long card, String key);
    public long countlistQueryByCard(Long card, String key, Integer sex);
    /**
@@ -78,7 +78,7 @@
     * @param moveType
     * @throws SpecialException
     */
    public void updateOrder(Long id, Integer moveType) throws SpecialException;
    public void updateOrder(Long id, Integer moveType, Integer sex) throws SpecialException;
    /**
@@ -86,7 +86,7 @@
     * @return
     * @throws Exception
     */
    public JSONObject listCacheSpecialToIndex(AcceptData acceptData) throws Exception;
    public JSONObject listCacheSpecialToIndex(AcceptData acceptData, Integer sex) throws Exception;
    /**
fanli/src/main/java/com/yeshi/fanli/service/inter/msg/UserOtherMsgNotificationService.java
@@ -2,6 +2,7 @@
import java.math.BigDecimal;
import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
@@ -168,4 +169,12 @@
     */
    public void rewardCouponAlreadyOutOfDate(UserSystemCoupon coupon);
    /**
     * 淘礼金消息
     * @param uid
     * @param beiZhu
     * @param content
     */
    public void taoLiJinMsg(Long uid, String beiZhu, MsgOtherTaoLiJinContentDTO content);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/tlj/ConfigTaoLiJinService.java
New file
@@ -0,0 +1,21 @@
package com.yeshi.fanli.service.inter.tlj;
import com.yeshi.fanli.entity.bus.tlj.ConfigTaoLiJin;
public interface ConfigTaoLiJinService {
    /**
     * 根据key值查询
     * @param key
     * @return
     */
    public ConfigTaoLiJin getByKey(String key);
    /**
     * 根据key值 获取value
     * @param key
     * @return
     */
    public String getValueByKey(String key);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/tlj/DeviceTaoLiJinRecordService.java
New file
@@ -0,0 +1,23 @@
package com.yeshi.fanli.service.inter.tlj;
import java.math.BigDecimal;
import com.yeshi.fanli.entity.bus.tlj.DeviceTaoLiJinRecord;
public interface DeviceTaoLiJinRecordService {
    /**
     * 根据key值查询
     * @param key
     * @return
     */
    public DeviceTaoLiJinRecord getByDevice(String device);
    /**
     *  保存
     * @param key
     * @return
     */
    public void save(String device, BigDecimal money);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/tlj/GoodsTaoLiJinRateService.java
New file
@@ -0,0 +1,25 @@
package com.yeshi.fanli.service.inter.tlj;
import java.math.BigDecimal;
import com.yeshi.fanli.entity.bus.tlj.GoodsTaoLiJinRate;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
public interface GoodsTaoLiJinRateService {
    /**
     * 根据key值查询
     * @param key
     * @return
     */
    public GoodsTaoLiJinRate getById(Long goodId);
    /**
     * 获取商品推广红包
     * @param goods
     * @return
     */
    public BigDecimal getGoodsSpreadMoney(TaoBaoGoodsBrief goods);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/tlj/UserTaoLiJinDetailService.java
New file
@@ -0,0 +1,51 @@
package com.yeshi.fanli.service.inter.tlj;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin;
import com.yeshi.fanli.vo.tlj.TaoLiJinDetailVO;
public interface UserTaoLiJinDetailService {
    /**
     * 根据日期类型统计消耗金额
     * @param uid
     * @param dateType 1今日 、2昨日、3本月、4上月
     * @return
     */
    public BigDecimal countUseMoneyByDate(long uid, int dateType);
    /**
     * 查询明细记录
     * @param uid
     * @param detailId
     * @param maxTime
     * @return
     */
    public List<TaoLiJinDetailVO> listUserMoneyDetailForClient(Long uid, Long detailId, Date maxTime);
    public long countUserMoneyDetailForClient(Long uid, Long detailId, Date maxTime);
    /**
     *  创建明细
     * @param record
     */
    public void insertSelective(UserTaoLiJinDetail record);
    /**
     * 创建新增明细
     * @param taoLiJinOrigin
     */
    public void createAddDetail(UserTaoLiJinOrigin taoLiJinOrigin);
    /**
     * 统计个数
     * @param uid
     */
    public Long countDetail(long uid);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/tlj/UserTaoLiJinOriginService.java
New file
@@ -0,0 +1,122 @@
package com.yeshi.fanli.service.inter.tlj;
import java.math.BigDecimal;
import java.util.List;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinReport;
import com.yeshi.fanli.entity.bus.user.UserRank;
import com.yeshi.fanli.exception.tlj.UserTaoLiJinOriginException;
public interface UserTaoLiJinOriginService {
    /**
     * 根据日期类型统计金额
     * @param uid
     * @param dateType 1今日 、2昨日、3本月、4上月
     * @return
     */
    public BigDecimal countMoneyByDate(long uid, int dateType);
    /**
     * 统计类型个数
     * @param uid
     * @param origin
     * @return
     */
    public long countByUidAndOrigin(long uid, String origin);
    /**
     * 判断本月红包领取个数
     * @param uid
     * @return
     */
    public boolean hasRankHongBao(long uid);
    /**
     * 使红包过期
     * @param uid
     */
    public void overdueHongBao(Long uid);
    /**
     * 获取类型
     * @param uid
     * @param origin
     * @return
     */
    public UserTaoLiJinOrigin getByUidAndOrigin(long uid, String origin);
    /**
     * 当月等级红包
     * @param uid
     * @return
     */
    public UserTaoLiJinOrigin getRankByThisMonth(long uid, String type);
    /**
     * 查询剩余淘礼金
     * @param uid
     * @return
     */
    public List<UserTaoLiJinOrigin> getSurplusLiJin(long uid);
    /**
     * 更新
     * @param record
     */
    public void updateByPrimaryKeySelective(UserTaoLiJinOrigin record);
    /**
     * 新人红包设备同步
     * @param uid
     * @param device
     */
    public void synchDeviceHongbao(long uid, String device);
    /**
     * 获得新人红包
     * @param uid
     * @param money
     * @throws UserTaoLiJinOriginException
     */
    public UserTaoLiJinOrigin addNewbiesWinMoney(Long uid) throws UserTaoLiJinOriginException;
    /**
     * 等级红包
     * @param uid
     * @param money
     * @param userRank
     * @throws UserTaoLiJinOriginException
     */
    public UserTaoLiJinOrigin addRankWinMoney(Long uid, UserRank userRank) throws UserTaoLiJinOriginException;
    /**
     * 邀请红包
     * @param uid
     * @param money
     * @param inviteName
     * @throws UserTaoLiJinOriginException
     */
    public UserTaoLiJinOrigin addInviteWinMoney(Long uid, String inviteName) throws UserTaoLiJinOriginException;
    /**
     * 分享红包
     * @param uid
     * @param money
     * @throws UserTaoLiJinOriginException
     */
    public UserTaoLiJinOrigin addShareWinMoney(Long uid) throws UserTaoLiJinOriginException;
    /**
     * 退回
     * @param uid
     * @param money
     * @param total
     * @param report
     * @throws UserTaoLiJinOriginException
     */
    public void refundMoney(UserTaoLiJinReport report) throws UserTaoLiJinOriginException;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/tlj/UserTaoLiJinRecordService.java
New file
@@ -0,0 +1,92 @@
package com.yeshi.fanli.service.inter.tlj;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinRecord;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.exception.tlj.UserTaoLiJinRecordException;
import com.yeshi.fanli.vo.user.UserTaoLiJinRecordVO;
public interface UserTaoLiJinRecordService {
    /**
     *  创建淘礼金
     * @param origin 用户使用类型: 1 自购 、 2 分享
     * @param uid
     * @param auctionId
     * @param totalNum
     * @param perface
     * @throws UserTaoLiJinRecordException
     */
    public UserTaoLiJinRecord createUserTaoLiJin(int origin, Long uid, Long auctionId, BigDecimal perface, int totalNum, String name, Date sendStartTime,
            Date sendEndTime, Date useStartTime, Date useEndTime) throws UserTaoLiJinRecordException;
    /**
     * 查询用户分享淘礼金记录
     * @param start
     * @param count
     * @param uid
     * @return
     * @throws UserTaoLiJinRecordException
     */
    public List<UserTaoLiJinRecordVO> getRecordByUid(long start, int count, Long uid);
    /**
     * 统计创建次数
     * @param uid
     * @return
     */
    public long countRecordByUid(Long uid);
    /**
     * 今日创建分享红包个数
     * @param uid
     * @return
     */
    public long countTodayNum(Long uid);
    /**
     * 查询推广红包
     * @param uid
     * @param goodsId
     * @return
     */
    public BigDecimal getShareHongBaoByUidAndGoodsId(Long uid, Long goodsId);
    /**
     * 根据红包id 查询
     * @param rightsId
     * @return
     */
    public UserTaoLiJinRecord getByRightsId(String rightsId);
    public UserTaoLiJinRecord selectByPrimaryKey(Long id);
    /**
     * 自购创建红包
     * @param uid
     * @param totalNum
     * @param goods
     * @return
     * @throws UserTaoLiJinRecordException
     */
    public UserTaoLiJinRecord createSelfBuyTaoLiJin(Long uid, int totalNum, TaoBaoGoodsBrief goods)
            throws UserTaoLiJinRecordException;
    /**
     * 分享创建红包
     * @param uid
     * @param totalNum
     * @param goods
     * @return
     * @throws UserTaoLiJinRecordException
     */
    public UserTaoLiJinRecord createShareTaoLiJin(Long uid, int totalNum, TaoBaoGoodsBrief goods)
            throws UserTaoLiJinRecordException;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/tlj/UserTaoLiJinReportService.java
New file
@@ -0,0 +1,25 @@
package com.yeshi.fanli.service.inter.tlj;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinReport;
public interface UserTaoLiJinReportService {
    /**
     * 保存或更新报告信息
     * @param record
     */
    public void insertDefault(String rightsId);
    /**
     * 更新报告
     * @param record
     */
    public void updateByPrimaryKeySelective(UserTaoLiJinReport record);
    /**
     * 报告更新
     * @return
     */
    public void needUpdateReport();
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInfoExtraService.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.service.inter.user;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.bus.user.UserRank;
import com.yeshi.fanli.exception.user.UserInfoExtraException;
import com.yeshi.fanli.vo.user.UserInfoExtraVO;
@@ -95,4 +96,11 @@
     */
    public void createUserInfoExtra(Long uid) throws UserInfoExtraException;
    
    /**
     * 获取用户等级
     * @param uid
     * @return
     */
    public UserRank gerUserRank(Long uid);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserMoneyExtraService.java
New file
@@ -0,0 +1,29 @@
package com.yeshi.fanli.service.inter.user;
import java.math.BigDecimal;
import com.yeshi.fanli.entity.bus.user.UserMoneyExtra;
public interface UserMoneyExtraService {
    /**
     * 查询用户额外金额
     * @param uid
     * @return
     */
    public UserMoneyExtra selectByPrimaryKey(Long uid);
    /**
     * 更新信息
     * @param record
     */
    public void updateByPrimaryKeySelective(UserMoneyExtra record);
    /**
     * 用户获得推广金
     * @param uid
     * @param money
     * @param canSelf
     */
    public void addTaoLiJin(Long uid, BigDecimal money, boolean canSelf);
}
fanli/src/main/java/com/yeshi/fanli/util/Constant.java
@@ -14,9 +14,9 @@
public class Constant {
    public static boolean IS_TASK = false;
    // 外网环境
    public static boolean IS_OUTNET = true;
    public static boolean IS_OUTNET = false;
    public static boolean IS_TEST = false;
    public static boolean IS_TEST = true;
    public static int PAGE_SIZE = 20;
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOtherDetailFactory.java
@@ -32,5 +32,29 @@
        detail.setSourceId(userCouponId);
        return detail;
    }
    /**
     * 券相关信息的通知
     *
     * @param uid
     * @param content
     * @param type
     * @param beiZhu
     * @return
     */
    public static MsgOtherDetail createTaoLiJinMsg(Long uid, Long userCouponId, MsgOtherCouponContentDTO content,
            MsgTypeOtherTypeEnum type, String beiZhu) {
        if (uid == null)
            return null;
        MsgOtherDetail detail = new MsgOtherDetail();
        detail.setBeiZhu(beiZhu);
        detail.setCreateTime(new Date());
        detail.setRead(false);
        detail.setUser(new UserInfo(uid));
        detail.setCoupnContent(content);
        detail.setType(type);
        detail.setSourceId(userCouponId);
        return detail;
    }
}
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java
@@ -7,6 +7,7 @@
import com.google.gson.Gson;
import com.yeshi.fanli.dto.msg.MsgOtherCouponContentDTO;
import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail;
import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail;
import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail;
@@ -477,6 +478,9 @@
     */
    public static UserMsgVO create(MsgOtherDetail msg) {
        List<CommonMsgItemVO> items = new ArrayList<>();
        String icon = null;
        if (msg.getType() == MsgTypeOtherTypeEnum.couponMianDan
                || msg.getType() == MsgTypeOtherTypeEnum.couponWelfareMianDan
                || msg.getType() == MsgTypeOtherTypeEnum.couponReward) {
@@ -486,7 +490,9 @@
            MsgOtherCouponContentDTO dto = new Gson().fromJson(msg.getContent(), MsgOtherCouponContentDTO.class);
            if (dto == null)
                return null;
            icon = "http://img.flqapp.com/resource/msg/icon_msg_other_coupon.png";
            List<ClientTextStyleVO> contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getState(), COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("状态", COLOR_TITLE), contentList));
@@ -547,10 +553,42 @@
            contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
                    COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
        } else if (msg.getType() == MsgTypeOtherTypeEnum.taoLiJin) {
            if (StringUtil.isNullOrEmpty(msg.getContent()))
                return null;
            MsgOtherTaoLiJinContentDTO dto = new Gson().fromJson(msg.getContent(), MsgOtherTaoLiJinContentDTO.class);
            if (dto == null)
                return null;
            icon = "http://img.flqapp.com/resource/msg/icon_msg_other_tlj.png";
            List<ClientTextStyleVO> contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(dto.getState(), COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("状态", COLOR_TITLE), contentList));
            if (!StringUtil.isNullOrEmpty(dto.getSource())) {
                contentList = new ArrayList<>();
                contentList.add(new ClientTextStyleVO(dto.getSource() + "", COLOR_CONTENT));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("来源", COLOR_TITLE), contentList));
            }
            if (dto.getMoney() != null) {
                contentList = new ArrayList<>();
                contentList.add(new ClientTextStyleVO("¥" + filterMoney(dto.getMoney().setScale(2)),
                        COLOR_HIGHLIGHT_CONTENT));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("面额", COLOR_TITLE), contentList));
            }
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
                    COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
        }
        return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_other_coupon.png", msg.getType().getDesc(),
                msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
        return new UserMsgVO(icon, msg.getType().getDesc(),    msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
    }
}
fanli/src/main/java/com/yeshi/fanli/util/mybatishandler/tlj/TaoLiJinDetailTypeEnumHandler.java
New file
@@ -0,0 +1,54 @@
package com.yeshi.fanli.util.mybatishandler.tlj;
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.bus.tlj.UserTaoLiJinDetail.TaoLiJinDetailTypeEnum;
public class TaoLiJinDetailTypeEnumHandler extends BaseTypeHandler<TaoLiJinDetailTypeEnum> {
    @Override
    public TaoLiJinDetailTypeEnum getNullableResult(ResultSet arg0, String arg1) throws SQLException {
        String key = arg0.getString(arg1);
        if (arg0.wasNull()) {
            return null;
        } else {
            return TaoLiJinDetailTypeEnum.valueOf(key);
        }
    }
    @Override
    public TaoLiJinDetailTypeEnum getNullableResult(ResultSet arg0, int arg1) throws SQLException {
        String key = arg0.getString(arg1);
        if (arg0.wasNull()) {
            return null;
        } else {
            // 根据数据库中的key值,定位SexEnum子类
            return TaoLiJinDetailTypeEnum.valueOf(key);
        }
    }
    @Override
    public TaoLiJinDetailTypeEnum getNullableResult(CallableStatement arg0, int arg1) throws SQLException {
        String key = arg0.getString(arg1);
        if (arg0.wasNull()) {
            return null;
        } else {
            // 根据数据库中的key值,定位SexEnum子类
            return TaoLiJinDetailTypeEnum.valueOf(key);
        }
    }
    @Override
    public void setNonNullParameter(PreparedStatement arg0, int arg1, TaoLiJinDetailTypeEnum arg2, JdbcType arg3)
            throws SQLException {
        arg0.setString(arg1, arg2.name());
    }
}
fanli/src/main/java/com/yeshi/fanli/util/mybatishandler/tlj/TaoLiJinOriginEnumHandler.java
New file
@@ -0,0 +1,54 @@
package com.yeshi.fanli.util.mybatishandler.tlj;
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.bus.tlj.UserTaoLiJinOrigin.TaoLiJinOriginEnum;
public class TaoLiJinOriginEnumHandler extends BaseTypeHandler<TaoLiJinOriginEnum> {
    @Override
    public TaoLiJinOriginEnum getNullableResult(ResultSet arg0, String arg1) throws SQLException {
        String key = arg0.getString(arg1);
        if (arg0.wasNull()) {
            return null;
        } else {
            return TaoLiJinOriginEnum.valueOf(key);
        }
    }
    @Override
    public TaoLiJinOriginEnum getNullableResult(ResultSet arg0, int arg1) throws SQLException {
        String key = arg0.getString(arg1);
        if (arg0.wasNull()) {
            return null;
        } else {
            // 根据数据库中的key值,定位SexEnum子类
            return TaoLiJinOriginEnum.valueOf(key);
        }
    }
    @Override
    public TaoLiJinOriginEnum getNullableResult(CallableStatement arg0, int arg1) throws SQLException {
        String key = arg0.getString(arg1);
        if (arg0.wasNull()) {
            return null;
        } else {
            // 根据数据库中的key值,定位SexEnum子类
            return TaoLiJinOriginEnum.valueOf(key);
        }
    }
    @Override
    public void setNonNullParameter(PreparedStatement arg0, int arg1, TaoLiJinOriginEnum arg2, JdbcType arg3)
            throws SQLException {
        arg0.setString(arg1, arg2.name());
    }
}
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java
@@ -767,12 +767,13 @@
        tg.setSalesType(1);
        // 测试使用
        // tg.setSalesType(Math.random() > 0.5 ? tg.getSalesType() : 3);
        if (Constant.IS_TEST) {
            List<ClientTextStyleVO> labels = new ArrayList<>();
            labels.add(new ClientTextStyleVO("标签内容", "#F14242"));
            labels.add(new ClientTextStyleVO("标签内容", "#00FF00"));
            tg.setLabels(labels);
        }
//        if(Constant.IS_TEST)
//        {
//         List<ClientTextStyleVO> labels = new ArrayList<>();
//         labels.add(new ClientTextStyleVO("标签内容", "#F14242"));
//         labels.add(new ClientTextStyleVO("标签内容", "#00FF00"));
//         tg.setLabels(labels);
//        }
        return tg;
    }
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java
@@ -12,6 +12,7 @@
import com.taobao.api.ApiException;
import com.yeshi.fanli.dto.taobao.TaoBaoShopInfoDTO;
import com.yeshi.fanli.dto.taobao.TaoLiJinDTO;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinReport;
import com.yeshi.fanli.entity.taobao.RelateGoods;
import com.yeshi.fanli.entity.taobao.SearchFilter;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
@@ -1946,9 +1947,8 @@
    }
    // 淘礼金创建
    public static TaoLiJinDTO createTaoLiJin(Long auctionId, String name, BigDecimal perface, int totalNum,
            int useDayLimit, Date sendStartTime, Date sendEndTime, Date useStartTime) {
            Date sendStartTime, Date sendEndTime, Date useStartTime, Date useEndTime) {
        Map<String, String> map = new HashMap<>();
        map.put("method", "taobao.tbk.dg.vegas.tlj.create");
        map.put("adzone_id", TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT.split("_")[3]);
@@ -1959,16 +1959,25 @@
        map.put("security_switch", "false");
        map.put("per_face", perface.toString());
        map.put("send_start_time", TimeUtil.getGernalTime(sendStartTime.getTime(), "yyyy-MM-dd HH:mm:ss"));
        map.put("send_end_time", TimeUtil.getGernalTime(sendEndTime.getTime(), "yyyy-MM-dd HH:mm:ss"));
        map.put("use_end_time", useDayLimit + "");
        map.put("use_end_time_mode", "1");
        map.put("use_start_time", TimeUtil.getGernalTime(useStartTime.getTime(), "yyyy-MM-dd HH:mm:ss"));
        if(sendEndTime != null)
            map.put("send_end_time", TimeUtil.getGernalTime(sendEndTime.getTime(), "yyyy-MM-dd HH:mm:ss"));
        if(useEndTime != null) {
            map.put("use_end_time", TimeUtil.getGernalTime(useEndTime.getTime(), "yyyy-MM-dd"));
            map.put("use_end_time_mode", "2");
        }
        if(useStartTime != null)
            map.put("use_start_time", TimeUtil.getGernalTime(useStartTime.getTime(), "yyyy-MM-dd"));
        TaoKeAppInfo app = new TaoKeAppInfo();
        app.setAppKey(TaoBaoConstant.TAOBAO_AUTH_APPKEY);
        app.setAppSecret(TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
        try {
            JSONObject json = TaoKeBaseUtil.baseRequest(map, app);
            String result = TaoKeBaseUtil.baseRequestForThreeTimes(map, app);
            JSONObject json = JSONObject.fromObject(result);
            System.out.println(json);
            JSONObject root = json.optJSONObject("tbk_dg_vegas_tlj_create_response");
            if (root != null && root.optJSONObject("result") != null) {
@@ -1980,28 +1989,58 @@
                    return dto;
                }
            }
        } catch (TaoKeApiException e) {
            e.printStackTrace();
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
        return null;
    }
    // lCj1Alo8b9L4Ed6yJLq6iqJ7%2BkHL3AEW
    public static void getTaoLiJinEffective() {
    // 淘礼金报告
    public static UserTaoLiJinReport getTaoLiJinEffective(String rightsId) {
        Map<String, String> map = new HashMap<>();
        map.put("method", "taobao.tbk.dg.vegas.tlj.instance.report");
        map.put("rights_id", "ZrIIvF/nd7SlL5Bg59eTK6J7+kHL3AEW");
        map.put("rights_id", rightsId);
        TaoKeAppInfo app = new TaoKeAppInfo();
        app.setAppKey(TaoBaoConstant.TAOBAO_AUTH_APPKEY);
        app.setAppSecret(TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
        String json = TaoKeBaseUtil.baseRequestForThreeTimes(map, app);
        System.out.println(json);
        try {
            String result = TaoKeBaseUtil.baseRequestForThreeTimes(map, app);
            JSONObject json = JSONObject.fromObject(result);
            System.out.println(json);
            JSONObject root = json.optJSONObject("tbk_dg_vegas_tlj_instance_report_response");
            if (root != null && root.optJSONObject("result") != null) {
                if (root.optJSONObject("result").optBoolean("success")) {
                    JSONObject modelJson = root.optJSONObject("result").optJSONObject("model");
                    if (modelJson != null && modelJson.size() > 0) {
                        UserTaoLiJinReport report = new UserTaoLiJinReport();
                        report.setId(rightsId);
                        report.setUnfreezeAmount(new BigDecimal(modelJson.optString("unfreeze_amount")));
                        report.setUnfreezeNum(modelJson.optInt("unfreeze_num"));
                        report.setRefundAmount(new BigDecimal(modelJson.optString("refund_amount")));
                        report.setRefundNum(modelJson.optInt("refund_num"));
                        report.setAlipayAmount(new BigDecimal(modelJson.optString("alipay_amount")));
                        report.setUseAmount(new BigDecimal(modelJson.optString("use_amount")));
                        report.setUseNum(modelJson.optInt("use_num"));
                        report.setWinAmount(new BigDecimal(modelJson.optString("win_amount")));
                        report.setWinNum(modelJson.optInt("win_num"));
                        report.setPreCommissionAmount(new BigDecimal(modelJson.optString("pre_commission_amount")));
                        return report;
                    }
                }
            }
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
        return null;
    }
}
class QuanInfo {
fanli/src/main/java/com/yeshi/fanli/vo/tlj/SpreadHongBao.java
New file
@@ -0,0 +1,23 @@
package com.yeshi.fanli.vo.tlj;
import com.google.gson.annotations.Expose;
public class SpreadHongBao {
    @Expose
    private String money;
    @Expose
    private String tip;
    public String getMoney() {
        return money;
    }
    public void setMoney(String money) {
        this.money = money;
    }
    public String getTip() {
        return tip;
    }
    public void setTip(String tip) {
        this.tip = tip;
    }
}
fanli/src/main/java/com/yeshi/fanli/vo/tlj/TaoLiJinDetailVO.java
New file
@@ -0,0 +1,27 @@
package com.yeshi.fanli.vo.tlj;
import com.google.gson.annotations.Expose;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail;
public class TaoLiJinDetailVO {
    @Expose
    private TaoLiJinMonthVO month;
    @Expose
    private UserTaoLiJinDetail detail;
    public TaoLiJinMonthVO getMonth() {
        return month;
    }
    public void setMonth(TaoLiJinMonthVO month) {
        this.month = month;
    }
    public UserTaoLiJinDetail getDetail() {
        return detail;
    }
    public void setDetail(UserTaoLiJinDetail detail) {
        this.detail = detail;
    }
}
fanli/src/main/java/com/yeshi/fanli/vo/tlj/TaoLiJinMonthVO.java
New file
@@ -0,0 +1,65 @@
package com.yeshi.fanli.vo.tlj;
import com.google.gson.annotations.Expose;
public class TaoLiJinMonthVO {
    @Expose
    private int year;// 年份
    @Expose
    private int month;// 月
    @Expose
    private String expend;// 支出
    @Expose
    private String income;// 收入
    private String dateFormate;
    public String getDateFormate() {
        return dateFormate;
    }
    public void setDateFormate(String dateFormate) {
        this.dateFormate = dateFormate;
    }
    public TaoLiJinMonthVO(int year, int month) {
        this.year = year;
        this.month = month;
    }
    public TaoLiJinMonthVO() {
    }
    public int getYear() {
        return year;
    }
    public void setYear(int year) {
        this.year = year;
    }
    public int getMonth() {
        return month;
    }
    public void setMonth(int month) {
        this.month = month;
    }
    public String getExpend() {
        return expend;
    }
    public void setExpend(String expend) {
        this.expend = expend;
    }
    public String getIncome() {
        return income;
    }
    public void setIncome(String income) {
        this.income = income;
    }
}
fanli/src/main/java/com/yeshi/fanli/vo/user/UserSettingsVO.java
@@ -16,6 +16,10 @@
    private Integer noShareRecordAndStorage;
    // 不看邀请拿奖金
    private Integer noInvitationBonus;
    // 开启推广红包
    private Integer openSpreadHongBao;
    public Integer getCancelNotice() {
        return cancelNotice;
@@ -57,4 +61,12 @@
        this.noInvitationBonus = noInvitationBonus;
    }
    public Integer getOpenSpreadHongBao() {
        return openSpreadHongBao;
    }
    public void setOpenSpreadHongBao(Integer openSpreadHongBao) {
        this.openSpreadHongBao = openSpreadHongBao;
    }
}
fanli/src/main/java/com/yeshi/fanli/vo/user/UserTaoLiJinRecordVO.java
New file
@@ -0,0 +1,150 @@
package com.yeshi.fanli.vo.user;
import java.math.BigDecimal;
import java.util.Date;
import com.google.gson.annotations.Expose;
import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
public class UserTaoLiJinRecordVO {
    // 商品id
    @Expose
    private Long auctionId;
    // 商品
    @Expose
    private String title;
    // 商品图片
    @Expose
    private String pictUrl;
    // 商品类型
    @Expose
    private int userType;
    // 淘礼金创建时间
    @Expose
    private Date createTime;
    // 已领取个数
    @Expose
    private int winNum;
    // 已使用个数
    @Expose
    private int useNum;
    // 已退回
    @Expose
    private int refundNum;
    // 总个数
    @Expose
    private int totalNum;
    // 剩余个数
    @Expose
    private int surplusNum;
    // 佣金
    private BigDecimal commission;
    // 预估奖金
    @Expose
    private ClientTextStyleVO desc;
    public Long getAuctionId() {
        return auctionId;
    }
    public void setAuctionId(Long auctionId) {
        this.auctionId = auctionId;
    }
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    public String getPictUrl() {
        return pictUrl;
    }
    public void setPictUrl(String pictUrl) {
        this.pictUrl = pictUrl;
    }
    public int getUserType() {
        return userType;
    }
    public void setUserType(int userType) {
        this.userType = userType;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public int getWinNum() {
        return winNum;
    }
    public void setWinNum(int winNum) {
        this.winNum = winNum;
    }
    public int getUseNum() {
        return useNum;
    }
    public void setUseNum(int useNum) {
        this.useNum = useNum;
    }
    public int getRefundNum() {
        return refundNum;
    }
    public void setRefundNum(int refundNum) {
        this.refundNum = refundNum;
    }
    public int getTotalNum() {
        return totalNum;
    }
    public void setTotalNum(int totalNum) {
        this.totalNum = totalNum;
    }
    public int getSurplusNum() {
        return surplusNum;
    }
    public void setSurplusNum(int surplusNum) {
        this.surplusNum = surplusNum;
    }
    public BigDecimal getCommission() {
        return commission;
    }
    public void setCommission(BigDecimal commission) {
        this.commission = commission;
    }
    public ClientTextStyleVO getDesc() {
        return desc;
    }
    public void setDesc(ClientTextStyleVO desc) {
        this.desc = desc;
    }
}
fanli/src/main/resource/ehcache.xml
@@ -121,86 +121,79 @@
        maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="120"
        timeToLiveSeconds="120" overflowToDisk="true"
        memoryStoreEvictionPolicy="LRU" />
    <!-- dos拦截 -->
    <!-- dos拦截 -->
    <cache name="rsCache" maxElementsInMemory="1000"
        maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="120"
        timeToLiveSeconds="120" overflowToDisk="true"
        memoryStoreEvictionPolicy="LRU" />
    <!-- 淘客推荐模块商品缓存 -->
    <cache name="taoKeMaterialCache" maxElementsInMemory="1000"
        maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="120"
        timeToLiveSeconds="120" overflowToDisk="true"
        memoryStoreEvictionPolicy="LRU" />
        memoryStoreEvictionPolicy="LRU" />
    <!-- 淘客物料搜索缓存 -->
    <cache name="searchWuLiaoCache" maxElementsInMemory="1000"
        maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="120"
        timeToLiveSeconds="120" overflowToDisk="true"
        memoryStoreEvictionPolicy="LRU" />
        memoryStoreEvictionPolicy="LRU" />
    <!-- 9.9/19.9/29.9/49.9模块商品缓存 -->
    <cache name="quality9K9Cache" maxElementsInMemory="1000"
        maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="120"
        timeToLiveSeconds="120" overflowToDisk="true"
        memoryStoreEvictionPolicy="LRU" />
        memoryStoreEvictionPolicy="LRU" />
    <!-- 精选库商品查询缓存 -->
    <cache name="qualityCache" maxElementsInMemory="1000"
        maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="120"
        timeToLiveSeconds="120" overflowToDisk="true"
        memoryStoreEvictionPolicy="LRU" />
        memoryStoreEvictionPolicy="LRU" />
    <!-- 标签缓存 -->
    <cache name="labelCache" maxElementsInMemory="1000"
        maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="120"
        timeToLiveSeconds="120" overflowToDisk="true"
        memoryStoreEvictionPolicy="LRU" />
        memoryStoreEvictionPolicy="LRU" />
    <!-- 淘宝推荐物料id -->
    <cache name="taobaoMeterialCache" maxElementsInMemory="1000"
        maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="120"
        timeToLiveSeconds="120" overflowToDisk="true"
        memoryStoreEvictionPolicy="LRU" />
        memoryStoreEvictionPolicy="LRU" />
    <!-- 混合分类查询缓存 -->
    <cache name="mergeClassCache" maxElementsInMemory="1000"
        maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="120"
        timeToLiveSeconds="120" overflowToDisk="true"
        memoryStoreEvictionPolicy="LRU" />
        memoryStoreEvictionPolicy="LRU" />
    <!-- 混合分类查询缓存 -->
    <cache name="helpCenterCache" maxElementsInMemory="1000"
        maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="120"
        timeToLiveSeconds="120" overflowToDisk="true"
        memoryStoreEvictionPolicy="LRU" />
        memoryStoreEvictionPolicy="LRU" />
    <!-- 双11缓存 -->
    <cache name="s11Cache" maxElementsInMemory="1000"
        maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="120"
        timeToLiveSeconds="120" overflowToDisk="true"
        memoryStoreEvictionPolicy="LRU" />
    <!-- 系统自定义券缓存 -->
        memoryStoreEvictionPolicy="LRU" />
        <!-- 系统自定义券缓存 -->
    <cache name="systemCouponCache" maxElementsInMemory="1000"
        maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="120"
        timeToLiveSeconds="120" overflowToDisk="true"
        memoryStoreEvictionPolicy="LRU" />
    <!--品牌缓存 -->
        memoryStoreEvictionPolicy="LRU" />
        <!--品牌缓存 -->
    <cache name="brandCache" maxElementsInMemory="1000"
        maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="120"
        timeToLiveSeconds="120" overflowToDisk="true"
        memoryStoreEvictionPolicy="LRU" />
        memoryStoreEvictionPolicy="LRU" />
    <!--动态缓存 -->
    <cache name="dynamicCache" maxElementsInMemory="1000"
        maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="120"
        timeToLiveSeconds="120" overflowToDisk="true"
        memoryStoreEvictionPolicy="LRU" />
    <!--通用模板内容缓存 -->
    <cache name="commonContentCache" maxElementsInMemory="1000"
        maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="120"
        timeToLiveSeconds="120" overflowToDisk="true"
        memoryStoreEvictionPolicy="LRU" />
        memoryStoreEvictionPolicy="LRU" />
</ehcache>
fanli/src/main/resource/log4j.properties
@@ -199,11 +199,3 @@
log4j.appender.requestTimeLog.layout=org.apache.log4j.PatternLayout
log4j.appender.requestTimeLog.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%c]-[%p] %m%n
log4j.appender.mongodb=org.apache.log4j.ConsoleAppender
log4j.appender.mongodb.Target=System.out
log4j.appender.mongodb.Threshold=DEBUG
log4j.appender.mongodb.ImmediateFlush=true
log4j.appender.mongodb.layout=org.apache.log4j.PatternLayout
log4j.appender.mongodb.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %5p %X{RequestId} - %m%n
log4j.logger.org.springframework.data.mongodb.core= DEBUG
utils/src/main/java/org/yeshi/utils/HttpUtil.java
@@ -9,9 +9,7 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.commons.httpclient.Header;
@@ -31,7 +29,6 @@
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.BasicCredentialsProvider;
@@ -42,7 +39,6 @@
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import sun.rmi.log.LogHandler;
public class HttpUtil {
@@ -56,7 +52,7 @@
        return "";
    }
    public static String getShortLink(String url) {
    public static String getShortLink(String url) {
        String shortLink = getShortLink2(url);
        if (StringUtil.isNullOrEmpty(shortLink))
            shortLink = getShortLink3(url);