admin
2019-04-12 c389b1ca090df256bad7fd0d183914146c1f93b8
Merge remote-tracking branch 'origin/master'
41个文件已添加
161个文件已修改
14个文件已删除
13501 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/AuthCallBackController.java 65 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/ClientJspController.java 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/ActivityAdminController.java 212 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsClassAdminCotroller.java 207 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsSubClassAdminController.java 250 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/PushController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/SystemCouponAdminController.java 344 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/config/SystemClientParamsAdminController.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/HomeNavbarAdminController.java 233 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/SpecialCardAdminController.java 520 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/SpecialPlaceAdminController.java 169 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/SwiperBannerAdminController.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/apph5/AppH5QualityGoodsController.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/apph5/AppH5UserController.java 109 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/ActivityController.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/ConfigController.java 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/GoodsClassController.java 116 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/HomeNavbarController.java 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/InviteGetMoneyController.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/RecommendController.java 204 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/SMSController.java 118 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/SystemClientController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserAccountController.java 208 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserAuthController.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserCouponController.java 289 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserInfoController.java 244 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java 165 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserOrderController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/h5/H5SearchController.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/web/WebSearchController.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/xcx/XcxSearchController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/xcx/XcxSystemMiniController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/AdminUserDao.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/config/SystemClientParamsDao.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/config/SystemConfigDao.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/config/SystemHelpListDao.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/config/SystemSecondProblemDao.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/config/SystemZnxDao.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/goods/GoodsClassDao.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/goods/GoodsSecondClassDao.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/goods/SuperGoodsClassDao.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/AdminUserMapper.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/CustomerContentMapper.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/CustomerNameMapper.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/GoodsClassMapper.java 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/GoodsSecondClassMapper.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/SuperGoodsClassMapper.java 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/SystemClientParamsMapper.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/SystemConfigMapper.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/ThreeSaleMapper.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/UserInfoMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/activity/RecommendActivityMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/HomeNavbarMapper.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/SpecialCardMapper.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/SpecialMapper.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/SpecialPlaceMapper.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/SwiperBannerMapper.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/SwiperPictureMapper.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/lable/QualityFactoryMapper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/msg/SystemZnxMapper.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/taobao/TaoBaoUnionAuthRecordMapper.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserExtraTaoBaoInfoMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserInviteRecordMapper.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserLotteryRecordMapper.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserSystemCouponMapper.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/statistic/OrderClassStatisticDao.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/activity/RecommendActivity.java 72 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/clazz/GoodsClass.java 130 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/clazz/GoodsSecondClass.java 87 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/clazz/GoodsSubClass.java 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/clazz/TaoBaoClass.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/clazz/TaoBaoClassRelation.java 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/HomeNavbar.java 159 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/Special.java 97 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/SpecialCard.java 142 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/SpecialPlace.java 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/SuperHomeNavbar.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/SuperSpecial.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/SuperSpecialCard.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/SwiperBanner.java 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/SwiperPicture.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/lable/BoutiqueAutoRule.java 98 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/lable/Label.java 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/lable/LabelClass.java 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/lable/LabelGoods.java 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/lable/MergeClass.java 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/lable/QualityFactory.java 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/lable/QualityFlashSale.java 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/UserSystemMsg.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/su/clazz/SuperGoodsClass.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/Extract.java 83 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/ExtractAuditRecord.java 55 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/ExtractRecord.java 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/PayInfo.java 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserExtraTaoBaoInfo.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserInfoExtra.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserInviteRecord.java 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserLotteryRecord.java 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserSystemCoupon.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/common/AdminUser.java 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/statistic/OrderClassStatistic.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/system/CustomerContent.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/system/CustomerName.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/system/SystemClientParams.java 84 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/system/SystemConfig.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/system/SystemZnx.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/GoodsClassException.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/GoodsSubClassException.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/SpecialPlaceException.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/homemodule/HomeNavbarException.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/homemodule/SpecialCardException.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/homemodule/SpecialException.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/user/UserExtraTaoBaoInfoException.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/user/UserInfoException.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/user/UserLotteryRecordException.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/AdminUserMapper.xml 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/CustomerContentMapper.xml 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/CustomerNameMapper.xml 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/ExtractMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/GoodsClassMapper.xml 114 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/GoodsSecondClassMapper.xml 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/GoodsSubClassMapper.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/SuperGoodsClassMapper.xml 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/SystemClientParamsMapper.xml 97 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/SystemConfigMapper.xml 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/ThreeSaleMapper.xml 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/activity/RecommendActivityMapper.xml 131 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/HomeNavbarMapper.xml 128 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SpecialCardMapper.xml 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SpecialMapper.xml 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SpecialPlaceMapper.xml 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SwiperBannerMapper.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SwiperPictureMapper.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/lable/QualityFactoryMapper.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/msg/SystemZnxMapper.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/taobao/TaoBaoUnionAuthRecordMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserExtraTaoBaoInfoMapper.xml 133 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserInfoExtraMapper.xml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserInviteRecordMapper.xml 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserLotteryRecordMapper.xml 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/AdminUserServiceImpl.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/activity/ActivityServiceImpl.java 212 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/config/CustomerContentServiceImpl.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/config/CustomerNameServiceImpl.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/config/SystemClientParamsServiceImpl.java 344 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/config/SystemConfigServiceImpl.java 128 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/count/CommonOrderCountServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsClassServiceImpl.java 658 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsSecondClassServiceImpl.java 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsSubClassServiceImpl.java 195 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/SuperGoodsClassServiceImpl.java 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/FloatADServiceImpl.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/HomeNavbarServiceImpl.java 342 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialCardServiceImpl.java 231 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialPlaceImpl.java 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java 354 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SwiperBannerServiceImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SwiperPictureServiceImpl.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/ThreeSaleSerivceImpl.java 82 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/lable/LabelServiceImpl.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/lable/QualityGoodsServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserSystemMsgServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/push/PushGoodsServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/push/PushServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/statistic/OrderClassStatisticServiceImpl.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoUnionAuthRecordServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/AccountMessageServiceImpl.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/SMSServiceImpl.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/ShamUserServiceImpl.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/SystemZnxServiceImpl.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountServiceImpl.java 224 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserExtraTaoBaoInfoServiceImpl.java 210 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java 174 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoServiceImpl.java 88 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInviteRecordServiceImpl.java 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserLotteryRecordServiceImpl.java 385 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java 132 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/activity/ActivityService.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/config/CustomerContentService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/config/CustomerNameService.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/config/SystemClientParamsService.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/config/SystemConfigService.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/GoodsClassService.java 64 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/GoodsSecondClassService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/GoodsSubClassService.java 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/SuperGoodsClassService.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/HomeNavbarService.java 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SpecialCardService.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SpecialPlaceService.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SpecialService.java 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SwiperBannerService.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SwiperPictureService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/hongbao/ThreeSaleSerivce.java 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/lable/QualityGoodsService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/order/CommonOrderCountService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/push/PushService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/statistic/OrderClassStatisticService.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/taobao/TaoBaoUnionAuthRecordService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/SMSService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/SystemZnxService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserAccountService.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserExtraTaoBaoInfoService.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInfoExtraService.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInfoService.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInviteRecordService.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserLotteryRecordService.java 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserSystemCouponService.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/RedisManager.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/StringUtil.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/DaTaoKeUtil.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/msg/ActivityInfo.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/msg/UserMsgCenter.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/msg/UserMsgVO.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/AuthCallBackController.java
@@ -14,6 +14,7 @@
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.taobao.TaoBaoUnionAuthRecord;
import com.yeshi.fanli.exception.user.UserExtraTaoBaoInfoException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionAuthRecordService;
import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
@@ -90,14 +91,57 @@
                        TaoBaoConstant.TAOBAO_AUTH_APPSECRET);// 渠道ID
                if (StringUtil.isNullOrEmpty(relationId))
                    LogHelper.test(uid + "渠道备案失败");
                userExtraTaoBaoInfoService.addRelationId(uid, relationId, taoBaoUid, true);
            } else {
                try {
                    userExtraTaoBaoInfoService.addRelationId(uid, relationId, taoBaoUid,nickName, true);
                } catch (UserExtraTaoBaoInfoException e) {
                    LogHelper.test(e.getMsg());
                    errCode = 5;
                }
            } else if ("zigou".equalsIgnoreCase(source))  {
                String specialId = TaoKeApiUtil.getSpecialId(accessToken, TaoBaoConstant.TAOBAO_AUTH_APPKEY,
                        TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
                if (StringUtil.isNullOrEmpty(specialId))
                    LogHelper.test(uid + "会员备案失败");
                userExtraTaoBaoInfoService.addSpecialId(uid, specialId, taoBaoUid, true);
                try {
                    userExtraTaoBaoInfoService.addSpecialId(uid, specialId, taoBaoUid, nickName, true);
                } catch (UserExtraTaoBaoInfoException e) {
                    LogHelper.test(e.getMsg());
                    errCode = 5;
            }
            } else if ("bind".equalsIgnoreCase(source)) {
                boolean bindInfo = true;
                // 绑定淘宝:V1.5.3
                String relationId = TaoKeApiUtil.getRelationId(accessToken, Constant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET);// 渠道ID
                if (StringUtil.isNullOrEmpty(relationId)) {
                    LogHelper.test(uid + "渠道备案失败");
                    bindInfo = false;
                }
                String specialId = null;
                if(bindInfo) {
                    specialId = TaoKeApiUtil.getSpecialId(accessToken, Constant.TAOBAO_AUTH_APPKEY,
                            TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
                    if (StringUtil.isNullOrEmpty(specialId)) {
                        LogHelper.test(uid + "会员备案失败");
                        bindInfo = false;
                    }
                }
                if (!bindInfo) {
                    errCode = 5;// 信息获取不全
                } else {
                    try {
                        userExtraTaoBaoInfoService.saveUserTaoBaoInfo(uid, relationId, specialId, taoBaoUid, nickName, true);
                    } catch (UserExtraTaoBaoInfoException e) {
                        LogHelper.test(e.getMsg());
                        errCode = 6;
                    }
                }
            }
            if (!StringUtil.isNullOrEmpty(nickName))
                try {
@@ -112,6 +156,7 @@
            record.setTaoBaoUserNick(nickName);
            record.setCreateTime(new Date());
            taoBaoUnionAuthRecordService.addAuthRecord(record);
        } catch (Exception e) {
            errCode = 4;
            try {
@@ -124,15 +169,21 @@
        try {
            if (errCode == 0)// 成功
            {
                if ("share".equalsIgnoreCase(source))
                if ("share".equalsIgnoreCase(source)) {
                    response.sendRedirect("http://apph5.yeshitv.com/apppage/flq_bonusState.html?code=0");
                else
                } else if ("zigou".equalsIgnoreCase(source)) {
                    response.sendRedirect("http://apph5.yeshitv.com/apppage/flq_rebateState.html?code=0");
                } else if ("bind".equalsIgnoreCase(source)) {
                    response.getWriter().print("<script>yestv.toast(\"恭喜你,淘宝绑定成功\");yestv.finishPage();</script>");
                }
            } else {// 失败
                if ("share".equalsIgnoreCase(source))
                if ("share".equalsIgnoreCase(source)) {
                    response.sendRedirect("http://apph5.yeshitv.com/apppage/flq_bonusState.html?code=1");
                else
                } else if ("zigou".equalsIgnoreCase(source)) {
                    response.sendRedirect("http://apph5.yeshitv.com/apppage/flq_rebateState.html?code=1");
                } else if ("bind".equalsIgnoreCase(source)) {
                    response.getWriter().print("<script>yestv.toast(\"抱歉,淘宝绑定失败\");yestv.finishPage();</script>");
                }
            }
        } catch (Exception e) {
fanli/src/main/java/com/yeshi/fanli/controller/ClientJspController.java
@@ -42,6 +42,8 @@
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.config.BusinessSystemService;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.config.CustomerContentService;
import com.yeshi.fanli.service.inter.config.CustomerNameService;
import com.yeshi.fanli.service.inter.config.SystemClientParamsService;
import com.yeshi.fanli.service.inter.config.SystemConfigService;
import com.yeshi.fanli.service.inter.goods.GoodsSecondClassService;
@@ -53,6 +55,7 @@
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
import com.yeshi.fanli.service.inter.user.ShamUserService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.service.inter.user.UserInviteRecordService;
import com.yeshi.fanli.util.AESUtil;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.GsonUtil;
@@ -114,10 +117,19 @@
    private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
    @Resource
    private UserInviteRecordService userInviteRecordService;
    @Resource
    private RedisManager redisManager;
    @Resource
    private TaoBaoUnionConfigService taoBaoUnionConfigService;
    @Resource
    private CustomerNameService customerNameService;
    @Resource
    private CustomerContentService customerContentService;
    private static final String DOWNURL = "http://sj.qq.com/myapp/detail.htm?apkName="
            + Constant.systemCommonConfig.getAndroidPackageName();
@@ -275,20 +287,9 @@
            // request.setAttribute("error", "1");
            return "redirect:" + down;
        }
        if (code == null) {// 用户取消了登陆!
            return "redirect:" + down;
        }
        UserInfo inviter = userInfoService.getUserById(Long.parseLong(uid));
        if (inviter == null) {// 没得这个人
            return "redirect:" + down;
        }
        boolean b = userInfoService.inviteWXUserInfo(code, inviter);
        if (!b) { // 绑定失败
            // request.setAttribute("msg", "非常遗憾,你已领取过红包,请勿再次领取。");
            return "redirect:" + down;
        }
        // 保存邀请记录
        userInviteRecordService.saveInviteRecord(code, uid);
        return "redirect:" + down;
    }
@@ -609,20 +610,20 @@
    public void getHelpList(PrintWriter out) {
        List<CustomerName> totalList = new ArrayList<>();
        int page = 0;
        List<CustomerName> customerNameList = systemClientParamsService.customerNameList(page, "", 1);
        List<CustomerName> customerNameList = customerNameService.customerNameList(page, "", 1);
        if (customerNameList != null && customerNameList.size() > 0)
            totalList.addAll(customerNameList);
        while (customerNameList != null && customerNameList.size() == Constant.PAGE_SIZE) {
            page++;
            customerNameList = systemClientParamsService.customerNameList(page, "", 1);
            customerNameList = customerNameService.customerNameList(page, "", 1);
            if (customerNameList != null && customerNameList.size() > 0)
                totalList.addAll(customerNameList);
        }
        // 获取每个下面的详情
        for (CustomerName cn : totalList) {
            List<CustomerContent> contentList = systemClientParamsService.getSecondProblemList(0, "", cn.getId());
            List<CustomerContent> contentList = customerContentService.getSecondProblemList(0, "", cn.getId());
            cn.setCustomerContentList(contentList);
        }
        out.print(JsonUtil.loadTrueResult(JsonUtil.getSimpleGson().toJson(totalList)));
@@ -631,7 +632,7 @@
    @RequestMapping("getHelpDetail")
    public void getHelpDetail(long id, PrintWriter out) {
        List<CustomerName> totalList = new ArrayList<>();
        CustomerContent customerContent = systemClientParamsService.getCustomerContent(id);
        CustomerContent customerContent = customerContentService.getCustomerContent(id);
        out.print(JsonUtil.loadTrueResult(customerContent.getContent().replace("\n", "<br>")));
    }
fanli/src/main/java/com/yeshi/fanli/controller/admin/ActivityAdminController.java
@@ -1,19 +1,15 @@
package com.yeshi.fanli.controller.admin;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
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;
@@ -27,6 +23,9 @@
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@Controller
@RequestMapping("admin/new/api/v1/activity")
@@ -56,21 +55,52 @@
    @RequestMapping(value = "getActivity")
    public void getActivity(String callback, long id, PrintWriter out) {
        try {
        RecommendActivity recommendActivity = activityService.getRecommendActivityById(id);
            if (recommendActivity ==null) {
                if (StringUtil.isNullOrEmpty(callback)) {
                    out.print(JsonUtil.loadFalseResult("该动态已不存在"));
                } else {
                    out.print(callback + "(" + JsonUtil.loadFalseResult("该动态已不存在") + ")");
                }
                return;
            }
        if (recommendActivity.getType() == RecommendActivity.TYPE_INVITE) {
            RecommendActivityInviteInfo info = activityService
                    .getRecommendActivityInviteInfoByActivityId(recommendActivity.getId());
            recommendActivity.setInviteInfo(info);
        }
        if (recommendActivity !=null) {
            Date startTime = recommendActivity.getStartTime();
            Date endTime = recommendActivity.getEndTime();
            if (startTime == null && endTime == null) {
                recommendActivity.setTimeTask(false);
                recommendActivity.setStartTime_str("");
                recommendActivity.setEndTime_str("");
            } else {
                recommendActivity.setTimeTask(true);
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
                if (startTime == null) {
                    recommendActivity.setStartTime_str("");
                } else {
                    recommendActivity.setStartTime_str(sdf.format(startTime));
                }
                if (endTime == null) {
                    recommendActivity.setEndTime_str("");
                } else {
                    recommendActivity.setEndTime_str(sdf.format(endTime));
                }
            }
            ActivityUser activityUser = recommendActivity.getActivityUser();
            if (activityUser != null) {
                ActivityUser resultUser = activityService.selectActivityUserByPrimaryKey(activityUser.getId());
                if (resultUser != null) {
                    recommendActivity.setActivityUser(resultUser);
                }
            }
        }
        
        if (StringUtil.isNullOrEmpty(callback)) {
@@ -78,36 +108,39 @@
        } else {
            out.print(callback + "(" + JsonUtil.loadTrueResult(recommendActivity) + ")");
        }
        } catch (Exception e) {
            if (StringUtil.isNullOrEmpty(callback)) {
                out.print(JsonUtil.loadFalseResult("操作失败"));
            } else {
                out.print(callback + "(" + JsonUtil.loadFalseResult("操作失败") + ")");
            }
            e.printStackTrace();
        }
    }
    @RequestMapping(value = "addShareGoodsActivity")
    public void addShareGoodsActivity(String callback, Long uid, String title, String actionIds, boolean top,
            int shareCount, PrintWriter out) {
    public void addShareGoodsActivity(String callback, Long uid, String actionIds, RecommendActivity activity, PrintWriter out) {
        if (uid == null) {
            out.print(callback + "(" + JsonUtil.loadFalseResult(1, "请选择发布用户") + ")");
            return;
        }
        if (StringUtil.isNullOrEmpty(title)) {
            out.print(callback + "(" + JsonUtil.loadFalseResult(1, "请上传标题") + ")");
            return;
        }
        if (StringUtil.isNullOrEmpty(actionIds)) {
            out.print(callback + "(" + JsonUtil.loadFalseResult(1, "选择商品") + ")");
            return;
        }
        // title = Jsoup.parse(title).text();
        JSONArray array = JSONArray.fromObject(actionIds);
        List<Long> auctionIds = new ArrayList<>();
        for (int i = 0; i < array.size(); i++) {
            auctionIds.add(array.optLong(i));
        }
        try {
            activityService.addShareGoodsRecommendActivity(uid, title, auctionIds, top, shareCount);
            activityService.addShareGoodsRecommendActivity(uid,auctionIds, activity);
            if (StringUtil.isNullOrEmpty(callback)) {
                out.print(JsonUtil.loadTrueResult("添加成功"));
            } else {
@@ -119,15 +152,17 @@
            } else {
                out.print(callback + "(" + JsonUtil.loadFalseResult(e.getCode(), e.getMsg()) + ")");
            }
        } catch (Exception e) {
            out.print(callback + "(" + JsonUtil.loadFalseResult(1, "操作失败") + ")");
            e.printStackTrace();
        }
    }
    // 修改商品分享动态
    @RequestMapping(value = "updateShareGoodsActivity")
    public void updateShareGoodsActivity(String callback, Long id, Long uid, String title, String actionIds,
            boolean top, int shareCount, PrintWriter out) {
    public void updateShareGoodsActivity(String callback, Long uid, String actionIds, RecommendActivity activity, PrintWriter out) {
        if (id == null) {
        if (activity.getId() == null) {
            out.print(callback + "(" + JsonUtil.loadFalseResult(1, "请上传ID") + ")");
            return;
        }
@@ -137,7 +172,7 @@
            return;
        }
        if (StringUtil.isNullOrEmpty(title)) {
        if (StringUtil.isNullOrEmpty(activity.getTitle())) {
            out.print(callback + "(" + JsonUtil.loadFalseResult(1, "请上传标题") + ")");
            return;
        }
@@ -147,7 +182,6 @@
            return;
        }
        // title = Jsoup.parse(title).text();
        JSONArray array = JSONArray.fromObject(actionIds);
        List<Long> auctionIds = new ArrayList<>();
@@ -155,7 +189,7 @@
            auctionIds.add(array.optLong(i));
        }
        try {
            activityService.updateShareGoodsRecommendActivity(id, uid, title, auctionIds, top, shareCount);
            activityService.updateShareGoodsRecommendActivity(uid, auctionIds, activity);
            if (StringUtil.isNullOrEmpty(callback)) {
                out.print(JsonUtil.loadTrueResult("添加成功"));
            } else {
@@ -167,6 +201,9 @@
            } else {
                out.print(callback + "(" + JsonUtil.loadFalseResult(e.getCode(), e.getMsg()) + ")");
            }
        } catch (Exception e) {
            out.print(callback + "(" + JsonUtil.loadFalseResult(1, "操作失败") + ")");
            e.printStackTrace();
        }
    }
@@ -182,7 +219,7 @@
     * @param out
     */
    @RequestMapping(value = "addInviteActivity")
    public void addInviteActivity(String callback, Long uid, String title, String img, boolean top, int shareCount,
    public void addInviteActivity(String callback, Long uid,RecommendActivity activity, String img,
            int px, int py, int size, PrintWriter out) {
        if (uid == null) {
@@ -190,7 +227,7 @@
            return;
        }
        if (StringUtil.isNullOrEmpty(title)) {
        if (StringUtil.isNullOrEmpty(activity.getTitle())) {
            out.print(callback + "(" + JsonUtil.loadFalseResult(1, "请上传标题") + ")");
            return;
        }
@@ -204,7 +241,7 @@
        img = img.trim();
        try {
            activityService.addInviteImgRecommendActivity(uid, title, img, top, shareCount, px, py, size);
            activityService.addInviteImgRecommendActivity(uid, activity, img, px, py, size);
            if (StringUtil.isNullOrEmpty(callback)) {
                out.print(JsonUtil.loadTrueResult("添加成功"));
            } else {
@@ -216,6 +253,9 @@
            } else {
                out.print(callback + "(" + JsonUtil.loadFalseResult(e.getCode(), e.getMsg()) + ")");
            }
        } catch (Exception e) {
            out.print(callback + "(" + JsonUtil.loadFalseResult(1, "操作失败") + ")");
            e.printStackTrace();
        }
    }
@@ -232,11 +272,11 @@
     * @param out
     */
    @RequestMapping(value = "updateInviteActivity")
    public void updateInviteActivity(String callback, Long id, Long uid, String title, String img, boolean top,
            int shareCount, int px, int py, int size, PrintWriter out) {
    public void updateInviteActivity(String callback, Long uid, RecommendActivity activity, String img,
             int px, int py, int size, PrintWriter out) {
        if (id == null) {
            out.print(callback + "(" + JsonUtil.loadFalseResult(1, "请选择用户") + ")");
        if (activity.getId() == null) {
            out.print(callback + "(" + JsonUtil.loadFalseResult(1, "ID不能为空") + ")");
            return;
        }
@@ -245,7 +285,7 @@
            return;
        }
        if (StringUtil.isNullOrEmpty(title)) {
        if (StringUtil.isNullOrEmpty(activity.getTitle())) {
            out.print(callback + "(" + JsonUtil.loadFalseResult(1, "请上传标题") + ")");
            return;
        }
@@ -258,7 +298,7 @@
        // title = Jsoup.parse(title).text();
        try {
            activityService.updateInviteImgRecommendActivity(id, uid, title, img, top, shareCount, px, py, size);
            activityService.updateInviteImgRecommendActivity(uid, activity, img, px, py, size);
            if (StringUtil.isNullOrEmpty(callback))
                out.print(JsonUtil.loadTrueResult("添加成功"));
            else
@@ -268,6 +308,9 @@
                out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
            else
                out.print(callback + "(" + JsonUtil.loadFalseResult(e.getCode(), e.getMsg()) + ")");
        } catch (Exception e) {
            out.print(callback + "(" + JsonUtil.loadFalseResult(1, "操作失败") + ")");
            e.printStackTrace();
        }
    }
@@ -282,19 +325,18 @@
     * @param out
     */
    @RequestMapping(value = "addTextImgActivity")
    public void addTextImgActivity(String callback, Long uid, String title, String imgs, boolean top, int shareCount,
    public void addTextImgActivity(String callback, Long uid, RecommendActivity activity, String imgs,
            PrintWriter out) {
        if (uid == null) {
            out.print(callback + "(" + JsonUtil.loadFalseResult(1, "请选择发布用户") + ")");
            return;
        }
        if (StringUtil.isNullOrEmpty(title)) {
        if (StringUtil.isNullOrEmpty(activity.getTitle())) {
            out.print(callback + "(" + JsonUtil.loadFalseResult(1, "请上传标题") + ")");
            return;
        }
        // title = Jsoup.parse(title).text();
        List<String> imgList = new ArrayList<>();
        if (!StringUtil.isNullOrEmpty(imgs)) {
@@ -304,7 +346,7 @@
        }
        try {
            activityService.addTextAndImgRecommendActivity(uid, title, imgList, top, shareCount);
            activityService.addTextAndImgRecommendActivity(uid, imgList, activity);
            if (StringUtil.isNullOrEmpty(callback))
                out.print(JsonUtil.loadTrueResult("添加成功"));
            else
@@ -314,6 +356,9 @@
                out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
            else
                out.print(callback + "(" + JsonUtil.loadFalseResult(e.getCode(), e.getMsg()) + ")");
        } catch (Exception e) {
            out.print(callback + "(" + JsonUtil.loadFalseResult(1, "操作失败") + ")");
            e.printStackTrace();
        }
    }
@@ -329,10 +374,9 @@
     * @param out
     */
    @RequestMapping(value = "updateTextImgActivity")
    public void updateTextImgActivity(String callback, Long id, Long uid, String title, String imgs, boolean top,
            int shareCount, PrintWriter out) {
    public void updateTextImgActivity(String callback, Long uid,  String imgs, RecommendActivity activity, PrintWriter out) {
        if (id == null) {
        if (activity.getId() == null) {
            out.print(callback + "(" + JsonUtil.loadFalseResult(1, "请上传ID") + ")");
            return;
        }
@@ -342,7 +386,7 @@
            return;
        }
        if (StringUtil.isNullOrEmpty(title)) {
        if (StringUtil.isNullOrEmpty(activity.getTitle())) {
            out.print(callback + "(" + JsonUtil.loadFalseResult(1, "请上传标题") + ")");
            return;
        }
@@ -357,7 +401,7 @@
        }
        try {
            activityService.updateTextAndImgRecommendActivity(id, uid, title, imgList, top, shareCount);
            activityService.updateTextAndImgRecommendActivity(uid, imgList, activity);
            if (StringUtil.isNullOrEmpty(callback))
                out.print(JsonUtil.loadTrueResult("添加成功"));
            else
@@ -367,51 +411,10 @@
                out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
            else
                out.print(callback + "(" + JsonUtil.loadFalseResult(e.getCode(), e.getMsg()) + ")");
        } catch (Exception e) {
            out.print(callback + "(" + JsonUtil.loadFalseResult(1, "操作失败") + ")");
            e.printStackTrace();
        }
    }
    /**
     *
     * @param pageIndex
     *            页数
     * @param key
     *            查询条件
     * @param out
     */
    @RequestMapping(value = "getRecommendActivityList", method = RequestMethod.POST)
    public void getRecommendActivityList(int pageIndex, String key, PrintWriter out) {
        List<RecommendActivity> recommendActivityList = null;
        if (StringUtil.isNullOrEmpty(key)) {
            recommendActivityList = activityService.getRecommendActivityList(pageIndex, Constant.PAGE_SIZE);
        } else {
            recommendActivityList = activityService.queryRecommendActivityList(key, pageIndex, Constant.PAGE_SIZE);
        }
        int count = (int) activityService.getRecommendActivityCount();
        int totalPage = count % Constant.PAGE_SIZE == 0 ? count / Constant.PAGE_SIZE : count / Constant.PAGE_SIZE + 1;
        PageEntity pe = new PageEntity(pageIndex, Constant.PAGE_SIZE, count, totalPage);
        Map<String, String> map = new HashMap<String, String>();
        map.put("key", key);
        pe.setParams(map);
        JSONObject data = new JSONObject();
        data.put("pe", pe);
        data.put("recommendActivityList", recommendActivityList);
        out.print(JsonUtil.loadTrueResult(data));
        return;
    }
    @RequestMapping(value = "deleteRecommendActivity", method = RequestMethod.POST)
    public void deleteRecommendActivity(long[] rsids, PrintWriter out) {
        // recommendSpecialService.deleteSpecials(rsids);
        activityService.deleteRecommendActivity(rsids);
        out.print(JsonUtil.loadTrueResult("删除成功"));
    }
    
    
@@ -436,18 +439,39 @@
        
        try {
            
            List<RecommendActivity> list = null;
            if (StringUtil.isNullOrEmpty(key)) {
                list = activityService.getRecommendActivityList(pageIndex, Constant.PAGE_SIZE);
            } else {
                list = activityService.queryRecommendActivityList(key, pageIndex, Constant.PAGE_SIZE);
            }
            List<RecommendActivity> list = activityService.queryRecommendActivityList(key, pageIndex, Constant.PAGE_SIZE);
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
                return;
            }
            
            for (RecommendActivity activity: list) {
                Date startTime = activity.getStartTime();
                Date endTime = activity.getEndTime();
                if (startTime == null && endTime == null) {
                    activity.setTimeTask(false);
                    activity.setStartTime_str("");
                    activity.setEndTime_str("");
                } else {
                    activity.setTimeTask(true);
                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
                    if (startTime == null) {
                        activity.setStartTime_str("");
                    } else {
                        activity.setStartTime_str(sdf.format(startTime));
                    }
                    if (endTime == null) {
                        activity.setEndTime_str("");
                    } else {
                        activity.setEndTime_str(sdf.format(endTime));
                    }
                }
            }
            int count = (int) activityService.getRecommendActivityCount();
            int totalPage = count % Constant.PAGE_SIZE == 0 ? count / Constant.PAGE_SIZE : count / Constant.PAGE_SIZE + 1;
fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsClassAdminCotroller.java
@@ -2,36 +2,28 @@
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import org.yeshi.utils.JsonUtil;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.entity.admin.GoodsClassAdmin;
import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.exception.FloatADException;
import com.yeshi.fanli.exception.GoodsClassException;
import com.yeshi.fanli.service.inter.config.BusinessSystemService;
import com.yeshi.fanli.service.inter.goods.GoodsClassService;
import com.yeshi.fanli.service.inter.goods.GoodsSecondClassService;
import com.yeshi.fanli.service.inter.goods.GoodsSubClassService;
import com.yeshi.fanli.service.inter.goods.SuperGoodsClassService;
import com.yeshi.fanli.service.inter.lable.LabelClassService;
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.Utils;
import net.sf.json.JSONObject;
@@ -59,34 +51,12 @@
    @Resource
    private BusinessSystemService businessSystemService;
    @RequestMapping(value = "getGoodsClassList")
    public void getGoodsClassList(String callback, Integer pageIndex, String platform, String packages, String key, PrintWriter out) {
        List<GoodsClassAdmin> goodsClassList = goodsClassService.getGoodsClassAdmins(pageIndex - 1, platform, packages, key);
        int count = goodsClassService.getCount(platform, packages, key);
        int totalPage = count % Constant.PAGE_SIZE == 0 ? count / Constant.PAGE_SIZE : count / Constant.PAGE_SIZE + 1;
        PageEntity pe = new PageEntity(pageIndex, Constant.PAGE_SIZE, count, totalPage);
        Map<String, String> map = new HashMap<String, String>();
        map.put("platform", platform);
        map.put("packages", packages);
        map.put("key", key);
        pe.setParams(map);
        JSONObject data = new JSONObject();
        data.put("pe", pe);
        List<BusinessSystem> systemList = businessSystemService.getBusinessSystems();
        data.put("systemList", systemList);
        data.put("goodsClassList", goodsClassList);
        JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
    }
    @RequestMapping(value = "queryAll")
    public void queryAll(String callback, String platform, String packages, PrintWriter out) {
    public void listquery(String callback,  PrintWriter out) {
        try {
            List<GoodsClass> goodsClassList = goodsClassService.queryAll(platform, packages);
            List<GoodsClass> goodsClassList = goodsClassService.listquery();
            if (goodsClassList == null || goodsClassList.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
@@ -120,147 +90,52 @@
    }
    @RequestMapping(value = "getGoodsClass", method = RequestMethod.POST)
    public void getGoodsClass(long id, PrintWriter out) {
        GoodsClass rb = goodsClassService.getGoodsClass(id);
        if (rb != null) {
            out.print(JsonUtil.loadTrueResult(rb));
            return;
        }
        out.print(JsonUtil.loadFalseResult("不存在该GoodsClass"));
    }
    /**
     * 添加类别
     * 保存信息
     * 
     * @param callback
     * @param goodsClass
     * @param request
     * @param special
     * @param out
     */
    @RequestMapping(value = "saveAdd", method = RequestMethod.POST)
    public void saveAdd(String callback, GoodsClass goodsClass, HttpServletRequest request, PrintWriter out) {
    @RequestMapping(value = "save")
    public void save(String callback, GoodsClass goodsClass, String jumpType, HttpServletRequest request,PrintWriter out) {
        try {
            String name = goodsClass.getName();
            if (StringUtil.isNullOrEmpty(name)) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("类别名称不能为空"));
                return;
            }
            // 1. 先判断httpRequest 是否含有文件类型
            if (request instanceof MultipartHttpServletRequest) {
                long result;
                List<MultipartFile> files = ((MultipartHttpServletRequest) request).getFiles("file");
                goodsClass.setAndroidClick(0L);
                goodsClass.setIosClick(0L);
                // 搜索条件:有券、在售价20-200、牛皮癣轻微
                goodsClass.setSearchParam("{\"quan\":1,\"endPrice\":220,\"includeGoodRate\":true,\"baoYou\":true,\"ip\":\"218.72.111.105\"}");
                if (files != null && files.size() > 0) {
                    // 图片文件上传
                    result = goodsClassService.saveAdd(goodsClass, files.get(0));
                MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
                goodsClassService.saveObject(fileRequest.getFile("file"), goodsClass);
                } else {
                    // 无图保存
                    result = goodsClassService.saveAdd(goodsClass, null);
                goodsClassService.saveObject(null, goodsClass);
                }
                if (result > 0) {
                    JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
                } else {
        } catch (FloatADException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
        } catch (Exception e) {
                    JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("保存失败"));
                }
            } else {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请传递正确的参数"));
            }
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
            e.printStackTrace();
        }
    }
    /**
     * 保存修改信息
     * 修改排序
     * 
     * @param callback
     * @param goodsClass
     * @param out
     */
    @RequestMapping(value = "saveModify")
    public void saveModify(String callback, GoodsClass goodsClass, PrintWriter out) {
    @RequestMapping(value = "updateOrder")
    public void updateOrder(String callback, Long id, Integer moveType, PrintWriter out) {
        try {
            Long id = goodsClass.getId();
            GoodsClass resultObj = goodsClassService.getGoodsClass(id);
            if (resultObj == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该类别不存在或已被删除"));
            } else {
                String name = goodsClass.getName();
                if (!StringUtil.isNullOrEmpty(name)) {
                    resultObj.setName(name);
                }
                String key = goodsClass.getKey();
                if (!StringUtil.isNullOrEmpty(key)) {
                    resultObj.setKey(key);
                }
                goodsClassService.updateGoodsClass(resultObj);
                JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("修改成功"));
            }
            goodsClassService.updateOrder(id, moveType);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
        } catch (GoodsClassException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
            e.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
        }
    }
    /**
     * 保存修改信息
     *
     * @param callback
     * @param goodsClass
     * @param out
     */
    @RequestMapping(value = "saveOrderby")
    public void saveOrderby(String callback, Long id, int orderby, PrintWriter out) {
        try {
            GoodsClass resultObj = goodsClassService.getGoodsClass(id);
            if (resultObj == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该类别不存在或已被删除"));
            } else {
                List<GoodsClass> glist = goodsClassService.getByorderby(orderby);
                if (glist != null && glist.size() > 0) {
                    GoodsClass changeObj = glist.get(0);
                    changeObj.setOrderby(resultObj.getOrderby());
                    goodsClassService.updateGoodsClass(changeObj);
                }
                resultObj.setOrderby(orderby);
                goodsClassService.updateGoodsClass(resultObj);
                JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("修改成功"));
            }
        } catch (Exception e) {
            e.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
        }
    }
    /**
@@ -299,46 +174,13 @@
            }
        } catch (Exception e) {
            // TODO Auto-generated catch block
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
            e.printStackTrace();
        }
    }
    //
    /**
     * 上传/修改 图片
     *
     * @param callback
     * @param file
     * @param request
     * @param out
     * @param response
     */
    @RequestMapping(value = "uploadPicture")
    public void uploadPicture(Long id, @RequestParam("file") CommonsMultipartFile file, PrintWriter out) {
        try {
            GoodsClass goodsClass = goodsClassService.getGoodsClass(id);
            if (goodsClass == null ) {
                out.print(JsonUtil.loadFalseResult("该类别不存在或已被删除"));
                return;
            }
            if (file == null) {
                out.print(JsonUtil.loadFalseResult("图片文件不能为空"));
                return;
            }
            goodsClassService.uploadPicture(goodsClass, file);
            out.print(JsonUtil.loadTrueResult("上传成功"));
        } catch (Exception e) {
            e.printStackTrace();
            out.print(JsonUtil.loadFalseResult("操作异常"));
        }
    }
    /**
     * 删除图片
@@ -367,7 +209,6 @@
            e.printStackTrace();
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("操作异常")));
        }
    }
    
    @RequestMapping(value = "setSuperSystem")
fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsSubClassAdminController.java
@@ -8,15 +8,9 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import net.sf.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import org.yeshi.utils.JsonUtil;
import com.google.gson.Gson;
@@ -24,9 +18,11 @@
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
import com.yeshi.fanli.entity.bus.clazz.GoodsSubClass;
import com.yeshi.fanli.exception.FloatADException;
import com.yeshi.fanli.service.inter.goods.GoodsSubClassService;
import com.yeshi.fanli.service.inter.lable.LabelClassService;
import com.yeshi.fanli.util.StringUtil;
import net.sf.json.JSONObject;
@Controller
@RequestMapping("admin/new/api/v1/goodsSubClass")
@@ -37,146 +33,35 @@
    @Resource
    private LabelClassService labelClassService;
    /**
     * 添加类别
     * 保存信息
     * 
     * @param callback
     * @param goodsSubClass
     * @param request
     * @param special
     * @param out
     */
    @RequestMapping(value = "saveAdd", method = RequestMethod.POST)
    public void saveAdd(String callback, Long pid, Integer type, GoodsSubClass goodsSubClass,
            HttpServletRequest request, PrintWriter out) {
    @RequestMapping(value = "save")
    public void save(String callback, GoodsSubClass goodsSubClass, Long pid, Integer type, HttpServletRequest request,PrintWriter out) {
        try {
            String name = goodsSubClass.getName();
            if (StringUtil.isNullOrEmpty(name)) {
                out.print(JsonUtil.loadFalseResult("类别名称不能为空"));
                return;
            }
            if (pid == null) {
                out.print(JsonUtil.loadFalseResult("上级id为空"));
                return;
            }
            if (type == null) {
                out.print(JsonUtil.loadFalseResult("等级不能为空"));
                return;
            }
            if (type > 5) {
                out.print(JsonUtil.loadFalseResult("等级不能超过五级"));
                return;
            }
            String key = goodsSubClass.getKey();
            if (StringUtil.isNullOrEmpty(key)) {
                goodsSubClass.setKey(name.trim());
            }
            // 默认停用
            goodsSubClass.setState(0);
            // 1. 先判断httpRequest 是否含有文件类型
            if (request instanceof MultipartHttpServletRequest) {
                int result;
                List<MultipartFile> files = ((MultipartHttpServletRequest) request).getFiles("file");
                goodsSubClass.setAndroidClick(0L);
                goodsSubClass.setIosClick(0L);
                goodsSubClass.setLevel(type);
                goodsSubClass.setCreatetime(new Date());
                goodsSubClass.setUpdatetime(new Date());
                // 搜索条件:有券、在售价20-200、牛皮癣轻微
                goodsSubClass.setSearchJson("{\"quan\":1,\"endPrice\":220,\"includeGoodRate\":true}");
                if (type == 2) {
                    goodsSubClass.setRootClass(new GoodsClass(pid));
                    int weight = goodsSubClassService.getMaxWeightByRootId(pid);
                    goodsSubClass.setWeight(weight + 1);
                MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
                goodsSubClassService.saveObject(fileRequest.getFile("file"),fileRequest.getFile("file2"), goodsSubClass, type, pid);
                } else {
                    goodsSubClass.setParent(new GoodsSubClass(pid));
                    int weight = goodsSubClassService.getMaxWeightByPid(pid);
                    goodsSubClass.setWeight(weight + 1);
                goodsSubClassService.saveObject(null, null, goodsSubClass, type, pid);
                }
                
                if (files != null && files.size() > 0) {
                    // 图片文件上传
                    result = goodsSubClassService.save(goodsSubClass, files.get(0));
                } else {
                    // 无图保存
                    result = goodsSubClassService.save(goodsSubClass, null);
                }
                if (result == 1) {
                    out.print(JsonUtil.loadTrueResult("保存成功"));
                } else {
                    out.print(JsonUtil.loadFalseResult("保存失败"));
                }
            } else {
                out.print(JsonUtil.loadFalseResult("请传递正确的参数"));
            }
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
        } catch (FloatADException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult("操作异常"));
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("保存失败"));
            e.printStackTrace();
        }
    }
    /**
     * 保存修改信息
     *
     * @param callback
     * @param goodsSubClass
     * @param out
     */
    @RequestMapping(value = "saveModify")
    public void saveModify(String callback, GoodsSubClass goodsSubClass, PrintWriter out) {
        try {
            Long id = goodsSubClass.getId();
            if (id == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("不存在该类别"));
                return;
            }
            GoodsSubClass resultObj = goodsSubClassService.selectByPrimaryKey(id);
            if (resultObj == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("不存在该类别"));
                return;
            }
            GoodsSubClass subClass = new GoodsSubClass();
            String name = goodsSubClass.getName();
            if (!StringUtil.isNullOrEmpty(name)) {
                subClass.setName(name);
            }
            // 关键词可以为空
            subClass.setKey(goodsSubClass.getKey());
            subClass.setId(id);
            subClass.setUpdatetime(new Date());
            subClass.setAndroidClick(resultObj.getAndroidClick());
            subClass.setIosClick(resultObj.getIosClick());
            goodsSubClassService.updateByPrimaryKeySelective(subClass);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("修改成功"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("修改失败"));
            e.printStackTrace();
        }
    }
    /**
     * 批量删除
@@ -202,50 +87,11 @@
            }
        } catch (Exception e) {
            // TODO Auto-generated catch block
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("操作异常")));
            e.printStackTrace();
        }
    }
    /**
     * 上传/修改 图片
     *
     * @param callback
     * @param file
     * @param request
     * @param out
     * @param response
     */
    @RequestMapping(value = "uploadPicture")
    public void uploadPicture(Long id, @RequestParam("file") CommonsMultipartFile file, PrintWriter out) {
        if (file == null) {
            out.print(JsonUtil.loadFalseResult("图片文件不能为空"));
            return;
        }
        try {
            GoodsSubClass goodsSubClass = goodsSubClassService.selectByPrimaryKey(id);
            if (goodsSubClass == null) {
                out.print(JsonUtil.loadFalseResult("该类别不存在或已被删除"));
                return;
            }
            int result = goodsSubClassService.uploadPicture(goodsSubClass, file);
            if (result == 1) {
                out.print(JsonUtil.loadTrueResult("上传成功"));
            } else {
                out.print(JsonUtil.loadFalseResult("上传失败"));
            }
        } catch (Exception e) {
            e.printStackTrace();
            out.print(JsonUtil.loadFalseResult("操作异常"));
        }
    }
    /**
     * 删除图片
@@ -277,7 +123,6 @@
            }
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("操作异常")));
        }
@@ -333,11 +178,17 @@
                    goodsSubClass.setCountClick(0l);
                }
                
                int countlabel = labelClassService.getCountQueryBySubClassId(goodsSubClass.getId());
                goodsSubClass.setCountlabel(countlabel);
                String searchJson = goodsSubClass.getSearchJson();
                if (searchJson == null) {
                    goodsSubClass.setSearchParam("");
                } else {
                    goodsSubClass.setSearchParam(searchJson);
            }
            
        
                int countlabel = labelClassService.getCountQueryBySubClassId(goodsSubClass.getId());
                goodsSubClass.setCountlabel(countlabel);
            }
            GsonBuilder gsonBuilder = new GsonBuilder();
            gsonBuilder.serializeNulls(); // 重点
@@ -396,14 +247,12 @@
     */
    @RequestMapping(value = "saveOrder")
    public void saveOrder(String callback, Long id, Integer type, Integer moveType, PrintWriter out) {
        try {
            
            if (moveType == null || (!moveType.equals(1) && !moveType.equals(-1))) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("传递的类型不正确"));
                return;
            }
            GoodsSubClass resultObj = goodsSubClassService.selectByPrimaryKey(id);
            if (resultObj == null) {
@@ -430,11 +279,11 @@
                changeObj.setWeight(resultWeight);
                
                changeObj.setUpdatetime(new Date());
                goodsSubClassService.updateByPrimaryKey(changeObj);
                goodsSubClassService.updateByPrimaryKeySelective(changeObj);
            }
            resultObj.setUpdatetime(new Date());
            goodsSubClassService.updateByPrimaryKey(resultObj);
            goodsSubClassService.updateByPrimaryKeySelective(resultObj);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
@@ -442,51 +291,6 @@
            e.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
        }
    }
    /**
     * 修改排序
     *
     * @param callback
     * @param goodsClass
     * @param out
     */
    @RequestMapping(value = "saveState")
    public void saveState(String callback, Long id,  PrintWriter out) {
        try {
            if (id == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("不存在该类别"));
                return;
            }
            GoodsSubClass resultObj = goodsSubClassService.selectByPrimaryKey(id);
            if (resultObj == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("不存在该类别"));
                return;
            }
            Integer state = resultObj.getState();
            if (state.equals(1) || state == 1) {
                state = 0;
            } else {
                state = 1;
            }
            resultObj.setState(state);
            resultObj.setUpdatetime(new Date());
            goodsSubClassService.updateByPrimaryKeySelective(resultObj);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(state));
        } catch (Exception e) {
            e.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/admin/PushController.java
@@ -125,7 +125,7 @@
                // 部分推送
                for (String str_uid: listuid) {
                    if (str_uid != null && str_uid.trim().length() > 0) {
                        pushService.pushUrl(Long.parseLong(str_uid), url, title, content, listIOS, listAndroid);
                        pushService.pushUrl(Long.parseLong(str_uid), title, content, url, listIOS, listAndroid);
                    }
                }
            }
fanli/src/main/java/com/yeshi/fanli/controller/admin/SystemCouponAdminController.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/controller/admin/config/SystemClientParamsAdminController.java
@@ -136,14 +136,11 @@
        
        try {
            
            List<SystemClientParams> list =
                    systemClientParamsService.getById(systemClientParams.getId());
            if (list == null || list.size() == 0) {
            SystemClientParams resultObject= systemClientParamsService.selectByPrimaryKey(systemClientParams.getId());
            if (resultObject == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作数据已不存在"));
                return;    
            }
            SystemClientParams resultObject = list.get(0);
            
            systemClientParams.setSystem(resultObject.getSystem());
            systemClientParams.setUpdatetime(java.lang.System.currentTimeMillis());
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/HomeNavbarAdminController.java
@@ -2,26 +2,22 @@
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.yeshi.utils.JsonUtil;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar;
import com.yeshi.fanli.entity.bus.homemodule.SuperHomeNavbar;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.service.AdminUserService;
import com.yeshi.fanli.exception.homemodule.HomeNavbarException;
import com.yeshi.fanli.service.inter.homemodule.HomeNavbarService;
import com.yeshi.fanli.service.inter.homemodule.SuperHomeNavbarService;
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
@@ -33,138 +29,37 @@
public class HomeNavbarAdminController {
    @Resource
    private AdminUserService adminUserService;
    @Resource
    private HomeNavbarService homeNavbarService;
    
    @Resource
    private SuperHomeNavbarService superHomeNavbarService;
    
    /**
     * 新增
     * 保存信息
     *
     * @param callback
     * @param special
     * @param out
     */
    @RequestMapping(value = "saveAdd")
    public void saveAdd(String callback, HomeNavbar homeNavbar, PrintWriter out) {
    @RequestMapping(value = "save")
    public void save(String callback, HomeNavbar homeNavbar, HttpServletRequest request, PrintWriter out) {
        try {
            String name = homeNavbar.getName();
            if (StringUtil.isNullOrEmpty(name)) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("导航名称不能为空"));
                return;
            }
            homeNavbar.setCreatetime(new Date());
            homeNavbar.setUpdatetime(new Date());
            int maxOrder = homeNavbarService.getMaxOrder();
            homeNavbar.setOrderby(maxOrder + 1);
            homeNavbarService.insert(homeNavbar);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("添加成功"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
            e.printStackTrace();
        }
    }
    /**
     * 修改
     * @param callback
     * @param special
     * @param out
     */
    @RequestMapping(value = "saveModify")
    public void saveModify(String callback, HomeNavbar homeNavbar, PrintWriter out) {
        try {
            Long id = homeNavbar.getId();
            if (id == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
                return;
            }
            String name = homeNavbar.getName();
            if (StringUtil.isNullOrEmpty(name)) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("导航名称不能为空"));
                return;
            }
            HomeNavbar resultObj = homeNavbarService.selectByPrimaryKey(id);
            if (resultObj == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作数据已不存在"));
                return;
            }
            homeNavbar.setUpdatetime(new Date());
            homeNavbarService.updateByPrimaryKeySelective(homeNavbar);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("修改成功"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
            e.printStackTrace();
        }
    }
    /**
     * 修改系统状态
     * @param callback
     * @param type
     * @param cardId
     * @param systemId
     * @param out
     */
    @RequestMapping(value = "saveSystemState")
    public void saveSystemState(String callback, Long id, Long systemId, PrintWriter out) {
        if (id == null || systemId == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("传递参数不能为空"));
            return;
        }
        try {
            List<SuperHomeNavbar> list = superHomeNavbarService.querybyNavbarId(id, systemId);
            if (list != null && list.size() > 0) {
                superHomeNavbarService.deletebyNavbarId(id, systemId);
                JSONObject data = new JSONObject();
                data.put("check", 0);
                JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
            // 1. 先判断httpRequest 是否含有文件类型
            if (request instanceof MultipartHttpServletRequest) {
                MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
                homeNavbarService.saveObject(fileRequest.getFile("file"), homeNavbar);
            } else {
                HomeNavbar homeNavbar = new HomeNavbar();
                homeNavbar.setId(id);
                BusinessSystem system = new BusinessSystem();
                system.setId(systemId);
                SuperHomeNavbar superNavbar = new  SuperHomeNavbar();
                superNavbar.setHomeNavbar(homeNavbar);
                superNavbar.setSystem(system);
                superHomeNavbarService.insertSelective(superNavbar);
                JSONObject data = new JSONObject();
                data.put("check", 1);
                JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
                homeNavbarService.saveObject(null, homeNavbar);
            }
            
        } catch (Exception e1) {
            e1.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("修改失败"));
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
        } catch (HomeNavbarException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("保存失败"));
            e.printStackTrace();
        }
        }
        
    }
    
    /**
     * 修改排序
@@ -173,49 +68,17 @@
     * @param goodsClass
     * @param out
     */
    @RequestMapping(value = "saveOrder")
    public void saveOrder(String callback, Long id, Integer moveType, PrintWriter out) {
        if (moveType == null || (!moveType.equals(1) && !moveType.equals(-1))) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("传递的类型不正确"));
            return;
        }
        if (id == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
            return;
        }
    @RequestMapping(value = "updateOrder")
    public void updateOrder(String callback, Long id, Integer moveType, PrintWriter out) {
        try {
            HomeNavbar resultObj = homeNavbarService.selectByPrimaryKey(id);
            if (resultObj == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作数据已不存在"));
                return;
            }
            Integer oldOrder = resultObj.getOrderby();
            List<HomeNavbar> list = homeNavbarService.getChangeOrder(moveType, oldOrder);
            if (list != null && list.size() > 0) {
                HomeNavbar changeObj = list.get(0);
                // 交换排序序号
                resultObj.setOrderby(changeObj.getOrderby());
                changeObj.setOrderby(oldOrder);
                homeNavbarService.updateByPrimaryKeySelective(changeObj);
            }
            homeNavbarService.updateByPrimaryKeySelective(resultObj);
            homeNavbarService.updateOrder(id, moveType);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
        } catch (HomeNavbarException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
            e.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
        }
    }
    
@@ -229,8 +92,7 @@
     * @param out
     */
    @RequestMapping(value = "query")
    public void query(String callback, Integer pageIndex, Integer pageSize, String key,
            Integer sort, PrintWriter out) {
    public void query(String callback, Integer pageIndex, Integer pageSize, String key, PrintWriter out) {
        if (pageIndex == null || pageIndex < 1) {
            pageIndex = 1;
@@ -303,45 +165,4 @@
            e.printStackTrace();
        }
    }
    /**
     * 专题图片上传
     * @param file
     * @param uid
     * @param id
     * @param request
     * @param response
     * @param out
     */
    @RequestMapping(value = "uploadPic")
    public void uploadPic(@RequestParam("file") CommonsMultipartFile file, Long id, PrintWriter out) {
        if (file == null) {
            out.print(JsonUtil.loadFalseResult("上传文件为空"));
            return;
        }
        if (id == null) {
            out.print(JsonUtil.loadFalseResult("ID不能为空"));
            return;
        }
        try {
            HomeNavbar resultObj = homeNavbarService.selectByPrimaryKey(id);
            if (resultObj == null) {
                out.print(JsonUtil.loadFalseResult("操作数据已不存在"));
                return;
            }
            homeNavbarService.uploadPicture(file, resultObj);
            out.print(JsonUtil.loadTrueResult("上传成功"));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult("操作失败"));
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/SpecialCardAdminController.java
@@ -2,15 +2,14 @@
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.yeshi.utils.JsonUtil;
import com.google.gson.Gson;
@@ -18,16 +17,10 @@
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.entity.bus.homemodule.Special;
import com.yeshi.fanli.entity.bus.homemodule.SpecialCard;
import com.yeshi.fanli.entity.bus.homemodule.SuperSpecialCard;
import com.yeshi.fanli.entity.common.JumpDetailV2;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.service.AdminUserService;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
import com.yeshi.fanli.service.inter.config.BusinessSystemService;
import com.yeshi.fanli.service.inter.config.SystemConfigService;
import com.yeshi.fanli.exception.FloatADException;
import com.yeshi.fanli.exception.homemodule.SpecialException;
import com.yeshi.fanli.service.inter.homemodule.SpecialCardService;
import com.yeshi.fanli.service.inter.homemodule.SpecialService;
import com.yeshi.fanli.service.inter.homemodule.SuperSpecialCardService;
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
@@ -44,207 +37,33 @@
    @Resource
    private SpecialCardService specialCardService;
    
    @Resource
    private SuperSpecialCardService superSpecialCardService;
    @Resource
    private SystemConfigService systemConfigService;
    @Resource
    private JumpDetailV2Service jumpDetailV2Service;
    @Resource
    private AdminUserService adminUserService;
    @Resource
    private BusinessSystemService businessSystemService;
    
    /**
     * 新增
     * 保存信息
     *
     * @param callback
     * @param special
     * @param out
     */
    @RequestMapping(value = "saveAdd")
    public void saveAdd(String callback, SpecialCard specialCard, PrintWriter out) {
    @RequestMapping(value = "save")
    public void save(String callback, SpecialCard specialCard, HttpServletRequest request,PrintWriter out) {
        try {
            String name = specialCard.getName();
            String card = specialCard.getCard();
            if (StringUtil.isNullOrEmpty(name) || StringUtil.isNullOrEmpty(card)) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("专题信息与标识不能为空"));
                return;
            }
            Date nowTime = new Date();
            specialCard.setState(1); // 默认停用
            specialCard.setCreatetime(nowTime);
            specialCard.setUpdatetime(nowTime);
            specialCardService.insert(specialCard);
            List<BusinessSystem> systemList = businessSystemService.getBusinessSystems();
            if (systemList != null && systemList.size() > 0) {
                for (BusinessSystem system: systemList) {
                    SuperSpecialCard superCard = new  SuperSpecialCard();
                    superCard.setSpecialCard(specialCard);
                    superCard.setSystem(system);
                    superSpecialCardService.insertSelective(superCard);
                }
            }
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("添加成功"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
            e.printStackTrace();
        }
    }
    /**
     * 修改
     * @param callback
     * @param special
     * @param out
     */
    @RequestMapping(value = "saveModify")
    public void saveModify(String callback, SpecialCard specialCard, PrintWriter out) {
        try {
            Long id = specialCard.getId();
            if (id == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
                return;
            }
            SpecialCard resultObj = specialCardService.selectByPrimaryKey(id);
            if (resultObj == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作数据已不存在"));
                return;
            }
            String name = specialCard.getName();
            String card = specialCard.getCard();
            if (StringUtil.isNullOrEmpty(name) && StringUtil.isNullOrEmpty(card)) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("修改内容不能为空"));
                return;
            }
            if (StringUtil.isNullOrEmpty(name)) {
                specialCard.setName(null);
            }
            if (StringUtil.isNullOrEmpty(card)) {
                specialCard.setCard(null);
            }
            specialCard.setUpdatetime(new Date());
            specialCardService.updateByPrimaryKeySelective(specialCard);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("修改成功"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
            e.printStackTrace();
        }
    }
    /**
     * 修该状态
     * @param callback
     * @param id
     * @param out
     */
    @RequestMapping(value = "updateState")
    public void updateState(String callback, Long id, PrintWriter out) {
        try {
            if (id == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
                return;
            }
            SpecialCard resultObj = specialCardService.selectByPrimaryKey(id);
            if (resultObj == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作数据已不存在"));
                return;
            }
            Integer state = resultObj.getState();
            if (state == null ||  state.equals(1) || state == 1) {
                resultObj.setState(0);
            // 1. 先判断httpRequest 是否含有文件类型
            if (request instanceof MultipartHttpServletRequest) {
                MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
                specialCardService.saveObject(fileRequest.getFile("file"), specialCard);
            } else {
                resultObj.setState(1);
                specialCardService.saveObject(null, specialCard);
            }
            specialCardService.updateByPrimaryKeySelective(resultObj);
            JSONObject data = new JSONObject();
            data.put("state", resultObj.getState());
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
        } catch (FloatADException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("保存失败"));
            e.printStackTrace();
        }
    }
    /**
     * 修改系统状态
     * @param callback
     * @param type
     * @param cardId
     * @param systemId
     * @param out
     */
    @RequestMapping(value = "saveSystemState")
    public void saveSystemState(String callback, Long cardId, Long systemId, PrintWriter out) {
        if (cardId == null || systemId == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("传递参数不能为空"));
            return;
        }
        try {
            List<SuperSpecialCard> list = superSpecialCardService.querybyCardIdAndSystemId(cardId, systemId);
            if (list != null && list.size() > 0) {
                superSpecialCardService.deletebyCardIdAndSystemId(cardId, systemId);
                JSONObject data = new JSONObject();
                data.put("check", 0);
                JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
            } else {
                SpecialCard specialCard = new SpecialCard();
                specialCard.setId(cardId);
                BusinessSystem system = new BusinessSystem();
                system.setId(systemId);
                SuperSpecialCard superCard = new  SuperSpecialCard();
                superCard.setSpecialCard(specialCard);
                superCard.setSystem(system);
                superSpecialCardService.insertSelective(superCard);
                JSONObject data = new JSONObject();
                data.put("check", 1);
                JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
            }
        } catch (Exception e1) {
            e1.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("修改失败"));
        }
    }
    
    /**
     * 查询
@@ -273,11 +92,6 @@
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
                return;
            }
            for (SpecialCard specialCard: list) {
                long totalSpecial= specialService.countlistQueryByCard(specialCard.getId(), null);
                specialCard.setTotalSpecial(totalSpecial);
            }
            long count = specialCardService.countlistQuery(key);
@@ -339,188 +153,30 @@
    
    
    /**
     *  查询专题
     * 保存信息
     *
     * @param callback
     * @param pageIndex
     * @param pageSize
     * @param bannerId
     * @param out
     */
    @RequestMapping(value = "querySpecial")
    public void querySpecial(String callback, Integer pageIndex, Integer pageSize, String key,
            Long cardId, PrintWriter out) {
        if (pageIndex == null || pageIndex < 1) {
            pageIndex = 1;
        }
        if (pageSize == null || pageSize < 1) {
            pageSize = Constant.PAGE_SIZE;
        }
        if (cardId == null) {
            out.print(JsonUtil.loadFalseResult("唯一标识ID不能为空"));
            return;
        }
        try {
            List<Special> list = specialService.listQueryByCard((pageIndex - 1) * pageSize,
                    pageSize, cardId, key);
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
                return;
            }
            // 跳转链接
            for (Special special: list) {
                String params = special.getParams();
                if (!StringUtil.isNullOrEmpty(params)) {
                    JSONObject jsonData = JSONObject.fromObject(params);
                    if (jsonData.get("url") != null){
                        special.setParams(jsonData.get("url").toString());
                    } else {
                        special.setParams(null);
                    }
                }
                JumpDetailV2 jumpDetail = special.getJumpDetail();
                if (jumpDetail == null) {
                    // 默认未选择
                    JumpDetailV2 jumpDetailV2 = new JumpDetailV2();
                    jumpDetailV2.setName("-未选择-");
                    jumpDetailV2.setType("default");
                    special.setJumpDetail(jumpDetailV2);
                }
            }
            long count = specialService.countlistQueryByCard(cardId, key);
            int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
            PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
            GsonBuilder gsonBuilder = new GsonBuilder();
            gsonBuilder.serializeNulls();
            Gson gson = gsonBuilder.setDateFormat("yyyy/MM/dd HH:mm:ss").create();
            JSONObject data = new JSONObject();
            data.put("pe", pe);
            data.put("result_list", gson.toJson(list));
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
            e.printStackTrace();
        }
    }
    /**
     * 修改专题信息
     * @param callback
     * @param record
     * @param out
     */
    @RequestMapping(value = "modifySpecial")
    public void modifySpecial(String callback, Special record, String jumpType, PrintWriter out) {
            Long id = record.getId();
            if (id == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
                return;
            }
        try {
            Special resultObj = specialService.selectByPrimaryKey(id);
            if (resultObj == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作数据已不存在"));
                return;
            }
            String params = record.getParams();
            if (!StringUtil.isNullOrEmpty(params)) {
                String jumpValue = systemConfigService.get("jump");
                if (StringUtil.isNullOrEmpty(jumpValue)) {
                    jumpValue = "{\"url\":\"#\"}";
                }
                params = jumpValue.replace("#", params);
            }
            if (!StringUtil.isNullOrEmpty(jumpType)) {
                List<JumpDetailV2> listByType = jumpDetailV2Service.listByType(jumpType);
                if (listByType !=null && listByType.size() > 0) {
                    resultObj.setJumpDetail(listByType.get(0));
                }
            }
            String name = record.getName();
            if (name != null && name.trim().length() > 0) {
                resultObj.setName(name);
            }
            if (params != null && params.trim().length() > 0) {
                resultObj.setParams(params);
            }
            String showType = record.getShowType();
            if (showType != null && showType.trim().length() > 0) {
                resultObj.setShowType(record.getShowType());
            }
            String remark = record.getRemark();
            if (remark != null && remark.trim().length() > 0) {
                resultObj.setRemark(remark);
            }
            specialService.updateByPrimaryKey(resultObj);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
            e.printStackTrace();
        }
    }
    /**
     * 专题图片上传
     * @param file
     * @param uid
     * @param id
     * @param request
     * @param response
     * @param special
     * @param out
     */
    @RequestMapping(value = "saveSpecial")
    public void saveSpecial(@RequestParam("file") CommonsMultipartFile file, Long id, Long cardId,
            PrintWriter out) {
        if (file == null) {
            out.print(JsonUtil.loadFalseResult("上传文件为空"));
            return;
        }
    public void saveSpecial(String callback, Special record, String jumpType, HttpServletRequest request,PrintWriter out) {
        try {
            Special resultObj = null;
            if (id != null) {
                resultObj = specialService.selectByPrimaryKey(id);
                if (resultObj == null) {
                    out.print(JsonUtil.loadFalseResult("该专题已不存在"));
                    return;
                }
            // 1. 先判断httpRequest 是否含有文件类型
            if (request instanceof MultipartHttpServletRequest) {
                MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
                specialService.saveObject(fileRequest.getFile("file"), fileRequest.getFile("file2"), fileRequest.getFile("file3"), record, jumpType);
            }else{
                specialService.saveObject(null, null, null,  record, jumpType);
            }
            
            specialService.uploadPicture(file, resultObj, cardId);
            out.print(JsonUtil.loadTrueResult("上传成功"));
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
        } catch (SpecialException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult("操作失败"));
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("保存失败"));
            e.printStackTrace();
        }
    }
@@ -560,48 +216,6 @@
    }
    
    /**
     * 修该状态
     * @param callback
     * @param id
     * @param out
     */
    @RequestMapping(value = "updateSpecialState")
    public void updateSpecialState(String callback, Long id, PrintWriter out) {
        try {
            if (id == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
                return;
            }
            Special resultObj = specialService.selectByPrimaryKey(id);
            if (resultObj == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作数据已不存在"));
                return;
            }
            Long state = resultObj.getState();
            if (state == null ||  state.equals(1) || state == 1) {
                resultObj.setState(0L);
            } else {
                resultObj.setState(1L);
            }
            specialService.updateByPrimaryKeySelective(resultObj);
            JSONObject data = new JSONObject();
            data.put("state", resultObj.getState());
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
            e.printStackTrace();
        }
    }
    /**
     * 修改排序
@@ -612,48 +226,74 @@
     */
    @RequestMapping(value = "saveSpecialOrder")
    public void saveSpecialOrder(String callback, Long id,Integer moveType, PrintWriter out) {
        try {
        
        if (moveType == null || (!moveType.equals(1) && !moveType.equals(-1))) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("传递的类型不正确"));
            return;
            specialService.updateOrder(id, moveType);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
        } catch (SpecialException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("保存失败"));
            e.printStackTrace();
        }
        }
        
        if (id == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
    /**
     *  查询专题
     * @param callback
     * @param pageIndex
     * @param pageSize
     * @param bannerId
     * @param out
     */
    @RequestMapping(value = "querySpecial")
    public void querySpecial(String callback, Integer pageIndex, Integer pageSize, String key, Long cardId, PrintWriter out) {
        if (pageIndex == null || pageIndex < 1) {
            pageIndex = 1;
        }
        if (pageSize == null || pageSize < 1) {
            pageSize = Constant.PAGE_SIZE;
        }
        if (cardId == null) {
            out.print(JsonUtil.loadFalseResult("唯一标识ID不能为空"));
            return;
        }
        
        try {
            Special resultObj = specialService.selectByPrimaryKey(id);
            if (resultObj == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作数据已不存在"));
            List<Special> list = specialService.listQueryByCard((pageIndex - 1) * pageSize, pageSize, cardId, key);
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
                return;
            }
            
            Long cid = resultObj.getCardId();
            Integer oldOrder = resultObj.getOrderby();
            List<Special> list = specialService.getOrderByCardID(cid, moveType, oldOrder);
            long count = specialService.countlistQueryByCard(cardId, key);
            
            if (list != null && list.size() > 0) {
                Special changeObj = list.get(0);
                // 交换排序序号
                resultObj.setOrderby(changeObj.getOrderby());
            int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
            PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
                
                changeObj.setOrderby(oldOrder);
            GsonBuilder gsonBuilder = new GsonBuilder();
            gsonBuilder.serializeNulls();
            Gson gson = gsonBuilder.setDateFormat("yyyy/MM/dd HH:mm:ss").create();
                
                specialService.updateByPrimaryKeySelective(changeObj);
            }
            JSONObject data = new JSONObject();
            data.put("pe", pe);
            data.put("result_list", gson.toJson(list));
            
            specialService.updateByPrimaryKeySelective(resultObj);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            e.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
            e.printStackTrace();
        }
    }
    
}
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/SpecialPlaceAdminController.java
New file
@@ -0,0 +1,169 @@
package com.yeshi.fanli.controller.admin.homemodule;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.yeshi.utils.JsonUtil;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.entity.bus.homemodule.SpecialPlace;
import com.yeshi.fanli.exception.SpecialPlaceException;
import com.yeshi.fanli.service.inter.homemodule.SpecialPlaceService;
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import net.sf.json.JSONObject;
@Controller
@RequestMapping("admin/new/api/v1/specialPlace")
public class SpecialPlaceAdminController {
    @Resource
    private SpecialPlaceService specialPlaceService;
    /**
     * 保存信息
     *
     * @param callback
     * @param special
     * @param out
     */
    @RequestMapping(value = "save")
    public void save(String callback, SpecialPlace specialPlace, PrintWriter out) {
        try {
            specialPlaceService.saveObject(specialPlace);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
        } catch (SpecialPlaceException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("保存失败"));
            e.printStackTrace();
        }
    }
    /**
     * 查询
     * @param callback
     * @param pageIndex
     * @param pageSize
     * @param key  模糊查询:说明、标识
     * @param out
     */
    @RequestMapping(value = "query")
    public void query(String callback, Integer pageIndex, Integer pageSize, String key, PrintWriter out) {
        if (pageIndex == null || pageIndex < 1) {
            pageIndex = 1;
        }
        if (pageSize == null || pageSize < 1) {
            pageSize = Constant.PAGE_SIZE;
        }
        try {
            List<SpecialPlace> list = specialPlaceService.listQuery((pageIndex - 1) * pageSize, pageSize, key);
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
                return;
            }
            long count = specialPlaceService.countQuery(key);
            int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
            PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
            GsonBuilder gsonBuilder = new GsonBuilder();
            gsonBuilder.serializeNulls();
            Gson gson = gsonBuilder.setDateFormat("yyyy/MM/dd HH:mm:ss").create();
            JSONObject data = new JSONObject();
            data.put("pe", pe);
            data.put("result_list", gson.toJson(list));
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
            e.printStackTrace();
        }
    }
    /**
     * 删除
     * @param callback
     * @param idArray
     * @param out
     */
    @RequestMapping(value = "delete")
    public void delete(String callback, String idArray, PrintWriter out) {
        try {
            if (StringUtil.isNullOrEmpty(idArray)) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择操作的数据"));
                return;
            }
            Gson gson = new Gson();
            List<Long> list = gson.fromJson(idArray, new TypeToken<ArrayList<Long>>() {}.getType());
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("未检测到删除的数据"));
                return;
            }
            int count = specialPlaceService.deleteByPrimaryKeyList(list);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("成功删除["+ count +"]条数据"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
            e.printStackTrace();
        }
    }
    @RequestMapping(value = "getEffectiveOption")
    public void getEffectiveOption(String callback, PrintWriter out) {
        try {
            List<Object> list = new ArrayList<Object>();
            Map<String,Object> mapDefalut =new HashMap<String,Object>();
            mapDefalut.put("key", 0);
            mapDefalut.put("value", "--未选择--");
            list.add(mapDefalut);
            List<SpecialPlace> listRecord = specialPlaceService.getEffectiveList();
            if (listRecord != null && listRecord.size() > 0) {
                for (SpecialPlace record: listRecord) {
                    Map<String,Object> map =new HashMap<String,Object>();
                    map.put("key", record.getId());
                    map.put("value", record.getName());
                    list.add(map);
                }
            }
            JSONObject data = new JSONObject();
            data.put("result_list", list);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/SwiperBannerAdminController.java
@@ -4,7 +4,9 @@
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@@ -83,8 +85,7 @@
            swiperBannerService.insert(swiperBanner);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("添加成功"));
        } catch (SwiperBannerException e) {
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
            e.printStackTrace();
        }
@@ -269,10 +270,39 @@
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
            e.printStackTrace();
        }
    }
    
    @RequestMapping(value = "getEffectiveOption")
    public void getEffectiveOption(String callback, PrintWriter out) {
        try {
            List<Object> list = new ArrayList<Object>();
            Map<String,Object> mapDefalut =new HashMap<String,Object>();
            mapDefalut.put("key", 0);
            mapDefalut.put("value", "--未选择--");
            list.add(mapDefalut);
            List<SwiperBanner> listBanner = swiperBannerService.getEffectiveOption();
            if (listBanner != null && listBanner.size() > 0) {
                for (SwiperBanner swiperBanner: listBanner) {
                    Map<String,Object> map =new HashMap<String,Object>();
                    map.put("key", swiperBanner.getId());
                    map.put("value", swiperBanner.getTitle());
                    list.add(map);
                }
            }
            JSONObject data = new JSONObject();
            data.put("result_list", list);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
            e.printStackTrace();
        }
    }
    
    /**
     *  查询图片列表
fanli/src/main/java/com/yeshi/fanli/controller/apph5/AppH5QualityGoodsController.java
@@ -31,6 +31,7 @@
import com.yeshi.fanli.service.inter.goods.CollectionGoodsV2Service;
import com.yeshi.fanli.service.inter.goods.GoodsClassService;
import com.yeshi.fanli.service.inter.goods.TaoBaoClassService;
import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.lable.LabelService;
import com.yeshi.fanli.service.inter.lable.MergeClassService;
@@ -56,6 +57,9 @@
    @Resource
    private QualityFactoryService selectionGoodsService;
    @Resource
    private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
    @Resource
    private TaobaoMeterialService taobaoMeterialService;
@@ -864,13 +868,25 @@
     * @param out
     */
    @RequestMapping("getFlashSale")
    public void getFlashSale(String callback, Integer page, PrintWriter out) {
    public void getFlashSale(String callback, Integer page, Long auctionId, PrintWriter out) {
        if (page == null)
            page = 1;
        int pageSize = Constant.PAGE_SIZE;
        int type = qualityFlashSaleService.getNowType();
        TaoBaoGoodsBrief goodsBrief = null;
        if (page == 1 && auctionId != null) {
            List<TaoBaoGoodsBrief> list = taoBaoGoodsBriefService.queryByAuctionId(auctionId);
            if (list != null && list.size() > 0) {
                goodsBrief = list.get(0);
            }
        }
        if (goodsBrief != null) {
            pageSize = pageSize -1;
        }
        List<QualityFactory> listQuery = qualityGoodsService.listQueryByFlashSale((page - 1) * pageSize, pageSize);
@@ -889,15 +905,22 @@
        BigDecimal proportion = manageService.getFanLiRate();
        if (goodsBrief != null) {
            array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(goodsBrief, proportion.toString(), null)));
        }
        // 遍历列表数据
        for (QualityFactory quality : listQuery) {
            TaoBaoGoodsBrief taoBaoGoodsBrief = quality.getTaoBaoGoodsBrief();
            if (taoBaoGoodsBrief == null) {
                continue;
            }
            if (goodsBrief != null && auctionId.equals(taoBaoGoodsBrief.getAuctionId())) {
                continue;
            }
            int biz30day = taoBaoGoodsBrief.getBiz30day();
            if (biz30day >= 10000) {
                double sales = biz30day;
fanli/src/main/java/com/yeshi/fanli/controller/apph5/AppH5UserController.java
@@ -57,7 +57,7 @@
                String prize = generateAward();
                if (prize == null) {
                    prize = "抽中一张福利免单券";
                    prize = "一张福利免单券";
                }
                dataInfo.put("pic", shamUser.getPicUrl());
@@ -136,6 +136,113 @@
        return prize;
    }
    /**
     * 获取抽奖广告列表
     *
     * @param callback
     * @param out
     */
    @RequestMapping(value = "getDailyRadioList")
    public void getDailyRadioList(String callback, PrintWriter out) {
        try {
            // 随机20条数据
            List<ShamUser> listUser = shamUserService.listRandUser(20);
            JSONArray array = new JSONArray();
            for (ShamUser shamUser : listUser) {
                JSONObject dataInfo = new JSONObject();
                String name = shamUser.getName();
                if (name.length() == 1) {
                    name = "Jx****" + name;
                } else {
                    name = name.substring(0, 1) + "****" + name.substring(name.length() - 2, name.length() - 1);
                }
                String prize = dailyGenerateAward();
                if (prize == null) {
                    prize = "两张返利奖励券";
                }
                dataInfo.put("pic", shamUser.getPicUrl());
                dataInfo.put("content", name + ",抽中" + prize);
                array.add(dataInfo);
            }
            JSONObject data = new JSONObject();
            data.put("result_list", array);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
            e.printStackTrace();
        }
    }
    /**
     * 生成奖项-天天抽
     *
     * @return
     */
    public String dailyGenerateAward() {
        RandomGift randomGift1 = new RandomGift();
        randomGift1.prize = "抽中华为手机20一台";
        randomGift1.probability = 2;
        RandomGift randomGift2 = new RandomGift();
        randomGift2.prize = "现金红包¥188";
        randomGift2.probability = 5;
        RandomGift randomGift3 = new RandomGift();
        randomGift3.prize = "现金红包¥88";
        randomGift3.probability = 13;
        RandomGift randomGift4 = new RandomGift();
        randomGift4.prize = "两张返利奖励券";
        randomGift4.probability = 40;
        RandomGift randomGift5 = new RandomGift();
        randomGift5.prize = "一张返利奖励券";
        randomGift5.probability = 40;
        List<RandomGift> giftList = new ArrayList<RandomGift>();
        giftList.add(randomGift1);
        giftList.add(randomGift2);
        giftList.add(randomGift3);
        giftList.add(randomGift4);
        giftList.add(randomGift5);
        long result = (1 + Math.round(Math.random() * (99)));
        int minRange = 0;
        int maxRange = 0;
        String prize = null;
        for (int i = 0; i < giftList.size(); i++) {
            RandomGift obj2 = giftList.get(i);
            int probability = obj2.probability;
            maxRange = maxRange + probability;
            minRange = 100 - maxRange;
            if (probability != 0) {
                if (result > minRange && result <= maxRange) {
                    prize = obj2.prize;
                    break;
                }
            }
        }
        return prize;
    }
    class RandomGift {
        public String prize;// 奖项
        public int probability; // 概率
fanli/src/main/java/com/yeshi/fanli/controller/client/ActivityController.java
@@ -8,14 +8,10 @@
import javax.annotation.Resource;
import net.sf.json.JSONObject;
import org.jsoup.Jsoup;
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 org.yeshi.utils.NumberUtil;
import org.yeshi.utils.entity.FileUploadResult;
import com.google.gson.Gson;
@@ -30,7 +26,8 @@
import com.yeshi.fanli.exception.share.UserShareGoodsRecordException;
import com.yeshi.fanli.service.inter.activity.ActivityService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import net.sf.json.JSONObject;
/**
 * 动态
@@ -98,18 +95,6 @@
        if (page <= 0)
            page = 1;
        List<RecommendActivity> list = activityService.getRecommendActivityListCache(page, Constant.PAGE_SIZE);
        // 过滤一遍
        if (list != null)
            for (RecommendActivity activity : list) {
                if (!StringUtil.isNullOrEmpty(activity.getTitle())) {
                    activity.setTitle(Jsoup.parse(activity.getTitle()).text());
                    if (activity.getShareCount() >= 10000)
                        activity.setShareCountShow(
                                NumberUtil.get1PointNumber(activity.getShareCount() / 10000.0) + "万");
                    else
                        activity.setShareCountShow(activity.getShareCount() + "");
                }
            }
        long count = activityService.getRecommendActivityCountCache();
        JSONObject data = new JSONObject();
        data.put("data", getGson().toJson(list));
fanli/src/main/java/com/yeshi/fanli/controller/client/ConfigController.java
@@ -14,14 +14,11 @@
import com.yeshi.fanli.entity.bus.homemodule.FloatAD;
import com.yeshi.fanli.entity.config.AppHomeFloatImg;
import com.yeshi.fanli.entity.taobao.ClientTBPid;
import com.yeshi.fanli.entity.taobao.PidUser;
import com.yeshi.fanli.entity.taobao.TBPid;
import com.yeshi.fanli.entity.taobao.TaoBaoUnionConfig;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.homemodule.FloatADService;
import com.yeshi.fanli.service.inter.order.CommonOrderCountService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
import com.yeshi.fanli.service.inter.user.TBPidService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
@@ -47,7 +44,7 @@
    private TaoBaoUnionConfigService taoBaoUnionConfigService;
    @Resource
    private CommonOrderCountService commonOrderCountService;
    private UserInfoExtraService userInfoExtraService;
    
    @Resource
    private FloatADService floatADService;
@@ -86,7 +83,8 @@
            detail.put("showTime", floatAD.getShowMode());
            detail.put("accountLogin", floatAD.isJumpNeedLogin());
            
            if (uid != null && !commonOrderCountService.hasRebateAndShareOrder(uid)) {
            if (uid != null && userInfoExtraService.isNewUser(uid)) {
                // 新用户
                data.put("floatImgDetail", detail);
            } else {
                data.put("floatImgDetail", detail);
@@ -96,6 +94,12 @@
        // 领券帮助链接,1.5.2后生效
        String couponHelp = configService.get("taobao_coupon_help");
        data.put("couponHelpUrl", couponHelp);
        // 底部网页链接
        String platform = acceptData.getPlatform();
        if ("android".equalsIgnoreCase(platform)) {
            data.put("htmlLink", configService.get("index_html_link_android"));
        }
        out.print(JsonUtil.loadTrueResult(data));
    }
@@ -169,4 +173,21 @@
        out.print(JsonUtil.loadTrueResult(data));
    }
    @RequestMapping(value = "getUserConfig", method = RequestMethod.POST)
    public void getUserConfig(AcceptData acceptData, PrintWriter out) {
        try {
            // 用户协议链接
            String serviceProtocol = configService.get("service_protocol_link");
            // 隐私条款链接
            String privacyProtocol = configService.get("privacy_protocol_link");
            JSONObject data = new JSONObject();
            data.put("serviceProtocolLink", serviceProtocol);
            data.put("privacyProtocolLink", privacyProtocol);
            out.print(JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult("获取失败"));
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/GoodsClassController.java
@@ -22,6 +22,7 @@
import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
import com.yeshi.fanli.entity.bus.clazz.GoodsSecondClass;
import com.yeshi.fanli.entity.bus.clazz.GoodsSubClass;
import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
import com.yeshi.fanli.entity.bus.lable.QualityFactory;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.entity.taobao.SearchFilter;
@@ -38,6 +39,8 @@
import com.yeshi.fanli.service.inter.goods.SuperGoodsClassService;
import com.yeshi.fanli.service.inter.goods.TaoBaoClassService;
import com.yeshi.fanli.service.inter.goods.TaoBaoCouponService;
import com.yeshi.fanli.service.inter.homemodule.HomeNavbarService;
import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.lable.LabelClassService;
import com.yeshi.fanli.service.inter.lable.QualityFactoryService;
@@ -104,6 +107,12 @@
    @Resource
    private MonitorService monitorService;
    @Resource
    private HomeNavbarService homeNavbarService;
    @Resource
    private SwiperPictureService swiperPictureService;
    @Resource(name = "taskExecutor")
    private TaskExecutor executor;
@@ -117,13 +126,7 @@
    public void getGoodsClass(AcceptData acceptData, PrintWriter out) {
        try {
            BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
            if (system == null) {
                out.print(JsonUtil.loadFalseResult("系统不存在"));
                return;
            }
            List<GoodsClass> goodsClassList = goodsClassService.getListClassCache(system.getId());
            List<GoodsClass> goodsClassList = goodsClassService.getEffectiveClassCache();
            if (goodsClassList == null || goodsClassList.size() == 0) {
                out.print(JsonUtil.loadFalseResult("暂无数据"));
                return;
@@ -131,7 +134,7 @@
            JSONObject data = new JSONObject();
            data.put("count", goodsClassList.size());
            data.put("goodsClassList", goodsClassList);
            data.put("goodsClassList", JsonUtil.getApiCommonGson().toJson(goodsClassList));
            out.print(JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
@@ -153,14 +156,21 @@
     * @param out
     */
    @RequestMapping(value = "getgoodssecondclass", method = RequestMethod.POST)
    public void getGoodsSecondClass(AcceptData acceptData, long gcid, PrintWriter out) {
    public void getGoodsSecondClass(AcceptData acceptData, long gcid, Long swpid, PrintWriter out) {
        try {
            GoodsClass goodsClass = goodsClassService.getGoodsClassCache(gcid);
            if (goodsClass == null) {
                out.print(JsonUtil.loadFalseResult("暂无数据"));
                return;
            }
            // 轮播图
            List<SwiperPicture> picList = null;
            if (swpid != null) {
                picList = swiperPictureService.getByBannerId(swpid);
            }
            if (picList == null) {
                picList = new ArrayList<SwiperPicture>();
            }
            List<GoodsSubClass> goodsSubClassList = goodsSubClassService.getSubClassCache(gcid, 1);
@@ -168,7 +178,28 @@
                goodsSubClassList = new ArrayList<GoodsSubClass>();
            }
            boolean changePicture = false;
            String version = acceptData.getVersion();
            int tversion = Integer.parseInt(version);
            String platform = acceptData.getPlatform();
            if ("android".equalsIgnoreCase(platform) && tversion > 34) {
                changePicture = true;
            } else if (tversion > 44){
                changePicture = true;
            }
            // 1.5.3新版图片替换
            if (changePicture) {
                for (GoodsSubClass goodsSubClass: goodsSubClassList) {
                    String pictureSecond = goodsSubClass.getPictureSecond();
                    if (pictureSecond != null && pictureSecond.trim().length() > 0) {
                        goodsSubClass.setPicture(pictureSecond);
                    }
                }
            }
            JSONObject data = new JSONObject();
            data.put("picList", JsonUtil.getApiCommonGson().toJson(picList));
            data.put("count", goodsSubClassList.size());
            data.put("goodsSecondClassList", JsonUtil.getApiCommonGson().toJson(goodsSubClassList));
            out.print(JsonUtil.loadTrueResult(data));
@@ -192,7 +223,12 @@
                            goodsClass.setIosClick(1L);
                        }
                    }
                    goodsClassService.updateByPrimaryKeySelective(goodsClass);
                    GoodsClass gc = new GoodsClass();
                    gc.setId(goodsClass.getId());
                    gc.setIosClick(goodsClass.getIosClick());
                    gc.setAndroidClick(goodsClass.getAndroidClick());
                    goodsClassService.updateByPrimaryKeySelective(gc);
                }
            });
@@ -580,13 +616,6 @@
                filter = new SearchFilter();
            }
            // String searchKey = goodsClass.getName();
            // String key = goodsClass.getKey();
            // if (key != null && !"".equals(key.trim())) {
            // searchKey = key;
            // }
            // filter.setKey(searchKey);
            filter.setMaterialId("6707");
            filter.setPage(page);
            filter.setPageSize(pageSize);
@@ -637,44 +666,6 @@
        data.put("result", array);
        out.print(JsonUtil.loadTrueResult(data));
        /*
         * // 测试取消缓存 GoodsClass goodsClass =
         * goodsClassService.getGoodsClassCache(gcid); if (goodsClass == null) {
         * out.append(JsonUtil.loadFalseResult("不存在该分类")); return; }
         *
         * SearchFilter sf = new SearchFilter(); sf.setKey(goodsClass.getKey());
         * sf.setPage(page); sf.setPageSize(Constant.PAGE_SIZE); sf.setQuan(1);
         *
         * TaoBaoSearchResult result = TaoKeApiUtil.searchWuLiao(sf);
         *
         * List<TaoBaoSearchNav> navList = TaoBaoUtil.getBaseNav(); if
         * (result.getNavList() != null) navList.addAll(result.getNavList());
         * Gson gson = new GsonBuilder().create(); JSONObject data = new
         * JSONObject(); data.put("nav", gson.toJson(navList));
         * List<TaoBaoGoodsBriefExtra> re = new
         * ArrayList<TaoBaoGoodsBriefExtra>(); List<TaoBaoGoodsBrief>
         * taoBaoGoodsBriefs = result.getTaoBaoGoodsBriefs(); Map<String,
         * String> map = manageService.convertMap(); String proportion =
         * map.get("hongbao_goods_proportion"); String fcRate =
         * map.get("hongbao_fc_ratio");
         *
         * TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra; if (taoBaoGoodsBriefs !=
         * null) for (TaoBaoGoodsBrief taoBaoGoodsBrief : taoBaoGoodsBriefs) {
         * int count = taoBaoGoodsBrief.getBiz30day(); if (count >= 10000) {
         * double sales = count; String salesCountMidea = String.format("%.1f",
         * sales / 10000); taoBaoGoodsBrief.setSalesCount(salesCountMidea +
         * "万"); taoBaoGoodsBriefExtra =
         * TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion,
         * fcRate, ""); re.add(taoBaoGoodsBriefExtra); } else {
         * taoBaoGoodsBrief.setSalesCount(count + ""); taoBaoGoodsBriefExtra =
         * TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion,
         * fcRate, ""); re.add(taoBaoGoodsBriefExtra); } }
         *
         * Gson gson2 = JsonUtil.getApiCommonGson(); data.put("result",
         * gson2.toJson(re)); data.put("count",
         * result.getTaoBaoHead().getDocsfound());
         * out.print(JsonUtil.loadTrueResult(data));
         */
    }
@@ -755,7 +746,7 @@
        if (meterialId > 0)
            result = TaoKeApiUtil.getMaterialByMaterialId(meterialId, page, 20);
        else
            result = TaoKeApiUtil.searchCouple(goodsClassService.getKwById(id), null, page, 20);
            result = TaoKeApiUtil.searchCouple(goodsClassService.getKeysById(id), null, page, 20);
        List<TaoBaoSearchNav> navList = TaoBaoUtil.getBaseNav();
        if (result.getNavList() != null)
@@ -809,14 +800,7 @@
    @RequestMapping(value = { "getcategory" }, method = { org.springframework.web.bind.annotation.RequestMethod.POST })
    public void getcategory(AcceptData acceptData, PrintWriter out) {
        try {
            com.yeshi.fanli.entity.system.BusinessSystem system = this.businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
                    acceptData.getPackages());
            if (system == null) {
                out.print(JsonUtil.loadFalseResult("系统不存在"));
                return;
            }
            List<Map<String, Object>> listCache = goodsClassService.getClassListAllCache(system.getId());
            List<Map<String, Object>> listCache = goodsClassService.getClassListAllCache();
            if (listCache == null) {
                listCache = new ArrayList<Map<String, Object>>();
            }
fanli/src/main/java/com/yeshi/fanli/controller/client/HomeNavbarController.java
@@ -13,10 +13,7 @@
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar;
import com.yeshi.fanli.entity.bus.homemodule.SuperHomeNavbar;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.service.inter.config.BusinessSystemService;
import com.yeshi.fanli.service.inter.homemodule.SuperHomeNavbarService;
import com.yeshi.fanli.service.inter.homemodule.HomeNavbarService;
import net.sf.json.JSONObject;
@@ -25,11 +22,7 @@
public class HomeNavbarController<E> {
    @Resource
    private BusinessSystemService businessSystemService;
    @Resource
    private SuperHomeNavbarService superHomeNavbarService;
    private HomeNavbarService homeNavbarService;
    /**
@@ -40,36 +33,14 @@
     */
    @RequestMapping(value = "gethomenavbar", method = RequestMethod.POST)
    public void gethomenavbar(AcceptData acceptData, PrintWriter out) {
        BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
        if (system == null) {
            out.print(JsonUtil.loadFalseResult("系统不存在"));
            return;
        }
        List<SuperHomeNavbar> listSuper = superHomeNavbarService.listBySystemCache(system.getId());
        if (listSuper == null || listSuper.size() == 0) {
            out.print(JsonUtil.loadFalseResult("暂无数据"));
            return;
        }
        List<HomeNavbar> listNavbar = new ArrayList<HomeNavbar>();
        for (SuperHomeNavbar superHomeNavbar : listSuper) {
            HomeNavbar homeNavbar = superHomeNavbar.getHomeNavbar();
            if (homeNavbar == null) {
                continue;
            }
            homeNavbar.setCreatetime(null);
            homeNavbar.setUpdatetime(null);
            listNavbar.add(homeNavbar);
        List<HomeNavbar> listNavbar = homeNavbarService.listQueryEffectiveNavbar();
        if (listNavbar == null) {
            listNavbar = new ArrayList<HomeNavbar>();
        }
        
        JSONObject data = new JSONObject();
        data.put("count", listNavbar.size());
        data.put("listNavbar", listNavbar);
        data.put("listNavbar", JsonUtil.getApiCommonGson().toJson(listNavbar));
        
        out.print(JsonUtil.loadTrueResult(data));
    }
fanli/src/main/java/com/yeshi/fanli/controller/client/InviteGetMoneyController.java
@@ -11,6 +11,7 @@
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.HttpUtil;
import org.yeshi.utils.JsonUtil;
import com.yeshi.fanli.dto.money.InviteGetMoney;
@@ -176,7 +177,7 @@
     * @throws IOException
     */
    @RequestMapping(value = "/listInviteFriendImg", method = RequestMethod.POST)
    public void listInviteFriendImg(AcceptData acceptData, PrintWriter out, Long uid)
    public void listInviteFriendImg(AcceptData acceptData,  Long uid, PrintWriter out)
            throws NotExistObjectException, IOException {
        JSONObject data = new JSONObject();
        if (uid != null && !uid.equals("0")) {
@@ -184,9 +185,19 @@
            data.put("imgUrlList", JsonUtil.getSimpleGsonWithDate().toJson(imgList));
        }
        // 邀请链接
        String shortLink = HttpUtil.getShortLink("http://" + Constant.wxGZConfig.getLoginHost() + "/"
                 + Constant.systemCommonConfig.getProjectName() + "/client/threeShareNew?uid=" + uid);
        data.put("inviteLink", shortLink);
        UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
        if (userInfoExtra != null) {
            data.put("inviteCode", userInfoExtra.getInviteCode());
        }
        // 邀请规则
        String key = "inviteRules"; // key值
        com.yeshi.fanli.entity.system.BusinessSystem system = new BusinessSystem();
        BusinessSystem system = new BusinessSystem();
        system.setCreatetime(java.lang.System.currentTimeMillis());
        system.setPlatform(1);
        system.setId(4L);
@@ -250,7 +261,7 @@
                return;
            }
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("激活成功"));
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("邀请码激活成功"));
        } catch (UserInfoExtraException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
@@ -260,6 +271,31 @@
        }
    }
    /**
     * 激活邀请
     *
     * @param callback
     * @param uid
     *            用户id
     * @param inviteCode
     *            邀请嘛
     * @param out
     */
    @RequestMapping(value = "activationInviteWX")
    public void activationInviteWX(AcceptData acceptData, Long uid, String  code, PrintWriter out) {
        try {
            userInfoExtraService.activationInviteWX(uid, code);
            out.print(JsonUtil.loadTrueResult("邀请码激活成功"));
        } catch (UserInfoExtraException e) {
            out.print(JsonUtil.loadFalseResult(e.getMsg()));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult("邀请码激活失败"));
            e.printStackTrace();
        }
    }
    /**
     * 获取邀请码
     * 
fanli/src/main/java/com/yeshi/fanli/controller/client/RecommendController.java
@@ -7,8 +7,8 @@
import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@@ -28,11 +28,11 @@
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import com.yeshi.fanli.dao.mybatis.HongBaoManageMapper;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.homemodule.Special;
import com.yeshi.fanli.entity.bus.homemodule.SuperSpecial;
import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
import com.yeshi.fanli.entity.bus.lable.QualityFactory;
import com.yeshi.fanli.entity.bus.recommend.Honest;
import com.yeshi.fanli.entity.bus.recommend.RecommendBanner;
import com.yeshi.fanli.entity.bus.recommend.RecommendBannerV2;
@@ -53,7 +53,6 @@
import com.yeshi.fanli.entity.taobao.ClientTBPid;
import com.yeshi.fanli.entity.taobao.PidUser;
import com.yeshi.fanli.entity.taobao.SearchFilter;
import com.yeshi.fanli.entity.taobao.TBPid;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
@@ -75,7 +74,6 @@
import com.yeshi.fanli.service.inter.config.SystemConfigService;
import com.yeshi.fanli.service.inter.goods.CollectionGoodsV2Service;
import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
import com.yeshi.fanli.service.inter.goods.RecommendBannerService;
import com.yeshi.fanli.service.inter.goods.ScanHistoryV2Service;
import com.yeshi.fanli.service.inter.goods.SuperRecommendBannerService;
import com.yeshi.fanli.service.inter.goods.SuperRecommendBannerV2Service;
@@ -86,6 +84,7 @@
import com.yeshi.fanli.service.inter.homemodule.SuperSpecialService;
import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.lable.QualityFlashSaleService;
import com.yeshi.fanli.service.inter.lable.QualityGoodsService;
import com.yeshi.fanli.service.inter.monitor.MonitorService;
import com.yeshi.fanli.service.inter.order.OrderService;
@@ -107,7 +106,6 @@
import com.yeshi.fanli.util.cache.TaoBaoGoodsCacheUtil;
import com.yeshi.fanli.util.factory.MonitorFactory;
import com.yeshi.fanli.util.taobao.TaoBaoCouponUtil;
import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import com.yeshi.fanli.vo.user.UserSettingsVO;
@@ -119,8 +117,6 @@
@RequestMapping("api/v1/user")
public class RecommendController {
    @Resource
    private RecommendBannerService recommendService;
    @Resource
    private BusinessSystemService businessSystemService;
@@ -146,8 +142,6 @@
    @Resource
    private UserInfoService userInfoService;
    @Resource
    private TaoBaoOrderUtil taoBaoOrderUtil;
    @Resource
    private TaoBaoCouponService taoBaoCouponService;
@@ -160,9 +154,6 @@
    @Resource
    private CollectionGoodsV2Service collectionGoodsV2Service;
    @Resource
    private HongBaoManageMapper hongBaoManageMapper;
    @Resource
    private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
@@ -225,12 +216,14 @@
    private UserInfoExtraService userInfoExtraService;
    @Resource
    private QualityFlashSaleService qualityFlashSaleService;
    @Resource
    private TaoBaoGoodsCacheUtil taoBaoGoodsCacheUtil;
    @RequestMapping(value = "getHonestList")
    public void getHonestList(AcceptData acceptData, PrintWriter out) {
        BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
                acceptData.getPackages());
        List<Honest> honestList = null;
        List<TaoBaoUnionConfig> configList = taoBaoUnionConfigService.getConfigByTypeCache(PidUser.TYPE_FANLI_ANDROID);
        if ((Integer.parseInt(acceptData.getVersion()) >= 20 && "android".equalsIgnoreCase(acceptData.getPlatform()))
@@ -979,7 +972,6 @@
        ClientTBPid clientTBPid = null;
        // 用户已经登录
        if (!StringUtil.isNullOrEmpty(uid)) {
            TBPid tbPid = null;
            if (acceptData.getPlatform().equalsIgnoreCase("android")) {
                clientTBPid = tbPidService.getAndroidDefault();
            } else {
@@ -1301,7 +1293,6 @@
        // 从推荐来
        if (page <= 1) {
            array.clear();
            Map<String, String> map = hongBaoManageService.convertMap();
            BigDecimal proportion = manageService.getFanLiRate();
            if (!StringUtil.isNullOrEmpty(imei) || !StringUtil.isNullOrEmpty(idfa)) {
                long startTime = java.lang.System.currentTimeMillis();
@@ -1343,14 +1334,12 @@
                    proportion.toString());
            array.addAll(localArray);
        } else {// 从精选库来
            Map<String, String> map = hongBaoManageService.convertMap();
            BigDecimal proportion = manageService.getFanLiRate();
            array = qualityGoodsService.getRecommendToIndex((page - 1) * pageSize, pageSize, proportion.toString());
            if (array == null) {
                out.print(JsonUtil.loadFalseResult("没有更多了"));
                return;
            }
            long count = qualityGoodsService.countRecommendToIndex(proportion.toString());
        }
        JSONObject data = new JSONObject();
@@ -1570,10 +1559,187 @@
                    root.put("invite", invite);
            }
        }
        out.print(JsonUtil.loadTrueResult(root));
    }
    /**
     * 新版推荐专题管理(1.5.3)
     *
     * @param acceptData
     * @param out
     */
    @RequestMapping(value = "getRecommendIndex")
    public void getRecommendIndex(AcceptData acceptData, Long uid, PrintWriter out) {
        try {
            // 专题模块
            JSONObject root = specialService.listCacheSpecialToIndex();
            // 顶部轮播图
            List<SwiperPicture> topPicList = getSwiperByCard("index_top");
            if (topPicList == null) {
                topPicList = new ArrayList<SwiperPicture>();
            }
            root.put("topPicList", JsonUtil.getApiCommonGson().toJson(topPicList));
            // 邀请、分享轮播图
            List<SwiperPicture> invitePicList = getInvitePicList(uid, acceptData);
            if (invitePicList == null) {
                invitePicList = new ArrayList<SwiperPicture>();
            }
            root.put("invitePicList", JsonUtil.getApiCommonGson().toJson(invitePicList));
            // 底部网页链接
            String platform = acceptData.getPlatform();
            if ("ios".equalsIgnoreCase(platform)) {
                root.put("htmlLink", configService.get("index_html_link_ios"));
            }
        out.print(JsonUtil.loadTrueResult(root));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult(1, "获取数据失败"));
            try {
                LogHelper.errorDetailInfo(e);
            } catch (Exception e1) {
                e1.printStackTrace();
    }
        }
    }
    /**
     * 邀请有奖是否需要返回
     * @param uid
     * @param acceptData
     * @return
     */
    public List<SwiperPicture>  getInvitePicList(Long uid, AcceptData acceptData) {
        // 如果IOS当前版本处于审核状态就不返回
        if ("ios".equalsIgnoreCase(acceptData.getPlatform())
                && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()))) {
            return null;
        }
        List<SwiperPicture> invitePicList = getSwiperByCard("index_invite");
        if (uid != null) {
            try {
                // 用户自定义:不看邀请有奖
                UserSettingsVO vo = userCustomSettingsService.getMySettings(uid);
                if (vo != null  && vo.getNoInvitationBonus() != null && vo.getNoInvitationBonus() == 1
                        && invitePicList != null && invitePicList.size() > 0) {
                    Iterator<SwiperPicture> iterator = invitePicList.iterator();
                    while (iterator.hasNext()) {
                        SwiperPicture swiperPicture = iterator.next();
                        JumpDetailV2 jumpDetail = swiperPicture.getJumpDetail();
                        if (jumpDetail != null && "invite".equals(jumpDetail.getType())) {
                            iterator.remove();
                        }
                    }
                }
            } catch (UserCustomSettingsException e) {
                e.printStackTrace();
            }
        }
        return invitePicList;
    }
    public List<SwiperPicture> getSwiperByCard(String card){
        List<SwiperPicture> swiperList = null;
        try {
            swiperList = swiperPictureService.getByBannerCard(card);
        } catch (Exception e) {
            try {
                LogHelper.errorDetailInfo(e);
            } catch (Exception e1) {
                e1.printStackTrace();
            }
            e.printStackTrace();
        }
        return swiperList;
    }
    /**
     * 限时秒杀 1.5.3
     *
     * @param acceptData
     * @param out
     */
    @RequestMapping(value = "getSpikeGoods")
    public void getSpikeGoods(AcceptData acceptData, PrintWriter out) {
        // 下一次倒计时的时间
        int type = qualityFlashSaleService.getNowType() + 1;
        int hour = 0;
        switch(type) {
            case 1:
                hour = 0;
                break;
            case 2:
                hour = 9;
                break;
            case 3:
                hour = 12;
                break;
            case 4:
                hour = 14;
                break;
            case 5:
                hour = 16;
                break;
            case 6:
                hour = 20;
                break;
            case 7:
                hour = 22;
                break;
            default:
                break;
        }
        Calendar nextTime = Calendar.getInstance();
        nextTime.set(Calendar.HOUR_OF_DAY, hour);
        nextTime.set(Calendar.MINUTE, 0);
        nextTime.set(Calendar.SECOND, 0);
        nextTime.set(Calendar.MILLISECOND, 0);
        JSONObject root = new JSONObject();
        root.put("time", nextTime.getTimeInMillis());
        JSONArray array = new JSONArray();
        String cachekey = "spikeGoodsList" ;
        String cacheValue = redisManager.getCommonString(cachekey);
        if (!StringUtil.isNullOrEmpty(cacheValue)) {
            array = JSONArray.fromObject(cacheValue);
        } else {
            BigDecimal proportion = manageService.getFanLiRate();
            Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                    .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
            // 缓存中不存在
            List<QualityFactory> listGoods = qualityGoodsService.listFlashSaleRandGoods();
            if (listGoods == null) {
                listGoods = new ArrayList<QualityFactory>();
            }
            /* 遍历列表数据 */
            for (QualityFactory qualityFactory : listGoods) {
                TaoBaoGoodsBrief taoBaoGoodsBrief = qualityFactory.getTaoBaoGoodsBrief();
                if (taoBaoGoodsBrief == null) {
                    continue;
                }
                array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null)));
            }
            // 缓存半个小时
            redisManager.cacheCommonString(cachekey, array.toString(), 60 * 30);
        }
        root.put("listgoods", array);
        out.print(JsonUtil.loadTrueResult(root));
    }
    /**
     * 商品基本详情 (1.4.0)
fanli/src/main/java/com/yeshi/fanli/controller/client/SMSController.java
@@ -7,16 +7,19 @@
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.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode;
import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode.ForbiddenUserIdentifyCodeTypeEnum;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.exception.SMSException;
import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
import com.yeshi.fanli.service.inter.user.SMSService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.annotation.RequestSerializableByKey;
import org.yeshi.utils.JsonUtil;
@Controller
@RequestMapping("api/v1/sms")
@@ -30,6 +33,9 @@
    @Resource
    private UserInfoService userInfoService;
    @Resource
    private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService;
    // 发送短信
@@ -57,7 +63,7 @@
                out.print(JsonUtil.loadFalseResult(4, "电话号码格式不正确"));
                return;
            }
            String msg = smsService.sendLoginVCode(phone);
            smsService.sendLoginVCode(phone, 6);
            out.print(JsonUtil.loadTrueResult("发送成功"));
        } catch (SMSException e) {
@@ -65,4 +71,112 @@
        }
    }
    /**
     * 1.5.3  登录发送短信
     * @param acceptData
     * @param phone
     * @param uid
     * @param out
     */
    @RequestMapping(value = "sendMSMLogin", method = RequestMethod.POST)
    public void sendMSMLogin(AcceptData acceptData, String phone, boolean slideVerify, PrintWriter out) {
        if (phone == null || !StringUtil.isMobile(phone.replaceAll(" ", ""))) {
            out.print(JsonUtil.loadFalseResult(1, "手机号输入有误,请修改"));
            return;
        }
        phone = phone.replaceAll(" ", "");
        sendMSNnew(phone,slideVerify, 1, StringUtil.Md5(phone + "-" + acceptData.getDevice()), out);
    }
    /**
     * 1.5.3 绑定发送短信
     * @param acceptData
     * @param phone
     * @param uid
     * @param out
     */
    @RequestMapping(value = "sendMSMBind", method = RequestMethod.POST)
    public void sendMSMBind(AcceptData acceptData, String phone, boolean slideVerify, PrintWriter out) {
        if (phone == null || !StringUtil.isMobile(phone.replaceAll(" ", ""))) {
            out.print(JsonUtil.loadFalseResult(1, "手机号输入有误,请修改"));
            return;
        }
        phone = phone.replaceAll(" ", "");
        // 判断手机号码是否被封禁
        ForbiddenUserIdentifyCode identifyCode1 = forbiddenUserIdentifyCodeService
                .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.phone, phone);
        if (identifyCode1 != null && identifyCode1.getEffective() != null && identifyCode1.getEffective()) {
            out.print(JsonUtil.loadFalseResult(9001,"该电话号码被占用"));
            return;
        }
        // 判断手机号码是否被封禁
        UserInfo phoneUser = userInfoService.getEffectiveUserInfoByPhone(phone);
        if (phoneUser != null) {
            out.print(JsonUtil.loadFalseResult(9001,"该电话号码被占用"));
            return;
        }
        sendMSNnew(phone,slideVerify, 2, StringUtil.Md5(phone + "-" + acceptData.getDevice()), out);
    }
    @RequestSerializableByKey(key = "key")
    public void sendMSNnew(String phone, boolean slideVerify, int type, String key, PrintWriter out) {
        try {
            int count = 0;
            String cachekey = null;
            if (type == 1) {
                // 登录验证码
                cachekey = "sendMSNLoginCount" + phone;
            } else if (type == 2) {
                // 绑定验证码
                cachekey = "sendMSNBindCount" + phone;
            }
            if (cachekey == null) {
                out.print(JsonUtil.loadFalseResult(1,"发送失败"));
                return;
            }
            String cacheValue = redisManager.getCommonString(cachekey);
            if (!StringUtil.isNullOrEmpty(cacheValue)) {
                count = Integer.parseInt(cacheValue);
                // 限制3次
                if (count >= 3) {
                    out.print(JsonUtil.loadFalseResult(3,"验证码次数超限,请稍后再试"));
                    return;
                }
            }
            if (count == 2 && !slideVerify) {
                out.print(JsonUtil.loadFalseResult(2,"需要滑动验证"));
                return;
            }
            // 缓存一个小时
            count ++;
            redisManager.cacheCommonString(cachekey, count + "", 60 * 60);
            if (type == 1) {
                // 登录验证码
                smsService.sendLoginVCode(phone, 4);
            } else if (type == 2) {
                // 绑定验证码
                smsService.sendBindVCode(phone, 4);
            }
            out.print(JsonUtil.loadTrueResult("发送成功"));
        } catch (SMSException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult(1, "发送失败"));
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/SystemClientController.java
@@ -20,6 +20,7 @@
import com.yeshi.fanli.entity.system.SystemClientParams;
import com.yeshi.fanli.service.inter.config.BusinessSystemService;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.config.CustomerContentService;
import com.yeshi.fanli.service.inter.config.SystemClientParamsService;
import com.yeshi.fanli.service.inter.push.DeviceActiveService;
import com.yeshi.fanli.service.inter.push.IOSPushService;
@@ -45,6 +46,9 @@
    @Resource
    private DeviceActiveService deviceActiveService;
    @Resource
    private CustomerContentService customerContentService;
    @RequestMapping("getsystemclientparams")
    public void getSystemClientParams(AcceptData acceptData, PrintWriter out) {
@@ -121,7 +125,7 @@
    @RequestMapping("contactCustomerService")
    public void contactCustomerService(AcceptData acceptData, PrintWriter out) {
        String title = "联系客服";
        List<CustomerContent> contentList = systemClientParamsService.contactCustomerService(title);
        List<CustomerContent> contentList = customerContentService.contactCustomerService(title);
        JSONObject data = new JSONObject();
        data.put("contentList", JsonUtil.getSimpleGsonWithDate().toJson(contentList));
        out.print(JsonUtil.loadTrueResult(data));
fanli/src/main/java/com/yeshi/fanli/controller/client/UserAccountController.java
@@ -9,6 +9,7 @@
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 org.yeshi.utils.encrypt.DESUtil;
@@ -132,6 +133,7 @@
    @Resource
    private UserMoneyService userMoneyService;
    private static final String PASSWORD_MAX_ERROR = "password_max_error";
    private static final String EXTRACT_MIN_MONEY = "extract_min_money";
@@ -1104,4 +1106,210 @@
            deviceTokenHWService.unBindDeviceToken(acceptData.getDevice());
        out.print(JsonUtil.loadTrueResult(""));
    }
    /**
     *   新版登录  V1.5.3
     * @param acceptData
     * @param vcode
     * @param phone
     * @param code
     * @param loginType 登录方式:  1-手机登录   2-微信登录
     * @param request
     * @param out
     */
    @RequestMapping(value = "loginNew", method = RequestMethod.POST)
    public void loginNew(AcceptData acceptData, String vcode, String phone, String code,
            int loginType, HttpServletRequest request, PrintWriter out) {
        try {
            BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
                    acceptData.getPackages());
            if (system == null) {
                out.print(JsonUtil.loadFalseResult("系统不存在"));
                return;
            }
            UserInfo userInfo = null;
            // 手机登录
            if (loginType == 1) {
                userInfo = userAccountService.loginPhone(request, loginType, vcode, phone, system.getAppid());
            }
            // 微信登录
            if (loginType == 2) {
                userInfo = userAccountService.loginWinXin(request,loginType, code, system.getAppid());
            }
            if (userInfo == null) {
                out.print(JsonUtil.loadFalseResult("登录失败"));
            } else {
                JSONObject data = new JSONObject();
                data.put("userInfo", UserUtil.filterForClientUser(userInfo));
                out.print(JsonUtil.loadTrueResult(data));
                final UserInfo uuser = userInfo;
                ThreadUtil.run(new Runnable() {
                    public void run() {
                        try {
                            /* 同步未登录之前设备抽奖数据  */
                            int platformType = 0;
                            String platform = acceptData.getPlatform();
                            if ("android".equals(platform)) {
                                platformType = 1;
                            } else if ("ios".equals(platform)) {
                                platformType = 2;
                            }
                            userSystemCouponService.copyLotteryPrize(uuser.getId(), platformType, acceptData.getDevice());
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    }
                });
            }
        } catch (UserAccountException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
            try {
                LogHelper.cookieLog("登录出错:" + e.getCode() + "-" + e.getMessage());
            } catch (Exception e1) {
                e1.printStackTrace();
            }
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult("登录失败"));
            try {
                LogHelper.errorDetailInfo(e);
            } catch (Exception e1) {
                e1.printStackTrace();
            }
        }
    }
    /**
     *   绑定电话号码  V1.5.3
     *
     * @param acceptData
     * @param vcode
     * @param phone
     * @param out
     */
    @RequestMapping(value = "bindPhoneNew")
    public void bindPhoneNew(AcceptData acceptData, Long uid, String vcode, String phone, PrintWriter out) {
        BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
                acceptData.getPackages());
        if (system == null) {
            out.print(JsonUtil.loadFalseResult("系统不存在"));
            return;
        }
        if (StringUtil.isNullOrEmpty(vcode)) {
            out.print(JsonUtil.loadFalseResult("验证码不能为空"));
            return;
        }
        if (StringUtil.isNullOrEmpty(phone)) {
            out.print(JsonUtil.loadFalseResult("电话号码不能为空"));
            return;
        }
        phone = phone.replaceAll(" ", "");
        String oldVCode = redisManager.getSMSVCode(phone, SMSHistory.TYPE_BIND);
        if (Constant.IS_OUTNET) {
            if (!vcode.equalsIgnoreCase(oldVCode)) {
                out.print(JsonUtil.loadFalseResult(9001, "验证码错误,重新输入"));
                return;
            }
            redisManager.clearSMSFrequencyLimit(phone, SMSHistory.TYPE_BIND);
        }
        try {
            // 绑定用户
            userAccountService.bindPhoneNew(uid, phone);
            UserInfo user = userInfoService.getUserByIdWithMybatis(uid);
            // 判断电话号码是否已经封禁
            ForbiddenUserIdentifyCode ic = forbiddenUserIdentifyCodeService
                    .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.phone, phone);
            if (ic != null && ic.getEffective() != null && ic.getEffective()) {
                out.print(JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC));
                // 封禁用户
                // 封禁绑定的正常用户
                if (user != null && user.getState() != null && user.getState() == UserInfo.STATE_NORMAL) {
                    UserInfo update = new UserInfo(uid);
                    update.setState(UserInfo.STATE_FORBIDDEN);
                    update.setStateDesc("绑定被封禁的电话号码被封禁");
                    userInfoService.updateByPrimaryKeySelective(update);
                }
                return;
            }
            JSONObject data = new JSONObject();
            data.put("userInfo", UserUtil.filterForClientUser(user));
            out.print(JsonUtil.loadTrueResult(data));
        } catch (UserAccountException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult(1, "绑定失败"));
        }
    }
    /**
     * 更改微信
     *
     * @param acceptData
     * @param uid
     * @param code
     * @param out
     */
    @RequestMapping(value = "bindWeiXin")
    public void bindWeiXin(AcceptData acceptData, Long uid, String code, PrintWriter out) {
        BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
                acceptData.getPackages());
        if (system == null) {
            out.print(JsonUtil.loadFalseResult("系统不存在"));
            return;
        }
        if (StringUtil.isNullOrEmpty(code)) {
            out.print(JsonUtil.loadFalseResult("请上传code"));
            return;
        }
        try {
            userAccountService.bindWeiXin(uid, code);
            UserInfo user = userInfoService.getUserByIdWithMybatis(uid);
            // 判断taoBaoUid是否已经封禁
            ForbiddenUserIdentifyCode ic = forbiddenUserIdentifyCodeService
                    .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.wxUnionId, user.getWxUnionId());
            if (ic != null && ic.getEffective() != null && ic.getEffective()) {
                out.print(JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC));
                // 封禁用户
                // 封禁绑定的正常用户
                if (user != null && user.getState() != null && user.getState() == UserInfo.STATE_NORMAL) {
                    UserInfo update = new UserInfo(uid);
                    update.setState(UserInfo.STATE_FORBIDDEN);
                    update.setStateDesc("绑定被封禁的微信号被封禁");
                    userInfoService.updateByPrimaryKeySelective(update);
                }
                return;
            }
            JSONObject data = new JSONObject();
            data.put("userInfo", UserUtil.filterForClientUser(user));
            out.print(JsonUtil.loadTrueResult(data));
        } catch (UserAccountException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/UserAuthController.java
@@ -61,12 +61,6 @@
            return;
        }
        
        //
        UserExtraTaoBaoInfo user = userExtraTaoBaoInfoService.getByUid(uid);
        if ("share".equalsIgnoreCase(source)) {
            if (user != null && !StringUtil.isNullOrEmpty(user.getRelationId()) && user.getRelationValid()) {
@@ -74,7 +68,7 @@
                return;
            }
        } else {
        } else if ("zigou".equalsIgnoreCase(source)) {
            if (user != null && !StringUtil.isNullOrEmpty(user.getSpecialId()) && user.getSpecialValid()) {
                out.print(JsonUtil.loadFalseResult(1, "无需授权"));
                return;
@@ -101,4 +95,9 @@
        else
            out.print(JsonUtil.loadTrue(0, data, "淘宝授权未成功,请稍后再试"));
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/UserCouponController.java
@@ -4,6 +4,7 @@
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
@@ -17,19 +18,18 @@
import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
import com.yeshi.fanli.entity.bus.user.DeviceLotteryRecord;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
import com.yeshi.fanli.entity.bus.user.UserLotteryRecord;
import com.yeshi.fanli.entity.system.SystemCoupon;
import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
import com.yeshi.fanli.exception.user.UserInfoExtraException;
import com.yeshi.fanli.exception.user.UserLotteryRecordException;
import com.yeshi.fanli.exception.user.UserSystemCouponException;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.config.SystemCouponService;
import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
import com.yeshi.fanli.service.inter.order.CommonOrderCountService;
import com.yeshi.fanli.service.inter.order.CommonOrderService;
import com.yeshi.fanli.service.inter.user.DeviceLotteryRecordService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.UserLotteryRecordService;
import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.vo.user.UserSystemCouponRecordVO;
@@ -54,6 +54,9 @@
    private ConfigService configService;
    @Resource
    private SystemCouponService systemCouponService;
    @Resource
    private UserSystemCouponService UserSystemCouponService;
    @Resource
@@ -66,19 +69,15 @@
    private DeviceLotteryRecordService deviceLotteryRecordService;
    @Resource
    private SystemCouponService systemCouponService;
    @Resource
    private UserSystemCouponService userSystemCouponService;
    @Resource
    private UserInfoExtraService userInfoExtraService;
    @Resource
    private CommonOrderCountService commonOrderCountService;
    @Resource
    private ThreeSaleSerivce threeSaleSerivce;
    private UserLotteryRecordService userLotteryRecordService;
    /**
@@ -110,9 +109,19 @@
                }
            }
            boolean changeJump = false;
            String version = acceptData.getVersion();
            int tversion = Integer.parseInt(version);
            String platform = acceptData.getPlatform();
            if ("android".equalsIgnoreCase(platform) && tversion > 34) {
                changeJump = true;
            } else if (tversion > 44){
                changeJump = true;
            }
            long count = 0;
            List<UserSystemCouponVO> resultList = UserSystemCouponService
                    .getUserCouponVOList((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid);
                    .getUserCouponVOList((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid, changeJump);
            if (resultList != null && resultList.size() > 0) {
                count = UserSystemCouponService.countUserCouponList(uid);
@@ -358,10 +367,14 @@
    @RequestMapping(value = "getLotteryCount")
    public void getLotteryCount(String callback, AcceptData acceptData, Long uid, PrintWriter out) {
        try {
            // 默认最大抽奖次数
            int count = 5;
            // 1、已登录系统
            if (uid != null) {
                JSONObject data = userLotteryRecordService.getLotteryCountNewbies(uid);
                JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
                return;
            }
            if (uid == null || uid == 0) { // 未登录
            // 2、未登录系统 - 记录设备
                int platformType = 0;
                String platform = acceptData.getPlatform();
                if ("android".equals(platform)) {
@@ -379,42 +392,20 @@
                    return;
                }
                List<DeviceLotteryRecord> list = deviceLotteryRecordService.listByPlatformAndDevice(platformType,
                        device);
            List<DeviceLotteryRecord> list = deviceLotteryRecordService.listByPlatformAndDevice(platformType, device);
            int count = UserLotteryRecord.COUNT_NEWBIES;
                if (list != null && list.size() > 0) {
                    count = count - list.size();
                }
            } else { // 已登录
                UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
                if (userInfoExtra == null) {
                    JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户信息不存在"));
                    return;
                }
                Integer lotteryNewbies = userInfoExtra.getLotteryNewbies();
                if (lotteryNewbies == null) { // 未抽过
                    // 是否有过订单:返利、分享订单
                    boolean hasOrder = commonOrderCountService.hasRebateAndShareOrder(uid);
                    if (hasOrder) {
                        count = 0; // 不算新用户
                    }
                    userInfoExtra.setLotteryNewbies(count);
                    userInfoExtraService.saveUserInfoExtra(userInfoExtra);
                } else {
                    count = lotteryNewbies; // 剩余次数
                }
            }
            // 抽奖规则
            String lotteryRule = configService.get("lottery_rule_newbies");
            JSONObject data = new JSONObject();
            data.put("count", count);
            data.put("rule", lotteryRule);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (UserLotteryRecordException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
            e.printStackTrace();
@@ -423,7 +414,6 @@
    /**
     * 获取抽奖结果
     *
     * @param callback
     * @param acceptData
     * @param uid
@@ -433,19 +423,14 @@
    public void getLotteryResult(String callback, AcceptData acceptData, Long uid, PrintWriter out) {
        try {
            // 剩余抽奖次数
            int count = 0;
            // 本次抽中的奖品
            String prize = null;
            // 1、已登录用户抽奖
            if (uid != null) {
                Map<String, Object> map = userLotteryRecordService.executeLotteryNewbies(uid);
                JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(map));
                return;
            }
            
            // 已使用抽奖次数
            int countUsed = 0;
            // 已拥有奖品数量
            int countPrize = 0;
            // 已有券类型
            String couponType = null;
            if (uid == null || uid == 0) { // 未登录
            // 2、未登录用户抽奖
                int platformType = 0;
                String platform = acceptData.getPlatform();
                if ("android".equals(platform)) {
@@ -463,19 +448,38 @@
                    return;
                }
                List<DeviceLotteryRecord> list = deviceLotteryRecordService.listByPlatformAndDevice(platformType,
                        device);
                if (list != null && list.size() >= Constant.MAX_COUNT_LOTTERY_NEWBIES) { // 无抽奖机会
            List<DeviceLotteryRecord> list = deviceLotteryRecordService.listByPlatformAndDevice(platformType, device);
            if (list != null && list.size() >= UserLotteryRecord.COUNT_NEWBIES) {
                    JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(2, "抽奖次数不足"));
                    return;
                } 
            // 设备抽奖
            JSONObject data = getDevicePrize(list, device, platformType);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (UserLotteryRecordException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("抽奖失败"));
            e.printStackTrace();
        }
    }
                
    /**
     * 设备信息抽奖-未登录
     * @param list
     * @param device
     * @param platformType
     * @return
     */
    public JSONObject getDevicePrize(List<DeviceLotteryRecord> list, String device, int platformType) {
        int count = 0;
        int countPrize = 0;
                Long couponId = null;
                
                if (list == null || list.size() == 0) { // 拥有抽奖机会
                    count = Constant.MAX_COUNT_LOTTERY_NEWBIES - 1;
            count = UserLotteryRecord.COUNT_NEWBIES;
                } else {
                    for (DeviceLotteryRecord deviceLotteryRecord : list) {
                        Long systemCouponId = deviceLotteryRecord.getSystemCouponId();
                        if (systemCouponId != null) {
@@ -483,33 +487,39 @@
                            couponId = systemCouponId;
                        }
                    }
                    count = Constant.MAX_COUNT_LOTTERY_NEWBIES - 1 - list.size();
            count = UserLotteryRecord.COUNT_NEWBIES - list.size();
                }
                
                // 奖品小于2时才抽奖
                if (countPrize < 2) {
        String prize = null;
        String couponType = null;
        if (countPrize == 0) {
            prize = userLotteryRecordService.getLotteryPrizeNewbies(count, countPrize, null);
        } else if (countPrize == 1) {
                    if (couponId != null) {
                        SystemCoupon coupon = systemCouponService.selectByPrimaryKey(couponId);
                        // 已有券
                        couponType = coupon.getType().name();
                    }
                    // 奖品
                    prize = getLotteryPrize(Constant.MAX_COUNT_LOTTERY_NEWBIES, countPrize, list.size(), couponType);
            if(couponType != null && couponType.trim().length() > 0) {
                prize = userLotteryRecordService.getLotteryPrizeNewbies(count, countPrize, couponType);
            }
                }
                
                // 抽中
                Long newCouponId = null;
                if (prize != null && prize.trim().length() > 0) {
        if (prize == null || prize.trim().length() == 0) {
            prize = "NoPrize";
        } else if (prize.equals(couponType)) {
                    // 已存在此券
                    if (prize.equals(couponType)) {
                        prize = null;
                    } else {
                        SystemCoupon coupon = systemCouponService.getCouponByType(prize);
                        if (coupon != null) {
                            newCouponId = coupon.getId();
                        }
                    }
                }
        count --;
                // 插入记录
                DeviceLotteryRecord record = new DeviceLotteryRecord();
@@ -519,128 +529,51 @@
                record.setCreateTime(new Date());
                deviceLotteryRecordService.insertSelective(record);
            } else { // 已登录
                UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
                if (userInfoExtra == null) {
                    JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("信息不正确"));
                    return;
                }
                // 剩余抽奖次数
                Integer lotteryNewbies = userInfoExtra.getLotteryNewbies();
                if (lotteryNewbies == null || lotteryNewbies < 1) { // 次数已用光
                    JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(2, "抽奖次数不足"));
                    return;
                }
                // 剩余次数
                count = lotteryNewbies - 1;
                // 已使用次数
                countUsed = Constant.MAX_COUNT_LOTTERY_NEWBIES - lotteryNewbies;
                // 已抽中的奖品
                List<UserSystemCoupon> list = userSystemCouponService.getUserCouponBySource(uid,
                        UserSystemCoupon.SOURCE_CHOUJIANG);
                if (list == null || list.size() == 0) {
                    // 抽奖
                    prize = getLotteryPrize(Constant.MAX_COUNT_LOTTERY_NEWBIES, countPrize , countUsed, couponType);
                } else if (list.size() == 1) {
                    UserSystemCoupon userSystemCoupon = list.get(0);
                    SystemCoupon systemCoupon = userSystemCoupon.getSystemCoupon();
                    if (systemCoupon != null) {
                        SystemCoupon coupon = systemCouponService.selectByPrimaryKey(systemCoupon.getId());
                        // 已有券
                        couponType = coupon.getType().name();
                    }
                    // 拥有奖品数量
                    countPrize = 1;
                    // 抽奖
                    prize = getLotteryPrize(Constant.MAX_COUNT_LOTTERY_NEWBIES, countPrize, countUsed, couponType);
                }
                // 抽中
                if (prize != null && prize.trim().length() > 0) {
                    if (prize.equals(couponType)) {
                        // 已有此券
                        prize = null;
                    } else {
                        // 插入券信息
                        userSystemCouponService.insertUserCoupon(uid, prize, UserSystemCoupon.SOURCE_CHOUJIANG);
                    }
                }
                // 剩余次数
                userInfoExtra.setLotteryNewbies(count);
                userInfoExtraService.saveUserInfoExtra(userInfoExtra);
            }
            if (prize == null || prize.trim().length() == 0) {
                prize = "NoPrize";
            }
            JSONObject data = new JSONObject();
            data.put("count", count);
            data.put("result", prize);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        return data;
    }
    /**
     * 获取抽奖次数- 天天抽奖励券
     *
     * @param callback
     * @param acceptData
     * @param uid
     * @param out
     */
    @RequestMapping(value = "getDailyCount")
    public void getDailyCount(String callback, AcceptData acceptData, Long uid, PrintWriter out) {
        try {
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(userLotteryRecordService.getLotteryCountDaily(uid)));
        } catch (UserLotteryRecordException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getCode(),e.getMsg()));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("抽奖失败"));
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("信息获取失败"));
            e.printStackTrace();
        }
    }
    /**
     * 奖品抽取
     *
     * @param maxCount 最大次数
     * @param hasPrize 拥有奖品数量
     * @param record   已抽次数
     * @param couponId 券id
     * @return
     * 获取抽奖结果 - 天天抽奖励券`
     * @param callback
     * @param acceptData
     * @param uid
     * @param out
     */
    public String getLotteryPrize(int maxCount, int countPrize, int record, String couponType) {
        String prize = null;
        String freeCoupon = CouponTypeEnum.welfareFreeCoupon.name(); // 福利免费券
        String rebateCoupon = CouponTypeEnum.rebatePercentCoupon.name(); // 奖励券
        if (countPrize == 1 && record == maxCount - 1) {
            // 最后一次: 只收到一个奖品
            if (rebateCoupon.equals(couponType)) {
                prize = freeCoupon; // 福利免费券
            } else {
                prize = rebateCoupon;  // 奖励券
    @RequestMapping(value = "getDailyResult")
    public void getDailyResult(String callback, AcceptData acceptData, Long uid, PrintWriter out) {
        try {
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(userLotteryRecordService.executeLotteryDaily(uid)));
        } catch (UserLotteryRecordException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getCode(),e.getMsg()));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("抽奖失败"));
            e.printStackTrace();
            }
        } else if (countPrize == 0 && record == maxCount - 2) {
            // 前3次没有奖励时、后面两次必中
            long result = (1 + Math.round(Math.random() * (9)));
            if (result <= 5) {
                prize = freeCoupon; // 福利免费券
            } else {
                prize = rebateCoupon; // 奖励券
            }
        } else { // 大于3次机会
            if (countPrize < 2) { // 不足两个奖品
                long result = (1 + Math.round(Math.random() * (9)));
                if (result <= 3) {
                    prize = freeCoupon; // 福利免费券
                } else if (result <= 6) {
                    prize = rebateCoupon; // 奖励券
                }
            }
        }
        return prize;
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/UserInfoController.java
@@ -66,6 +66,7 @@
import com.yeshi.fanli.exception.taobao.TaoKeApiException;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
import com.yeshi.fanli.exception.user.UserCustomSettingsException;
import com.yeshi.fanli.exception.user.UserInfoException;
import com.yeshi.fanli.exception.user.UserInfoExtraException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.AdminUserService;
@@ -201,6 +202,7 @@
    @Resource
    private AccountMessageService accountMessageService;
    private static final String PASSWORD_MAX_ERROR = "password_max_error";
    private static final String EXTRACT_MIN_MONEY = "extract_min_money";
@@ -518,6 +520,7 @@
            }
        }
        GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
        JSONObject data = new JSONObject();
@@ -573,10 +576,20 @@
        data.put("moduleState", mySettings);
        int welfareCenterNews = 0;
        String invitCode = null;
        UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(user.getId());
        if (userInfoExtra != null && userInfoExtra.getCouponNews() != null) {
        if (userInfoExtra != null  ) {
            if(userInfoExtra.getCouponNews() != null) {
            welfareCenterNews = userInfoExtra.getCouponNews();
        }
            if(userInfoExtra.getInviteCode() != null && userInfoExtra.getInviteCode().trim().length() > 0) {
                invitCode = userInfoExtra.getInviteCode();
            }
        }
        // 邀请码
        data.put("invitCode", invitCode);
        // 福利中心消息
        data.put("welfareCenterNews", welfareCenterNews);
        out.print(JsonUtil.loadTrueResult(data));
@@ -1576,9 +1589,9 @@
            JSONObject resultData = new JSONObject();
            if (type == 1) {
                resultData = threeSaleSerivce.getMyFirstTeam((page - 1) * pageSize, pageSize, uid);
                resultData = threeSaleSerivce.getMyFirstTeam((page - 1) * pageSize, pageSize, uid, null);
            } else if (type == 2) {
                resultData = threeSaleSerivce.getMySecondTeam((page - 1) * pageSize, pageSize, uid);
                resultData = threeSaleSerivce.getMySecondTeam((page - 1) * pageSize, pageSize, uid, null);
            }
            // 安卓系统返回所有数据
@@ -1637,6 +1650,81 @@
        }
    }
    /**
     * 用户队员列表查询 1.5.3查询有效队员
     *
     * @param acceptData
     * @param id
     * @param out
     */
    @RequestMapping(value = "getMyTeamNew", method = RequestMethod.POST)
    public void getMyTeamNew(AcceptData acceptData, long page, long uid, long type, PrintWriter out) {
        try {
            int pageSize = Constant.PAGE_SIZE;
            JSONObject resultData = new JSONObject();
            if (type == 1) {
                resultData = threeSaleSerivce.getMyFirstTeam((page - 1) * pageSize, pageSize, uid, 1);
            } else if (type == 2) {
                resultData = threeSaleSerivce.getMySecondTeam((page - 1) * pageSize, pageSize, uid, 1);
            }
            // 安卓系统返回所有数据
            String platform = acceptData.getPlatform();
            if ("android".equalsIgnoreCase(platform)) {
                long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1);
                long secondTeam = threeSaleSerivce.countSecondTeam(uid, 1);
                JSONObject bossData = null;
                ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
                if (threeSale != null) {
                    bossData = new JSONObject();
                    UserInfo boss = threeSale.getBoss();
                    if (boss != null) {
                        bossData.put("nickName", boss.getNickName());
                        bossData.put("portrait", boss.getPortrait());
                    }
                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
                    Long createTime = threeSale.getCreateTime();
                    Date inviteTime = new Date(createTime);
                    bossData.put("inviteTime", "邀请时间: " + sdf.format(inviteTime));
                }
                String helpLink = configService.get("team_help_url");
                if (helpLink == null) {
                    helpLink = "";
                }
                boolean hasCode = false;
                String inviteCode = userInfoExtraService.getUserInviteCode(uid);
                if (inviteCode != null && inviteCode.trim().length() > 0) {
                    hasCode = true; // 已有邀请码
                } else {
                    // 邀请激活链接
                    resultData.put("activationlink", configService.get("invite_activation_url"));
                }
                resultData.put("hasCode", hasCode);
                resultData.put("helpLink", helpLink);
                resultData.put("firstTeam", firstTeam);
                resultData.put("secondTeam", secondTeam);
                resultData.put("boss", bossData);
            }
            out.print(JsonUtil.loadTrueResult(resultData));
        } catch (UserInfoExtraException e) {
            out.print(JsonUtil.loadFalseResult(e.getMsg()));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult("统计失败"));
            e.printStackTrace();
        }
    }
    /**
     * 用户队员统计 1.4.1
@@ -1909,4 +1997,154 @@
            e.printStackTrace();
        }
    }
    /**
     * 获取用户信息
     *
     * @param acceptData
     * @param form
     * @param requst
     * @param out
     */
    @RequestMapping(value = "getuserinfoNew", method = RequestMethod.POST)
    public void getuserinfoNew(AcceptData acceptData, Long uid, HttpServletRequest requst, PrintWriter out) {
        try {
            BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
                    acceptData.getPackages());
            if (system == null) {
                out.print(JsonUtil.loadFalseResult("系统不存在"));
                return;
            }
            if (uid == null) {
                out.print(JsonUtil.loadFalseResult("请求参数为空"));
                return;
            }
            UserInfo userInfo = userInfoService.getUserInfo(uid);
            // 添加用户活跃记录
            UserActiveLog userActiveLog = new UserActiveLog();
            userActiveLog.setChannel(acceptData.getChannel());
            userActiveLog.setIp(requst.getRemoteHost());
            userActiveLog.setUid(userInfo.getId());
            userActiveLog.setVersionCode(acceptData.getVersion());
            userActiveLog.setOsVersion(acceptData.getOsVersion());
            userActiveLog.setDeviceType(acceptData.getDeviceType());
            userActiveLogService.addUserActiveLog(userActiveLog);
            // 处理用户信息
            outUserInfoHandle(userInfo);
            GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
            JSONObject data = new JSONObject();
            data.put("user", JsonUtil.getConvertBigDecimalToStringBuilder(gsonBuilder).create().toJson(userInfo));
            // 界面状态
            UserSettingsVO mySettings = null;
            try {
                mySettings = userCustomSettingsService.getMySettings(uid);
            } catch (UserCustomSettingsException e) {
                mySettings = new UserSettingsVO();
                e.printStackTrace();
            }
            if (mySettings.getCancelNotice() == null) {
                mySettings.setCancelNotice(0);
            }
            if (mySettings.getNoBonusCount() == null) {
                mySettings.setNoBonusCount(0);
            }
            if (mySettings.getNoNewsRedDot() == null) {
                mySettings.setNoNewsRedDot(0);
            }
            if (mySettings.getNoShareRecordAndStorage() == null) {
                mySettings.setNoShareRecordAndStorage(0);
            }
            if (mySettings.getNoInvitationBonus() == null) {
                mySettings.setNoInvitationBonus(0);
            }
            data.put("moduleState", mySettings);
            int welfareCenterNews = 0;
            String invitCode = null;
            UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
            if (userInfoExtra != null  ) {
                if(userInfoExtra.getCouponNews() != null) {
                    welfareCenterNews = userInfoExtra.getCouponNews();
                }
                if(userInfoExtra.getInviteCode() != null && userInfoExtra.getInviteCode().trim().length() > 0) {
                    invitCode = userInfoExtra.getInviteCode();
                }
                if (userInfoExtra.getUserRank() != null) {
                    String picture = userInfoExtra.getUserRank().getPicture();
                    String icon = userInfoExtra.getUserRank().getIcon();
                    userInfo.setRankNamePicture(picture);
                    userInfo.setRankIcon(icon);
                } else {
                    userInfo.setRankNamePicture(null);
                    userInfo.setRankIcon(null);
                }
            }
            data.put("invitCode", invitCode); // 邀请码
            data.put("welfareCenterNews", welfareCenterNews);// 福利中心消息
            out.print(JsonUtil.loadTrueResult(data));
            final UserInfo uuser = userInfo;
            ThreadUtil.run(new Runnable() {
                public void run() {
                    try {
                        // 获取邀请码:若无邀请码且存在有效的队员关系 则自动生成邀请码
                        userInfoExtraService.getUserInviteCode(uuser.getId());
                    } catch (UserInfoExtraException e) {
                        e.printStackTrace();
                    }
                    // 更新用户附加信息,老用户不存在的需要添加
                    try {
                        userInfoExtraService.updateUserRankByUid(uuser.getId());
                    } catch (UserInfoExtraException e) {
                        e.printStackTrace();
                    }
                }
            });
        } catch (UserInfoException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult("获取失败"));
            e.printStackTrace();
        }
    }
    private void outUserInfoHandle(UserInfo user) {
        // 红包处理
        user.setTotalHongBao(new BigDecimal(0));
        user.setNoOpenHongBao(new BigDecimal(0));
        user.setCanOpenHongBao(new BigDecimal(0));
        // 电话号码处理
        if (!StringUtil.isNullOrEmpty(user.getPhone())) {
            if (user.getPhone().length() > 5) {
                String phone = user.getPhone().substring(0, 3);
                phone += "******";
                phone += user.getPhone().substring(user.getPhone().length() - 2, user.getPhone().length());
                user.setPhone(phone);
            }
        }
        UserInfoExtraVO userInfoExtra = userInfoExtraService.getInfoExtraVOByUid(user.getId());
        if (userInfoExtra != null && userInfoExtra.getUserRank() != null) {
            String picture = userInfoExtra.getUserRank().getPicture();
            String icon = userInfoExtra.getUserRank().getIcon();
            user.setRankNamePicture(picture);
            user.setRankIcon(icon);
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java
@@ -5,9 +5,13 @@
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.Resource;
@@ -27,6 +31,7 @@
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.homemodule.Special;
import com.yeshi.fanli.entity.bus.lable.QualityFactory;
import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail;
import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail;
@@ -37,14 +42,17 @@
import com.yeshi.fanli.entity.bus.msg.UserSystemMsg;
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.entity.goods.RecommendUserGoods;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
import com.yeshi.fanli.exception.goods.CommonGoodsException;
import com.yeshi.fanli.exception.goods.RecommendUserGoodsException;
import com.yeshi.fanli.exception.msg.UserSystemMsgException;
import com.yeshi.fanli.exception.user.UserCustomSettingsException;
import com.yeshi.fanli.service.inter.config.BusinessSystemService;
import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
import com.yeshi.fanli.service.inter.goods.RecommendUserGoodsService;
import com.yeshi.fanli.service.inter.homemodule.SpecialService;
import com.yeshi.fanli.service.inter.lable.QualityFactoryService;
import com.yeshi.fanli.service.inter.msg.MsgAccountDetailService;
import com.yeshi.fanli.service.inter.msg.MsgInviteDetailService;
@@ -63,6 +71,7 @@
import com.yeshi.fanli.util.factory.msg.UserMsgVOFactory;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import com.yeshi.fanli.vo.msg.UserHomeMsgVO;
import com.yeshi.fanli.vo.msg.UserMsgCenter;
import com.yeshi.fanli.vo.msg.UserMsgVO;
import com.yeshi.fanli.vo.msg.UserSystemMsgVO;
import com.yeshi.fanli.vo.user.UserSettingsVO;
@@ -73,6 +82,8 @@
@RequestMapping("api/v1/user/msg")
public class UserMsgController {
    @Resource
    private BusinessSystemService businessSystemService;
    @Resource
    private MsgOrderDetailService msgOrderDetailService;
@@ -111,6 +122,10 @@
    @Resource
    private RedisManager redisManager;
    @Resource
    private SpecialService specialService;
    // 消息的类型
    final static String MSG_TYPE_ORDER = "order";
@@ -508,6 +523,156 @@
        out.print(JsonUtil.loadTrueResult(root));
    }
    /**
     * 获取消息列表
     *
     * @param acceptData
     * @param uid
     * @param page
     * @param type
     * @param out
     */
    @RequestMapping(value = "getHomeMsgListNew", method = RequestMethod.POST)
    public void getHomeMsgListNew(AcceptData acceptData, Long uid, PrintWriter out) {
        if (uid == null) {
            out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
        }
        BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
                acceptData.getPackages());
        if (system == null) {
            out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
            return;
        }
        int page = 1;
        List<UserMsgVO> list = new ArrayList<>();
        List<MsgOrderDetail> detailList = msgOrderDetailService.listMsgOrderDetail(uid, page);
        if (detailList != null && detailList.size() > 0) {
            for (MsgOrderDetail detail : detailList) {
                UserMsgVO userMsgVO = UserMsgVOFactory.create(detail);
                userMsgVO.setType(MSG_TYPE_ORDER);
                list.add(userMsgVO);
            }
        }
        List<MsgMoneyDetail> detailList1 = msgMoneyDetailService.listMsgMoneyDetail(uid, page);
        if (detailList1 != null && detailList1.size() > 0) {
            for (MsgMoneyDetail detail : detailList1) {
                UserMsgVO userMsgVO = UserMsgVOFactory.create(detail);
                userMsgVO.setType(MSG_TYPE_MONEY);
                list.add(userMsgVO);
            }
        }
        List<MsgAccountDetail> detailList2 = msgAccountDetailService.listMsgAccountDetail(uid, page);
        if (detailList2 != null && detailList2.size() > 0) {
            for (MsgAccountDetail detail : detailList2) {
                UserMsgVO userMsgVO = UserMsgVOFactory.create(detail);
                userMsgVO.setType(MSG_TYPE_ACCOUNT);
                list.add(userMsgVO);
            }
        }
        List<MsgInviteDetail> detailList3 = msgInviteDetailService.listMsgInviteDetail(uid, page);
        if (detailList3 != null && detailList3.size() > 0) {
            for (MsgInviteDetail detail : detailList3) {
                UserMsgVO userMsgVO = UserMsgVOFactory.create(detail);
                if (userMsgVO != null) {
                    userMsgVO.setType(MSG_TYPE_INVITE);
                    list.add(userMsgVO);
                }
            }
        }
        List<MsgOtherDetail> detailList4 = msgOtherDetailService.listMsgOtherDetail(uid, page);
        if (detailList4 != null && detailList4.size() > 0) {
            for (MsgOtherDetail detail : detailList4) {
                UserMsgVO userMsgVO = UserMsgVOFactory.create(detail);
                if (userMsgVO != null) {
                    userMsgVO.setType(MSG_TYPE_OTHER);
                    list.add(userMsgVO);
                }
            }
        }
        List<UserMsgCenter> listCenter = new ArrayList<>();
        List<Special> listSpecial = specialService.listBySystemAndCard("msg_activities", system.getId());
        if (listSpecial != null && listSpecial.size() > 0) {
            for (Special special: listSpecial) {
                UserMsgCenter msgCenter = new UserMsgCenter();
                msgCenter.setSpecial(special);
                listCenter.add(msgCenter);
            }
        }
        if (list.size() > 0 ) {
            // 时间排序
            listSort(list);
            if (list.size() >= 20 ) {
                list = list.subList(0, 19);
            }
            for (UserMsgVO userMsgVO: list) {
                UserMsgCenter userMsgCenter = new UserMsgCenter();
                userMsgCenter.setUserMsg(userMsgVO);
                listCenter.add(userMsgCenter);
            }
        }
        // 添加欢迎语
        Long time = (uid == null ? System.currentTimeMillis() : userInfoService.selectByPKey(uid).getCreatetime());
        // 创建时间在28号后的才有新人欢迎
        if ((time > TimeUtil.convertToTimeTemp("2019-01-28", "yyyy-MM-dd") || uid == null)) {
            Map<String, Object> map = new HashMap<String, Object>();
            map.put("title", "新人欢迎");
            map.put("content", "恭喜你,成为返利券的用户\n独家优惠券帮你省钱;\n参与奖金活动帮你赚钱;\n让返利券成为你的省钱助手吧!");
            map.put("createTime",new Date(time));
            UserMsgCenter msgCenternre = new UserMsgCenter();
            msgCenternre.setWelcomeMsg(map);
            listCenter.add(msgCenternre);
        }
        GsonBuilder builder = new GsonBuilder();
        builder = getTimeDescJsonBuilder(builder);
        JSONObject root = new JSONObject();
        UserMsgUnReadNum num = userMsgReadStateService.getReadStateByUid(uid);
        UserSystemMsg usm = userSystemMsgService.getLatestUserSystemMsg(uid);
        if (usm != null) {
            root.put("systemMsg", new UserSystemMsgVO(usm.getId(), usm.getType().name(), usm.getSolved(), "系统消息", usm.getTitle(),
                usm.getTimeTag() == 1 ? "http://img.flqapp.com/resource/msg/icon_emergent.png" : "", "http://img.flqapp.com/resource/msg/icon_msg_system.png",getTimeDesc(new Date(), usm.getCreateTime()), num.getTypeSystem()));
        }
        root.put("list", builder.create().toJson(listCenter));
        root.put("count", listCenter.size());
        out.print(JsonUtil.loadTrueResult(root));
    }
    public static void listSort(List<UserMsgVO> list) {
        Collections.sort(list, new Comparator<UserMsgVO>() {
            @Override
            public int compare(UserMsgVO o1, UserMsgVO o2) {
                if (o1.getTime().getTime() > o2.getTime().getTime()) {
                    return -1;
                } else if (o1 == o2) {
                    return 0;
                } else {
                    return 1;
                }
            }
        });
    }
    /**
     * 获取系统消息列表
     * 
fanli/src/main/java/com/yeshi/fanli/controller/client/UserOrderController.java
@@ -67,7 +67,7 @@
     * @param page
     * @param uid
     * @param state
     *            状态:0全部 1-未到账 2-已到账 3-已失效
     *            状态:0全部 1-未到账 2-已到账 3-已失效  4已收货
     * @param type
     *            类型:1-返利订单 2-分享订单 3-邀请订单
     * @param orderState
@@ -103,6 +103,12 @@
            state = null;// 所有状态
        }
        // 转换状态
        if (state != null && state == 4) {
            orderState = state; // 已收货状态
            state = null; // 清空
        }
        if (type != null && type == 0) {
            type = null; // 所有类型订单
        }
fanli/src/main/java/com/yeshi/fanli/controller/h5/H5SearchController.java
@@ -5,17 +5,14 @@
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.Resource;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
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;
@@ -28,13 +25,16 @@
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
import com.yeshi.fanli.entity.taobao.TaoBaoSearchNav;
import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
import com.yeshi.fanli.service.inter.config.CustomerContentService;
import com.yeshi.fanli.service.inter.config.SuperHotSearchService;
import com.yeshi.fanli.service.inter.config.SystemClientParamsService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.user.HistorySearchService;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import org.yeshi.utils.JsonUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@Controller
@RequestMapping("api/h5/v1/webSearch")
@@ -54,6 +54,9 @@
    @Resource
    private SuperHotSearchService superHotSearchSerivce;
    @Resource
    private CustomerContentService customerContentService;
    // 优惠券
    /*
@@ -276,7 +279,7 @@
    @RequestMapping(value = "contactCustomer", method = RequestMethod.GET)
    public void contactCustomerService(PrintWriter out) {
        String title = "联系客服";
        List<CustomerContent> contentList = systemClientParamsService.contactCustomerService(title);
        List<CustomerContent> contentList = customerContentService.contactCustomerService(title);
        JSONObject data = new JSONObject();
        data.put("contentList", JsonUtil.getSimpleGsonWithDate().toJson(contentList));
        out.print(JsonUtil.loadTrueResult(data));
fanli/src/main/java/com/yeshi/fanli/controller/web/WebSearchController.java
@@ -10,12 +10,10 @@
import javax.annotation.Resource;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
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;
@@ -28,13 +26,16 @@
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
import com.yeshi.fanli.entity.taobao.TaoBaoSearchNav;
import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
import com.yeshi.fanli.service.inter.config.CustomerContentService;
import com.yeshi.fanli.service.inter.config.SuperHotSearchService;
import com.yeshi.fanli.service.inter.config.SystemClientParamsService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.user.HistorySearchService;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import org.yeshi.utils.JsonUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@Controller
@RequestMapping("api/web/v1/webSearch")
@@ -54,6 +55,9 @@
    @Resource
    private SuperHotSearchService superHotSearchSerivce;
    @Resource
    private CustomerContentService customerContentService;
    // 优惠券
    /*
@@ -275,7 +279,7 @@
    @RequestMapping(value = "contactCustomer", method = RequestMethod.GET)
    public void contactCustomerService(PrintWriter out) {
        String title = "联系客服";
        List<CustomerContent> contentList = systemClientParamsService.contactCustomerService(title);
        List<CustomerContent> contentList = customerContentService.contactCustomerService(title);
        JSONObject data = new JSONObject();
        data.put("contentList", JsonUtil.getSimpleGsonWithDate().toJson(contentList));
        out.print(JsonUtil.loadTrueResult(data));
fanli/src/main/java/com/yeshi/fanli/controller/xcx/XcxSearchController.java
@@ -177,7 +177,7 @@
            return;
        }
        String kw = goodsClassService.getKwById(id);
        String kw = goodsClassService.getKeysById(id);
        filter = "[{\"type\": \"quantype\"}]";
        JSONObject data = search(kw, pagesize, filter, order, startprice, endprice);
        // if (StringUtil.isNullOrEmpty(kw)) {
fanli/src/main/java/com/yeshi/fanli/controller/xcx/XcxSystemMiniController.java
@@ -9,17 +9,18 @@
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.wx.WXUtil;
import org.yeshi.utils.wx.XCXKeFuUtil;
import com.yeshi.fanli.entity.system.CustomerContent;
import com.yeshi.fanli.entity.xcx.XCXSettingConfig;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.config.CustomerContentService;
import com.yeshi.fanli.service.inter.config.SystemClientParamsService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.wx.WXUtil;
import org.yeshi.utils.wx.XCXKeFuUtil;
import net.sf.json.JSONObject;
@@ -33,6 +34,9 @@
    @Resource
    private ConfigService configService;
    @Resource
    private CustomerContentService customerContentService;
    /**
     * 
     * 方法说明: 联系客服
@@ -43,7 +47,7 @@
    @RequestMapping("contactCustomerService")
    public void contactCustomerService(PrintWriter out) {
        String title = "联系客服";
        List<CustomerContent> contentList = systemClientParamsService.contactCustomerService(title);
        List<CustomerContent> contentList = customerContentService.contactCustomerService(title);
        JSONObject data = new JSONObject();
        data.put("contentList", JsonUtil.getSimpleGsonWithDate().toJson(contentList));
        out.print(JsonUtil.loadTrueResult(data));
fanli/src/main/java/com/yeshi/fanli/dao/AdminUserDao.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/dao/config/SystemClientParamsDao.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/dao/config/SystemConfigDao.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/dao/config/SystemHelpListDao.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/dao/config/SystemSecondProblemDao.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/dao/config/SystemZnxDao.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/dao/goods/GoodsClassDao.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/dao/goods/GoodsSecondClassDao.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/dao/goods/SuperGoodsClassDao.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/AdminUserMapper.java
@@ -1,18 +1,11 @@
package com.yeshi.fanli.dao.mybatis;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.common.AdminUser;
public interface AdminUserMapper {
public interface AdminUserMapper extends BaseMapper<AdminUser>{
    int deleteByPrimaryKey(Long id);
    int insert(AdminUser record);
    int insertSelective(AdminUser record);
    AdminUser selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(AdminUser record);
    int updateByPrimaryKey(AdminUser record);
    AdminUser getByAccountAndPwd(@Param("account") String account, @Param("pwd") String pwd);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/CustomerContentMapper.java
New file
@@ -0,0 +1,17 @@
package com.yeshi.fanli.dao.mybatis;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.system.CustomerContent;
public interface CustomerContentMapper extends BaseMapper<CustomerContent>{
    List<CustomerContent> listByCnidAndTitle(@Param("start") long start, @Param("count") int count,
            @Param("cnid")Long cnid, @Param("key")String key);
    List<CustomerContent> contactCustomerService(@Param("title")String title);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/CustomerNameMapper.java
New file
@@ -0,0 +1,14 @@
package com.yeshi.fanli.dao.mybatis;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.system.CustomerName;
public interface CustomerNameMapper extends BaseMapper<CustomerName>{
    List<CustomerName> listByTypeAndName(@Param("start") long start, @Param("count") int count,
            @Param("type")Integer type, @Param("key")String key);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/GoodsClassMapper.java
@@ -4,18 +4,33 @@
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
public interface GoodsClassMapper {
public interface GoodsClassMapper extends BaseMapper<GoodsClass>{
    String getKwById(Long id);
    /**
     * 查询搜索关键词
     * @param id
     * @return
     */
    String getKeysById(Long id);
    
    GoodsClass selectByPrimaryKey(Long id);
    
    // 查询所有
    List<GoodsClass> queryAll();
    /**
     * 根据名称模糊搜索
     * @param id
     * @return
     */
    List<GoodsClass> listByName(@Param("start") long start, @Param("count") int count, @Param("name")String name);
    
    int updateByPrimaryKeySelective(GoodsClass record);
    /**
     * 根据名称模糊搜索
     * @param id
     * @return
     */
    int countByName(@Param("name")String name, @Param("systemId")Long systemId);
    
    /**
     * 根据系统id查询分类
@@ -23,4 +38,27 @@
     * @return
     */
    List<GoodsClass> listGoodsClassBySystemId(@Param("systemId") Long systemId);
    /**
     * 根据排序查询
     * @param orderby
     * @return
     */
    GoodsClass getByAdjoinOrder(@Param("order") Integer order, @Param("type") Integer type);
    List<GoodsClass> getGoodsClassAll();
    /**
     * 获取最大排序值
     * @return
     */
    int getMaxOrder();
    /**
     * 获取有效分类
     * @return
     */
    List<GoodsClass> getEffectiveClass();
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/GoodsSecondClassMapper.java
New file
@@ -0,0 +1,31 @@
package com.yeshi.fanli.dao.mybatis;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.bus.clazz.GoodsSecondClass;
public interface GoodsSecondClassMapper extends BaseMapper<GoodsSecondClass>{
    /**
     * 根据上级分类ID查询
     * @param pid
     * @return
     */
    List<GoodsSecondClass> getByGoodsClassId(@Param("pid") Long pid);
    /**
     * 根据上级分类ID查询
     * @param pid
     * @return
     */
    List<GoodsSecondClass> getByNameAndGoodsClassId(@Param("start") long start, @Param("count") int count,
            @Param("pid") Long pid, @Param("name") String name);
    int countByNameAndGoodsClassId(@Param("pid") Long pid, @Param("name") String name);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/SuperGoodsClassMapper.java
New file
@@ -0,0 +1,58 @@
package com.yeshi.fanli.dao.mybatis;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.bus.su.clazz.SuperGoodsClass;
public interface SuperGoodsClassMapper extends BaseMapper<SuperGoodsClass>{
    /**
     *   根据系统id
     * @param id
     * @return
     */
    List<SuperGoodsClass> listBySystemId(@Param("systemId") Long systemId);
    /**
     * 根据分类id 批量查询
     * @param list
     * @return
     */
    List<SuperGoodsClass> listByGoodsclassIds(@Param("list") List<Long> list);
    /**
     * 根据系统id 分类名称模糊查询
     * @param start
     * @param count
     * @param name
     * @param systemId
     * @return
     */
    List<SuperGoodsClass> listBySystemIdAmdClassName(@Param("start") long start, @Param("count") int count,
            @Param("name")String name, @Param("systemId") Long systemId);
    /**
     * 根据分类id 删除
     * @param goodsClassId
     * @param systemId
     * @return
     */
    void deleteByClassId(@Param("goodsClassId")Long goodsClassId);
    /**
     * 根据系统id 和分类id 删除
     * @param goodsClassId
     * @param systemId
     * @return
     */
    Integer deleteBySystemIdAndClassId(@Param("goodsClassId")Long goodsClassId, @Param("systemId") Long systemId);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/SystemClientParamsMapper.java
@@ -2,17 +2,26 @@
import java.util.List;
import com.yeshi.fanli.entity.system.CustomerContent;
import com.yeshi.fanli.entity.system.CustomerName;
import org.apache.ibatis.annotations.Param;
public interface SystemClientParamsMapper {
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.system.SystemClientParams;
    Integer getCount(int type);
public interface SystemClientParamsMapper extends BaseMapper<SystemClientParams>{
    CustomerName getHelpCenter(long id);
    /**
     *  根据系统id查询
     * @param systemId
     * @return
     */
    List<SystemClientParams> listBySystemId(@Param("systemId") Long systemId);
    Integer getProblemCount(long id);
    List<CustomerContent> contactCustomerService(String title);
    SystemClientParams getSystemClientParamsBySystemAndKey(@Param("systemId") Long systemId, @Param("key") String key);
    List<SystemClientParams> listQuery( @Param("start") long start,  @Param("count") int count,
            @Param("systemId") Long systemId, @Param("key") String key);
    long countQuery(@Param("systemId") Long systemId, @Param("key") String key);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/SystemConfigMapper.java
New file
@@ -0,0 +1,14 @@
package com.yeshi.fanli.dao.mybatis;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.system.SystemConfig;
public interface SystemConfigMapper extends BaseMapper<SystemConfig>{
    SystemConfig getByKey(@Param("key") String key);
    SystemConfig getByKeyAndSystemId(@Param("key") String key, @Param("systemId") Long systemId);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/ThreeSaleMapper.java
@@ -149,7 +149,8 @@
     * @param paramLong1
     * @return
     */
    List<ThreeSale> listFirstTeam(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid);
    List<ThreeSale> listFirstTeam(@Param("start") long start, @Param("count") int count,
            @Param("uid") Long uid, @Param("state") Integer state);
    /**
     * 统计一级队员
@@ -168,7 +169,8 @@
     * @param uid
     * @return
     */
    List<ThreeSale> listSecondTeam(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid);
    List<ThreeSale> listSecondTeam(@Param("start") long start, @Param("count") int count,
            @Param("uid") Long uid,@Param("state") Integer state);
    /**
     * 统计二级队员
@@ -229,4 +231,11 @@
    ThreeSale selectSuccessByWorkerId(Long workerId);
    
    /**
     * 根据邀请者ID查询未失效关系
     *
     * @param workerId
     * @return
     */
    ThreeSale getByWorkerId(Long workerId);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/UserInfoMapper.java
@@ -48,6 +48,13 @@
    // 根据AppId与电话号码获取用户
    List<UserInfo> listByAppIdAndPhone(@Param("appId") String appId, @Param("phone") String phone);
    // 根据获取电话号码有效用户
    UserInfo getEffectiveUserInfoByPhone(@Param("phone") String phone);
    // 根据获WXUnionId有效用户
    UserInfo getEffectiveUserInfoByWXUnionId(@Param("unionId") String unionId);
    Long getMaxUid();
    /**
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/activity/RecommendActivityMapper.java
@@ -25,6 +25,8 @@
    List<RecommendActivity> getRecommendActivityList(@Param("start") long start, @Param("count") int count);
    long getRecommendActivityCount();
    long getRecommendActivityEffectiveCount();
    List<RecommendActivity> getRecommendActivityListByType(@Param("type") int type, @Param("start") long start,
            @Param("count") int count);
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/HomeNavbarMapper.java
@@ -4,21 +4,11 @@
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar;
public interface HomeNavbarMapper {
public interface HomeNavbarMapper extends BaseMapper<HomeNavbar>{
    int deleteByPrimaryKey(Long id);
    int insert(HomeNavbar record);
    int insertSelective(HomeNavbar record);
    HomeNavbar selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(HomeNavbar record);
    int updateByPrimaryKey(HomeNavbar record);
    
    /**
     * 根据主键批量删除
@@ -40,7 +30,7 @@
     * @param order 排序值
     * @return
     */
    List<HomeNavbar> getChangeOrder(@Param("type") Integer type, @Param("order") Integer order);
    HomeNavbar getChangeOrder(@Param("type") Integer type, @Param("order") Integer order);
    
    /**
     * 后端列表查询
@@ -52,4 +42,18 @@
    List<HomeNavbar> listQuery(@Param("start") long start, @Param("count") int count, @Param("key") String key);
    
    long countListQuery(@Param("key") String key);
    /**
     * 查询有效导航栏
     * @return
     */
    List<HomeNavbar> listQueryEffective();
    /**
     * 根据分类查询有效导航栏
     * @param classId
     * @return
     */
    HomeNavbar getEffectiveByClassId(@Param("classId") Long classId);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/SpecialCardMapper.java
@@ -4,30 +4,19 @@
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.bus.homemodule.SpecialCard;
public interface SpecialCardMapper {
    int deleteByPrimaryKey(Long id);
    int insert(SpecialCard record);
    int insertSelective(SpecialCard record);
    SpecialCard selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(SpecialCard record);
    int updateByPrimaryKey(SpecialCard record);
public interface SpecialCardMapper extends BaseMapper<SpecialCard>{
    
    
    int deleteBatchByPrimaryKey(List<Long> list);
    
    
    List<SpecialCard> listQuery(@Param("start") long start, @Param("count") int count, @Param("key") String key,
             @Param("sort") Integer sort);
    List<SpecialCard> listQuery(@Param("start") long start, @Param("count") int count, @Param("key") String key);
    
    long countlistQuery(@Param("key") String key);
    
    
    String getbottomPicture(@Param("placeKey") String placeKey);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/SpecialMapper.java
@@ -4,21 +4,11 @@
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.bus.homemodule.Special;
public interface SpecialMapper {
public interface SpecialMapper extends BaseMapper<Special>{
    int deleteByPrimaryKey(Long id);
    int insert(Special record);
    int insertSelective(Special record);
    Special selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(Special record);
    int updateByPrimaryKey(Special record);
    
    int deleteBatchByPrimaryKey(List<Long> list);
    
@@ -44,8 +34,7 @@
     * @param order
     * @return
     */
    List<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);
    
    
    List<Special> listQueryByCard(@Param("start") long start, @Param("count") int count,
@@ -58,7 +47,7 @@
     * @param card
     * @return
     */
    int getMaxOrderByCard(@Param("cardId") Long card);
    int getMaxOrderByCard(@Param("cardId") Long cardId);
    
    /**
     * 根据标识、系统查询启用专题
@@ -77,4 +66,13 @@
    List<Special> listPageBySystemAndCard(@Param("start") long start, @Param("count") int count, 
            @Param("card") String card, @Param("systemId") Long systemId);
    
    /**
     * 根据位置标识查询
     * @param card
     * @param systemId
     * @return
     */
    List<Special> listByPlaceKey(@Param("placeKey") String placeKey);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/SpecialPlaceMapper.java
New file
@@ -0,0 +1,39 @@
package com.yeshi.fanli.dao.mybatis.homemodule;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.bus.homemodule.SpecialPlace;
public interface SpecialPlaceMapper extends BaseMapper<SpecialPlace> {
    /**
     * 获取所有有效
     * @return
     */
    List<SpecialPlace> getAll();
    /**
     * 批量删除
     * @param list
     * @return
     */
    int deleteByPrimaryKeyList(List<Long> list);
   /**
     *  后端列表查询
    * @param start
    * @param count
    * @param key
    * @param state
    * @return
    */
    List<SpecialPlace> listQuery(@Param("start") long start, @Param("count") int count, @Param("key") String key);
    long countQuery(@Param("key") String key);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/SwiperBannerMapper.java
@@ -4,21 +4,10 @@
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.bus.homemodule.SwiperBanner;
public interface SwiperBannerMapper {
    int deleteByPrimaryKey(Long id);
    int insert(SwiperBanner record);
    int insertSelective(SwiperBanner record);
    SwiperBanner selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(SwiperBanner record);
    int updateByPrimaryKey(SwiperBanner record);
public interface SwiperBannerMapper extends BaseMapper<SwiperBanner>{
    
    List<SwiperBanner> query(@Param("start") long start, @Param("count") int count, @Param("key") String key,
             @Param("sort") Integer sort);
@@ -27,4 +16,10 @@
    
    int deleteBatchByPrimaryKey(List<Long> list);
    
    /**
     * 查询有效专题
     * @return
     */
    List<SwiperBanner> getEffectiveOption();
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/SwiperPictureMapper.java
@@ -47,4 +47,13 @@
    List<SwiperPicture> getByBannerCard(@Param("card") String card);
    
    
    /**
     * 根据 唯一标识查询
     * @param card 唯一标识
     * @return
     */
    List<SwiperPicture> getByBannerId(@Param("bannerId") Long bannerId);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/lable/QualityFactoryMapper.java
@@ -218,6 +218,12 @@
    long countQueryByFlashSale();
    /**
     * 限时秒杀 随机3个商品
     * @return
     */
    List<QualityFactory> listFlashSaleRandGoods();
    /**
     * 返利金额数据查询
     * 
     * @param start
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/msg/SystemZnxMapper.java
@@ -1,8 +1,16 @@
package com.yeshi.fanli.dao.mybatis.msg;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.system.SystemZnx;
public interface SystemZnxMapper extends BaseMapper<SystemZnx>{
    List<SystemZnx> listbyCreateTime(@Param("createTime")long createTime);
    List<SystemZnx> listbyUidAndCreateTime(@Param("uid")long uid, @Param("createTime")long createTime);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/taobao/TaoBaoUnionAuthRecordMapper.java
@@ -1,9 +1,11 @@
package com.yeshi.fanli.dao.mybatis.taobao;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.taobao.TaoBaoUnionAuthRecord;
public interface TaoBaoUnionAuthRecordMapper extends BaseMapper<TaoBaoUnionAuthRecord>{
    String getTaoBaoUserNick(@Param("uid") Long uid);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserExtraTaoBaoInfoMapper.java
@@ -1,5 +1,7 @@
package com.yeshi.fanli.dao.mybatis.user;
import java.util.List;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
@@ -45,4 +47,9 @@
     */
    UserExtraTaoBaoInfo selectBySpecialIdWithUidNotNull(String specialId);
    /**
     * 统计正在使用的该淘宝的用户
     */
    List<UserExtraTaoBaoInfo> listByTaoBaoUid(String taoBaoUid);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserInviteRecordMapper.java
New file
@@ -0,0 +1,26 @@
package com.yeshi.fanli.dao.mybatis.user;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.bus.user.UserInviteRecord;
public interface UserInviteRecordMapper extends BaseMapper<UserInviteRecord>{
    /**
     *    获取邀请记录
     * @param inviterId 邀请人id
     * @param wxUnionId 微信id
     * @return
     */
    UserInviteRecord getByInviterIdAndUnionid(@Param("inviterId")Long inviterId, @Param("wxUnionId")String wxUnionId);
    /**
     *    获取最新 inviterId 邀请人id
     * @param wxUnionId 微信id
     * @return
     */
    Long getNewestInviterId(@Param("wxUnionId")String wxUnionId);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserLotteryRecordMapper.java
New file
@@ -0,0 +1,18 @@
package com.yeshi.fanli.dao.mybatis.user;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.bus.user.UserLotteryRecord;
public interface UserLotteryRecordMapper extends BaseMapper<UserLotteryRecord>{
    /**
     * 根据用户、抽奖类型查询记录
     * @param uid
     * @param type
     * @return
     */
    UserLotteryRecord getByTypeAndUid(@Param("uid")Long uid, @Param("type")String type);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserSystemCouponMapper.java
@@ -37,6 +37,14 @@
    List<UserSystemCoupon> getUserCouponBySource(@Param("uid") Long uid, @Param("source") String source);
    
    /**
     * 根据来源查询订单
     * @param uid
     * @param source
     * @return
     */
    int countTodatyUserCouponBySource(@Param("uid") Long uid, @Param("source") String source);
    /**
     * 获取已经过期但状态未改变的券
     * @param uid
     * @return
fanli/src/main/java/com/yeshi/fanli/dao/statistic/OrderClassStatisticDao.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/entity/bus/activity/RecommendActivity.java
@@ -40,14 +40,6 @@
    @Column(name = "ar_activity_uid")
    private ActivityUser activityUser;// 发布动态的用户
    @Expose
    private List<RecommendActivityTaoBaoGoods> goodsList;// 商品列表-商品分享有此属性
    @Expose
    private List<String> imageList;// 图片列表
    @Expose
    private List<String> widthAndHeight;
    @Column(name = "ar_share_count")
    private Integer shareCount;// 分享数
@@ -77,6 +69,29 @@
    @SerializedName("shareCount")
    private String shareCountShow;
    
    @Column(name = "ar_start_time")
    private Date startTime;//起始时间
    @Column(name = "ar_end_time")
    private Date endTime;//结束时间
    // 是否定时
    private boolean timeTask;
    // 起始时间
    private String startTime_str;
    // 结束时间
    private String endTime_str;
    @Expose
    private List<RecommendActivityTaoBaoGoods> goodsList;// 商品列表-商品分享有此属性
    @Expose
    private List<String> imageList;// 图片列表
    @Expose
    private List<String> widthAndHeight;
    
    private RecommendActivityInviteInfo inviteInfo;
@@ -207,4 +222,45 @@
    public void setWidthAndHeight(List<String> widthAndHeight) {
        this.widthAndHeight = widthAndHeight;
    }
    public Date getStartTime() {
        return startTime;
    }
    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }
    public Date getEndTime() {
        return endTime;
    }
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }
    public boolean isTimeTask() {
        return timeTask;
    }
    public void setTimeTask(boolean timeTask) {
        this.timeTask = timeTask;
    }
    public String getStartTime_str() {
        return startTime_str;
    }
    public void setStartTime_str(String startTime_str) {
        this.startTime_str = startTime_str;
    }
    public String getEndTime_str() {
        return endTime_str;
    }
    public void setEndTime_str(String endTime_str) {
        this.endTime_str = endTime_str;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/clazz/GoodsClass.java
@@ -1,77 +1,80 @@
package com.yeshi.fanli.entity.bus.clazz;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.google.gson.annotations.Expose;
/**
 * 商品分类
 * 
 * @author Administrator
 *
 *
 */
@Entity
@Table(name = "yeshi_ec_class")
@Table("yeshi_ec_class")
public class GoodsClass implements Serializable{
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Expose
    @Column(name = "id")
    private long id;
    private Long id;
    
    @Column(name = "`name`", length = 50)
    @Expose
    @Column(name = "name")
    private String name;
    
    @Column(name = "`picture`", length = 1024)
    @Expose
    @Column(name = "picture")
    private String picture;
    @Expose
    @Column(name = "url")
    private String url;
    
    @Column(name = "`key`", length = 50)
    @Column(name = "key")
    private String key;
    
    @Column(name = "`search_param`", length = 1024)
    @Column(name = "search_param")
    private String searchParam;
//    @Column(name = "`tbcates`", length = 1024)
//    private String tbCates;
    @Column(name = "orderby")
    private Integer orderby;
    private int orderby;
    private long createtime;
    @Column(name = "createtime")
    private Long createtime;
    
    @Column(name = "ios_click")
    private Long iosClick = 0l;
    private Long iosClick;
    
    @Column(name = "android_click")
    private Long androidClick = 0l;
    private Long androidClick;
    
    @Transient // 点击次数
    // 状态
    @Column(name = "cs_state")
    private Integer state;
    // 点击次数
    private Long countClick = 0l; 
    @Transient // 关联标签数量
    // 关联标签数量
    private int countlabel = 0; 
    
    @Transient // 系统关联列表
    private  List<BusinessSystem> systemList;
    public GoodsClass() {
    }
    public GoodsClass(String name, String picture, int orderby, long createtime) {
    public GoodsClass(Long id) {
        super();
        this.id = id;
    }
    public GoodsClass(String name, String picture, Integer orderby, Long createtime) {
        super();
        this.name = name;
        this.picture = picture;
@@ -79,19 +82,11 @@
        this.createtime = createtime;
    }
    public GoodsClass() {
    }
    public GoodsClass(long id) {
        super();
        this.id = id;
    }
    public long getId() {
    public Long getId() {
        return id;
    }
    public void setId(long id) {
    public void setId(Long id) {
        this.id = id;
    }
@@ -101,14 +96,6 @@
    public void setName(String name) {
        this.name = name;
    }
    public String getKey() {
        return key;
    }
    public void setKey(String key) {
        this.key = key;
    }
    public String getPicture() {
@@ -127,19 +114,35 @@
        this.url = url;
    }
    public int getOrderby() {
    public String getKey() {
        return key;
    }
    public void setKey(String key) {
        this.key = key;
    }
    public String getSearchParam() {
        return searchParam;
    }
    public void setSearchParam(String searchParam) {
        this.searchParam = searchParam;
    }
    public Integer getOrderby() {
        return orderby;
    }
    public void setOrderby(int orderby) {
    public void setOrderby(Integer orderby) {
        this.orderby = orderby;
    }
    public long getCreatetime() {
    public Long getCreatetime() {
        return createtime;
    }
    public void setCreatetime(long createtime) {
    public void setCreatetime(Long createtime) {
        this.createtime = createtime;
    }
@@ -167,14 +170,6 @@
        this.countClick = countClick;
    }
    public List<BusinessSystem> getSystemList() {
        return systemList;
    }
    public void setSystemList(List<BusinessSystem> systemList) {
        this.systemList = systemList;
    }
    public int getCountlabel() {
        return countlabel;
    }
@@ -183,13 +178,14 @@
        this.countlabel = countlabel;
    }
    public String getSearchParam() {
        return searchParam;
    public Integer getState() {
        return state;
    }
    public void setSearchParam(String searchParam) {
        this.searchParam = searchParam;
    public void setState(Integer state) {
        this.state = state;
    }
    
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/clazz/GoodsSecondClass.java
@@ -1,14 +1,7 @@
package com.yeshi.fanli.entity.bus.clazz;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.google.gson.annotations.Expose;
@@ -18,27 +11,32 @@
 * @author Administrator
 *
 */
@Entity
@Table(name = "yeshi_ec_second_class")
@Table("yeshi_ec_second_class")
public class GoodsSecondClass {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Expose
    @Column(name = "id")
    private Long id;
    @Expose
    private long id;
    @Expose
    @Column(name = "`name`", length = 50)
    @Column(name = "name")
    private String name;
    @Expose
    @Column(name = "`picture`", length = 1024)
    @Column(name = "picture")
    private String picture;
    private int orderby;
    private long createtime;
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "pid")
    @Column(name = "pid")
    private GoodsClass parent;
    @Column(name = "`key`", length = 10)
    @Column(name = "key")
    private String key;
    @Column(name = "orderby")
    private Integer orderby;
    @Column(name = "createtime")
    private Long createtime;
    
    public GoodsSecondClass() {
    }
@@ -58,27 +56,11 @@
        this.parent = parent;
    }
    
    public String getKey() {
        return key;
    }
    public void setKey(String key) {
        this.key = key;
    }
    public GoodsClass getParent() {
        return parent;
    }
    public void setParent(GoodsClass parent) {
        this.parent = parent;
    }
    public long getId() {
    public Long getId() {
        return id;
    }
    public void setId(long id) {
    public void setId(Long id) {
        this.id = id;
    }
@@ -98,19 +80,36 @@
        this.picture = picture;
    }
    public int getOrderby() {
    public GoodsClass getParent() {
        return parent;
    }
    public void setParent(GoodsClass parent) {
        this.parent = parent;
    }
    public String getKey() {
        return key;
    }
    public void setKey(String key) {
        this.key = key;
    }
    public Integer getOrderby() {
        return orderby;
    }
    public void setOrderby(int orderby) {
    public void setOrderby(Integer orderby) {
        this.orderby = orderby;
    }
    public long getCreatetime() {
    public Long getCreatetime() {
        return createtime;
    }
    public void setCreatetime(long createtime) {
    public void setCreatetime(Long createtime) {
        this.createtime = createtime;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/clazz/GoodsSubClass.java
@@ -3,16 +3,8 @@
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.google.gson.annotations.Expose;
@@ -22,104 +14,74 @@
 * @author Administrator
 *
 */
@Entity
@Table(name = "yeshi_ec_sub_class")
@org.yeshi.utils.mybatis.Table("yeshi_ec_sub_class")
@Table("yeshi_ec_sub_class")
public class GoodsSubClass implements Serializable{
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    @Id
    @Expose
    @Column(name = "sub_id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    @org.yeshi.utils.mybatis.Column(name="sub_id")
    private Long id;
    
    @Expose
    @Column(name = "sub_name")
    @org.yeshi.utils.mybatis.Column(name="sub_name")
    private String name;  // 名称
    
    @Expose
    @Column(name = "sub_picture")
    @org.yeshi.utils.mybatis.Column(name="sub_picture")
    private String picture; // 图片路径
    
    @Expose
    @Column(name = "sub_picture_second")
    private String pictureSecond; // 新版图片1.5.3
    @Column(name = "sub_weight")
    @org.yeshi.utils.mybatis.Column(name="sub_weight")
    private Integer weight; // 权重-排序
    
    @Expose
    @Column(name = "sub_state")
    @org.yeshi.utils.mybatis.Column(name="sub_state")
    private Integer state;  // 状态 1启用  0停用
    
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "sub_root_id")
    @org.yeshi.utils.mybatis.Column(name="sub_root_id")
    @Column(name = "sub_root_id")
    private GoodsClass rootClass; // 一级类别
    
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "sub_pid")
    @org.yeshi.utils.mybatis.Column(name="sub_pid")
    @Column(name = "sub_pid")
    private GoodsSubClass parent ; // 上级:对应的二级以下分类  用于3级、4级、5级
    
    @Expose
    @Column(name = "sub_level")
    @org.yeshi.utils.mybatis.Column(name="sub_level")
    private Integer level;  // 具体等级
    
    @Expose
    @Column(name = "sub_key")
    @org.yeshi.utils.mybatis.Column(name="sub_key")
    private String key;  // 搜索关键词
    
    @Expose
    @Column(name = "sub_search_json")
    @org.yeshi.utils.mybatis.Column(name="sub_search_json")
    private String searchJson;  // 搜索条件
    
    @Expose
    @Column(name = "sub_ios_click")
    @org.yeshi.utils.mybatis.Column(name="sub_ios_click")
    private Long iosClick = 0l;  
    
    @Expose
    @Column(name = "sub_android_click")
    @org.yeshi.utils.mybatis.Column(name="sub_android_click")
    private Long androidClick = 0l;  
    
    @Expose
    @Column(name = "sub_createtime")
    @org.yeshi.utils.mybatis.Column(name="sub_createtime")
    private Date createtime; // 创建时间
    
    @Expose
    @Column(name = "sub_updatetime")
    @org.yeshi.utils.mybatis.Column(name="sub_updatetime")
    private Date updatetime; // 创建时间
    
    @Transient
    private Long CountClick = 0l;
    @Transient // 关联标签数量
    private Long countClick = 0l;
    // 关联标签数量
    private int countlabel = 0; 
    
    private String searchParam;
    
    public GoodsSubClass(){}
    
    public GoodsSubClass(Long id) {
        this.id = id;
    }
    
    public Long getId() {
@@ -195,14 +157,6 @@
        this.androidClick = androidClick;
    }
    public Long getCountClick() {
        return CountClick;
    }
    public void setCountClick(Long countClick) {
        CountClick = countClick;
    }
    public Integer getLevel() {
        return level;
    }
@@ -251,4 +205,27 @@
        this.state = state;
    }
    
    public String getSearchParam() {
        return searchParam;
    }
    public void setSearchParam(String searchParam) {
        this.searchParam = searchParam;
    }
    public Long getCountClick() {
        return countClick;
    }
    public void setCountClick(Long countClick) {
        this.countClick = countClick;
    }
    public String getPictureSecond() {
        return pictureSecond;
    }
    public void setPictureSecond(String pictureSecond) {
        this.pictureSecond = pictureSecond;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/clazz/TaoBaoClass.java
@@ -2,12 +2,8 @@
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.google.gson.annotations.Expose;
@@ -17,40 +13,31 @@
 * @author yj
 *
 */
@Entity
@Table(name = "yeshi_ec_taobao_class")
@org.yeshi.utils.mybatis.Table("yeshi_ec_taobao_class")
@Table("yeshi_ec_taobao_class")
public class TaoBaoClass {
    @Id
    @Expose
    @Column(name = "tc_id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    @org.yeshi.utils.mybatis.Column(name="tc_id")
    private Long id;
    
    @Expose
    @Column(name = "tc_category_id")
    @org.yeshi.utils.mybatis.Column(name="tc_category_id")
    private Integer categoryId;  // 分类id
    
    @Expose
    @Column(name = "tc_category_name")
    @org.yeshi.utils.mybatis.Column(name="tc_category_name")
    private String categoryName; // 淘宝分类名称
    
    @Expose
    @Column(name = "tc_parent_category_id")
    @org.yeshi.utils.mybatis.Column(name="tc_parent_category_id")
    private Integer parentCategoryId; // 上级淘宝分类id
    
    @Expose
    @Column(name = "tc_createtime")
    @org.yeshi.utils.mybatis.Column(name="tc_createtime")
    private Date createtime; // 创建时间
    
    @Expose
    @Column(name = "tc_updatetime")
    @org.yeshi.utils.mybatis.Column(name="tc_updatetime")
    private Date updatetime; // 更新时间
    
    
fanli/src/main/java/com/yeshi/fanli/entity/bus/clazz/TaoBaoClassRelation.java
@@ -2,13 +2,8 @@
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Table;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.google.gson.annotations.Expose;
@@ -18,42 +13,32 @@
 * @author yj
 *
 */
@Entity
@Table(name = "yeshi_ec_taobao_class_mapper")
@org.yeshi.utils.mybatis.Table("yeshi_ec_taobao_class_mapper")
@Table("yeshi_ec_taobao_class_mapper")
public class TaoBaoClassRelation {
    @Id
    @Expose
    @Column(name = "tm_id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    @org.yeshi.utils.mybatis.Column(name="tm_id")
    private Long id;
    
    @Expose
    @Column(name = "tm_system_cid")
    @org.yeshi.utils.mybatis.Column(name="tm_system_cid")
    private Long cid;  // 本系统一级类目id
    
    @Expose
    @Column(name = "tm_system_sub_cid")
    @org.yeshi.utils.mybatis.Column(name="tm_system_sub_cid")
    private Long subId; //本系统二级类目id
    
    @Expose
    @Column(name = "tm_taobao_cid")
    @org.yeshi.utils.mybatis.Column(name="tm_taobao_cid")
    private Long taobaoCid; // 淘宝类目id
    @JoinColumn(name = "tm_weight")
    @org.yeshi.utils.mybatis.Column(name = "tm_weight")
    @Column(name = "tm_weight")
    private Double weight; // 权重
    @JoinColumn(name = "tm_createtime")
    @org.yeshi.utils.mybatis.Column(name = "tm_createtime")
    @Column(name = "tm_createtime")
    private Date createtime; // 创建时间
    @JoinColumn(name = "tm_updatetime")
    @org.yeshi.utils.mybatis.Column(name = "tm_updatetime")
    @Column(name = "tm_updatetime")
    private Date updatetime; // 更新时间(修改时间)
    
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/HomeNavbar.java
@@ -2,18 +2,11 @@
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.google.gson.annotations.Expose;
/**
 * 导航管理
@@ -22,15 +15,14 @@
 *
 * @date 2018年10月23日
 */
@Entity
@Table(name = "yeshi_ec_home_navbar")
@org.yeshi.utils.mybatis.Table("yeshi_ec_home_navbar")
@Table("yeshi_ec_home_navbar")
public class HomeNavbar implements Serializable {
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    
    // 消息类型的枚举
    public enum NavbarTypeEnum {
        category("分类"), weex("阿里百川"), web("网页");
        private final String desc;
@@ -45,54 +37,77 @@
    }
    
    @Id
    @Column(name = "br_id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    @org.yeshi.utils.mybatis.Column(name = "br_id")
    private Long id;
    // 名称
    @JoinColumn(name = "br_name")
    @org.yeshi.utils.mybatis.Column(name = "br_name")
    @Expose
    @Column(name = "br_name")
    private String name;
    // 图片
    @JoinColumn(name = "br_picture")
    @org.yeshi.utils.mybatis.Column(name = "br_picture")
    @Expose
    @Column(name = "br_picture")
    private String picture;
    // 分类id
    @JoinColumn(name = "br_class_id")
    @org.yeshi.utils.mybatis.Column(name = "br_class_id")
    @Expose
    @Column(name = "br_class_id")
    private Long classId;
    // 对应轮播图标识
    @Expose
    @Column(name = "br_swiper_banner_id")
    private Long swiperBannerId;
    // 跳转链接
    @JoinColumn(name = "br_url")
    @org.yeshi.utils.mybatis.Column(name = "br_url")
    @Expose
    @Column(name = "br_url")
    private String url;
    // 类型
    @JoinColumn(name = "br_type")
    @org.yeshi.utils.mybatis.Column(name = "br_type")
    @Expose
    @Column(name = "br_type")
    private NavbarTypeEnum type;
    // 排序
    @JoinColumn(name = "br_orderby")
    @org.yeshi.utils.mybatis.Column(name = "br_orderby")
    @Column(name = "br_orderby")
    private Integer orderby;
    //起始时间
    @Column(name = "br_start_time")
    private Date startTime;
    //结束时间
    @Column(name = "br_end_time")
    private Date endTime;
    // 状态:1启用 0 停用
    @Column(name = "br_state")
    private Integer state;
    // 创建时间
    @JoinColumn(name = "br_createtime")
    @org.yeshi.utils.mybatis.Column(name = "br_createtime")
    @Column(name = "br_createtime")
    private Date createtime;
    // 更新时间
    @JoinColumn(name = "br_updatetime")
    @org.yeshi.utils.mybatis.Column(name = "br_updatetime")
    @Column(name = "br_updatetime")
    private Date updatetime;
    
    @Transient // 系统关联列表
    private List<BusinessSystem> systemList;
    // 是否定时
    private boolean timeTask;
    // 起始时间
    private String startTime_str;
    // 结束时间
    private String endTime_str;
    // 轮播名字
    private String swiperName;
    // 分类名称
    private String className;
    public Long getId() {
        return id;
@@ -166,12 +181,76 @@
        this.updatetime = updatetime;
    }
    public List<BusinessSystem> getSystemList() {
        return systemList;
    public Long getSwiperBannerId() {
        return swiperBannerId;
    }
    public void setSystemList(List<BusinessSystem> systemList) {
        this.systemList = systemList;
    public void setSwiperBannerId(Long swiperBannerId) {
        this.swiperBannerId = swiperBannerId;
    }
    public Date getStartTime() {
        return startTime;
    }
    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }
    public Date getEndTime() {
        return endTime;
    }
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }
    public Integer getState() {
        return state;
    }
    public void setState(Integer state) {
        this.state = state;
    }
    public boolean isTimeTask() {
        return timeTask;
    }
    public void setTimeTask(boolean timeTask) {
        this.timeTask = timeTask;
    }
    public String getStartTime_str() {
        return startTime_str;
    }
    public void setStartTime_str(String startTime_str) {
        this.startTime_str = startTime_str;
    }
    public String getEndTime_str() {
        return endTime_str;
    }
    public void setEndTime_str(String endTime_str) {
        this.endTime_str = endTime_str;
    }
    public String getSwiperName() {
        return swiperName;
    }
    public void setSwiperName(String swiperName) {
        this.swiperName = swiperName;
    }
    public String getClassName() {
        return className;
    }
    public void setClassName(String className) {
        this.className = className;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/Special.java
@@ -3,15 +3,8 @@
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.google.gson.annotations.Expose;
import com.yeshi.fanli.entity.common.JumpDetailV2;
@@ -23,93 +16,84 @@
 *
 * @date 2018年10月23日
 */
@Entity
@Table(name = "yeshi_ec_special")
@org.yeshi.utils.mybatis.Table("yeshi_ec_special")
@Table("yeshi_ec_special")
public class Special implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Expose
    @Column(name = "b_id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    @org.yeshi.utils.mybatis.Column(name = "b_id")
    private Long id;
    // 名称
    @Expose
    @JoinColumn(name = "b_name")
    @org.yeshi.utils.mybatis.Column(name = "b_name")
    @Column(name = "b_name")
    private String name;
    // 唯一标识
    @JoinColumn(name = "b_card")
    @org.yeshi.utils.mybatis.Column(name = "b_card")
    @Column(name = "b_card")
    private String card;
    // 标识管理id
    @Expose
    @JoinColumn(name = "b_card_id")
    @org.yeshi.utils.mybatis.Column(name = "b_card_id")
    @Column(name = "b_card_id")
    private Long cardId;
        
    // 主图
    @Expose
    @JoinColumn(name = "b_main_picture")
    @org.yeshi.utils.mybatis.Column(name = "b_main_picture")
    @Column(name = "b_main_picture")
    private String picture;
    // 装饰图
    @Expose
    @Column(name = "b_icon")
    private String icon;
    
    // 附图
    @Expose
    @JoinColumn(name = "b_sub_picture")
    @org.yeshi.utils.mybatis.Column(name = "b_sub_picture")
    @Column(name = "b_sub_picture")
    private String subPicture;
    // 跳转详情
    @Expose
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "b_jumpid")
    @org.yeshi.utils.mybatis.Column(name = "b_jumpid")
    @Column(name = "b_jumpid")
    private JumpDetailV2 jumpDetail;
    // 跳转参数
    @Expose
    @JoinColumn(name = "b_params")
    @org.yeshi.utils.mybatis.Column(name = "b_params")
    @Column(name = "b_params")
    private String params;
    // 跳转是否需要登录
    @Column(name = "b_jump_login")
    private boolean jumpLogin;
    // 排序
    @JoinColumn(name = "b_orderby")
    @org.yeshi.utils.mybatis.Column(name = "b_orderby")
    @Column(name = "b_orderby")
    private Integer orderby;
    // 状态
    @JoinColumn(name = "b_state")
    @org.yeshi.utils.mybatis.Column(name = "b_state")
    @Column(name = "b_state")
    private Long state;
    
    // 显示类型
    // 显示类型:圆形图 、大图
    @Expose
    @JoinColumn(name = "b_show_type")
    @org.yeshi.utils.mybatis.Column(name = "b_show_type")
    @Column(name = "b_show_type")
    private String showType;
    
    // 备注
    @JoinColumn(name = "b_remark")
    @org.yeshi.utils.mybatis.Column(name = "b_remark")
    @Column(name = "b_remark")
    private String remark;
    
    // 创建时间
    @JoinColumn(name = "b_createtime")
    @org.yeshi.utils.mybatis.Column(name = "b_createtime")
    @Column(name = "b_createtime")
    private Date createtime;
    // 更新时间
    @JoinColumn(name = "b_updatetime")
    @org.yeshi.utils.mybatis.Column(name = "b_updatetime")
    @Column(name = "b_updatetime")
    private Date updatetime;
    // 背景图片
    private String bottomPicture;
    public Long getId() {
        return id;
@@ -224,4 +208,27 @@
        this.remark = remark;
    }
    public boolean isJumpLogin() {
        return jumpLogin;
    }
    public void setJumpLogin(boolean jumpLogin) {
        this.jumpLogin = jumpLogin;
    }
    public String getBottomPicture() {
        return bottomPicture;
    }
    public void setBottomPicture(String bottomPicture) {
        this.bottomPicture = bottomPicture;
    }
    public String getIcon() {
        return icon;
    }
    public void setIcon(String icon) {
        this.icon = icon;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/SpecialCard.java
@@ -2,18 +2,9 @@
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Table;
import javax.persistence.Transient;
import com.yeshi.fanli.entity.system.BusinessSystem;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
/**
 * 专题标识管理
@@ -22,51 +13,60 @@
 *
 * @date 2018年10月23日
 */
@Entity
@Table(name = "yeshi_ec_special_card")
@org.yeshi.utils.mybatis.Table("yeshi_ec_special_card")
@Table("yeshi_ec_special_card")
public class SpecialCard implements Serializable{
    private static final long serialVersionUID = 1L;
    
    @Id
    @Column(name = "cd_id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    @org.yeshi.utils.mybatis.Column(name = "cd_id")
    private Long id;
    // 名称
    @JoinColumn(name = "cd_name")
    @org.yeshi.utils.mybatis.Column(name = "cd_name")
    @Column(name = "cd_name")
    private String name;
    // 匹配标识
    @JoinColumn(name = "cd_card")
    @org.yeshi.utils.mybatis.Column(name = "cd_card")
    // 匹配标识 (已停用  :兼容1.5.3 以前版本-暂保留)
    @Column(name = "cd_card")
    private String card; 
    
    // 匹配标识
    @JoinColumn(name = "cd_state")
    @org.yeshi.utils.mybatis.Column(name = "cd_state")
    @Column(name = "cd_state")
    private Integer state; 
        
    // 位置管理id
    @Column(name = "cd_place_id")
    private Long placeId;
    // 背景图片
    @Column(name = "cd_bottom_picture")
    private String bottomPicture;
    //起始时间
    @Column(name = "cd_start_time")
    private Date startTime;
    //结束时间
    @Column(name = "cd_end_time")
    private Date endTime;
    // 创建时间
    @JoinColumn(name = "cd_createtime")
    @org.yeshi.utils.mybatis.Column(name = "cd_createtime")
    @Column(name = "cd_createtime")
    private Date createtime; 
    // 更新时间(修改时间)
    @JoinColumn(name = "cd_updatetime")
    @org.yeshi.utils.mybatis.Column(name = "cd_updatetime")
    @Column(name = "cd_updatetime")
    private Date updatetime;
    
    @Transient
    // 是否定时
    private boolean timeTask;
    // 起始时间
    private String startTime_str;
    // 结束时间
    private String endTime_str;
    // 位置名称
    private String placeName;
    // 已有专题数量
    private Long totalSpecial;
    @Transient // 系统关联列表
    private List<BusinessSystem> systemList;
    
    public Long getId() {
@@ -109,14 +109,6 @@
        this.updatetime = updatetime;
    }
    public List<BusinessSystem> getSystemList() {
        return systemList;
    }
    public void setSystemList(List<BusinessSystem> systemList) {
        this.systemList = systemList;
    }
    public Long getTotalSpecial() {
        return totalSpecial;
    }
@@ -133,4 +125,68 @@
        this.state = state;
    } 
    
    public Long getPlaceId() {
        return placeId;
    }
    public void setPlaceId(Long placeId) {
        this.placeId = placeId;
    }
    public String getBottomPicture() {
        return bottomPicture;
    }
    public void setBottomPicture(String bottomPicture) {
        this.bottomPicture = bottomPicture;
    }
    public Date getStartTime() {
        return startTime;
    }
    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }
    public Date getEndTime() {
        return endTime;
    }
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }
    public boolean isTimeTask() {
        return timeTask;
    }
    public void setTimeTask(boolean timeTask) {
        this.timeTask = timeTask;
    }
    public String getStartTime_str() {
        return startTime_str;
    }
    public void setStartTime_str(String startTime_str) {
        this.startTime_str = startTime_str;
    }
    public String getEndTime_str() {
        return endTime_str;
    }
    public void setEndTime_str(String endTime_str) {
        this.endTime_str = endTime_str;
    }
    public String getPlaceName() {
        return placeName;
    }
    public void setPlaceName(String placeName) {
        this.placeName = placeName;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/SpecialPlace.java
New file
@@ -0,0 +1,78 @@
package com.yeshi.fanli.entity.bus.homemodule;
import java.util.Date;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
/**
 *  首页专题位置管理
 *
 * @author yj
 *
 * @date 2019年4月11日
 */
@Table("yeshi_ec_special_place")
public class SpecialPlace {
    @Column(name = "sp_id")
    private Long id;
    // 位置
    @Column(name = "sp_name")
    private String name;
    // 位置标识
    @Column(name = "sp_key")
    private String key;
    // 创建时间
    @Column(name = "sp_create_time")
    private Date createTime;
    // 更新时间
    @Column(name = "sp_update_time")
    private Date updateTime;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getKey() {
        return key;
    }
    public void setKey(String key) {
        this.key = key;
    }
    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/homemodule/SuperHomeNavbar.java
@@ -2,15 +2,8 @@
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.yeshi.fanli.entity.system.BusinessSystem;
@@ -21,29 +14,20 @@
 *
 * @date 2018年10月24日
 */
@Entity
@Table(name = "yeshi_ec_super_homenavbar")
@org.yeshi.utils.mybatis.Table("yeshi_ec_super_homenavbar")
@Table("yeshi_ec_super_homenavbar")
public class SuperHomeNavbar implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "sp_id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    @org.yeshi.utils.mybatis.Column(name = "sp_id")
    private Long id;
    // 导航栏id
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "sp_navbar_id")
    @org.yeshi.utils.mybatis.Column(name = "sp_navbar_id")
    @Column(name = "sp_navbar_id")
    private HomeNavbar homeNavbar;
    // 系统id
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "sp_system_id")
    @org.yeshi.utils.mybatis.Column(name = "sp_system_id")
    @Column(name = "sp_system_id")
    private BusinessSystem system;
    public Long getId() {
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/SuperSpecial.java
@@ -2,15 +2,8 @@
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.yeshi.fanli.entity.system.BusinessSystem;
@@ -21,29 +14,20 @@
 *
 * @date 2018年10月23日
 */
@Entity
@Table(name = "yeshi_ec_super_special")
@org.yeshi.utils.mybatis.Table("yeshi_ec_super_special")
@Table("yeshi_ec_super_special")
public class SuperSpecial implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "sup_id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    @org.yeshi.utils.mybatis.Column(name = "sup_id")
    private Long id;
    // 名称
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "sup_special_id")
    @org.yeshi.utils.mybatis.Column(name = "sup_special_id")
    @Column(name = "sup_special_id")
    private Special special;
    // 唯一标识
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "sup_system_id")
    @org.yeshi.utils.mybatis.Column(name = "sup_system_id")
    @Column(name = "sup_system_id")
    private BusinessSystem system;
    public Long getId() {
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/SuperSpecialCard.java
@@ -2,15 +2,8 @@
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.yeshi.fanli.entity.system.BusinessSystem;
@@ -21,29 +14,20 @@
 *
 * @date 2018年11月08日
 */
@Entity
@Table(name = "yeshi_ec_super_special_card")
@org.yeshi.utils.mybatis.Table("yeshi_ec_super_special_card")
@Table("yeshi_ec_super_special_card")
public class SuperSpecialCard implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "sp_id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    @org.yeshi.utils.mybatis.Column(name = "sp_id")
    private Long id;
    // 专题管理
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "sp_special_cid")
    @org.yeshi.utils.mybatis.Column(name = "sp_special_cid")
    @Column(name = "sp_special_cid")
    private SpecialCard specialCard;
    // 系统
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "sp_system_id")
    @org.yeshi.utils.mybatis.Column(name = "sp_system_id")
    @Column(name = "sp_system_id")
    private BusinessSystem system;
    
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/SwiperBanner.java
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/SwiperPicture.java
@@ -20,6 +20,7 @@
    
    private static final long serialVersionUID = 1L;
    @Expose
    @Column(name = "pic_id")
    private Long id;
fanli/src/main/java/com/yeshi/fanli/entity/bus/lable/BoutiqueAutoRule.java
@@ -4,16 +4,9 @@
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.springframework.format.annotation.DateTimeFormat;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.yeshi.fanli.entity.common.AdminUser;
@@ -25,9 +18,7 @@
 *
 * @date 2018年8月2日
 */
@Entity
@Table(name = "yeshi_ec_boutique_auto_rule")
@org.yeshi.utils.mybatis.Table("yeshi_ec_boutique_auto_rule")
@Table("yeshi_ec_boutique_auto_rule")
public class BoutiqueAutoRule implements Serializable{ 
    /**
@@ -47,142 +38,87 @@
    
    
    @Id
    @Column(name = "sr_id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    @org.yeshi.utils.mybatis.Column(name = "sr_id")
    private Long id;
    @JoinColumn(name = "sr_source")
    @org.yeshi.utils.mybatis.Column(name = "sr_source")
    @Column(name = "sr_source")
    private Integer source; // 来源
    
    @JoinColumn(name = "sr_title")
    @org.yeshi.utils.mybatis.Column(name = "sr_title")
    @Column(name = "sr_title")
    private String title; // 任务名称
    @JoinColumn(name = "sr_search_content")
    @org.yeshi.utils.mybatis.Column(name = "sr_search_content")
    @Column(name = "sr_search_content")
    private String searchContent; // 任务内容
    
    @JoinColumn(name = "sr_class_name")
    @org.yeshi.utils.mybatis.Column(name = "sr_class_name")
    @Column(name = "sr_class_name")
    private String className; // 主类目
    
    @JoinColumn(name = "sr_subclass_name")
    @org.yeshi.utils.mybatis.Column(name = "sr_subclass_name")
    @Column(name = "sr_subclass_name")
    private String subclassName; // 子类目
    
    @JoinColumn(name = "sr_execute_day")
    @org.yeshi.utils.mybatis.Column(name = "sr_execute_day")
    @Column(name = "sr_execute_day")
    private String executeDay; // 执行相隔天数
    
    @JoinColumn(name = "sr_execute_time")
    @org.yeshi.utils.mybatis.Column(name = "sr_execute_time")
    @Column(name = "sr_execute_time")
    private String executeTime; // 执行时间
    
    @JoinColumn(name = "sr_cron_time")
    @org.yeshi.utils.mybatis.Column(name = "sr_cron_time")
    @Column(name = "sr_cron_time")
    private String cronTime; // cron执行时间
    @JoinColumn(name = "sr_state")
    @org.yeshi.utils.mybatis.Column(name = "sr_state")
    @Column(name = "sr_state")
    private Integer state; // 状态:1启用  0停用
    
    @JoinColumn(name = "sr_start_time")
    @org.yeshi.utils.mybatis.Column(name = "sr_start_time")
    @Column(name = "sr_start_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date startTime; // 生效时间
    @JoinColumn(name = "sr_end_time")
    @org.yeshi.utils.mybatis.Column(name = "sr_end_time")
    @Column(name = "sr_end_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endTime; // 失效时间
    
    @JoinColumn(name = "sr_createtime")
    @org.yeshi.utils.mybatis.Column(name = "sr_createtime")
    @Column(name = "sr_createtime")
    private Date createtime; // 创建时间
    @JoinColumn(name = "sr_updatetime")
    @org.yeshi.utils.mybatis.Column(name = "sr_updatetime")
    @Column(name = "sr_updatetime")
    private Date updatetime; // 更新时间(修改时间)
    
    
    @Transient
    private String key; // 搜索关键词
    @Transient
    private String cateIds; // 官方推荐商品库投放ID;淘宝类目id集合
    @Transient
    private Integer startSales; // 销量小值
    @Transient
    private Integer endSales; // 销量大值
    
    @Transient
    private Double startZkPrice; // 在售价范围小值
    @Transient
    private Double endZkPrice; // 在售价范围大值
    
    @Transient
    private Double startPrice; // 券后价范围小值
    @Transient
    private Double endPrice; // 券后价范围大值
    @Transient
    private Double startTkRate; // 佣金范围小值
    @Transient
    private Double endTkRate; // 佣金范围大值
    @Transient
    private Integer isTmall; // 是否天猫
    @Transient
    private Integer hasCoupon; // 是否有券:1 有 0 无
    @Transient
    private Integer freeShipment; // 是否包邮:1 有 0 无
    @Transient
    private Integer needPrepay; // 是否消费保障:1有 0 无
    @Transient
    private Integer npxLevel; // 牛皮癣程度,取值:1:不限,2:无,3:轻微
    @Transient
    private Integer includePayRate30; // 成交转化是否高于行业均值        1 有 0 无
    @Transient
    private Integer includeGoodRate; // 好评率是否高于行业均值            1 有 0 无
    @Transient
    private Integer includeRfdRate; // 退款率是否低于行业均值             1 有 0 无
    
    @Transient
    private String lableNames; // 标签名称:空格隔开
    
    @Transient
    private String classNameChinese; // 淘宝类目名称
    
    @Transient
    private Integer maxPage; // 请求最大页数
    @Transient
    private int goodsSource; // 权重结束
    @Transient
    private String sourceCalss; // 具体来源
    @Transient
    private String systemCid;// 系统分类id
    @Transient
    private boolean calss9k9; // 是否9k9类目
    @Transient
    private boolean flashSale; // 是否加入限时抢购
    @Transient
    private int startWeight; // 权重起始
    @Transient
    private int endWeight; // 权重结束
    @Transient
    private AdminUser adminUser;
    
    
fanli/src/main/java/com/yeshi/fanli/entity/bus/lable/Label.java
@@ -3,15 +3,8 @@
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.yeshi.fanli.entity.common.AdminUser;
@@ -22,15 +15,14 @@
 *
 * @date 2018年6月27日
 */
@Entity
@Table(name = "yeshi_ec_label")
@org.yeshi.utils.mybatis.Table("yeshi_ec_label")
@Table("yeshi_ec_label")
public class Label implements Serializable{
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    // 后台录入
    public final static int MODE_BACKSTAGE = 1;
    // excel导入
@@ -38,48 +30,35 @@
    // 系统数据抓取
    public final static int MODE_SYSTEM = 3;
    @Id
    @Column(name = "lab_id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    @org.yeshi.utils.mybatis.Column(name = "lab_id")
    private Long id;
    @JoinColumn(name = "lab_title")
    @org.yeshi.utils.mybatis.Column(name = "lab_title")
    @Column(name = "lab_title")
    private String title;// 名称
    @JoinColumn(name = "lab_picture")
    @org.yeshi.utils.mybatis.Column(name = "lab_picture")
    @Column(name = "lab_picture")
    private String picture; // 图片url
    @JoinColumn(name = "lab_ios_click")
    @org.yeshi.utils.mybatis.Column(name = "lab_ios_click")
    @Column(name = "lab_ios_click")
    private Long iosClick; // 点击次数
    @JoinColumn(name = "lab_android_click")
    @org.yeshi.utils.mybatis.Column(name = "lab_android_click")
    @Column(name = "lab_android_click")
    private Long androidClick; // 点击次数
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "lab_entry_aid")
    @org.yeshi.utils.mybatis.Column(name = "lab_entry_aid")
    @Column(name = "lab_entry_aid")
    private AdminUser createUser; // 录入人
    @JoinColumn(name = "lab_entry_mode")
    @org.yeshi.utils.mybatis.Column(name = "lab_entry_mode")
    @Column(name = "lab_entry_mode")
    private Integer entrymode; // 录入方式 (1 人工录入、2 系统自动录入、3 搜索录入)
    @JoinColumn(name = "lab_remark")
    @org.yeshi.utils.mybatis.Column(name = "lab_remark")
    @Column(name = "lab_remark")
    private String remark; //  备注
    
    @JoinColumn(name = "lab_createtime")
    @org.yeshi.utils.mybatis.Column(name = "lab_createtime")
    @Column(name = "lab_createtime")
    private Date createtime; // 创建时间
    @JoinColumn(name = "lab_updatetime")
    @org.yeshi.utils.mybatis.Column(name = "lab_updatetime")
    @Column(name = "lab_updatetime")
    private Date updatetime; // 更新时间(修改时间)
    
fanli/src/main/java/com/yeshi/fanli/entity/bus/lable/LabelClass.java
@@ -1,17 +1,9 @@
package com.yeshi.fanli.entity.bus.lable;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
import com.yeshi.fanli.entity.bus.clazz.GoodsSubClass;
@@ -23,41 +15,26 @@
 *
 * @date 2018年6月27日
 */
@Entity
@Table(name = "yeshi_ec_label_")
@org.yeshi.utils.mybatis.Table("yeshi_ec_label_class")
public class LabelClass implements Serializable{
@Table("yeshi_ec_label_")
public class LabelClass {
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "lc_id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    @org.yeshi.utils.mybatis.Column(name = "lc_id")
    private Long id;
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "lc_label_id")
    @org.yeshi.utils.mybatis.Column(name = "lc_label_id")
    @Column(name = "lc_label_id")
    private Label label; // 标签id
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "lc_class_id")
    @org.yeshi.utils.mybatis.Column(name = "lc_class_id")
    @Column(name = "lc_class_id")
    private GoodsClass goodClass;// 商品大类
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "lc_subclass_id")
    @org.yeshi.utils.mybatis.Column(name = "lc_subclass_id")
    @Column(name = "lc_subclass_id")
    private GoodsSubClass goodsSubClass; // 商品子类
    @JoinColumn(name = "lc_createtime")
    @org.yeshi.utils.mybatis.Column(name = "lc_createtime")
    @Column(name = "lc_createtime")
    private Date createtime; // 创建时间
    public Long getId() {
        return id;
    }
fanli/src/main/java/com/yeshi/fanli/entity/bus/lable/LabelGoods.java
@@ -1,17 +1,9 @@
package com.yeshi.fanli.entity.bus.lable;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.yeshi.fanli.entity.common.AdminUser;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
@@ -23,49 +15,28 @@
 *
 * @date 2018年6月27日
 */
@Entity
@Table(name = "yeshi_ec_label_goods")
@org.yeshi.utils.mybatis.Table("yeshi_ec_label_goods")
public class LabelGoods implements Serializable{
@Table("yeshi_ec_label_goods")
public class LabelGoods {
    
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "lg_id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    @org.yeshi.utils.mybatis.Column(name = "lg_id")
    private Long id;
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "lg_label_id")
    @org.yeshi.utils.mybatis.Column(name = "lg_label_id")
    @Column(name = "lg_label_id")
    private Label label; // 标签id
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "lg_goods_id")
    @org.yeshi.utils.mybatis.Column(name = "lg_goods_id")
    @Column(name = "lg_goods_id")
    private TaoBaoGoodsBrief taoBaoGoodsBrief;// 商品id
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "lg_create_aid")
    @org.yeshi.utils.mybatis.Column(name = "lg_create_aid")
    @Column(name = "lg_create_aid")
    private AdminUser createUser; // 创建人
    
    @JoinColumn(name = "lg_weight")
    @org.yeshi.utils.mybatis.Column(name = "lg_weight")
    @Column(name = "lg_weight")
    private Double weight; // 分类id
    @JoinColumn(name = "lg_createtime")
    @org.yeshi.utils.mybatis.Column(name = "lg_createtime")
    @Column(name = "lg_createtime")
    private Date createtime; // 创建时间
    @JoinColumn(name = "lg_updatetime")
    @org.yeshi.utils.mybatis.Column(name = "lg_updatetime")
    @Column(name = "lg_updatetime")
    private Date updatetime; // 更新时间
    
fanli/src/main/java/com/yeshi/fanli/entity/bus/lable/MergeClass.java
@@ -1,19 +1,9 @@
package com.yeshi.fanli.entity.bus.lable;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import com.yeshi.fanli.entity.common.AdminUser;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
/**
 * 9k9组合类
@@ -22,41 +12,25 @@
 *
 * @date 2018年6月27日
 */
@Entity
@Table(name = "yeshi_ec_class_9k9")
@org.yeshi.utils.mybatis.Table("yeshi_ec_class_9k9")
public class MergeClass implements Serializable{
@Table("yeshi_ec_class_9k9")
public class MergeClass {
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "k_id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    @org.yeshi.utils.mybatis.Column(name = "k_id")
    private Long id;
    @JoinColumn(name = "k_name")
    @org.yeshi.utils.mybatis.Column(name = "k_name")
    @Column(name = "k_name")
    private String  name;// 名称
    @JoinColumn(name = "k_merge_cid")
    @org.yeshi.utils.mybatis.Column(name = "k_merge_cid")
    @Column(name = "k_merge_cid")
    private String mergeCids; // 系统类id(逗号隔开)
    @JoinColumn(name = "k_weight")
    @org.yeshi.utils.mybatis.Column(name = "k_weight")
    @Column(name = "k_weight")
    private Double weight; // 权重
    @JoinColumn(name = "k_createtime")
    @org.yeshi.utils.mybatis.Column(name = "k_createtime")
    @Column(name = "k_createtime")
    private Date createtime; // 创建时间
    @JoinColumn(name = "k_updatetime")
    @org.yeshi.utils.mybatis.Column(name = "k_updatetime")
    @Column(name = "k_updatetime")
    private Date updatetime; // 更新时间(修改时间)
fanli/src/main/java/com/yeshi/fanli/entity/bus/lable/QualityFactory.java
@@ -3,15 +3,8 @@
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.yeshi.fanli.entity.common.AdminUser;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
@@ -23,11 +16,12 @@
 *
 * @date 2018年7月3日
 */
@Entity
@Table(name = "yeshi_ec_quality_factory")
@org.yeshi.utils.mybatis.Table("yeshi_ec_quality_factory")
@Table("yeshi_ec_quality_factory")
public class QualityFactory implements Serializable{
    
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    
    // 人工筛选入库
@@ -53,60 +47,42 @@
    public final static int SOURCE_OTHER = 5;
    
    
    @Id
    @Column(name = "sg_id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    @org.yeshi.utils.mybatis.Column(name = "sg_id")
    private Long id;
    
    @JoinColumn(name = "sg_class_id")
    @org.yeshi.utils.mybatis.Column(name = "sg_class_id")
    @Column(name = "sg_class_id")
    private Long systemCid; // 商品类目id
    
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "sg_goods_id")
    @org.yeshi.utils.mybatis.Column(name = "sg_goods_id")
    @Column(name = "sg_goods_id")
    private TaoBaoGoodsBrief taoBaoGoodsBrief;// 商品id
    @JoinColumn(name = "sg_entry_mode")
    @org.yeshi.utils.mybatis.Column(name = "sg_entry_mode")
    @Column(name = "sg_entry_mode")
    private Integer entryMode; // 录入方式
    @JoinColumn(name = "sg_goods_source")
    @org.yeshi.utils.mybatis.Column(name = "sg_goods_source")
    @Column(name = "sg_goods_source")
    private Integer goodsSource; // 商品来源
    
    @JoinColumn(name = "sg_source_calss")
    @org.yeshi.utils.mybatis.Column(name = "sg_source_calss")
    @Column(name = "sg_source_calss")
    private String sourceCalss; // 来源具体类目
    
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "sg_rule_id")
    @org.yeshi.utils.mybatis.Column(name = "sg_rule_id")
    @Column(name = "sg_rule_id")
    private BoutiqueAutoRule boutiqueAutoRule; // 录入方式
    @JoinColumn(name = "sg_weight")
    @org.yeshi.utils.mybatis.Column(name = "sg_weight")
    @Column(name = "sg_weight")
    private Integer weight; // 商品权重 -- 排序
    
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "sg_create_aid")
    @org.yeshi.utils.mybatis.Column(name = "sg_create_aid")
    @Column(name = "sg_create_aid")
    private AdminUser createUser; // 创建人
    @JoinColumn(name = "sg_createtime")
    @org.yeshi.utils.mybatis.Column(name = "sg_createtime")
    @Column(name = "sg_createtime")
    private Date createtime; // 创建时间
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "sg_update_aid")
    @org.yeshi.utils.mybatis.Column(name = "sg_update_aid")
    @Column(name = "sg_update_aid")
    private AdminUser updateUser; // 修改人
    @JoinColumn(name = "sg_updatetime")
    @org.yeshi.utils.mybatis.Column(name = "sg_updatetime")
    @Column(name = "sg_updatetime")
    private Date updatetime; // 更新时间
    public Long getId() {
fanli/src/main/java/com/yeshi/fanli/entity/bus/lable/QualityFlashSale.java
@@ -3,15 +3,8 @@
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
/**
 * 精选库:限时抢购
@@ -20,44 +13,34 @@
 *
 * @date 2018年9月18日
 */
@Entity
@Table(name = "yeshi_ec_quality_flash_sale")
@org.yeshi.utils.mybatis.Table("yeshi_ec_quality_flash_sale")
@Table("yeshi_ec_quality_flash_sale")
public class QualityFlashSale implements Serializable{
    
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "fs_id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    @org.yeshi.utils.mybatis.Column(name = "fs_id")
    private Long id;
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "fs_qfgoods_id")
    @org.yeshi.utils.mybatis.Column(name = "fs_qfgoods_id")
    @Column(name = "fs_qfgoods_id")
    private QualityFactory qualityFactory; // 精选id
    
    // 取消数据区分时间段:1(00:00) 2(09:00)  3(12:00) 4(14:00) 5(16:00) 6(20:00) 7(22:00)  
    @JoinColumn(name = "fs_type")
    @org.yeshi.utils.mybatis.Column(name = "fs_type")
    @Column(name = "fs_type")
    private Integer type; // 暂停用
    
    
    @JoinColumn(name = "fs_weight")
    @org.yeshi.utils.mybatis.Column(name = "fs_weight")
    @Column(name = "fs_weight")
    private Double weight; // 商品权重 -- 排序
    
    
    @JoinColumn(name = "fs_createtime")
    @org.yeshi.utils.mybatis.Column(name = "fs_createtime")
    @Column(name = "fs_createtime")
    private Date createtime; // 创建时间
    
    @JoinColumn(name = "fs_updatetime")
    @org.yeshi.utils.mybatis.Column(name = "fs_updatetime")
    @Column(name = "fs_updatetime")
    private Date updatetime; // 更新时间
    public Long getId() {
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/UserSystemMsg.java
@@ -15,7 +15,7 @@
 * @author Administrator
 *
 */
@Table("yeshi_ec_msg_system")
@Table("yeshi_ec_user_msg_system")
public class UserSystemMsg {
    public final static int TIME_TAG_COMMON = 0;// 普通
    public final static int TIME_TAG_EMERGENT = 1;// 紧急
fanli/src/main/java/com/yeshi/fanli/entity/bus/su/clazz/SuperGoodsClass.java
@@ -1,39 +1,24 @@
package com.yeshi.fanli.entity.bus.su.clazz;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
import com.yeshi.fanli.entity.system.BusinessSystem;
@Entity
@Table(name = "yeshi_ec_super_goodsclass")
public class SuperGoodsClass implements Serializable{
    /**
     *
     */
    private static final long serialVersionUID = 1L;
@Table("yeshi_ec_super_goodsclass")
public class SuperGoodsClass {
    
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id")
    private long id;
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "goodsclass_id")
    private Long id;
    @Column(name = "goodsclass_id")
    private GoodsClass goodsClass;
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "system_id")
    @Column(name = "system_id")
    private BusinessSystem system;
    public SuperGoodsClass() {
    }
@@ -44,11 +29,13 @@
        this.system = system;
    }
    public long getId() {
    public Long getId() {
        return id;
    }
    public void setId(long id) {
    public void setId(Long id) {
        this.id = id;
    }
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/Extract.java
@@ -3,15 +3,8 @@
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.google.gson.annotations.Expose;
import com.yeshi.fanli.entity.system.BusinessSystem;
@@ -23,18 +16,51 @@
 *
 * @date 2018年1月29日
 */
@Entity
@Table(name = "yeshi_ec_extract")
@Table("yeshi_ec_extract")
public class Extract {
    public static int STATE_NOT_PROCESS = 0;// 未处理
    public static int STATE_PASS = 1;// 通过
    public static int STATE_REJECT = 2;// 拒绝
    public static int STATE_PROCESSING = 3;// 正在处理
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "`id`")
    @Column(name = "id")
    private Long id;
    @Column(name = "uid")
    private UserInfo userInfo;// 用户
    @Column(name = "sid")
    private BusinessSystem system;
    @Expose
    @Column(name = "adminId")
    private Long adminId; // 任务id 目前默认值
    @Column(name = "account")
    private String account;// 庄户
    @Column(name = "name")
    private String name;// 提现名称
    @Column(name = "type")
    private Integer type;// 提现类型
    @Column(name = "money")
    private BigDecimal money;// 提现金额
    @Column(name = "extractTime")
    private Long extractTime;
    @Column(name = "ip")
    private String ip;
    @Column(name = "state")
    private Integer state;
    @Column(name = "reason")
    private String reason;
    public Extract(Long id) {
        this.id = id;
@@ -43,35 +69,6 @@
    
    }
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "uid")
    @org.yeshi.utils.mybatis.Column(name = "uid")
    private UserInfo userInfo;// 用户
    private String account;// 庄户
    private String name;// 提现名称
    private Integer type;// 提现类型
    private BigDecimal money;// 提现金额
    private Long extractTime;
    private String ip;
    private Integer state;
    private String reason;
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "sid")
    private BusinessSystem system;
    @Column(name = "adminId")
    @Expose
    @org.yeshi.utils.mybatis.Column(name = "adminId")
    private Long adminId; // 任务id 目前默认值
    // TODO 等待添加字段
    private Date receiveTime;// 到账时间
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/ExtractAuditRecord.java
@@ -1,15 +1,9 @@
package com.yeshi.fanli.entity.bus.user;
import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.google.gson.annotations.Expose;
import com.yeshi.fanli.entity.common.AdminUser;
@@ -21,65 +15,48 @@
 *
 * @date 2018年6月14日
 */
@Entity
@Table(name = "yeshi_ec_extract_audit_record")
@org.yeshi.utils.mybatis.Table("yeshi_ec_extract_audit_record")
@Table("yeshi_ec_extract_audit_record")
public class ExtractAuditRecord {
    @Id
    @Column(name = "`id`")
    @GeneratedValue(strategy = GenerationType.AUTO)
    @org.yeshi.utils.mybatis.Column(name="id")
    @Column(name = "id")
    private Long id;
    
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "aid")
    @org.yeshi.utils.mybatis.Column(name="aid")
    @Column(name = "aid")
    private AdminUser adminUser;// 审核用户
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "extractId")
    @org.yeshi.utils.mybatis.Column(name="extractId")
    @Column(name = "extractId")
    private Extract extract; // 申请记录id
    
    @Column(name = "beforeMoney")
    @Expose
    @org.yeshi.utils.mybatis.Column(name="beforeMoney")
    @Column(name = "beforeMoney")
    private BigDecimal beforeMoney;// 提现之前余额
    @Column(name = "afterMoney")
    @Expose
    @org.yeshi.utils.mybatis.Column(name="afterMoney")
    @Column(name = "afterMoney")
    private BigDecimal afterMoney;// 提现之后余额
    @Column(name = "countMoney")
    @Expose
    @org.yeshi.utils.mybatis.Column(name="countMoney")
    @Column(name = "countMoney")
    private BigDecimal countMoney;// 累计提现金额
    @Column(name = "countNum")
    @Expose
    @org.yeshi.utils.mybatis.Column(name="countNum")
    @Column(name = "countNum")
    private Long countNum; // 累计提现次数
    @Column(name = "`auditTime`")
    @Expose
    @org.yeshi.utils.mybatis.Column(name = "auditTime")
    @Column(name = "auditTime")
    private Long auditTime;// 审核时间
    
    @Column(name = "orderNum")
    @Expose
    @org.yeshi.utils.mybatis.Column(name="orderNum")
    @Column(name = "orderNum")
    private Long orderNum; // 累计提现次数
    
    @Column(name = "cancelOrderNum")
    @Expose
    @org.yeshi.utils.mybatis.Column(name="cancelOrderNum")
    @Column(name = "cancelOrderNum")
    private Long cancelOrderNum; // 维权订单
    
    @Column(name = "auditRole")
    @Expose
    @org.yeshi.utils.mybatis.Column(name="auditRole")
    @Column(name = "auditRole")
    private String auditRole; //审核人
    
    @Expose // 风险等级
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/ExtractRecord.java
@@ -2,45 +2,30 @@
import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
/**
 * 每日的提现记录
 * @author cxx
 *
 * @date 2018年1月29日
 */
@Entity
@Table(name="yeshi_ec_extract_record")
@org.yeshi.utils.mybatis.Table("yeshi_ec_extract_record")
@Table("yeshi_ec_extract_record")
public class ExtractRecord {
    
    @org.yeshi.utils.mybatis.Column(name="id")
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    @Column(name="`id`")
    @Column(name="id")
    private Long id;
    
    @org.yeshi.utils.mybatis.Column(name="uid")
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name="uid")
    @Column(name="uid")
    private UserInfo userInfo;
    
    @org.yeshi.utils.mybatis.Column(name="count")
    @Column(name="count")
    private Integer count;
    @org.yeshi.utils.mybatis.Column(name="money")
    @Column(name="money")
    private BigDecimal money;
    
    @org.yeshi.utils.mybatis.Column(name="createTime")
    @Column(name="createTime")
    private Long createTime;
    
    public Long getId() {
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/PayInfo.java
@@ -2,55 +2,39 @@
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
/**
 * 支付宝转账结果记录
 * @author Administrator
 *
 */
@Entity
@Table(name = "`yeshi_ec_payinfo`")
@org.yeshi.utils.mybatis.Table("yeshi_ec_payinfo")
@Table("yeshi_ec_payinfo")
public class PayInfo {
    @org.yeshi.utils.mybatis.Column(name="id")
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id")
    private Long id;
    
    @org.yeshi.utils.mybatis.Column(name="eid")
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "`eid`")
    @Column(name = "eid")
    private Extract extract;
    
    
    @org.yeshi.utils.mybatis.Column(name="state")
    @Column(name = "state",length=2)
    @Column(name = "state")
    private Integer state; //转账状态  1.成功 2.失败 
    
    @org.yeshi.utils.mybatis.Column(name="info")
    @Column(name="info")
    private String info; //错误信息
    
    @org.yeshi.utils.mybatis.Column(name="biz_no")
    @Column(name = "biz_no")
    private String bizno; 
    
    @org.yeshi.utils.mybatis.Column(name="orderId")
    @Column(name="orderId")
    private String orderId;
    
    @org.yeshi.utils.mybatis.Column(name="createtime")
    @Column(name="createtime")
    private Date createtime;
    
    @org.yeshi.utils.mybatis.Column(name="ordertime")
    @Column(name="ordertime")
    private String ordertime;
    public Long getId() {
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserExtraTaoBaoInfo.java
@@ -27,6 +27,8 @@
    private String taoBaoUid;// 淘宝的用户ID
    @Column(name = "uiet_taobao_order_end_6_num")
    private String taoBaoOrderEnd6Num;// 订单结尾的6个数字
    @Column(name = "uiet_taobao_nick_name")
    private String taoBaoNickName;// 淘宝昵称
    @Column(name = "uiet_create_time")
    private Date createTime;
    @Column(name = "uiet_update_time")
@@ -128,4 +130,11 @@
        this.updateTime = updateTime;
    }
    public String getTaoBaoNickName() {
        return taoBaoNickName;
    }
    public void setTaoBaoNickName(String taoBaoNickName) {
        this.taoBaoNickName = taoBaoNickName;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserInfoExtra.java
@@ -53,6 +53,10 @@
    @Column(name = "uie_coupon_news")
    private Integer couponNews;
        
    // 首次登录时间
    @Column(name = "uie_first_login_time")
    private Date firstLoginTime;
    // 创建时间
    @Column(name = "uie_create_time")
    private Date createTime;
@@ -60,6 +64,7 @@
    // 更新时间
    @Column(name = "uie_update_time")
    private Date updateTime;
    public Long getId() {
        return id;
@@ -149,4 +154,11 @@
        this.couponNews = couponNews;
    }
    
    public Date getFirstLoginTime() {
        return firstLoginTime;
    }
    public void setFirstLoginTime(Date firstLoginTime) {
        this.firstLoginTime = firstLoginTime;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserInviteRecord.java
New file
@@ -0,0 +1,75 @@
package com.yeshi.fanli.entity.bus.user;
import java.util.Date;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
/**
 * 用户邀请记录
 *
 * @author Administrator
 *
 */
@Table("yeshi_user_invite_record")
public class UserInviteRecord {
    @Column(name = "uir_id")
    private Long id;
    // 邀请人id
    @Column(name = "uir_inviter_id")
    private Long inviterId;
    // 微信id
    @Column(name = "uir_wx_unionid")
    private String wxUnionid;
    // 创建时间
    @Column(name = "uir_create_time")
    private Date createTime;
    // 更新时间
    @Column(name = "uir_update_time")
    private Date updateTime;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public Long getInviterId() {
        return inviterId;
    }
    public void setInviterId(Long inviterId) {
        this.inviterId = inviterId;
    }
    public String getWxUnionid() {
        return wxUnionid;
    }
    public void setWxUnionid(String wxUnionid) {
        this.wxUnionid = wxUnionid;
    }
    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/UserLotteryRecord.java
New file
@@ -0,0 +1,105 @@
package com.yeshi.fanli.entity.bus.user;
import java.util.Date;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
/**
 *    抽奖次数记录
 * @author Administrator
 *
 */
@Table("yeshi_ec_user_lottery_record")
public class UserLotteryRecord {
    // 新人抽奖
    public static String TYPE_NEWBIES = "newbies";
    // 天天抽奖-奖励券
    public static String TYPE_DAILY_REBATE= "dailyRebate";
    // 新人抽奖
    public static int COUNT_NEWBIES = 5;
    // 天天抽奖-奖励券
    public static int COUNT_DAILY_REBATE= 5;
    @Column(name = "ulr_id")
    private Long id;
    // 抽奖类型
    @Column(name = "ulr_type")
    private String type;
    // 图片
    @Column(name = "ulr_uid")
    private Long uid;
    // 剩余次数
    @Column(name = "ulr_count")
    private Integer count;
    // 创建时间
    @Column(name = "ulr_create_time")
    private Date createTime;
    // 更新时间
    @Column(name = "ulr_update_time")
    private Date updateTime;
    public UserLotteryRecord(){}
    public UserLotteryRecord(Long id){
        this.id = id;
    }
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public Long getUid() {
        return uid;
    }
    public void setUid(Long uid) {
        this.uid = uid;
    }
    public Integer getCount() {
        return count;
    }
    public void setCount(Integer count) {
        this.count = count;
    }
    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/UserSystemCoupon.java
@@ -24,9 +24,10 @@
    
    
    // 来源: 新人抽奖、邀请奖励
    public final static String SOURCE_CHOUJIANG = "新人抽奖";
    public final static String SOURCE_NEWBIES = "新人抽奖";
    public final static String SOURCE_YAOQING = "邀请奖励";
    public final static String SOURCE_SYSTEM_PUSH = "系统赠送";
    public final static String SOURCE_DAILY_REBATE = "奖励券天天抽";
    
    @Expose
    @Column(name = "usc_id")
fanli/src/main/java/com/yeshi/fanli/entity/common/AdminUser.java
@@ -2,54 +2,39 @@
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.google.gson.annotations.Expose;
@Entity
@Table(name = "`yeshi_ec_adminuser`")
@org.yeshi.utils.mybatis.Table("yeshi_ec_adminuser")
@Table("yeshi_ec_adminuser")
public class AdminUser implements Serializable{
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @org.yeshi.utils.mybatis.Column(name = "id")
    @Column(name = "id")
    private Long id;
    @org.yeshi.utils.mybatis.Column(name = "name")
    @Column(name = "name", length = 32)
    @Expose
    @Column(name = "name")
    private String name;
    @org.yeshi.utils.mybatis.Column(name = "account")
    @Column(name = "account", length = 50)
    @Column(name = "account")
    private String account;
    @org.yeshi.utils.mybatis.Column(name = "pwd")
    @Column(name = "pwd", length = 50)
    @Column(name = "pwd")
    private String pwd;
    @org.yeshi.utils.mybatis.Column(name = "createtime")
    @Column(name = "createtime", length = 16)
    @Column(name = "createtime")
    private String createtime;
    @org.yeshi.utils.mybatis.Column(name = "authority")
    @Column(name = "authority", length = 1)
    @Column(name = "authority")
    private Integer authority;// 0-超级权限 1-普�?权限
    // 邮箱
    @org.yeshi.utils.mybatis.Column(name = "email")
    @Column(name = "email", length = 30)
    @Column(name = "email")
    private String email;
    
    
@@ -57,24 +42,6 @@
    
    public AdminUser(Long id){
        this.id=id;
    }
    public String getEmail() {
        return email;
    }
    public void setEmail(String email) {
        this.email = email;
    }
    public int getAuthority() {
        return authority;
    }
    public void setAuthority(int authority) {
        this.authority = authority;
    }
    public Long getId() {
@@ -116,4 +83,21 @@
    public void setCreatetime(String createtime) {
        this.createtime = createtime;
    }
    public Integer getAuthority() {
        return authority;
    }
    public void setAuthority(Integer authority) {
        this.authority = authority;
    }
    public String getEmail() {
        return email;
    }
    public void setEmail(String email) {
        this.email = email;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/statistic/OrderClassStatistic.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/entity/system/CustomerContent.java
@@ -2,28 +2,21 @@
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.google.gson.annotations.Expose;
@Entity
@Table(name = "yeshi_ec_customer_content")
@Table("yeshi_ec_customer_content")
public class CustomerContent {
    
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id")
    @Expose
    private long id;
    @Column(name = "id")
    private Long id;
    
    @Expose
    @Column(name = "cn_id")
    private long cnId;
    private Long cnId;
    
    @Expose
    @Column(name = "title")
@@ -37,27 +30,19 @@
    @Column(name="createTime")
    private Date createTime;
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public long getId() {
    public Long getId() {
        return id;
    }
    public void setId(long id) {
    public void setId(Long id) {
        this.id = id;
    }
    public long getCnId() {
    public Long getCnId() {
        return cnId;
    }
    public void setCnId(long cnId) {
    public void setCnId(Long cnId) {
        this.cnId = cnId;
    }
@@ -77,5 +62,12 @@
        this.content = content;
    }
    
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/system/CustomerName.java
@@ -3,25 +3,17 @@
import java.util.Date;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.google.gson.annotations.Expose;
@Entity
@Table(name = "yeshi_ec_customer_name")
@Table("yeshi_ec_customer_name")
public class CustomerName {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id")
    @Expose
    private long id;
    private Long id;
    @Column(name = "name")
    private String name;
@@ -32,16 +24,16 @@
    @Column(name = "type")
    private Integer type; // 1:帮助中心 2:关于我们 3:返利详情用户协议 4:联系客服
    @Transient
    private List<CustomerContent> customerContentList;//一级标题下面的二级标题内容
    
    
    public long getId() {
    public Long getId() {
        return id;
    }
    public void setId(long id) {
    public void setId(Long id) {
        this.id = id;
    }
fanli/src/main/java/com/yeshi/fanli/entity/system/SystemClientParams.java
@@ -2,16 +2,8 @@
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.google.gson.annotations.Expose;
@@ -21,8 +13,7 @@
 * @author Administrator
 *
 */
@Entity
@Table(name = "yeshi_ec_system_clientparams",uniqueConstraints={@UniqueConstraint(columnNames={"`name`","`key`", "systemid"})})
@Table("yeshi_ec_system_clientparams")
public class SystemClientParams implements Serializable{
    /**
     * 
@@ -30,27 +21,30 @@
    private static final long serialVersionUID = 1L;
    
    
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id")
    private long id;
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "systemid")
    private Long id;
    @Column(name = "systemid")
    private BusinessSystem system;
    @Column(name = "`key`", length = 50)
    @Column(name = "key")
    @Expose
    private String key;
    @Column(name = "`value`", length = 1024)
    @Expose
    @Column(name = "value")
    private String value;
    @Column(name = "`name`", length = 50)
    @Expose
    @Column(name = "name")
    private String name;
    @Expose
    private long updatetime;
    @Column(name = "updatetime")
    private Long updatetime;
    public SystemClientParams() {
        // TODO Auto-generated constructor stub
    }
    
    public SystemClientParams(BusinessSystem system, String key, String value) {
@@ -60,11 +54,11 @@
        this.value = value;
    }
    public long getId() {
    public Long getId() {
        return id;
    }
    public void setId(long id) {
    public void setId(Long id) {
        this.id = id;
    }
@@ -100,49 +94,11 @@
        this.name = name;
    }
    public long getUpdatetime() {
    public Long getUpdatetime() {
        return updatetime;
    }
    public void setUpdatetime(long updatetime) {
    public void setUpdatetime(Long updatetime) {
        this.updatetime = updatetime;
    }
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((key == null) ? 0 : key.hashCode());
        result = prime * result + ((name == null) ? 0 : name.hashCode());
        result = prime * result + ((value == null) ? 0 : value.hashCode());
        return result;
    }
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        SystemClientParams other = (SystemClientParams) obj;
        if (key == null) {
            if (other.key != null)
                return false;
        } else if (!key.equals(other.key))
            return false;
        if (name == null) {
            if (other.name != null)
                return false;
        } else if (!name.equals(other.name))
            return false;
        if (value == null) {
            if (other.value != null)
                return false;
        } else if (!value.equals(other.value))
            return false;
        return true;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/system/SystemConfig.java
@@ -3,16 +3,8 @@
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
/**
 * 系统配置参数
@@ -20,47 +12,40 @@
 * @author Administrator
 *
 */
@Entity
@Table(name = "yeshi_ec_system_config")
@Table("yeshi_ec_system_config")
public class SystemConfig {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id")
    private long id;
    @ManyToMany(fetch = FetchType.EAGER)
    @JoinTable(name="yeshi_ec_system_systemconfig",joinColumns=@JoinColumn(name="scid",referencedColumnName="id"),inverseJoinColumns=@JoinColumn(name="sid",referencedColumnName="id"))
    private Set<BusinessSystem> systems=new HashSet<BusinessSystem>();
    @Column(name = "`key`", length = 50)
    private Long id;
    @Column(name = "key")
    private String key;
    @Column(name = "`value`", length = 1024)
    @Column(name = "value")
    private String value;
    @Column(name = "`name`", length = 50)
    @Column(name = "name")
    private String name;
    private long updatetime;
    @Column(name = "updatetime")
    private Long updatetime;
    private Set<BusinessSystem> systems=new HashSet<BusinessSystem>();
    
    public SystemConfig() {
        // TODO Auto-generated constructor stub
    }
    public SystemConfig(long id) {
    public SystemConfig(Long id) {
        super();
        this.id = id;
    }
    public long getId() {
    public Long getId() {
        return id;
    }
    public void setId(long id) {
    public void setId(Long id) {
        this.id = id;
    }
    public Set<BusinessSystem> getSystems() {
        return systems;
    }
    public void setSystems(Set<BusinessSystem> systems) {
        this.systems = systems;
    }
    public String getKey() {
@@ -87,11 +72,19 @@
        this.name = name;
    }
    public long getUpdatetime() {
    public Long getUpdatetime() {
        return updatetime;
    }
    public void setUpdatetime(long updatetime) {
    public void setUpdatetime(Long updatetime) {
        this.updatetime = updatetime;
    }
    public Set<BusinessSystem> getSystems() {
        return systems;
    }
    public void setSystems(Set<BusinessSystem> systems) {
        this.systems = systems;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/system/SystemZnx.java
@@ -1,32 +1,22 @@
package com.yeshi.fanli.entity.system;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
@Entity
@Table(name = "yeshi_ec_system_msg")
@org.yeshi.utils.mybatis.Table("yeshi_ec_system_msg")
@Table("yeshi_ec_system_msg")
public class SystemZnx {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id")
    @org.yeshi.utils.mybatis.Column(name="id")
    private Long id;
    
    @Column(name = "`title`", length = 128)
    @org.yeshi.utils.mybatis.Column(name="title")
    @Column(name = "title")
    private String title;
    
    @Column(name = "`content`", length = 128)
    @org.yeshi.utils.mybatis.Column(name="content")
    @Column(name = "content")
    private String content;
    
    @Column(name = "`createTime`", length = 128)
    @org.yeshi.utils.mybatis.Column(name="createTime")
    @Column(name = "createTime")
    private Long createTime;
    public Long getId() {
fanli/src/main/java/com/yeshi/fanli/exception/GoodsClassException.java
New file
@@ -0,0 +1,32 @@
package com.yeshi.fanli.exception;
public class GoodsClassException 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 GoodsClassException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public GoodsClassException() {
    }
    @Override
    public String getMessage() {
        return this.msg;
    }
}
fanli/src/main/java/com/yeshi/fanli/exception/GoodsSubClassException.java
New file
@@ -0,0 +1,32 @@
package com.yeshi.fanli.exception;
public class GoodsSubClassException 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 GoodsSubClassException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public GoodsSubClassException() {
    }
    @Override
    public String getMessage() {
        return this.msg;
    }
}
fanli/src/main/java/com/yeshi/fanli/exception/SpecialPlaceException.java
New file
@@ -0,0 +1,32 @@
package com.yeshi.fanli.exception;
public class SpecialPlaceException 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 SpecialPlaceException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public SpecialPlaceException() {
    }
    @Override
    public String getMessage() {
        return this.msg;
    }
}
fanli/src/main/java/com/yeshi/fanli/exception/homemodule/HomeNavbarException.java
New file
@@ -0,0 +1,32 @@
package com.yeshi.fanli.exception.homemodule;
public class HomeNavbarException 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 HomeNavbarException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public HomeNavbarException() {
    }
    @Override
    public String getMessage() {
        return this.msg;
    }
}
fanli/src/main/java/com/yeshi/fanli/exception/homemodule/SpecialCardException.java
New file
@@ -0,0 +1,32 @@
package com.yeshi.fanli.exception.homemodule;
public class SpecialCardException 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 SpecialCardException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public SpecialCardException() {
    }
    @Override
    public String getMessage() {
        return this.msg;
    }
}
fanli/src/main/java/com/yeshi/fanli/exception/homemodule/SpecialException.java
New file
@@ -0,0 +1,32 @@
package com.yeshi.fanli.exception.homemodule;
public class SpecialException 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 SpecialException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public SpecialException() {
    }
    @Override
    public String getMessage() {
        return this.msg;
    }
}
fanli/src/main/java/com/yeshi/fanli/exception/user/UserExtraTaoBaoInfoException.java
New file
@@ -0,0 +1,32 @@
package com.yeshi.fanli.exception.user;
public class UserExtraTaoBaoInfoException 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 UserExtraTaoBaoInfoException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public UserExtraTaoBaoInfoException() {
    }
    @Override
    public String getMessage() {
        return this.msg;
    }
}
fanli/src/main/java/com/yeshi/fanli/exception/user/UserInfoException.java
New file
@@ -0,0 +1,32 @@
package com.yeshi.fanli.exception.user;
public class UserInfoException 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 UserInfoException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public UserInfoException() {
    }
    @Override
    public String getMessage() {
        return this.msg;
    }
}
fanli/src/main/java/com/yeshi/fanli/exception/user/UserLotteryRecordException.java
New file
@@ -0,0 +1,32 @@
package com.yeshi.fanli.exception.user;
public class UserLotteryRecordException 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 UserLotteryRecordException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public UserLotteryRecordException() {
    }
    @Override
    public String getMessage() {
        return this.msg;
    }
}
fanli/src/main/java/com/yeshi/fanli/mapping/AdminUserMapper.xml
@@ -12,7 +12,7 @@
        <result column="id" property="id" jdbcType="BIGINT" />
        <result column="email" property="email" jdbcType="VARCHAR" />
    </resultMap>
    <sql id="Base_Column_List">id,name,account,pwd,createtime,authority,email</sql>
    <sql id="Base_Column_List">id,`name`,`account`,`pwd`,createtime,authority,`email`</sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
@@ -23,21 +23,21 @@
        yeshi_ec_adminuser where id = #{id,jdbcType=BIGINT}</delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.common.AdminUser"
        useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_adminuser
        (id,name,account,pwd,createtime,authority,id,email) values
        (id,`name`,`account`,`pwd`,createtime,authority,`email`) values
        (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{account,jdbcType=VARCHAR},
        #{pwd,jdbcType=VARCHAR},#{createtime,jdbcType=VARCHAR},#{authority,jdbcType=INTEGER},#{id,jdbcType=BIGINT},#{email,jdbcType=VARCHAR})
        #{pwd,jdbcType=VARCHAR},#{createtime,jdbcType=VARCHAR},#{authority,jdbcType=INTEGER},#{email,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.common.AdminUser"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_adminuser
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="name != null">name,</if>
            <if test="account != null">account,</if>
            <if test="pwd != null">pwd,</if>
            <if test="name != null">`name`,</if>
            <if test="account != null">`account`,</if>
            <if test="pwd != null">`pwd`,</if>
            <if test="createtime != null">createtime,</if>
            <if test="authority != null">authority,</if>
            <if test="email != null">email,</if>
            <if test="email != null">`email`,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -51,22 +51,28 @@
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.common.AdminUser">update
        yeshi_ec_adminuser set name = #{name,jdbcType=VARCHAR},account =
        #{account,jdbcType=VARCHAR}, pwd = #{pwd,jdbcType=VARCHAR},createtime
        yeshi_ec_adminuser set `name` = #{name,jdbcType=VARCHAR},`account` =
        #{account,jdbcType=VARCHAR}, `pwd` = #{pwd,jdbcType=VARCHAR},createtime
        = #{createtime,jdbcType=VARCHAR}, authority =
        #{authority,jdbcType=INTEGER} ,email =#{email,jdbcType=VARCHAR} where
        #{authority,jdbcType=INTEGER} ,`email` =#{email,jdbcType=VARCHAR} where
        id = #{id,jdbcType=BIGINT}</update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.common.AdminUser">
        update yeshi_ec_adminuser
        <set>
            <if test="name != null">name=#{name,jdbcType=VARCHAR},</if>
            <if test="account != null">account=#{account,jdbcType=VARCHAR},</if>
            <if test="pwd != null">pwd=#{pwd,jdbcType=VARCHAR},</if>
            <if test="name != null">`name`=#{name,jdbcType=VARCHAR},</if>
            <if test="account != null">`account`=#{account,jdbcType=VARCHAR},</if>
            <if test="pwd != null">`pwd`=#{pwd,jdbcType=VARCHAR},</if>
            <if test="createtime != null">createtime=#{createtime,jdbcType=VARCHAR},</if>
            <if test="authority != null">authority=#{authority,jdbcType=INTEGER},</if>
            <if test="id !=null">id =#{id,jdbcType=BIGINT},</if>
            <if test="email !=null">email =#{email,jdbcType=VARCHAR},</if>
            <if test="email !=null">`email` =#{email,jdbcType=VARCHAR},</if>
        </set>
        where id = #{id,jdbcType=BIGINT}
    </update>
    <select id="getByAccountAndPwd" resultMap="BaseResultMap">
        SELECT * FROM yeshi_ec_adminuser u
        WHERE u.`account` = #{account} AND u.`pwd`= #{pwd}
        LIMIT 1
    </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/CustomerContentMapper.xml
New file
@@ -0,0 +1,57 @@
<?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.CustomerContentMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.system.CustomerContent">
    <id column="id" property="id" jdbcType="BIGINT"/>
    <result column="cn_id" property="cnId" jdbcType="BIGINT"/>
    <result column="title" property="title" jdbcType="VARCHAR"/>
    <result column="content" property="content" jdbcType="VARCHAR"/>
    <result column="createTime" property="createTime" jdbcType="TIMESTAMP"/>
  </resultMap>
  <sql id="Base_Column_List">id,cn_id,title,content,createTime</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_customer_content where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_customer_content where id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.system.CustomerContent" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_customer_content (id,cn_id,title,content,createTime) values (#{id,jdbcType=BIGINT},#{cnId,jdbcType=BIGINT},#{title,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.system.CustomerContent" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_customer_content
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">id,</if>
      <if test="cnId != null">cn_id,</if>
      <if test="title != null">title,</if>
      <if test="content != null">content,</if>
      <if test="createTime != null">createTime,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="cnId != null">#{cnId,jdbcType=BIGINT},</if>
      <if test="title != null">#{title,jdbcType=VARCHAR},</if>
      <if test="content != null">#{content,jdbcType=VARCHAR},</if>
      <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.system.CustomerContent">update yeshi_ec_customer_content set cn_id = #{cnId,jdbcType=BIGINT},title = #{title,jdbcType=VARCHAR},content = #{content,jdbcType=VARCHAR},createTime = #{createTime,jdbcType=TIMESTAMP} where id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.system.CustomerContent">update yeshi_ec_customer_content
    <set>
      <if test="cnId != null">cn_id=#{cnId,jdbcType=BIGINT},</if>
      <if test="title != null">title=#{title,jdbcType=VARCHAR},</if>
      <if test="content != null">content=#{content,jdbcType=VARCHAR},</if>
      <if test="createTime != null">createTime=#{createTime,jdbcType=TIMESTAMP},</if>
    </set> where id = #{id,jdbcType=BIGINT}
  </update>
  <select id="listByCnidAndTitle" resultMap="BaseResultMap">
     SELECT * FROM yeshi_ec_customer_content  t
    WHERE t.`cn_id` = #{cnid} AND t.`title` LIKE '%${key}%'
    ORDER BY t.`createTime` ASC
    LIMIT #{start},#{count}
  </select>
   <select id="contactCustomerService" resultMap="BaseResultMap">
         <!-- 查询联系客服信息 -->
        SELECT yecc.`content` FROM `yeshi_ec_customer_content` yecc
        WHERE yecc.`title` = #{title}
    </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/CustomerNameMapper.xml
New file
@@ -0,0 +1,48 @@
<?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.CustomerNameMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.system.CustomerName">
    <id column="id" property="id" jdbcType="BIGINT"/>
    <result column="name" property="name" jdbcType="VARCHAR"/>
    <result column="createTime" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="type" property="type" jdbcType="INTEGER"/>
  </resultMap>
  <sql id="Base_Column_List">id,`name`,createTime,`type`</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_customer_name where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_customer_name where id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.system.CustomerName" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_customer_name (id,`name`,createTime,`type`) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{type,jdbcType=INTEGER})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.system.CustomerName" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_customer_name
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">id,</if>
      <if test="name != null">`name`,</if>
      <if test="createTime != null">createTime,</if>
      <if test="type != null">`type`,</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="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="type != null">#{type,jdbcType=INTEGER},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.system.CustomerName">update yeshi_ec_customer_name set `name` = #{name,jdbcType=VARCHAR},createTime = #{createTime,jdbcType=TIMESTAMP},`type` = #{type,jdbcType=INTEGER} where id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.system.CustomerName">update yeshi_ec_customer_name
    <set>
      <if test="name != null">`name`=#{name,jdbcType=VARCHAR},</if>
      <if test="createTime != null">createTime=#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="type != null">`type`=#{type,jdbcType=INTEGER},</if>
    </set> where id = #{id,jdbcType=BIGINT}
  </update>
  <select id="listByTypeAndName" resultMap="BaseResultMap">
      SELECT * FROM  yeshi_ec_customer_name cn
    WHERE cn.`type` = #{type} AND cn.`name` LIKE '%${key}%'
    ORDER BY cn.`createtime` ASC
    LIMIT #{start},#{count}
  </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/ExtractMapper.xml
@@ -74,7 +74,7 @@
        #{state,jdbcType=INTEGER},
        #{type,jdbcType=INTEGER},
        #{userInfo.id,jdbcType=BIGINT},
        #{system.id,jdbcType=BIGINT}
        #{system.id,jdbcType=BIGINT},
        #{adminId,jdbcType=BIGINT},
        #{receiveTime,jdbcType=TIMESTAMP}
        )
fanli/src/main/java/com/yeshi/fanli/mapping/GoodsClassMapper.xml
@@ -1,31 +1,75 @@
<?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.GoodsClassMapper">
    <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.clazz.GoodsClass">
        <id column="id" property="id" jdbcType="BIGINT"/>
        <result column="name" property="name" jdbcType="VARCHAR"/>
        <result column="picture" property="picture" jdbcType="VARCHAR"/>
        <result column="orderby" property="orderby" jdbcType="INTEGER"/>
        <result column="createtime" property="createtime" jdbcType="TIMESTAMP"/>
        <result column="url" property="url" jdbcType="VARCHAR"/>
        <result column="key" property="key" jdbcType="VARCHAR"/>
    <result column="search_param" property="searchParam" jdbcType="VARCHAR"/>
    <result column="orderby" property="orderby" jdbcType="INTEGER"/>
    <result column="createtime" property="createtime" jdbcType="BIGINT"/>
        <result column="ios_click" property="iosClick" jdbcType="BIGINT"/>
        <result column="android_click" property="androidClick" jdbcType="BIGINT"/>
    <result column="cs_state" property="state" jdbcType="INTEGER"/>
     </resultMap>
      
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsClass">
      update yeshi_ec_class
    <set>
      <if test="iosClick != null">ios_click=#{iosClick,jdbcType=BIGINT},</if>
      <if test="androidClick != null">android_click=#{androidClick,jdbcType=BIGINT},</if>
    </set> where id = #{id,jdbcType=BIGINT}
  </update>
    <select id="getKwById" resultType="String">
        SELECT ec.`key` FROM `yeshi_ec_class` ec WHERE ec.`id` = #{id};
    </select>
   <sql id="Base_Column_List">id,`name`,picture,`key`,search_param,orderby,createtime,ios_click,android_click,cs_state</sql>
    
    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">
        select * from yeshi_ec_class where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_class where id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsClass" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_class (id,`name`,picture,url,`key`,search_param,orderby,createtime,ios_click,android_click,cs_state) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{url,jdbcType=VARCHAR},#{key,jdbcType=VARCHAR},#{searchParam,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{createtime,jdbcType=BIGINT},#{iosClick,jdbcType=BIGINT},#{androidClick,jdbcType=BIGINT},#{state,jdbcType=INTEGER})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsClass" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_class
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">id,</if>
      <if test="name != null">`name`,</if>
      <if test="picture != null">picture,</if>
      <if test="url != null">url,</if>
      <if test="key != null">`key`,</if>
      <if test="searchParam != null">search_param,</if>
      <if test="orderby != null">orderby,</if>
      <if test="createtime != null">createtime,</if>
      <if test="iosClick != null">ios_click,</if>
      <if test="androidClick != null">android_click,</if>
      <if test="state != null">cs_state,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="name != null">#{name,jdbcType=VARCHAR},</if>
      <if test="picture != null">#{picture,jdbcType=VARCHAR},</if>
      <if test="url != null">#{url,jdbcType=VARCHAR},</if>
      <if test="key != null">#{key,jdbcType=VARCHAR},</if>
      <if test="searchParam != null">#{searchParam,jdbcType=VARCHAR},</if>
      <if test="orderby != null">#{orderby,jdbcType=INTEGER},</if>
      <if test="createtime != null">#{createtime,jdbcType=BIGINT},</if>
      <if test="iosClick != null">#{iosClick,jdbcType=BIGINT},</if>
      <if test="androidClick != null">#{androidClick,jdbcType=BIGINT},</if>
      <if test="state != null">#{state,jdbcType=INTEGER},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsClass">update yeshi_ec_class set `name` = #{name,jdbcType=VARCHAR},picture = #{picture,jdbcType=VARCHAR},url = #{url,jdbcType=VARCHAR},`key` = #{key,jdbcType=VARCHAR},search_param = #{searchParam,jdbcType=VARCHAR},orderby = #{orderby,jdbcType=INTEGER},createtime = #{createtime,jdbcType=BIGINT},ios_click = #{iosClick,jdbcType=BIGINT},android_click = #{androidClick,jdbcType=BIGINT},cs_state = #{state,jdbcType=INTEGER} where id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsClass">update yeshi_ec_class
    <set>
      <if test="name != null">`name`=#{name,jdbcType=VARCHAR},</if>
      <if test="picture != null">picture=#{picture,jdbcType=VARCHAR},</if>
      <if test="url != null">url=#{url,jdbcType=VARCHAR},</if>
      <if test="key != null">`key`=#{key,jdbcType=VARCHAR},</if>
      <if test="searchParam != null">search_param=#{searchParam,jdbcType=VARCHAR},</if>
      <if test="orderby != null">orderby=#{orderby,jdbcType=INTEGER},</if>
      <if test="createtime != null">createtime=#{createtime,jdbcType=BIGINT},</if>
      <if test="iosClick != null">ios_click=#{iosClick,jdbcType=BIGINT},</if>
      <if test="androidClick != null">android_click=#{androidClick,jdbcType=BIGINT},</if>
      <if test="state != null">cs_state=#{state,jdbcType=INTEGER},</if>
    </set> where id = #{id,jdbcType=BIGINT}
  </update>
    <select id="getKeysById" resultType="java.lang.String">
        SELECT ec.`key` FROM `yeshi_ec_class` ec WHERE ec.`id` = #{id};
     </select>
     
     <select id="listGoodsClassBySystemId" resultMap="BaseResultMap">
@@ -35,5 +79,51 @@
        ORDER BY c.`orderby`
     </select>
     
     <select id="getByAdjoinOrder" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_class fd
        WHERE  1=1
        <if test="type == -1">
            AND fd.`orderby` <![CDATA[<]]> #{order}
            ORDER BY fd.`orderby` desc
        </if>
        <if test="type == 1">
            AND fd.`orderby` <![CDATA[>]]> #{order}
            ORDER BY fd.`orderby`
        </if>
        LIMIT 1
   </select>
     <select id="getGoodsClassAll" resultMap="BaseResultMap">
         SELECT *  FROM yeshi_ec_class rs ORDER BY rs.`orderby`
     </select>
     <select id="listByName" resultMap="BaseResultMap">
         SELECT *  from yeshi_ec_class rs
         WHERE rs.name like '%#{name}%'
         LIMIT ${start},${count}
     </select>
     <select id="countByName" resultType="java.lang.Integer">
         SELECT  IFNULL(COUNT(rs.id),0) FROM yeshi_ec_class rs
         <if test="systemId != null">
            RIGHT JOIN yeshi_ec_super_goodsclass sp ON sp.`goodsclass_id` = rs.`id`
        </if>
        WHERE rs.name LIKE '%#{name}%'
            <if test="systemId != null">
                AND sp.`system_id` = #{systemId}
            </if>
     </select>
     <select id="getMaxOrder" resultType="java.lang.Integer">
         SELECT IFNULL(MAX(orderby),0) FROM `yeshi_ec_class`
     </select>
     <select id="getEffectiveClass" resultMap="BaseResultMap">
         SELECT *  FROM yeshi_ec_class rs
         WHERE rs.cs_state = 1
         ORDER BY rs.`orderby`
     </select>
    
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/GoodsSecondClassMapper.xml
New file
@@ -0,0 +1,73 @@
<?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.GoodsSecondClassMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.clazz.GoodsSecondClass">
    <id column="id" property="id" jdbcType="BIGINT"/>
    <result column="name" property="name" jdbcType="VARCHAR"/>
    <result column="picture" property="picture" jdbcType="VARCHAR"/>
    <result column="key" property="key" jdbcType="VARCHAR"/>
    <result column="orderby" property="orderby" jdbcType="INTEGER"/>
    <result column="createtime" property="createtime" jdbcType="BIGINT"/>
    <association property="parent" column="pid" javaType="com.yeshi.fanli.entity.bus.clazz.GoodsClass">
        <id column="pid" property="id" jdbcType="BIGINT"/>
    </association>
  </resultMap>
  <sql id="Base_Column_List">id,name,picture,pid,key,orderby,createtime</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_second_class where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_second_class where id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSecondClass" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_second_class (id,name,picture,pid,key,orderby,createtime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{parent.id,jdbcType=BIGINT},#{key,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{createtime,jdbcType=BIGINT})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSecondClass" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_second_class
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">id,</if>
      <if test="name != null">name,</if>
      <if test="picture != null">picture,</if>
      <if test="parent != null">pid,</if>
      <if test="key != null">key,</if>
      <if test="orderby != null">orderby,</if>
      <if test="createtime != null">createtime,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="name != null">#{name,jdbcType=VARCHAR},</if>
      <if test="picture != null">#{picture,jdbcType=VARCHAR},</if>
      <if test="parent != null">#{parent.id,jdbcType=BIGINT},</if>
      <if test="key != null">#{key,jdbcType=VARCHAR},</if>
      <if test="orderby != null">#{orderby,jdbcType=INTEGER},</if>
      <if test="createtime != null">#{createtime,jdbcType=BIGINT},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSecondClass">update yeshi_ec_second_class set name = #{name,jdbcType=VARCHAR},picture = #{picture,jdbcType=VARCHAR},pid = #{parent.id,jdbcType=BIGINT},key = #{key,jdbcType=VARCHAR},orderby = #{orderby,jdbcType=INTEGER},createtime = #{createtime,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSecondClass">update yeshi_ec_second_class
    <set>
      <if test="name != null">name=#{name,jdbcType=VARCHAR},</if>
      <if test="picture != null">picture=#{picture,jdbcType=VARCHAR},</if>
      <if test="parent != null">pid=#{parent.id,jdbcType=BIGINT},</if>
      <if test="key != null">key=#{key,jdbcType=VARCHAR},</if>
      <if test="orderby != null">orderby=#{orderby,jdbcType=INTEGER},</if>
      <if test="createtime != null">createtime=#{createtime,jdbcType=BIGINT},</if>
    </set> where id = #{id,jdbcType=BIGINT}
  </update>
  <select id="getByGoodsClassId" resultMap="BaseResultMap">
          SELECT * FROM `yeshi_ec_second_class` gc
          WHERE gc.`pid` = #{pid}
          ORDER BY gc.`orderby`
  </select>
  <select id="getByNameAndGoodsClassId" resultMap="BaseResultMap">
          SELECT * FROM `yeshi_ec_second_class` gc
          WHERE gc.`pid` = #{pid} AND gc.`name` like '%#{name}%'
          ORDER BY gc.`orderby`
          LIMIT #{start},#{count}
  </select>
  <select id="countByNameAndGoodsClassId" resultType="java.lang.Integer">
          SELECT IFNULL(COUNT(gc.`id`),0) FROM `yeshi_ec_second_class` gc
          WHERE gc.`pid` = #{pid} AND gc.`name` like '%#{name}%'
  </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/GoodsSubClassMapper.xml
@@ -6,6 +6,7 @@
    <id column="sub_id" property="id" jdbcType="BIGINT"/>
    <result column="sub_name" property="name" jdbcType="VARCHAR"/>
    <result column="sub_picture" property="picture" jdbcType="VARCHAR"/>
    <result column="sub_picture_second" property="pictureSecond" jdbcType="VARCHAR"/>
    <result column="sub_weight" property="weight" jdbcType="INTEGER"/>
    <result column="sub_level" property="level" jdbcType="INTEGER"/>
    <result column="sub_state" property="state" jdbcType="INTEGER"/>
@@ -30,6 +31,7 @@
    <id column="sub_id" property="id" jdbcType="BIGINT"/>
    <result column="sub_name" property="name" jdbcType="VARCHAR"/>
    <result column="sub_picture" property="picture" jdbcType="VARCHAR"/>
    <result column="sub_picture_second" property="pictureSecond" jdbcType="VARCHAR"/>
    <result column="sub_weight" property="weight" jdbcType="INTEGER"/>
    <result column="sub_level" property="level" jdbcType="INTEGER"/>
    <result column="sub_state" property="state" jdbcType="INTEGER"/>
@@ -51,17 +53,18 @@
  </resultMap>
  
  
  <sql id="Base_Column_List">sub_id,sub_name,sub_picture,sub_weight,sub_root_id,sub_pid,sub_level,sub_state,sub_key,sub_search_json,sub_ios_click,sub_android_click,sub_createtime,sub_updatetime</sql>
  <sql id="Base_Column_List">sub_id,sub_name,sub_picture,sub_picture_second,sub_weight,sub_root_id,sub_pid,sub_level,sub_state,sub_key,sub_search_json,sub_ios_click,sub_android_click,sub_createtime,sub_updatetime</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_sub_class where sub_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_sub_class where sub_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_sub_class (sub_id,sub_name,sub_picture,sub_weight,sub_root_id,sub_pid,sub_level,sub_state,sub_key,sub_search_json,sub_ios_click,sub_android_click,sub_createtime,sub_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{weight,jdbcType=INTEGER},#{rootClass.id,jdbcType=BIGINT},#{parent.id,jdbcType=BIGINT},#{level,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{key,jdbcType=VARCHAR},#{searchJson,jdbcType=VARCHAR},#{iosClick,jdbcType=BIGINT},#{androidClick,jdbcType=BIGINT},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_sub_class (sub_id,sub_name,sub_picture,sub_picture_second,sub_weight,sub_root_id,sub_pid,sub_level,sub_state,sub_key,sub_search_json,sub_ios_click,sub_android_click,sub_createtime,sub_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{pictureSecond,jdbcType=VARCHAR},#{weight,jdbcType=INTEGER},#{rootClass.id,jdbcType=BIGINT},#{parent.id,jdbcType=BIGINT},#{level,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{key,jdbcType=VARCHAR},#{searchJson,jdbcType=VARCHAR},#{iosClick,jdbcType=BIGINT},#{androidClick,jdbcType=BIGINT},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_sub_class
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">sub_id,</if>
      <if test="name != null">sub_name,</if>
      <if test="picture != null">sub_picture,</if>
      <if test="pictureSecond != null">sub_picture_second,</if>
      <if test="weight != null">sub_weight,</if>
      <if test="rootClass != null">sub_root_id,</if>
      <if test="parent != null">sub_pid,</if>
@@ -78,6 +81,7 @@
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="name != null">#{name,jdbcType=VARCHAR},</if>
      <if test="picture != null">#{picture,jdbcType=VARCHAR},</if>
      <if test="pictureSecond != null">#{pictureSecond,jdbcType=VARCHAR},</if>
      <if test="weight != null">#{weight,jdbcType=INTEGER},</if>
      <if test="rootClass != null">#{rootClass.id,jdbcType=BIGINT},</if>
      <if test="parent != null">#{parent.id,jdbcType=BIGINT},</if>
@@ -91,11 +95,12 @@
      <if test="updatetime != null">#{updatetime,jdbcType=TIMESTAMP},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass">update yeshi_ec_sub_class set sub_name = #{name,jdbcType=VARCHAR},sub_picture = #{picture,jdbcType=VARCHAR},sub_weight = #{weight,jdbcType=INTEGER},sub_root_id = #{rootClass.id,jdbcType=BIGINT},sub_pid = #{parent.id,jdbcType=BIGINT},sub_level = #{level,jdbcType=INTEGER},sub_state = #{state,jdbcType=INTEGER}, sub_key = #{key,jdbcType=VARCHAR},sub_search_json = #{searchJson,jdbcType=VARCHAR},sub_ios_click = #{iosClick,jdbcType=BIGINT},sub_android_click = #{androidClick,jdbcType=BIGINT},sub_createtime = #{createtime,jdbcType=TIMESTAMP},sub_updatetime = #{updatetime,jdbcType=TIMESTAMP} where sub_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass">update yeshi_ec_sub_class set sub_name = #{name,jdbcType=VARCHAR},sub_picture = #{picture,jdbcType=VARCHAR},sub_picture_second = #{pictureSecond,jdbcType=VARCHAR},sub_weight = #{weight,jdbcType=INTEGER},sub_root_id = #{rootClass.id,jdbcType=BIGINT},sub_pid = #{parent.id,jdbcType=BIGINT},sub_level = #{level,jdbcType=INTEGER},sub_state = #{state,jdbcType=INTEGER}, sub_key = #{key,jdbcType=VARCHAR},sub_search_json = #{searchJson,jdbcType=VARCHAR},sub_ios_click = #{iosClick,jdbcType=BIGINT},sub_android_click = #{androidClick,jdbcType=BIGINT},sub_createtime = #{createtime,jdbcType=TIMESTAMP},sub_updatetime = #{updatetime,jdbcType=TIMESTAMP} where sub_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.clazz.GoodsSubClass">update yeshi_ec_sub_class
    <set>
      <if test="name != null">sub_name=#{name,jdbcType=VARCHAR},</if>
      <if test="picture != null">sub_picture=#{picture,jdbcType=VARCHAR},</if>
      <if test="pictureSecond != null">sub_picture_second=#{pictureSecond,jdbcType=VARCHAR},</if>
      <if test="weight != null">sub_weight=#{weight,jdbcType=INTEGER},</if>
      <if test="rootClass != null">sub_root_id=#{rootClass.id,jdbcType=BIGINT},</if>
      <if test="parent != null">sub_pid=#{parent.id,jdbcType=BIGINT},</if>
@@ -185,7 +190,7 @@
  
   <select id="queryByListCid" resultMap="SimpleResultMap">
       SELECT * FROM yeshi_ec_sub_class
       WHERE sub_root_id in
       WHERE sub_state = 1 AND sub_root_id in
            <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
                ${item}
            </foreach>
fanli/src/main/java/com/yeshi/fanli/mapping/SuperGoodsClassMapper.xml
New file
@@ -0,0 +1,76 @@
<?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.SuperGoodsClassMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.su.clazz.SuperGoodsClass">
    <id column="id" property="id" jdbcType="BIGINT"/>
    <association property="goodsClass" column="goodsclass_id"
        select="com.yeshi.fanli.dao.mybatis.GoodsClassMapper.selectByPrimaryKey"/>
    <association property="system" column="system_id" javaType="com.yeshi.fanli.entity.system.BusinessSystem">
        <id column="system_id" property="id" jdbcType="BIGINT" />
    </association>
  </resultMap>
  <sql id="Base_Column_List">id,goodsclass_id,system_id</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_super_goodsclass where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_super_goodsclass where id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.su.clazz.SuperGoodsClass" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_super_goodsclass (id,goodsclass_id,system_id) values (#{id,jdbcType=BIGINT},#{goodsClass.id,jdbcType=BIGINT},#{system.id,jdbcType=BIGINT})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.su.clazz.SuperGoodsClass" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_super_goodsclass
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">id,</if>
      <if test="goodsClass != null">goodsclass_id,</if>
      <if test="system != null">system_id,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="goodsClass != null">#{goodsClass.id,jdbcType=BIGINT},</if>
      <if test="system != null">#{system.id,jdbcType=BIGINT},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.su.clazz.SuperGoodsClass">update yeshi_ec_super_goodsclass set goodsclass_id = #{goodsClass.id,jdbcType=BIGINT},system_id = #{system.id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.su.clazz.SuperGoodsClass">update yeshi_ec_super_goodsclass
    <set>
      <if test="goodsClass != null">goodsclass_id=#{goodsClass.id,jdbcType=BIGINT},</if>
      <if test="system != null">system_id=#{system.id,jdbcType=BIGINT},</if>
    </set> where id = #{id,jdbcType=BIGINT}
  </update>
  <select id="listBySystemId" resultMap="BaseResultMap">
      SELECT * FROM yeshi_ec_super_goodsclass sg
    LEFT JOIN  yeshi_ec_class cs ON cs.`id` = sg.`goodsclass_id`
    WHERE sg.`system_id` = #{systemId}
    ORDER BY cs.`orderby`
  </select>
  <select id="listByGoodsclassIds" resultMap="BaseResultMap">
      SELECT * FROM yeshi_ec_super_goodsclass sg
    LEFT JOIN  yeshi_ec_class cs ON cs.`id` = sg.`goodsclass_id`
    WHERE cs.`id` IN
            <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
                 #{item}
            </foreach>
  </select>
   <select id="listBySystemIdAmdClassName" resultMap="BaseResultMap">
      SELECT * FROM yeshi_ec_super_goodsclass sg
    LEFT JOIN  yeshi_ec_class cs ON cs.`id` = sg.`goodsclass_id`
    WHERE sg.`system_id` = #{systemId} AND  cs.`name` LIKE '%#{name}%'
    ORDER BY cs.`orderby`
    LIMIT #{start},#{count}
  </select>
  <delete id="deleteBySystemIdAndClassId">
    DELETE FROM yeshi_ec_super_goodsclass
    WHERE `goodsclass_id` = #{goodsClassId} AND  system_id = #{systemId}
  </delete>
  <delete id="deleteByClassId">
    DELETE FROM yeshi_ec_super_goodsclass
    WHERE `goodsclass_id` = #{goodsClassId}
  </delete>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/SystemClientParamsMapper.xml
@@ -1,29 +1,98 @@
<?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.SystemClientParamsMapper">
      <!-- 返回实体 -->
      <resultMap id="ParamsResultMap" type="com.yeshi.fanli.entity.system.CustomerName" >
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.system.SystemClientParams">
          <id column="id" property="id" jdbcType="BIGINT"/>
    <result column="key" property="key" jdbcType="VARCHAR"/>
    <result column="value" property="value" jdbcType="VARCHAR"/>
          <result column="name" property="name" jdbcType="VARCHAR"/>
          <result column="createtime" property="createtime" jdbcType="DATE"/>
    <result column="updatetime" property="updatetime" jdbcType="BIGINT"/>
     <association property="system" column="systemid" javaType="com.yeshi.fanli.entity.system.BusinessSystem">
        <id column="systemid" property="id" jdbcType="BIGINT" />
    </association>
      </resultMap>
  <sql id="Base_Column_List">id,`systemid`,`key`,`value`,`name`,updatetime</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_system_clientparams where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_system_clientparams where id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.system.SystemClientParams" useGeneratedKeys="true" keyProperty="id">
      insert into yeshi_ec_system_clientparams
          (id,`systemid`,`key`,`value`,`name`,updatetime)
          values
          (#{id,jdbcType=BIGINT},
        #{system.id,jdbcType=BIGINT},
        #{key,jdbcType=VARCHAR},
        #{value,jdbcType=VARCHAR},
        #{name,jdbcType=VARCHAR},
        #{updatetime,jdbcType=BIGINT})
  </insert>
    <!-- 根据type查询问题数量  -->
    <select id="getCount" resultType="Integer">
        SELECT COUNT(1) FROM yeshi_ec_customer_name yecn WHERE yecn.`type` = #{type};
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.system.SystemClientParams" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_system_clientparams
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">id,</if>
      <if test="system != null">`systemid`,</if>
      <if test="key != null">`key`,</if>
      <if test="value != null">`value`,</if>
      <if test="name != null">`name`,</if>
      <if test="updatetime != null">updatetime,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="system != null">#{system.id,jdbcType=BIGINT},</if>
      <if test="key != null">#{key,jdbcType=VARCHAR},</if>
      <if test="value != null">#{value,jdbcType=VARCHAR},</if>
      <if test="name != null">#{name,jdbcType=VARCHAR},</if>
      <if test="updatetime != null">#{updatetime,jdbcType=BIGINT},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.system.SystemClientParams">update yeshi_ec_system_clientparams set systemid = #{system.id,jdbcType=BIGINT},`key` = #{key,jdbcType=VARCHAR},`value` = #{value,jdbcType=VARCHAR},`name` = #{name,jdbcType=VARCHAR},updatetime = #{updatetime,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.system.SystemClientParams">update yeshi_ec_system_clientparams
    <set>
      <if test="system != null">`systemid`=#{system.id,jdbcType=BIGINT},</if>
      <if test="key != null">`key`=#{key,jdbcType=VARCHAR},</if>
      <if test="value != null">`value`=#{value,jdbcType=VARCHAR},</if>
      <if test="name != null">`name`=#{name,jdbcType=VARCHAR},</if>
      <if test="updatetime != null">updatetime=#{updatetime,jdbcType=BIGINT},</if>
    </set> where id = #{id,jdbcType=BIGINT}
  </update>
  <select id="listBySystemId" resultMap="BaseResultMap">
      SELECT * FROM yeshi_ec_system_clientparams cp
    WHERE cp.`systemid` = #{systemId}
    </select>
    
    <!-- 根据id查询二级问题列表数量 -->
    <select id="getProblemCount" resultType="Integer">
        SELECT COUNT(1) FROM `yeshi_ec_customer_content` yecc WHERE cn_id = #{id};
  <select id="getSystemClientParamsBySystemAndKey" resultMap="BaseResultMap">
      SELECT * FROM yeshi_ec_system_clientparams cp
    WHERE cp.`systemid` =  #{systemId}  AND cp.`key` = #{key}
    LIMIT 1
    </select>
    
    <!-- 查询联系客服信息 -->
    <select id="contactCustomerService" resultType="String">
        SELECT yecc.`content` FROM `yeshi_ec_customer_content` yecc WHERE yecc.`title` = #{title};
  <select id="listQuery" resultMap="BaseResultMap">
     SELECT * FROM yeshi_ec_system_clientparams cp
    WHERE 1=1
        <if test="systemId != null">
            AND cp.`systemid` =  #{systemId}
        </if>
        <if test="key != null and key != '' ">
            AND (cp.`name` LIKE '%${key}%' or  cp.`key` LIKE  '%${key}%' )
        </if>
    LIMIT #{start},#{count}
    </select>
  <select id="countQuery" resultType="java.lang.Long">
     SELECT IFNULL(COUNT(cp.`id`),0)  FROM yeshi_ec_system_clientparams cp
    WHERE 1=1
        <if test="systemId != null">
            AND cp.`systemid` =  #{systemId}
        </if>
        <if test="key != null and key != '' ">
            AND (cp.`name` LIKE '%${key}%' or  cp.`key` LIKE  '%${key}%' )
        </if>
  </select>
    
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/SystemConfigMapper.xml
New file
@@ -0,0 +1,57 @@
<?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.SystemConfigMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.system.SystemConfig">
    <id column="id" property="id" jdbcType="BIGINT"/>
    <result column="key" property="key" jdbcType="VARCHAR"/>
    <result column="value" property="value" jdbcType="VARCHAR"/>
    <result column="name" property="name" jdbcType="VARCHAR"/>
    <result column="updatetime" property="updatetime" jdbcType="BIGINT"/>
  </resultMap>
  <sql id="Base_Column_List">id,`key`,`value`,`name`,updatetime</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_system_config where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_system_config where id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.system.SystemConfig" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_system_config (id,`key`,`value`,`name`,updatetime) values (#{id,jdbcType=BIGINT},#{key,jdbcType=VARCHAR},#{value,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{updatetime,jdbcType=BIGINT})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.system.SystemConfig" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_system_config
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">id,</if>
      <if test="key != null">`key`,</if>
      <if test="value != null">`value`,</if>
      <if test="name != null">`name`,</if>
      <if test="updatetime != null">updatetime,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="key != null">#{key,jdbcType=VARCHAR},</if>
      <if test="value != null">#{value,jdbcType=VARCHAR},</if>
      <if test="name != null">#{name,jdbcType=VARCHAR},</if>
      <if test="updatetime != null">#{updatetime,jdbcType=BIGINT},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.system.SystemConfig">update yeshi_ec_system_config set `key` = #{key,jdbcType=VARCHAR},`value` = #{value,jdbcType=VARCHAR},`name` = #{name,jdbcType=VARCHAR},updatetime = #{updatetime,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.system.SystemConfig">update yeshi_ec_system_config
    <set>
      <if test="key != null">`key`=#{key,jdbcType=VARCHAR},</if>
      <if test="value != null">`value`=#{value,jdbcType=VARCHAR},</if>
      <if test="name != null">`name`=#{name,jdbcType=VARCHAR},</if>
      <if test="updatetime != null">updatetime=#{updatetime,jdbcType=BIGINT},</if>
    </set> where id = #{id,jdbcType=BIGINT}
  </update>
  <select id="getByKey" resultMap="BaseResultMap">
      SELECT * FROM yeshi_ec_system_config  t
    WHERE t.`key` = #{key}
    LIMIT 1
  </select>
  <select id="getByKeyAndSystemId" resultMap="BaseResultMap">
      SELECT * FROM yeshi_ec_system_config  t
    LEFT JOIN `yeshi_ec_system_systemconfig` g ON g.`scid` = t.`id`
    WHERE t.`key` = #{key} AND g.`sid` = #{systemId}
    LIMIT 1
  </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/ThreeSaleMapper.xml
@@ -81,6 +81,12 @@
    </select>
<!-- 根据邀请者ID查询关系 -->
    <select id="getByWorkerId" resultMap="BaseResultMap" parameterType="java.lang.Long">
        select     <include refid="Base_Column_List" /> from yeshi_ec_threeSale
        where worker_id = #{0} AND t.state=0 AND (t.expire = 0 OR t.expire IS NULL)
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_threeSale where id = #{id,jdbcType=BIGINT}
@@ -390,21 +396,21 @@
    <select id="listFirstTeam" resultMap="AllResultMap">
        SELECT * FROM
        `yeshi_ec_threesale` ts
        SELECT * FROM `yeshi_ec_threesale` ts
        LEFT JOIN `yeshi_ec_threesale_extra_info` ff
        ON
        ts.`boss_id` = ff.`tf_boss_id` AND ts.`worker_id`=ff.`tf_worker_id`
        WHERE ts.`boss_id` = #{uid}
        ORDER BY ts.state DESC, ts.expire,
        ts.createTime DESC
            <if test="state != null">
                AND ts.`state` = #{state}
            </if>
        ORDER BY ts.state DESC, ts.expire, ts.createTime DESC
        LIMIT ${start},${count}
    </select>
    <select id="countFirstTeam" resultType="java.lang.Long">
        SELECT IFNULL(count(id),0) FROM `yeshi_ec_threesale`
        WHERE `boss_id` =
        #{uid}
        WHERE `boss_id` = #{uid}
        <if test="state != null">
            AND `state` = #{state}
        </if>
@@ -413,19 +419,14 @@
    <select id="listSecondTeam" resultMap="AllResultMap">
        SELECT yet.* FROM (
        SELECT
        DISTINCT(ts.`id`) AS id FROM `yeshi_ec_threesale` ts
        LEFT JOIN
        yeshi_ec_threesale tf ON ts.`boss_id`=tf.`worker_id`
        WHERE tf.`boss_id`
        = #{uid})A
        LEFT JOIN yeshi_ec_threesale yet ON yet.id =
        A.id
        LEFT JOIN
        `yeshi_ec_threesale_extra_info` ff
        ON yet.`boss_id` =
        ff.`tf_boss_id`
        AND yet.`worker_id` =ff.`tf_worker_id`
            SELECT DISTINCT(ts.`id`) AS id FROM `yeshi_ec_threesale` ts
            LEFT JOIN yeshi_ec_threesale tf ON ts.`boss_id`=tf.`worker_id`
            WHERE tf.`boss_id` = #{uid})A
        LEFT JOIN yeshi_ec_threesale yet ON yet.id = A.id
        WHERE 1=1
            <if test="state != null">
                AND yet.`state` = #{state}
            </if>
        ORDER BY
        yet.state DESC,
        yet.expire, yet.createTime DESC
@@ -434,10 +435,8 @@
    <select id="countSecondTeam" resultType="java.lang.Long">
        SELECT COUNT(A.id) FROM (
        SELECT DISTINCT(ts.`id`) AS id FROM
        `yeshi_ec_threesale` ts
        LEFT JOIN yeshi_ec_threesale tf ON
        ts.`boss_id`=tf.`worker_id`
            SELECT DISTINCT(ts.`id`) AS id FROM `yeshi_ec_threesale` ts
            LEFT JOIN yeshi_ec_threesale tf ON ts.`boss_id`=tf.`worker_id`
        WHERE tf.`boss_id` = #{uid}
        <if test="state != null">
            AND ts.`state` = #{state}
fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml
@@ -244,6 +244,21 @@
        <include refid="Base_Column_List" />
        from yeshi_ec_user where appid=#{appId} and phone=#{phone} 
    </select>
    <!-- 根据AppId与电话号码获取用户 -->
    <select id="getEffectiveUserInfoByPhone" resultMap="BaseResultMap">
        select <include refid="Base_Column_List" /> from yeshi_ec_user
        where phone=#{phone} AND state = 0
        LIMIT 1
    </select>
    <!-- 根据AppId与电话号码获取用户 -->
    <select id="getEffectiveUserInfoByWXUnionId" resultMap="BaseResultMap">
        select <include refid="Base_Column_List" /> from yeshi_ec_user
        where wx_union_id=#{unionId} AND state = 0
        LIMIT 1
    </select>
    <select id="getMaxUid" resultType="java.lang.Long">select max(id) from
        yeshi_ec_user
    </select>
fanli/src/main/java/com/yeshi/fanli/mapping/activity/RecommendActivityMapper.xml
@@ -2,20 +2,20 @@
<!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.activity.RecommendActivityMapper">
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.bus.activity.RecommendActivity">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.activity.RecommendActivity">
        <id column="ar_id" property="id" jdbcType="BIGINT" />
        <result column="ar_title" property="title" jdbcType="VARCHAR" />
        <result column="ar_type" property="type" jdbcType="INTEGER" />
        <result column="ar_order_by" property="orderBy" jdbcType="INTEGER" />
        <result column="ar_share_count" property="shareCount" jdbcType="INTEGER" />
        <result column="ar_total_getmoney" property="totalGetMoney"
            jdbcType="VARCHAR" />
        <result column="ar_video_post_picture" property="videoPostPictire"
            jdbcType="VARCHAR" />
    <result column="ar_total_getmoney" property="totalGetMoney" jdbcType="VARCHAR"/>
    <result column="ar_video_post_picture" property="videoPostPictire" jdbcType="VARCHAR"/>
        <result column="ar_video_url" property="videoUrl" jdbcType="VARCHAR" />
        <result column="ar_create_time" property="createTime" jdbcType="TIMESTAMP" />
        <result column="ar_top" property="top" jdbcType="BOOLEAN" />
    <result column="ar_start_time" property="startTime" jdbcType="TIMESTAMP"/>
    <result column="ar_end_time" property="endTime" jdbcType="TIMESTAMP"/>
        <association property="activityUser" column="ar_activity_uid"
            resultMap="com.yeshi.fanli.dao.mybatis.activity.ActivityUserMapper.BaseResultMap" />
@@ -30,37 +30,40 @@
            select="com.yeshi.fanli.dao.mybatis.activity.RecommendActivityImgMapper.getImgWithAndHeightByActivityId">
        </association>
    </resultMap>
    <sql id="Base_Column_List">ar_id,ar_title,ar_type,ar_order_by,ar_activity_uid as
        au_id,ar_share_count,ar_total_getmoney,ar_video_post_picture,ar_video_url,ar_create_time,ar_top
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_activity_recommend where ar_id = #{id,jdbcType=BIGINT}
   <sql id="Base_Column_List">ar_id,ar_title,ar_type,ar_order_by,ar_activity_uid,ar_share_count,ar_total_getmoney,ar_video_post_picture,ar_video_url,ar_create_time,ar_top,ar_start_time,ar_end_time</sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">
         select  *,ar_activity_uid AS au_id  from yeshi_ec_activity_recommend
         where ar_id = #{id,jdbcType=BIGINT}
    </select>
    <select id="getRecommendActivityList" resultMap="BaseResultMap">
        select
        *
        from
        yeshi_ec_activity_recommend left join yeshi_ec_activity_user on
        ar_activity_uid=au_id order by ar_top desc,ar_order_by
        asc,ar_create_time desc limit #{start},#{count}
        SELECT    *,IF(ar_start_time IS NULL,ar_create_time,ar_start_time) AS orderbyTime FROM yeshi_ec_activity_recommend
        LEFT JOIN yeshi_ec_activity_user ON ar_activity_uid=au_id
        WHERE IF(ar_start_time IS NULL,TRUE, ar_start_time<![CDATA[<=]]> NOW())
             AND IF(ar_end_time IS NULL,TRUE, ar_end_time <![CDATA[>=]]> NOW())
        ORDER BY ar_top DESC,ar_order_by ASC,orderbyTime  DESC
        LIMIT #{start},#{count}
    </select>
    <select id="getRecommendActivityEffectiveCount" resultType="java.lang.Long">
        SELECT    count(ar_id) FROM yeshi_ec_activity_recommend
        WHERE IF(ar_start_time IS NULL,TRUE, ar_start_time<![CDATA[<=]]> NOW())
             AND IF(ar_end_time IS NULL,TRUE, ar_end_time <![CDATA[>=]]> NOW())
    </select>
    <select id="queryRecommendActivityList" resultMap="BaseResultMap">
        select
        *
        from
        yeshi_ec_activity_recommend left join yeshi_ec_activity_user on
        ar_activity_uid=au_id where ar_title like '%${title}%' order by ar_top
        desc,ar_order_by
        asc,ar_create_time desc limit ${start},${count}
        select * from yeshi_ec_activity_recommend
        left join yeshi_ec_activity_user on ar_activity_uid=au_id
         where 1=1
             <if test="title != null and title != '' ">
                  ar_title like '%${title}%'
             </if>
         order by ar_top desc,ar_order_by asc,ar_create_time desc
         limit ${start},${count}
    </select>
    <select id="getRecommendActivityCount" resultType="java.lang.Long">
@@ -68,7 +71,6 @@
        count(ar_id)
        from yeshi_ec_activity_recommend
    </select>
    <select id="getRecommendActivityListByType" resultMap="BaseResultMap">
@@ -81,7 +83,6 @@
        asc,ar_create_time desc limit ${start},${count}
    </select>
    <select id="getRecommendActivityCountByType" resultType="java.lang.Long"
        parameterType="java.lang.Integer">
        select
@@ -89,16 +90,6 @@
        from yeshi_ec_activity_recommend where
        ar_type=#{type}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_activity_recommend where ar_id = #{id,jdbcType=BIGINT}
    </delete>
    <delete id="batchDeleteByPrimaryKey" parameterType="int">
        <!-- 批量删除动态信息 -->
@@ -110,18 +101,9 @@
    </delete>
    <insert id="insert"
        parameterType="com.yeshi.fanli.entity.bus.activity.RecommendActivity"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_activity_recommend
        (ar_id,ar_title,ar_type,ar_order_by,ar_activity_uid,ar_share_count,ar_total_getmoney,ar_video_post_picture,ar_video_url,ar_create_time,ar_top)
        values
        (#{id,jdbcType=BIGINT},#{title,jdbcType=VARCHAR},#{type,jdbcType=INTEGER},#{orderBy,jdbcType=INTEGER},#{activityUser.id,jdbcType=BIGINT},#{shareCount,jdbcType=INTEGER},#{totalGetMoney,jdbcType=VARCHAR},#{videoPostPictire,jdbcType=VARCHAR},#{videoUrl,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{top,jdbcType=BOOLEAN})
    </insert>
    <insert id="insertSelective"
        parameterType="com.yeshi.fanli.entity.bus.activity.RecommendActivity"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_activity_recommend
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_activity_recommend where ar_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.activity.RecommendActivity" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_activity_recommend (ar_id,ar_title,ar_type,ar_order_by,ar_activity_uid,ar_share_count,ar_total_getmoney,ar_video_post_picture,ar_video_url,ar_create_time,ar_top,ar_start_time,ar_end_time) values (#{id,jdbcType=BIGINT},#{title,jdbcType=VARCHAR},#{type,jdbcType=INTEGER},#{orderBy,jdbcType=INTEGER},#{activityUser.id,jdbcType=BIGINT},#{shareCount,jdbcType=INTEGER},#{totalGetMoney,jdbcType=VARCHAR},#{videoPostPictire,jdbcType=VARCHAR},#{videoUrl,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{top,jdbcType=BOOLEAN},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.activity.RecommendActivity" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_activity_recommend
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">ar_id,</if>
            <if test="title != null">ar_title,</if>
@@ -134,8 +116,9 @@
            <if test="videoUrl != null">ar_video_url,</if>
            <if test="createTime != null">ar_create_time,</if>
            <if test="top != null">ar_top,</if>
        </trim>
        values
      <if test="startTime != null">ar_start_time,</if>
      <if test="endTime != null">ar_end_time,</if>
    </trim>values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="title != null">#{title,jdbcType=VARCHAR},</if>
@@ -147,33 +130,13 @@
            <if test="videoPostPictire != null">#{videoPostPictire,jdbcType=VARCHAR},</if>
            <if test="videoUrl != null">#{videoUrl,jdbcType=VARCHAR},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="top != null">#{top,jdbcType=BOOLEAN}</if>
      <if test="top != null">#{top,jdbcType=BOOLEAN},</if>
      <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if>
      <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey"
        parameterType="com.yeshi.fanli.entity.bus.activity.RecommendActivity">update yeshi_ec_activity_recommend set ar_title =
        #{title,jdbcType=VARCHAR},ar_type =
        #{type,jdbcType=INTEGER},ar_order_by =
        #{orderBy,jdbcType=INTEGER},ar_activity_uid =
        #{activityUser.id,jdbcType=BIGINT},ar_share_count =
        #{shareCount,jdbcType=INTEGER},ar_total_getmoney =
        #{totalGetMoney,jdbcType=VARCHAR},ar_video_post_picture =
        #{videoPostPictire,jdbcType=VARCHAR},ar_video_url =
        #{videoUrl,jdbcType=VARCHAR},ar_create_time =
        #{createTime,jdbcType=TIMESTAMP} ,ar_top =#{top,jdbcType=BOOLEAN}
        where ar_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="addShareCount">update yeshi_ec_activity_recommend set ar_share_count
        =ar_share_count+#{count}
        where ar_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective"
        parameterType="com.yeshi.fanli.entity.bus.activity.RecommendActivity">
        update yeshi_ec_activity_recommend
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.activity.RecommendActivity">update yeshi_ec_activity_recommend set ar_title = #{title,jdbcType=VARCHAR},ar_type = #{type,jdbcType=INTEGER},ar_order_by = #{orderBy,jdbcType=INTEGER},ar_activity_uid = #{activityUser.id,jdbcType=BIGINT},ar_share_count = #{shareCount,jdbcType=INTEGER},ar_total_getmoney = #{totalGetMoney,jdbcType=VARCHAR},ar_video_post_picture = #{videoPostPictire,jdbcType=VARCHAR},ar_video_url = #{videoUrl,jdbcType=VARCHAR},ar_create_time = #{createTime,jdbcType=TIMESTAMP},ar_top = #{top,jdbcType=BOOLEAN},ar_start_time = #{startTime,jdbcType=TIMESTAMP},ar_end_time = #{endTime,jdbcType=TIMESTAMP} where ar_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.activity.RecommendActivity">update yeshi_ec_activity_recommend
        <set>
            <if test="title != null">ar_title=#{title,jdbcType=VARCHAR},</if>
            <if test="type != null">ar_type=#{type,jdbcType=INTEGER},</if>
@@ -181,12 +144,12 @@
            <if test="activityUser != null">ar_activity_uid=#{activityUser.id,jdbcType=BIGINT},</if>
            <if test="shareCount != null">ar_share_count=#{shareCount,jdbcType=INTEGER},</if>
            <if test="totalGetMoney != null">ar_total_getmoney=#{totalGetMoney,jdbcType=VARCHAR},</if>
            <if test="videoPostPictire != null">ar_video_post_picture=#{videoPostPictire,jdbcType=VARCHAR},
            </if>
      <if test="videoPostPictire != null">ar_video_post_picture=#{videoPostPictire,jdbcType=VARCHAR},</if>
            <if test="videoUrl != null">ar_video_url=#{videoUrl,jdbcType=VARCHAR},</if>
            <if test="createTime != null">ar_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="top !=null">ar_top =#{top,jdbcType=BOOLEAN},</if>
        </set>
        where ar_id = #{id,jdbcType=BIGINT}
      <if test="startTime != null">ar_start_time=#{startTime,jdbcType=TIMESTAMP},</if>
      <if test="endTime != null">ar_end_time=#{endTime,jdbcType=TIMESTAMP},</if>
    </set> where ar_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/HomeNavbarMapper.xml
@@ -2,69 +2,27 @@
<!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.homemodule.HomeNavbarMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar">
    <id column="br_id" property="id" jdbcType="BIGINT"/>
    <result column="br_name" property="name" jdbcType="VARCHAR"/>
    <result column="br_picture" property="picture" jdbcType="VARCHAR"/>
    <result column="br_class_id" property="classId" jdbcType="BIGINT"/>
    <result column="br_swiper_banner_id" property="swiperBannerId" jdbcType="BIGINT"/>
    <result column="br_url" property="url" jdbcType="VARCHAR"/>
     <result column="br_type" property="type"
            typeHandler="com.yeshi.fanli.util.mybatishandler.NavbarTypeEnumHandler" />
    <result column="br_type" property="type" jdbcType="VARCHAR"/>
    <result column="br_orderby" property="orderby" 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"/>
    <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" />
  </resultMap>
  
  <sql id="Base_Column_List">br_id,br_name,br_picture,br_class_id,br_url,br_type,br_orderby,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_start_time,br_end_time,br_state,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>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">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_url,br_type,br_orderby,br_createtime,br_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{classId,jdbcType=BIGINT},#{url,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{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=",">
      <if test="id != null">br_id,</if>
      <if test="name != null">br_name,</if>
      <if test="picture != null">br_picture,</if>
      <if test="classId != null">br_class_id,</if>
      <if test="url != null">br_url,</if>
      <if test="type != null">br_type,</if>
      <if test="orderby != null">br_orderby,</if>
      <if test="createtime != null">br_createtime,</if>
      <if test="updatetime != null">br_updatetime,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="name != null">#{name,jdbcType=VARCHAR},</if>
      <if test="picture != null">#{picture,jdbcType=VARCHAR},</if>
      <if test="classId != null">#{classId,jdbcType=BIGINT},</if>
      <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="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.HomeNavbar">update yeshi_ec_home_navbar set br_name = #{name,jdbcType=VARCHAR},br_picture = #{picture,jdbcType=VARCHAR},br_class_id = #{classId,jdbcType=BIGINT},br_url = #{url,jdbcType=VARCHAR},br_type = #{type,jdbcType=VARCHAR},br_orderby = #{orderby,jdbcType=INTEGER},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>
      <if test="name != null">br_name=#{name,jdbcType=VARCHAR},</if>
      <if test="picture != null">br_picture=#{picture,jdbcType=VARCHAR},</if>
      <if test="classId != null">br_class_id=#{classId,jdbcType=BIGINT},</if>
      <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="createtime != null">br_createtime=#{createtime,jdbcType=TIMESTAMP},</if>
      <if test="updatetime != null">br_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if>
    </set> where br_id = #{id,jdbcType=BIGINT}
  </update>
  
   <select id="getMaxOrder" resultType="java.lang.Integer">
        SELECT IFNULL(MAX(br_orderby),0) FROM yeshi_ec_home_navbar
@@ -82,6 +40,7 @@
            <![CDATA[and br_orderby > #{order} ]]>  
            order by br_orderby 
        </if>
         LIMIT 1
   </select>
   
    <select id="listQuery" resultMap="BaseResultMap">
@@ -102,10 +61,81 @@
           </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>
    <select id="getEffectiveByClassId" resultMap="BaseResultMap">
      SELECT * FROM    yeshi_ec_home_navbar
      WHERE br_state = 1  AND br_class_id = #{classId}
      LIMIT 1
   </select>
      <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List">
        delete from yeshi_ec_home_navbar WHERE br_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
    </delete>
    
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
      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_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},#{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=",">
      <if test="id != null">br_id,</if>
      <if test="name != null">br_name,</if>
      <if test="picture != null">br_picture,</if>
      <if test="classId != null">br_class_id,</if>
      <if test="swiperBannerId != null">br_swiper_banner_id,</if>
      <if test="url != null">br_url,</if>
      <if test="type != null">br_type,</if>
      <if test="orderby != null">br_orderby,</if>
      <if test="startTime != null">br_start_time,</if>
      <if test="endTime != null">br_end_time,</if>
      <if test="state != null">br_state,</if>
      <if test="createtime != null">br_createtime,</if>
      <if test="updatetime != null">br_updatetime,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="name != null">#{name,jdbcType=VARCHAR},</if>
      <if test="picture != null">#{picture,jdbcType=VARCHAR},</if>
      <if test="classId != null">#{classId,jdbcType=BIGINT},</if>
      <if test="swiperBannerId != null">#{swiperBannerId,jdbcType=BIGINT},</if>
      <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="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if>
      <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</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.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_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>
      <if test="name != null">br_name=#{name,jdbcType=VARCHAR},</if>
      <if test="picture != null">br_picture=#{picture,jdbcType=VARCHAR},</if>
      <if test="classId != null">br_class_id=#{classId,jdbcType=BIGINT},</if>
      <if test="swiperBannerId != null">br_swiper_banner_id=#{swiperBannerId,jdbcType=BIGINT},</if>
      <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="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>
      <if test="createtime != null">br_createtime=#{createtime,jdbcType=TIMESTAMP},</if>
      <if test="updatetime != null">br_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if>
    </set> where br_id = #{id,jdbcType=BIGINT}
  </update>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SpecialCardMapper.xml
@@ -7,26 +7,29 @@
    <result column="cd_name" property="name" jdbcType="VARCHAR"/>
    <result column="cd_card" property="card" jdbcType="VARCHAR"/>
    <result column="cd_state" property="state" jdbcType="INTEGER"/>
    <result column="cd_place_id" property="placeId" jdbcType="BIGINT"/>
    <result column="cd_bottom_picture" property="bottomPicture" jdbcType="VARCHAR"/>
    <result column="cd_start_time" property="startTime" jdbcType="TIMESTAMP"/>
    <result column="cd_end_time" property="endTime" jdbcType="TIMESTAMP"/>
    <result column="cd_createtime" property="createtime" jdbcType="TIMESTAMP"/>
    <result column="cd_updatetime" property="updatetime" jdbcType="TIMESTAMP"/>
  </resultMap>
  <sql id="Base_Column_List">cd_id,cd_name,cd_card,cd_state,cd_createtime,cd_updatetime</sql>
  <sql id="Base_Column_List">cd_id,cd_name,cd_card,cd_state,cd_place_id,cd_bottom_picture,cd_start_time,cd_end_time,cd_createtime,cd_updatetime</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_special_card where cd_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_special_card where cd_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.SpecialCard" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special_card (cd_id,cd_name,cd_card,cd_state,cd_createtime,cd_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{card,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.SpecialCard" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special_card (cd_id,cd_name,cd_card,cd_state,cd_place_id,cd_bottom_picture,cd_start_time,cd_end_time,cd_createtime,cd_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{card,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{placeId,jdbcType=BIGINT},#{bottomPicture,jdbcType=VARCHAR},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.SpecialCard" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special_card
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">cd_id,</if>
      <if test="name != null">cd_name,</if>
      <if test="card != null">cd_card,</if>
      <if test="state != null">cd_state,</if>
      <if test="placeId != null">cd_place_id,</if>
      <if test="bottomPicture != null">cd_bottom_picture,</if>
      <if test="startTime != null">cd_start_time,</if>
      <if test="endTime != null">cd_end_time,</if>
      <if test="createtime != null">cd_createtime,</if>
      <if test="updatetime != null">cd_updatetime,</if>
    </trim>values
@@ -35,18 +38,24 @@
      <if test="name != null">#{name,jdbcType=VARCHAR},</if>
      <if test="card != null">#{card,jdbcType=VARCHAR},</if>
      <if test="state != null">#{state,jdbcType=INTEGER},</if>
      <if test="placeId != null">#{placeId,jdbcType=BIGINT},</if>
      <if test="bottomPicture != null">#{bottomPicture,jdbcType=VARCHAR},</if>
      <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if>
      <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</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.SpecialCard">update yeshi_ec_special_card set cd_name = #{name,jdbcType=VARCHAR},cd_card = #{card,jdbcType=VARCHAR},cd_state = #{state,jdbcType=INTEGER},cd_createtime = #{createtime,jdbcType=TIMESTAMP},cd_updatetime = #{updatetime,jdbcType=TIMESTAMP} where cd_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.SpecialCard">update yeshi_ec_special_card set cd_name = #{name,jdbcType=VARCHAR},cd_card = #{card,jdbcType=VARCHAR},cd_state = #{state,jdbcType=INTEGER},cd_place_id = #{placeId,jdbcType=BIGINT},cd_bottom_picture = #{bottomPicture,jdbcType=VARCHAR},cd_start_time = #{startTime,jdbcType=TIMESTAMP},cd_end_time = #{endTime,jdbcType=TIMESTAMP},cd_createtime = #{createtime,jdbcType=TIMESTAMP},cd_updatetime = #{updatetime,jdbcType=TIMESTAMP} where cd_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.SpecialCard">update yeshi_ec_special_card
    <set>
      <if test="name != null">cd_name=#{name,jdbcType=VARCHAR},</if>
      <if test="card != null">cd_card=#{card,jdbcType=VARCHAR},</if>
      <if test="state != null">cd_state=#{state,jdbcType=INTEGER},</if>
      <if test="placeId != null">cd_place_id=#{placeId,jdbcType=BIGINT},</if>
      <if test="bottomPicture != null">cd_bottom_picture=#{bottomPicture,jdbcType=VARCHAR},</if>
      <if test="startTime != null">cd_start_time=#{startTime,jdbcType=TIMESTAMP},</if>
      <if test="endTime != null">cd_end_time=#{endTime,jdbcType=TIMESTAMP},</if>
      <if test="createtime != null">cd_createtime=#{createtime,jdbcType=TIMESTAMP},</if>
      <if test="updatetime != null">cd_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if>
    </set> where cd_id = #{id,jdbcType=BIGINT}
@@ -56,9 +65,9 @@
        SELECT <include refid="Base_Column_List" />  FROM yeshi_ec_special_card
        WHERE 1=1
           <if test='key != null and key != ""'>
                  AND (cd_name like '%${key}%' OR cd_card like '%${key}%')
                  AND cd_name like '%${key}%'
           </if>
           ORDER BY cd_createtime <if test='sort == 1'>DESC</if>
           ORDER BY cd_state DESC,cd_createtime
        LIMIT ${start},${count}
   </select>
   
@@ -66,7 +75,7 @@
        SELECT IFNULL(count(cd_id),0)  FROM yeshi_ec_special_card 
        WHERE 1=1
           <if test='key != null and key != ""'>
                  AND (cd_name like '%${key}%' OR cd_card like '%${key}%')
                  AND cd_name like '%${key}%'
           </if>
    </select>
    
@@ -76,4 +85,13 @@
            separator=",">#{item}</foreach>
    </delete>
    
     <select id="getbottomPicture"  resultType="java.lang.String">
        SELECT c.`cd_bottom_picture` FROM `yeshi_ec_special_card` c
        LEFT JOIN `yeshi_ec_special_place` pc ON pc.`sp_id` = c.`cd_place_id`
        WHERE c.`cd_state` = 0  AND pc.`sp_key` = #{placeKey}
             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())
        LIMIT 1;
   </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SpecialMapper.xml
@@ -8,24 +8,31 @@
    <result column="b_card" property="card" jdbcType="VARCHAR"/>
    <result column="b_card_id" property="cardId" jdbcType="BIGINT"/>
    <result column="b_main_picture" property="picture" jdbcType="VARCHAR"/>
    <result column="b_icon" property="icon" jdbcType="VARCHAR"/>
    <result column="b_sub_picture" property="subPicture" jdbcType="VARCHAR"/>
    <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_state" property="state" jdbcType="BIGINT"/>
    <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"/>
    <result column="b_updatetime" property="updatetime" jdbcType="TIMESTAMP"/>
     <!-- 背景图片 -->
    <result column="cd_bottom_picture" property="bottomPicture" jdbcType="VARCHAR"/>
    <association property="jumpDetail" column="b_jumpid" 
         select="com.yeshi.fanli.dao.mybatis.common.JumpDetailV2Mapper.selectByPrimaryKey"> 
    </association>
  </resultMap>
  <sql id="Base_Column_List">b_id,b_name,b_card,b_card_id,b_main_picture,b_sub_picture,b_jumpid,b_params,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_state,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_sub_picture,b_jumpid,b_params,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},#{subPicture,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,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_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="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>
@@ -33,9 +40,11 @@
      <if test="card != null">b_card,</if>
      <if test="cardId != null">b_card_id,</if>
      <if test="picture != null">b_main_picture,</if>
      <if test="icon != null">b_icon,</if>
      <if test="subPicture != null">b_sub_picture,</if>
      <if test="jumpDetail != null">b_jumpid,</if>
      <if test="params != null">b_params,</if>
      <if test="jumpLogin != null">b_jump_login,</if>
      <if test="orderby != null">b_orderby,</if>
      <if test="state != null">b_state,</if>
      <if test="showType != null">b_show_type,</if>
@@ -49,9 +58,11 @@
      <if test="card != null">#{card,jdbcType=VARCHAR},</if>
      <if test="cardId != null">#{cardId,jdbcType=BIGINT},</if>
      <if test="picture != null">#{picture,jdbcType=VARCHAR},</if>
      <if test="icon != null">#{icon,jdbcType=VARCHAR},</if>
      <if test="subPicture != null">#{subPicture,jdbcType=VARCHAR},</if>
      <if test="jumpDetail != null">#{jumpDetail.id,jdbcType=BIGINT},</if>
      <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="state != null">#{state,jdbcType=BIGINT},</if>
      <if test="showType != null">#{showType,jdbcType=VARCHAR},</if>
@@ -60,16 +71,18 @@
      <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_sub_picture = #{subPicture,jdbcType=VARCHAR},b_jumpid = #{jumpDetail.id,jdbcType=BIGINT},b_params = #{params,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_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>
      <if test="card != null">b_card=#{card,jdbcType=VARCHAR},</if>
      <if test="cardId != null">b_card_id=#{cardId,jdbcType=BIGINT},</if>
      <if test="picture != null">b_main_picture=#{picture,jdbcType=VARCHAR},</if>
      <if test="icon != null">b_icon=#{icon,jdbcType=VARCHAR},</if>
      <if test="subPicture != null">b_sub_picture=#{subPicture,jdbcType=VARCHAR},</if>
      <if test="jumpDetail != null">b_jumpid=#{jumpDetail.id,jdbcType=BIGINT},</if>
      <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="state != null">b_state=#{state,jdbcType=BIGINT},</if>
      <if test="showType != null">b_show_type=#{showType,jdbcType=VARCHAR},</if>
@@ -140,6 +153,7 @@
            <![CDATA[and b_orderby > #{order} ]]>  
            order by b_orderby 
        </if>
        limit 1
   </select>
   
   <select id="listBySystemAndCard" resultMap="BaseResultMap">
@@ -159,4 +173,17 @@
        LIMIT ${start},${count}
   </select>
   
    <select id="listByPlaceKey" resultMap="BaseResultMap">
        SELECT sp.*,c.`cd_bottom_picture` FROM `yeshi_ec_special` sp
        RIGHT JOIN (SELECT c.* FROM yeshi_ec_special_card c
            LEFT JOIN `yeshi_ec_special_place` pc ON pc.`sp_id` = c.`cd_place_id`
            WHERE c.`cd_state` = 0
            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`
   </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SpecialPlaceMapper.xml
New file
@@ -0,0 +1,71 @@
<?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.homemodule.SpecialPlaceMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.homemodule.SpecialPlace">
    <id column="sp_id" property="id" jdbcType="BIGINT"/>
    <result column="sp_name" property="name" jdbcType="VARCHAR"/>
    <result column="sp_key" property="key" jdbcType="VARCHAR"/>
    <result column="sp_create_time" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="sp_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
  </resultMap>
  <sql id="Base_Column_List">sp_id,sp_name,sp_key,sp_create_time,sp_update_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_special_place where sp_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_special_place where sp_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.SpecialPlace" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special_place (sp_id,sp_name,sp_key,sp_create_time,sp_update_time) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{key,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.SpecialPlace" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special_place
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">sp_id,</if>
      <if test="name != null">sp_name,</if>
      <if test="key != null">sp_key,</if>
      <if test="createTime != null">sp_create_time,</if>
      <if test="updateTime != null">sp_update_time,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="name != null">#{name,jdbcType=VARCHAR},</if>
      <if test="key != null">#{key,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.SpecialPlace">update yeshi_ec_special_place set sp_name = #{name,jdbcType=VARCHAR},sp_key = #{key,jdbcType=VARCHAR},sp_create_time = #{createTime,jdbcType=TIMESTAMP},sp_update_time = #{updateTime,jdbcType=TIMESTAMP} where sp_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.SpecialPlace">update yeshi_ec_special_place
    <set>
      <if test="name != null">sp_name=#{name,jdbcType=VARCHAR},</if>
      <if test="key != null">sp_key=#{key,jdbcType=VARCHAR},</if>
      <if test="createTime != null">sp_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updateTime != null">sp_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
    </set> where sp_id = #{id,jdbcType=BIGINT}
  </update>
  <delete id="deleteByPrimaryKeyList" parameterType="java.util.List">
    delete from yeshi_ec_special_place
    WHERE sp_id in <foreach collection="list" item="item" open="(" separator="," close=")">#{item}</foreach>
  </delete>
  <select id="getAll" resultMap="BaseResultMap">
      SELECT * FROM `yeshi_ec_special_place`
  </select>
   <select id="listQuery" resultMap="BaseResultMap">
      SELECT * FROM yeshi_ec_special_place
      WHERE 1=1
          <if test="key != null and key !='' ">
              AND (sp_place_name LIKE '%${key}%' OR sp_key LIKE '%${key}%')
          </if>
      ORDER BY sp_create_time
      LIMIT ${start},${count}
  </select>
  <select id="countQuery" resultType="java.lang.Long">
      SELECT IFNULL(COUNT(sp_id),0) FROM yeshi_ec_special_place
      WHERE 1=1
          <if test="key != null and key !='' ">
              AND (sp_place_name LIKE '%${key}%' OR sp_key LIKE '%${key}%')
          </if>
  </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SwiperBannerMapper.xml
@@ -72,5 +72,12 @@
            separator=",">#{item}</foreach>
    </delete>
    
    <select id="getEffectiveOption" resultMap="BaseResultMap">
          <!-- 根据条件查询所有标签 -->
        SELECT <include refid="Base_Column_List" />  FROM yeshi_ec_swiper_banner
        WHERE sp_state = 0
           ORDER BY sp_createtime
   </select>
    
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SwiperPictureMapper.xml
@@ -16,7 +16,9 @@
    <result column="pic_end_time" property="endTime" jdbcType="TIMESTAMP"/>
    <result column="pic_createtime" property="createtime" jdbcType="TIMESTAMP"/>
    <result column="pic_updatetime" property="updatetime" jdbcType="TIMESTAMP"/>
    <association property="jumpDetail" column="pic_jumpid" resultMap="com.yeshi.fanli.dao.mybatis.common.JumpDetailV2Mapper.BaseResultMap"/>
  </resultMap>
  
  <sql id="Base_Column_List">pic_id,pic_banner_id,pic_src,pic_jumpid,pic_params,pic_jump_need_login,pic_order,pic_remark,pic_state,pic_auto_control,pic_start_time,pic_end_time,pic_createtime,pic_updatetime</sql>
@@ -146,4 +148,13 @@
        ORDER BY p.`pic_order`
   </select>
   
    <select id="getByBannerId" resultMap="BaseResultMap">
        SELECT * FROM `yeshi_ec_swiper_banner` w
        LEFT JOIN  `yeshi_ec_swiper_banner_picture` p ON p.`pic_banner_id` = w.`sp_id`
        LEFT JOIN `yeshi_ec_action_jumpdetail_v2` j ON j.`jp_id` = p.`pic_jumpid`
        WHERE w.`sp_id` = #{bannerId} AND w.`sp_state` = 0 AND p.`pic_state`= 0
            <![CDATA[AND IF(p.`pic_auto_control` = 1, p.`pic_start_time` <= NOW() AND p.`pic_end_time` >= NOW(),TRUE)]]>
        ORDER BY p.`pic_order`
   </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/lable/QualityFactoryMapper.xml
@@ -964,6 +964,19 @@
    </select>
    <select id="listFlashSaleRandGoods" resultMap="GoodsResultMap">
        SELECT h.*, tb.* FROM yeshi_ec_quality_factory h
        RIGHT JOIN yeshi_ec_quality_flash_sale s ON h.`sg_id` = s.`fs_qfgoods_id`
        LEFT JOIN yeshi_ec_taobao_goods tb ON h.`sg_goods_id`= tb.`id`
        WHERE  s.`fs_id` IS NOT NULL AND tb.`biz30day` <![CDATA[>=]]> 10000
             AND tb.`couponTotalCount` <![CDATA[>]]>10
             AND tb.couponLeftCount <![CDATA[<]]> tb.couponTotalCount
        ORDER BY RAND()
        LIMIT 3
    </select>
    <!-- 查询精选商品信息 -->
    <select id="listQueryByKeyAndlabIDs" resultMap="BaseResultMap">
fanli/src/main/java/com/yeshi/fanli/mapping/msg/SystemZnxMapper.xml
@@ -54,4 +54,17 @@
        </set>
        where id = #{id,jdbcType=BIGINT}
    </update>
    <select id="listbyCreateTime" resultMap="BaseResultMap">
        SELECT * FROM yeshi_ec_system_msg  t
        WHERE t.`createTime` <![CDATA[ >= ]]> #{createTime}
    </select>
    <select id="listbyUidAndCreateTime" resultMap="BaseResultMap">
        SELECT sm.* FROM `yeshi_ec_system_msg` sm
        LEFT JOIN  (SELECT * FROM `yeshi_ec_account_message` a
            WHERE a.`uid`= #{uid}  AND a.`system_msg_id` IS NOT NULL)s ON s.`system_msg_id`=sm.`id`
        WHERE s.`system_msg_id` IS NULL AND sm.createTime<![CDATA[ >= ]]> #{createTime}
    </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderMapper.xml
@@ -252,6 +252,10 @@
            <!-- 整个订单失效 -->
            AND co.co_state_whole_order = 3
        </if>
        <if test="orderState != null and orderState ==  4">
            <!-- 已收货订单 -->
            AND co.co_state = 2
        </if>
    </sql>
    <sql id="SELECT_PARAM_ORDER_CREATE_TIME">
        <if test="startTime != null and startTime != '' ">AND <![CDATA[co.co_third_create_time >= #{startTime}]]>
fanli/src/main/java/com/yeshi/fanli/mapping/taobao/TaoBaoUnionAuthRecordMapper.xml
@@ -88,4 +88,12 @@
        </set>
        where tuar_id = #{id,jdbcType=BIGINT}
    </update>
    <select id="getTaoBaoUserNick" resultType="java.lang.String">
        SELECT u.`tuar_taobao_user_nick` FROM `yeshi_ec_taobao_union_auth_record` u
        WHERE u.`tuar_uid` = #{uid}
        ORDER BY u.`tuar_create_time` DESC
        LIMIT 1
    </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserExtraTaoBaoInfoMapper.xml
@@ -2,28 +2,19 @@
<!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.UserExtraTaoBaoInfoMapper">
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo">
        <id column="uiet_id" property="id" jdbcType="BIGINT" />
        <result column="uiet_relation_id" property="relationId"
            jdbcType="VARCHAR" />
        <result column="uiet_relation_update_time" property="relationUpdateTime"
            jdbcType="TIMESTAMP" />
    <result column="uiet_relation_id" property="relationId" jdbcType="VARCHAR"/>
    <result column="uiet_relation_valid" property="relationValid" jdbcType="BOOLEAN"/>
    <result column="uiet_relation_update_time" property="relationUpdateTime" jdbcType="TIMESTAMP"/>
        <result column="uiet_special_id" property="specialId" jdbcType="VARCHAR" />
        <result column="uiet_special_update_time" property="specialUpdateTime"
            jdbcType="TIMESTAMP" />
        <result column="uiet_create_time" property="createTime"
            jdbcType="TIMESTAMP" />
        <result column="uiet_update_time" property="updateTime"
            jdbcType="TIMESTAMP" />
        <result column="uiet_relation_valid" property="relationValid"
            jdbcType="BOOLEAN" />
        <result column="uiet_special_valid" property="specialValid"
            jdbcType="BOOLEAN" />
    <result column="uiet_special_valid" property="specialValid" jdbcType="BOOLEAN"/>
    <result column="uiet_special_update_time" property="specialUpdateTime" jdbcType="TIMESTAMP"/>
        <result column="uiet_taobao_uid" property="taoBaoUid" jdbcType="VARCHAR" />
        <result column="uiet_taobao_order_end_6_num" property="taoBaoOrderEnd6Num"
            jdbcType="VARCHAR" />
    <result column="uiet_taobao_order_end_6_num" property="taoBaoOrderEnd6Num" jdbcType="VARCHAR"/>
    <result column="uiet_taobao_nick_name" property="taoBaoNickName" jdbcType="VARCHAR"/>
    <result column="uiet_create_time" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="uiet_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
        <association property="user" column="uiet_uid"
            javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
@@ -31,16 +22,10 @@
        </association>
    </resultMap>
    <sql id="Base_Column_List">uiet_id,uiet_uid,uiet_relation_id,uiet_relation_update_time,uiet_special_id,uiet_special_update_time,uiet_create_time,uiet_update_time,uiet_relation_valid,uiet_special_valid,uiet_taobao_uid,uiet_taobao_order_end_6_num
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_user_info_extra_taobao where uiet_id =
        #{id,jdbcType=BIGINT}
  <sql id="Base_Column_List">uiet_id,uiet_uid,uiet_relation_id,uiet_relation_valid,uiet_relation_update_time,uiet_special_id,uiet_special_valid,uiet_special_update_time,uiet_taobao_uid,uiet_taobao_order_end_6_num,uiet_taobao_nick_name,uiet_create_time,uiet_update_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_user_info_extra_taobao where uiet_id = #{id,jdbcType=BIGINT}
    </select>
    <select id="selectByUid" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
@@ -57,6 +42,11 @@
        from yeshi_ec_user_info_extra_taobao where uiet_taobao_uid =
        #{0} limit
        1
    </select>
    <select id="listByTaoBaoUid" resultMap="BaseResultMap" parameterType="java.lang.String">
        SELECT * FROM yeshi_ec_user_info_extra_taobao tb
        WHERE  tb.`uiet_taobao_uid` = #{0} AND tb.`uiet_uid` IS NOT NULL
    </select>
@@ -80,93 +70,60 @@
        uiet_uid is not null limit 1
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_user_info_extra_taobao where uiet_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_user_info_extra_taobao
        (uiet_id,uiet_uid,uiet_relation_id,uiet_relation_update_time,uiet_special_id,uiet_special_update_time,uiet_create_time,uiet_update_time,uiet_relation_valid,uiet_special_valid,uiet_taobao_uid,uiet_taobao_order_end_6_num)
        values
        (#{id,jdbcType=BIGINT},#{user.id,jdbcType=BIGINT},#{relationId,jdbcType=VARCHAR},#{relationUpdateTime,jdbcType=TIMESTAMP},#{specialId,jdbcType=VARCHAR},#{specialUpdateTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{relationValid,jdbcType=BOOLEAN},#{specialValid,jdbcType=BOOLEAN},#{taoBaoUid,jdbcType=VARCHAR},#{taoBaoOrderEnd6Num,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_user_info_extra_taobao
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_info_extra_taobao where uiet_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_info_extra_taobao (uiet_id,uiet_uid,uiet_relation_id,uiet_relation_valid,uiet_relation_update_time,uiet_special_id,uiet_special_valid,uiet_special_update_time,uiet_taobao_uid,uiet_taobao_order_end_6_num,uiet_taobao_nick_name,uiet_create_time,uiet_update_time) values (#{id,jdbcType=BIGINT},#{user.id,jdbcType=BIGINT},#{relationId,jdbcType=VARCHAR},#{relationValid,jdbcType=BOOLEAN},#{relationUpdateTime,jdbcType=TIMESTAMP},#{specialId,jdbcType=VARCHAR},#{specialValid,jdbcType=BOOLEAN},#{specialUpdateTime,jdbcType=TIMESTAMP},#{taoBaoUid,jdbcType=VARCHAR},#{taoBaoOrderEnd6Num,jdbcType=VARCHAR},#{taoBaoNickName,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_info_extra_taobao
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">uiet_id,</if>
            <if test="user != null">uiet_uid,</if>
            <if test="relationId != null">uiet_relation_id,</if>
      <if test="relationValid != null">uiet_relation_valid,</if>
            <if test="relationUpdateTime != null">uiet_relation_update_time,</if>
            <if test="specialId != null">uiet_special_id,</if>
            <if test="specialUpdateTime != null">uiet_special_update_time,</if>
            <if test="createTime != null">uiet_create_time,</if>
            <if test="updateTime != null">uiet_update_time,</if>
            <if test="relationValid != null">uiet_relation_valid,</if>
            <if test="specialValid != null">uiet_special_valid,</if>
      <if test="specialUpdateTime != null">uiet_special_update_time,</if>
            <if test="taoBaoUid != null">uiet_taobao_uid,</if>
            <if test="taoBaoOrderEnd6Num != null">uiet_taobao_order_end_6_num,</if>
        </trim>
        values
      <if test="taoBaoNickName != null">uiet_taobao_nick_name,</if>
      <if test="createTime != null">uiet_create_time,</if>
      <if test="updateTime != null">uiet_update_time,</if>
    </trim>values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="user != null">#{user.id,jdbcType=BIGINT},</if>
            <if test="relationId != null">#{relationId,jdbcType=VARCHAR},</if>
      <if test="relationValid != null">#{relationValid,jdbcType=BOOLEAN},</if>
            <if test="relationUpdateTime != null">#{relationUpdateTime,jdbcType=TIMESTAMP},</if>
            <if test="specialId != null">#{specialId,jdbcType=VARCHAR},</if>
            <if test="specialUpdateTime != null">#{specialUpdateTime,jdbcType=TIMESTAMP},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="relationValid != null">#{relationValid,jdbcType=BOOLEAN},</if>
            <if test="specialValid != null">#{specialValid,jdbcType=BOOLEAN},</if>
      <if test="specialUpdateTime != null">#{specialUpdateTime,jdbcType=TIMESTAMP},</if>
            <if test="taoBaoUid != null">#{taoBaoUid,jdbcType=VARCHAR},</if>
            <if test="taoBaoOrderEnd6Num != null">#{taoBaoOrderEnd6Num,jdbcType=VARCHAR},</if>
      <if test="taoBaoNickName != null">#{taoBaoNickName,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.user.UserExtraTaoBaoInfo">update
        yeshi_ec_user_info_extra_taobao set uiet_uid =
        #{user.id,jdbcType=BIGINT},uiet_relation_id =
        #{relationId,jdbcType=VARCHAR},uiet_relation_update_time =
        #{relationUpdateTime,jdbcType=TIMESTAMP},uiet_special_id =
        #{specialId,jdbcType=VARCHAR},uiet_special_update_time =
        #{specialUpdateTime,jdbcType=TIMESTAMP},uiet_create_time =
        #{createTime,jdbcType=TIMESTAMP},uiet_update_time =
        #{updateTime,jdbcType=TIMESTAMP} ,uiet_relation_valid
        =#{relationValid,jdbcType=BOOLEAN} ,uiet_special_valid
        =#{specialValid,jdbcType=BOOLEAN} ,uiet_taobao_uid
        =#{taoBaoUid,jdbcType=VARCHAR},uiet_taobao_order_end_6_num
        =#{taoBaoOrderEnd6Num,jdbcType=VARCHAR}
        where uiet_id =
        #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo">
        update yeshi_ec_user_info_extra_taobao
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo">update yeshi_ec_user_info_extra_taobao set uiet_uid = #{user.id,jdbcType=BIGINT},uiet_relation_id = #{relationId,jdbcType=VARCHAR},uiet_relation_valid = #{relationValid,jdbcType=BOOLEAN},uiet_relation_update_time = #{relationUpdateTime,jdbcType=TIMESTAMP},uiet_special_id = #{specialId,jdbcType=VARCHAR},uiet_special_valid = #{specialValid,jdbcType=BOOLEAN},uiet_special_update_time = #{specialUpdateTime,jdbcType=TIMESTAMP},uiet_taobao_uid = #{taoBaoUid,jdbcType=VARCHAR},uiet_taobao_order_end_6_num = #{taoBaoOrderEnd6Num,jdbcType=VARCHAR},uiet_taobao_nick_name = #{taoBaoNickName,jdbcType=VARCHAR},uiet_create_time = #{createTime,jdbcType=TIMESTAMP},uiet_update_time = #{updateTime,jdbcType=TIMESTAMP} where uiet_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo">update yeshi_ec_user_info_extra_taobao
        <set>
            <if test="user != null">uiet_uid=#{user.id,jdbcType=BIGINT},</if>
            <if test="relationId != null">uiet_relation_id=#{relationId,jdbcType=VARCHAR},</if>
            <if test="relationUpdateTime != null">uiet_relation_update_time=#{relationUpdateTime,jdbcType=TIMESTAMP},
            </if>
      <if test="relationValid != null">uiet_relation_valid=#{relationValid,jdbcType=BOOLEAN},</if>
      <if test="relationUpdateTime != null">uiet_relation_update_time=#{relationUpdateTime,jdbcType=TIMESTAMP},</if>
            <if test="specialId != null">uiet_special_id=#{specialId,jdbcType=VARCHAR},</if>
            <if test="specialUpdateTime != null">uiet_special_update_time=#{specialUpdateTime,jdbcType=TIMESTAMP},
            </if>
      <if test="specialValid != null">uiet_special_valid=#{specialValid,jdbcType=BOOLEAN},</if>
      <if test="specialUpdateTime != null">uiet_special_update_time=#{specialUpdateTime,jdbcType=TIMESTAMP},</if>
      <if test="taoBaoUid != null">uiet_taobao_uid=#{taoBaoUid,jdbcType=VARCHAR},</if>
      <if test="taoBaoOrderEnd6Num != null">uiet_taobao_order_end_6_num=#{taoBaoOrderEnd6Num,jdbcType=VARCHAR},</if>
      <if test="taoBaoNickName != null">uiet_taobao_nick_name=#{taoBaoNickName,jdbcType=VARCHAR},</if>
            <if test="createTime != null">uiet_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">uiet_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="id !=null">uiet_id =#{id,jdbcType=BIGINT},</if>
            <if test="relationValid !=null">uiet_relation_valid =#{relationValid,jdbcType=BOOLEAN},
            </if>
            <if test="specialValid !=null">uiet_special_valid =#{specialValid,jdbcType=BOOLEAN},
            </if>
            <if test="taoBaoUid !=null">uiet_taobao_uid =#{taoBaoUid,jdbcType=VARCHAR},</if>
            <if test="taoBaoOrderEnd6Num !=null">uiet_taobao_order_end_6_num=#{taoBaoOrderEnd6Num,jdbcType=VARCHAR},
            </if>
        </set>
        where uiet_id = #{id,jdbcType=BIGINT}
    </set> where uiet_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="clearUid" parameterType="java.lang.Long">
        update
        yeshi_ec_user_info_extra_taobao set uiet_uid=null where uiet_uid=#{0}
    update yeshi_ec_user_info_extra_taobao set uiet_uid=null where uiet_uid=#{0}
    </update>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserInfoExtraMapper.xml
@@ -10,6 +10,7 @@
    <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_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"/>
    
@@ -30,6 +31,7 @@
    <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_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"/>
    
@@ -41,7 +43,7 @@
          
  </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_create_time,uie_update_time</sql>
  <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_first_login_time,uie_create_time,uie_update_time</sql>
 
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_user_info_extra where uie_id = #{id,jdbcType=BIGINT}
@@ -49,7 +51,7 @@
  
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_info_extra where uie_id = #{id,jdbcType=BIGINT}</delete>
  
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_info_extra (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_create_time,uie_update_time) values (#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{userRank.id,jdbcType=BIGINT},#{rankSource,jdbcType=INTEGER},#{rankOrderNum,jdbcType=INTEGER},#{rankUpdateTime,jdbcType=TIMESTAMP},#{inviteCode,jdbcType=VARCHAR},#{lotteryNewbies,jdbcType=INTEGER},#{couponNews,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_info_extra (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_first_login_time,uie_create_time,uie_update_time) values (#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{userRank.id,jdbcType=BIGINT},#{rankSource,jdbcType=INTEGER},#{rankOrderNum,jdbcType=INTEGER},#{rankUpdateTime,jdbcType=TIMESTAMP},#{inviteCode,jdbcType=VARCHAR},#{lotteryNewbies,jdbcType=INTEGER},#{couponNews,jdbcType=INTEGER},#{firstLoginTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
  
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_info_extra
    <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -62,6 +64,7 @@
      <if test="inviteCode != null">uie_invite_code,</if>
      <if test="lotteryNewbies != null">uie_lottery_newbies,</if>
      <if test="couponNews != null">uie_coupon_news,</if>
      <if test="firstLoginTime != null">uie_first_login_time,</if>
      <if test="createTime != null">uie_create_time,</if>
      <if test="updateTime != null">uie_update_time,</if>
    </trim>values
@@ -75,11 +78,12 @@
      <if test="inviteCode != null">#{inviteCode,jdbcType=VARCHAR},</if>
      <if test="lotteryNewbies != null">#{lotteryNewbies,jdbcType=INTEGER},</if>
      <if test="couponNews != null">#{couponNews,jdbcType=INTEGER},</if>
      <if test="firstLoginTime != null">#{firstLoginTime,jdbcType=TIMESTAMP},</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.UserInfoExtra">update yeshi_ec_user_info_extra set uie_uid = #{userInfo.id,jdbcType=BIGINT},uie_rank_id = #{userRank.id,jdbcType=BIGINT},uie_rank_source = #{rankSource,jdbcType=INTEGER},uie_rank_order_num = #{rankOrderNum,jdbcType=INTEGER},uie_rank_update_time = #{rankUpdateTime,jdbcType=TIMESTAMP},uie_invite_code = #{inviteCode,jdbcType=VARCHAR},uie_lottery_newbies = #{lotteryNewbies,jdbcType=INTEGER},uie_coupon_news = #{couponNews,jdbcType=INTEGER},uie_create_time = #{createTime,jdbcType=TIMESTAMP},uie_update_time = #{updateTime,jdbcType=TIMESTAMP} where uie_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra">update yeshi_ec_user_info_extra set uie_uid = #{userInfo.id,jdbcType=BIGINT},uie_rank_id = #{userRank.id,jdbcType=BIGINT},uie_rank_source = #{rankSource,jdbcType=INTEGER},uie_rank_order_num = #{rankOrderNum,jdbcType=INTEGER},uie_rank_update_time = #{rankUpdateTime,jdbcType=TIMESTAMP},uie_invite_code = #{inviteCode,jdbcType=VARCHAR},uie_lottery_newbies = #{lotteryNewbies,jdbcType=INTEGER},uie_coupon_news = #{couponNews,jdbcType=INTEGER},uie_first_login_time = #{firstLoginTime,jdbcType=TIMESTAMP},uie_create_time = #{createTime,jdbcType=TIMESTAMP},uie_update_time = #{updateTime,jdbcType=TIMESTAMP} where uie_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra">update yeshi_ec_user_info_extra
    <set>
      <if test="userInfo != null">uie_uid=#{userInfo.id,jdbcType=BIGINT},</if>
@@ -90,6 +94,7 @@
      <if test="inviteCode != null">uie_invite_code=#{inviteCode,jdbcType=VARCHAR},</if>
      <if test="lotteryNewbies != null">uie_lottery_newbies=#{lotteryNewbies,jdbcType=INTEGER},</if>
      <if test="couponNews != null">uie_coupon_news=#{couponNews,jdbcType=INTEGER},</if>
      <if test="firstLoginTime != null">uie_first_login_time=#{firstLoginTime,jdbcType=TIMESTAMP},</if>
      <if test="createTime != null">uie_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updateTime != null">uie_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
    </set> where uie_id = #{id,jdbcType=BIGINT}
@@ -105,6 +110,7 @@
      <if test="lotteryNewbies != null">uie_lottery_newbies=#{lotteryNewbies,jdbcType=INTEGER},</if>
      <if test="couponNews != null">uie_coupon_news=#{couponNews,jdbcType=INTEGER},</if>
      <if test="createTime != null">uie_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="firstLoginTime != null">uie_first_login_time=#{firstLoginTime,jdbcType=TIMESTAMP},</if>
      <if test="updateTime != null">uie_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
    </set> where uie_uid = #{userInfo.id,jdbcType=BIGINT}
  </update>
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserInviteRecordMapper.xml
New file
@@ -0,0 +1,57 @@
<?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.UserInviteRecordMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.UserInviteRecord">
    <id column="uir_id" property="id" jdbcType="BIGINT"/>
    <result column="uir_inviter_id" property="inviterId" jdbcType="BIGINT"/>
    <result column="uir_wx_unionid" property="wxUnionid" jdbcType="VARCHAR"/>
    <result column="uir_create_time" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="uir_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
  </resultMap>
  <sql id="Base_Column_List">uir_id,uir_inviter_id,uir_wx_unionid,uir_create_time,uir_update_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_user_invite_record where uir_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_user_invite_record where uir_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserInviteRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_user_invite_record (uir_id,uir_inviter_id,uir_wx_unionid,uir_create_time,uir_update_time) values (#{id,jdbcType=BIGINT},#{inviterId,jdbcType=BIGINT},#{wxUnionid,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInviteRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_user_invite_record
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">uir_id,</if>
      <if test="inviterId != null">uir_inviter_id,</if>
      <if test="wxUnionid != null">uir_wx_unionid,</if>
      <if test="createTime != null">uir_create_time,</if>
      <if test="updateTime != null">uir_update_time,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="inviterId != null">#{inviterId,jdbcType=BIGINT},</if>
      <if test="wxUnionid != null">#{wxUnionid,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.user.UserInviteRecord">update yeshi_user_invite_record set uir_inviter_id = #{inviterId,jdbcType=BIGINT},uir_wx_unionid = #{wxUnionid,jdbcType=VARCHAR},uir_create_time = #{createTime,jdbcType=TIMESTAMP},uir_update_time = #{updateTime,jdbcType=TIMESTAMP} where uir_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInviteRecord">update yeshi_user_invite_record
    <set>
      <if test="inviterId != null">uir_inviter_id=#{inviterId,jdbcType=BIGINT},</if>
      <if test="wxUnionid != null">uir_wx_unionid=#{wxUnionid,jdbcType=VARCHAR},</if>
      <if test="createTime != null">uir_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updateTime != null">uir_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
    </set> where uir_id = #{id,jdbcType=BIGINT}
  </update>
  <select id="getByInviterIdAndUnionid" resultMap="BaseResultMap">
      SELECT * FROM yeshi_user_invite_record d
    WHERE d.`uir_inviter_id` = #{inviterId} AND d.`uir_wx_unionid`= #{wxUnionId}
    LIMIT 1
  </select>
  <select id="getNewestInviterId" resultType="java.lang.Long">
      SELECT uir_inviter_id FROM yeshi_user_invite_record d
    WHERE d.`uir_wx_unionid`= #{wxUnionId}
    ORDER BY d.`uir_update_time` DESC
    LIMIT 1
  </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserLotteryRecordMapper.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.user.UserLotteryRecordMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.UserLotteryRecord">
    <id column="ulr_id" property="id" jdbcType="BIGINT"/>
    <result column="ulr_type" property="type" jdbcType="VARCHAR"/>
    <result column="ulr_uid" property="uid" jdbcType="BIGINT"/>
    <result column="ulr_count" property="count" jdbcType="INTEGER"/>
    <result column="ulr_create_time" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="ulr_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
  </resultMap>
  <sql id="Base_Column_List">ulr_id,ulr_type,ulr_uid,ulr_count,ulr_create_time,ulr_update_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_user_lottery_record where ulr_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_lottery_record where ulr_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserLotteryRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_lottery_record (ulr_id,ulr_type,ulr_uid,ulr_count,ulr_create_time,ulr_update_time) values (#{id,jdbcType=BIGINT},#{type,jdbcType=VARCHAR},#{uid,jdbcType=BIGINT},#{count,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserLotteryRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_lottery_record
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">ulr_id,</if>
      <if test="type != null">ulr_type,</if>
      <if test="uid != null">ulr_uid,</if>
      <if test="count != null">ulr_count,</if>
      <if test="createTime != null">ulr_create_time,</if>
      <if test="updateTime != null">ulr_update_time,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="type != null">#{type,jdbcType=VARCHAR},</if>
      <if test="uid != null">#{uid,jdbcType=BIGINT},</if>
      <if test="count != null">#{count,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.user.UserLotteryRecord">update yeshi_ec_user_lottery_record set ulr_type = #{type,jdbcType=VARCHAR},ulr_uid = #{uid,jdbcType=BIGINT},ulr_count = #{count,jdbcType=INTEGER},ulr_create_time = #{createTime,jdbcType=TIMESTAMP},ulr_update_time = #{updateTime,jdbcType=TIMESTAMP} where ulr_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.UserLotteryRecord">update yeshi_ec_user_lottery_record
    <set>
      <if test="type != null">ulr_type=#{type,jdbcType=VARCHAR},</if>
      <if test="uid != null">ulr_uid=#{uid,jdbcType=BIGINT},</if>
      <if test="count != null">ulr_count=#{count,jdbcType=INTEGER},</if>
      <if test="createTime != null">ulr_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updateTime != null">ulr_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
    </set> where ulr_id = #{id,jdbcType=BIGINT}
  </update>
  <select id="getByTypeAndUid" resultMap="BaseResultMap">
      SELECT * FROM  yeshi_ec_user_lottery_record  t
    WHERE t.`ulr_uid` = #{uid} AND  t.`ulr_type` = #{type}
  </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponMapper.xml
@@ -102,6 +102,12 @@
    WHERE uc.`usc_uid`= #{uid} AND usc_source = #{source}
  </select>
  
  <select id="countTodatyUserCouponBySource" resultType="java.lang.Integer">
    SELECT IFNULL(COUNT(uc.`usc_id`),0) FROM `yeshi_ec_user_system_coupon` uc
    WHERE uc.`usc_uid`= #{uid} AND usc_source = #{source}
         AND TO_DAYS(uc.`usc_create_time`) = TO_DAYS(NOW())
  </select>
  <select id="getUserCouponVOList" resultMap="ResultVOMap">
    SELECT * FROM `yeshi_ec_user_system_coupon` uc
    WHERE uc.`usc_uid`= #{uid}
fanli/src/main/java/com/yeshi/fanli/service/impl/AdminUserServiceImpl.java
@@ -1,15 +1,10 @@
package com.yeshi.fanli.service.impl;
import java.io.Serializable;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.AdminUserDao;
import com.yeshi.fanli.dao.mybatis.AdminUserMapper;
import com.yeshi.fanli.entity.bus.user.ExtractAuditRecord;
import com.yeshi.fanli.entity.common.AdminUser;
import com.yeshi.fanli.service.AdminUserService;
@@ -17,20 +12,13 @@
public class AdminUserServiceImpl implements AdminUserService {
    @Resource
    private AdminUserDao adminUserDao;
    @Resource
    private AdminUserMapper adminUserMapper;
    
    
    public AdminUser login(final String acction, final String pwd) {
        List<AdminUser> list = adminUserDao.list("from AdminUser a where a.account=? and a.pwd=? ",new Serializable[]{acction,pwd});
        if(list.size() > 0){
            return list.get(0);
    public AdminUser login(String acction, String pwd) {
        return adminUserMapper.getByAccountAndPwd(acction, pwd);
        }
        return null;
    }
    
    @Override
    public AdminUser selectByPrimaryKey(Long id){
fanli/src/main/java/com/yeshi/fanli/service/impl/activity/ActivityServiceImpl.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.service.impl.activity;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -8,12 +9,11 @@
import javax.annotation.Resource;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.jsoup.Jsoup;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.yeshi.utils.NumberUtil;
import org.yeshi.utils.entity.FileUploadResult;
import org.yeshi.utils.taobao.TbImgUtil;
@@ -54,6 +54,9 @@
import com.yeshi.fanli.util.factory.CommonGoodsFactory;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@Service
public class ActivityServiceImpl implements ActivityService {
@@ -309,20 +312,33 @@
    @Transactional
    @Override
    public RecommendActivity addShareGoodsRecommendActivity(Long activityUid, String title, List<Long> goodsList,
            boolean top, int shareCount) throws ActivityException {
    public RecommendActivity addShareGoodsRecommendActivity(Long activityUid, List<Long> goodsList,
            RecommendActivity activity) throws ActivityException , Exception{
        if (goodsList == null || goodsList.size() == 0 || goodsList.size() > 9)
            throw new ActivityException(1, "商品数量错误:10>商品数量>0");
        RecommendActivity activity = new RecommendActivity();
        if (StringUtil.isNullOrEmpty(activity.getTitle())) {
            throw new ActivityException(1, "标题不能为空");
        }
        Integer shareCount = activity.getShareCount();
        if (shareCount == null) {
            activity.setShareCount(0);
        }
        Boolean top = activity.getTop();
        if (top == null) {
            activity.setTop(false);
        }
        // 时间转换
        conversionTime(activity);
        activity.setActivityUser(new ActivityUser(activityUid));
        activity.setCreateTime(new Date());
        activity.setGoodsList(null);
        activity.setOrderBy(0);
        activity.setShareCount(shareCount);
        activity.setTitle(title);
        activity.setTop(top);
        activity.setType(RecommendActivity.TYPE_SHARE_GOODS);
        recommendActivityMapper.insertSelective(activity);
@@ -373,18 +389,28 @@
    @Transactional
    @Override
    public RecommendActivity addInviteImgRecommendActivity(Long activityUid, String title, String url, boolean top,
            int shareCount, int px, int py, int erCodeSize) throws ActivityException {
    public RecommendActivity addInviteImgRecommendActivity(Long activityUid, RecommendActivity activity, String url,
             int px, int py, int erCodeSize) throws ActivityException, Exception {
        if (StringUtil.isNullOrEmpty(url))
            throw new ActivityException(1, "图片为空");
        RecommendActivity activity = new RecommendActivity();
        Integer shareCount = activity.getShareCount();
        if (shareCount == null) {
            activity.setShareCount(0);
        }
        Boolean top = activity.getTop();
        if (top == null) {
            activity.setTop(false);
        }
        // 时间转换
        conversionTime(activity);
        activity.setActivityUser(new ActivityUser(activityUid));
        activity.setCreateTime(new Date());
        activity.setGoodsList(null);
        activity.setOrderBy(0);
        activity.setShareCount(shareCount);
        activity.setTitle(title);
        activity.setTop(top);
        activity.setType(RecommendActivity.TYPE_INVITE);
        recommendActivityMapper.insertSelective(activity);
        RecommendActivityImg img = new RecommendActivityImg();
@@ -412,16 +438,26 @@
    @Transactional
    @Override
    public RecommendActivity addTextAndImgRecommendActivity(Long activityUid, String title, List<String> imgList,
            boolean top, int shareCount) throws ActivityException {
        RecommendActivity activity = new RecommendActivity();
    public RecommendActivity addTextAndImgRecommendActivity(Long activityUid,  List<String> imgList,
            RecommendActivity activity) throws ActivityException, Exception {
        Integer shareCount = activity.getShareCount();
        if (shareCount == null) {
            activity.setShareCount(0);
        }
        Boolean top = activity.getTop();
        if (top == null) {
            activity.setTop(false);
        }
        // 时间转换
        conversionTime(activity);
        activity.setActivityUser(new ActivityUser(activityUid));
        activity.setCreateTime(new Date());
        activity.setGoodsList(null);
        activity.setOrderBy(0);
        activity.setShareCount(shareCount);
        activity.setTitle(title);
        activity.setTop(top);
        activity.setType(RecommendActivity.TYPE_TEXTIMG);
        recommendActivityMapper.insertSelective(activity);
        for (String imgUrl : imgList) {
@@ -457,20 +493,32 @@
    @Transactional
    @Override
    public RecommendActivity updateShareGoodsRecommendActivity(Long id, Long activityUid, String title,
            List<Long> goodsList, boolean top, int shareCount) throws ActivityException {
    public RecommendActivity updateShareGoodsRecommendActivity(Long activityUid,
            List<Long> goodsList, RecommendActivity activity) throws ActivityException , Exception{
        if (goodsList == null || goodsList.size() == 0 || goodsList.size() > 9)
            throw new ActivityException(1, "商品数量错误:10>商品数量>0");
        // 删除之前的商品
        recommendActivityTaoBaoGoodsMapper.batchDeleteByActivityid(new long[] { id });
        RecommendActivity activity = new RecommendActivity();
        activity.setId(id);
        recommendActivityTaoBaoGoodsMapper.batchDeleteByActivityid(new long[] { activity.getId() });
        activity.setActivityUser(new ActivityUser(activityUid));
        activity.setGoodsList(null);
        activity.setOrderBy(0);
        activity.setShareCount(shareCount);
        activity.setTitle(title);
        activity.setTop(top);
        Integer shareCount = activity.getShareCount();
        if (shareCount == null) {
            activity.setShareCount(0);
        }
        Boolean top = activity.getTop();
        if (top == null) {
            activity.setTop(false);
        }
        // 时间转换
        conversionTime(activity);
        activity.setType(RecommendActivity.TYPE_SHARE_GOODS);
        recommendActivityMapper.updateByPrimaryKeySelective(activity);
@@ -512,17 +560,26 @@
    @Transactional
    @Override
    public RecommendActivity updateInviteImgRecommendActivity(Long id, Long activityUid, String title, String url,
            boolean top, int shareCount, int px, int py, int erCodeSize) throws ActivityException {
        recommendActivityImgMapper.batchDeleteByActivityid(new long[] { id });
        RecommendActivity activity = new RecommendActivity();
        activity.setId(id);
    public RecommendActivity updateInviteImgRecommendActivity(Long activityUid, RecommendActivity activity, String url,
            int px, int py, int erCodeSize) throws ActivityException , Exception{
        recommendActivityImgMapper.batchDeleteByActivityid(new long[] { activity.getId() });
        Integer shareCount = activity.getShareCount();
        if (shareCount == null) {
            activity.setShareCount(0);
        }
        Boolean top = activity.getTop();
        if (top == null) {
            activity.setTop(false);
        }
        // 时间转换
        conversionTime(activity);
        activity.setActivityUser(new ActivityUser(activityUid));
        activity.setGoodsList(null);
        activity.setOrderBy(0);
        activity.setShareCount(shareCount);
        activity.setTitle(title);
        activity.setTop(top);
        activity.setType(RecommendActivity.TYPE_INVITE);
        recommendActivityMapper.updateByPrimaryKeySelective(activity);
        RecommendActivityImg img = new RecommendActivityImg();
@@ -555,17 +612,25 @@
    @Transactional
    @Override
    public RecommendActivity updateTextAndImgRecommendActivity(Long id, Long activityUid, String title,
            List<String> imgList, boolean top, int shareCount) throws ActivityException {
        recommendActivityImgMapper.batchDeleteByActivityid(new long[] { id });
        RecommendActivity activity = new RecommendActivity();
        activity.setId(id);
    public RecommendActivity updateTextAndImgRecommendActivity(Long activityUid, List<String> imgList,
            RecommendActivity activity) throws ActivityException , Exception{
        recommendActivityImgMapper.batchDeleteByActivityid(new long[] { activity.getId() });
        Integer shareCount = activity.getShareCount();
        if (shareCount == null) {
            activity.setShareCount(0);
        }
        Boolean top = activity.getTop();
        if (top == null) {
            activity.setTop(false);
        }
        // 时间转换
        conversionTime(activity);
        activity.setActivityUser(new ActivityUser(activityUid));
        activity.setGoodsList(null);
        activity.setOrderBy(0);
        activity.setShareCount(shareCount);
        activity.setTitle(title);
        activity.setTop(top);
        activity.setType(RecommendActivity.TYPE_TEXTIMG);
        recommendActivityMapper.updateByPrimaryKeySelective(activity);
        for (String imgUrl : imgList) {
@@ -594,12 +659,32 @@
    @Override
    public List<RecommendActivity> getRecommendActivityListCache(int page, int pageSize) {
        List<RecommendActivity> activityList = getRecommendActivityList(page, pageSize);
        if (activityList != null)
        if (activityList != null) {
            for (RecommendActivity activity : activityList) {
                if (activity != null && activity.getGoodsList() != null)
                if (activity != null && activity.getGoodsList() != null) {
                    for (RecommendActivityTaoBaoGoods goods : activity.getGoodsList()) {
                        goods.setQuanPrice(goods.getDesc().replace("券后价:¥", ""));
                    }
                }
                // 过滤一遍
                if (!StringUtil.isNullOrEmpty(activity.getTitle())) {
                    activity.setTitle(Jsoup.parse(activity.getTitle()).text());
                    if (activity.getShareCount() >= 10000) {
                        activity.setShareCountShow(NumberUtil.get1PointNumber(activity.getShareCount() / 10000.0) + "万");
                    } else {
                        activity.setShareCountShow(activity.getShareCount() + "");
                    }
                }
                Date startTime = activity.getStartTime();
                if (startTime != null) {
                    activity.setCreateTime(startTime);
                }
            }
            }
        return activityList;
    }
@@ -607,7 +692,7 @@
    @Cacheable(value = "activityCache", key = "'getRecommendActivityCount'")
    @Override
    public long getRecommendActivityCountCache() {
        return getRecommendActivityCount();
        return recommendActivityMapper.getRecommendActivityEffectiveCount();
    }
    @Transactional
@@ -738,4 +823,35 @@
                recommendActivityTaoBaoGoodsMapper.updateByPrimaryKeySelective(updateGoods);
            }
    }
    /**
     * web段时间转换
     * @param record
     */
    public void conversionTime(RecommendActivity record) throws ActivityException, Exception {
        // 是否时间控制
        if(!record.isTimeTask()) {
            record.setStartTime(null);
            record.setEndTime(null);
        } else {
            String startTime_str = record.getStartTime_str();
            String endTime_str = record.getEndTime_str();
            if ((startTime_str == null|| startTime_str.trim().length() == 0)
                    && (endTime_str == null || endTime_str.trim().length() == 0)) {
                throw new ActivityException(1, "请输入控制时间");
            } else {
                SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
                if (startTime_str != null && startTime_str.trim().length() > 0) {
                    startTime_str = startTime_str.replaceAll("T", " ");
                    record.setStartTime(format.parse(startTime_str));
                }
                if (endTime_str != null && endTime_str.trim().length() > 0) {
                    endTime_str = endTime_str.replaceAll("T", " ");
                    record.setEndTime(format.parse(endTime_str));
                }
            }
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/config/CustomerContentServiceImpl.java
New file
@@ -0,0 +1,37 @@
package com.yeshi.fanli.service.impl.config;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.CustomerContentMapper;
import com.yeshi.fanli.entity.system.CustomerContent;
import com.yeshi.fanli.service.inter.config.CustomerContentService;
import com.yeshi.fanli.util.Constant;
@Service
public class CustomerContentServiceImpl implements CustomerContentService {
    @Resource
    private CustomerContentMapper customerContentMapper;
    @Override
    public List<CustomerContent> getSecondProblemList(int index, String key, long id) {
        return customerContentMapper.listByCnidAndTitle(index * Constant.PAGE_SIZE, Constant.PAGE_SIZE, id, key);
    }
    @Override
    public CustomerContent getCustomerContent(long id) {
        return customerContentMapper.selectByPrimaryKey(id);
    }
    @Override
    public List<CustomerContent> contactCustomerService(String title) {
        return customerContentMapper.contactCustomerService(title);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/config/CustomerNameServiceImpl.java
New file
@@ -0,0 +1,25 @@
package com.yeshi.fanli.service.impl.config;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.CustomerNameMapper;
import com.yeshi.fanli.entity.system.CustomerName;
import com.yeshi.fanli.service.inter.config.CustomerNameService;
import com.yeshi.fanli.util.Constant;
@Service
public class CustomerNameServiceImpl implements CustomerNameService {
    @Resource
    private CustomerNameMapper customerNameMapper;
    @Override
    public List<CustomerName> customerNameList(int page, String key, int type) {
         return customerNameMapper.listByTypeAndName(page * Constant.PAGE_SIZE, Constant.PAGE_SIZE, type, key);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/config/SystemClientParamsServiceImpl.java
@@ -1,362 +1,50 @@
package com.yeshi.fanli.service.impl.config;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.orm.hibernate4.HibernateCallback;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.yeshi.fanli.dao.config.SystemClientParamsDao;
import com.yeshi.fanli.dao.config.SystemHelpListDao;
import com.yeshi.fanli.dao.config.SystemSecondProblemDao;
import com.yeshi.fanli.dao.mybatis.SystemClientParamsMapper;
import com.yeshi.fanli.entity.admin.SystemClientParamsAdmin;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.entity.system.CustomerContent;
import com.yeshi.fanli.entity.system.CustomerName;
import com.yeshi.fanli.entity.system.SystemClientParams;
import com.yeshi.fanli.service.inter.config.BusinessSystemService;
import com.yeshi.fanli.service.inter.config.SystemClientParamsService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
@Service
public class SystemClientParamsServiceImpl implements SystemClientParamsService {
    @Resource
    private SystemClientParamsDao systemClientParamsDao;
    @Resource
    private SystemClientParamsMapper systemClientParamsMapper;
    
    @Resource
    private SystemHelpListDao systemHelpListDao;
    
    @Resource
    private BusinessSystemService businessSystemService;
    @Resource
    private SystemSecondProblemDao systemSecondProblemDao;
    @Cacheable(value = "clientParamCache", key = "#id")
    public List<SystemClientParams> getSystemClientParamsBySystemId(long id) {
        return systemClientParamsDao.list("from SystemClientParams scp where scp.system.id=?",
                new Serializable[] { id });
    @Cacheable(value = "clientParamCache", key = "#systemId+'-'+#version")
    public List<SystemClientParams> getSystemClientParamsBySystemId(long systemId, int version) {
        return systemClientParamsMapper.listBySystemId(systemId);
    }
    
    @Cacheable(value = "clientParamCache", key = "#id+'-'+#version")
    public List<SystemClientParams> getSystemClientParamsBySystemId(long id,int version) {
        return systemClientParamsDao.list("from SystemClientParams scp where scp.system.id=?",
                new Serializable[] { id });
    }
    public List<SystemClientParamsAdmin> getAdminList(BusinessSystem system, String key) {
        List<SystemClientParams> list;
        List<SystemClientParamsAdmin> adminList = new ArrayList<SystemClientParamsAdmin>();
        if (system == null) {
            list = systemClientParamsDao.list("from SystemClientParams scp where scp.name like ? ",
                    new Serializable[] { "%" + key + "%" });
        } else {
            list = systemClientParamsDao.list(
                    "from SystemClientParams scp where scp.system.id = ? and scp.name like ? ",
                    new Serializable[] { system.getId(), "%" + key + "%" });
            StringBuffer hqlb = new StringBuffer("from SystemClientParams scp ");
            int ii = 0;
            if (list.size() > 0) {
                for (SystemClientParams scp : list) {
                    if (ii == 0) {
                        hqlb.append(" where ( scp.name = '" + scp.getName() + "'  and scp.key = '" + scp.getKey()
                                + "' and scp.value = '" + scp.getValue() + "' ) ");
                    } else {
                        hqlb.append(" or ( scp.name = '" + scp.getName() + "'  and scp.key = '" + scp.getKey()
                                + "' and scp.value = '" + scp.getValue() + "' ) ");
                    }
                    ii++;
                }
                list = systemClientParamsDao.list(hqlb.toString());
            }
        }
        SystemClientParamsAdmin scpa = null;
        for (SystemClientParams scp : list) {
            scpa = new SystemClientParamsAdmin(scp);
            if (adminList.contains(scpa)) {
                int indexof = adminList.indexOf(scpa);
                SystemClientParamsAdmin systemClientParamsAdmin = adminList.get(indexof);
                systemClientParamsAdmin.getSystemList().add(scp.getSystem());
            } else {
                scpa.getSystemList().add(scp.getSystem());
                adminList.add(scpa);
            }
        }
        return adminList;
    }
    @Transactional
    public void addSystemClientParamsList(SystemClientParams scp, List<BusinessSystem> list) throws Exception {
        SystemClientParams nscp = null;
        for (BusinessSystem system : list) {
            nscp = new SystemClientParams();
            nscp.setKey(scp.getKey());
            nscp.setName(scp.getName());
            nscp.setValue(scp.getValue());
            nscp.setSystem(system);
            nscp.setUpdatetime(java.lang.System.currentTimeMillis());
            systemClientParamsDao.create(nscp);
        }
    }
    @Transactional
    public void deleteSystemClientParams(final SystemClientParams scp, final BusinessSystem system) {
        systemClientParamsDao.excute(new HibernateCallback() {
            public Object doInHibernate(Session session) throws HibernateException {
                Query query = session.createQuery(
                        "delete from SystemClientParams scp where scp.name = ? and scp.key =? and scp.value = ? and scp.system.id = ?");
                query.setParameter(0, scp.getName());
                query.setParameter(1, scp.getKey());
                query.setParameter(2, scp.getValue());
                query.setParameter(3, system.getId());
                return query.executeUpdate();
            }
        });
    }
    public void addSystemClientParams(SystemClientParams scp, BusinessSystem system) {
        scp.setSystem(system);
        systemClientParamsDao.create(scp);
    }
    @Transactional
    public void deleteSystemClientParams(final SystemClientParams scp) {
        systemClientParamsDao.excute(new HibernateCallback() {
            public Object doInHibernate(Session session) throws HibernateException {
                Query query = session.createQuery(
                        "delete from SystemClientParams scp where scp.name=? and scp.key = ?  and scp.value = ? ");
                query.setParameter(0, scp.getName());
                query.setParameter(1, scp.getKey());
                query.setParameter(2, scp.getValue());
                return query.executeUpdate();
            }
        });
    }
    public SystemClientParamsAdmin getSystemClientParamsAdmin(final SystemClientParams scp) {
        return (SystemClientParamsAdmin) systemClientParamsDao.excute(new HibernateCallback<SystemClientParamsAdmin>() {
            public SystemClientParamsAdmin doInHibernate(Session session) throws HibernateException {
                Query query = session
                        .createQuery("from SystemClientParams s where s.key = ?");
                query.setParameter(0, scp.getKey());
                List<SystemClientParams> list = query.list();
                SystemClientParamsAdmin scpa = new SystemClientParamsAdmin(scp);
                for (SystemClientParams fscp : list) {
                    BusinessSystem system = fscp.getSystem();
                    if (scpa.getSystemList().contains(system)) {
                        continue;
                    }
                    scpa.getSystemList().add(fscp.getSystem());
                    scpa.setSystemClientParams(fscp);
                }
                return scpa;
            }
        });
    }
    @Transactional
    public void update(final SystemClientParams oscp, final SystemClientParams nscp) {
        systemClientParamsDao.excute(new HibernateCallback() {
            public Object doInHibernate(Session session) throws HibernateException {
                Query query = session.createQuery(
                        "update SystemClientParams s set s.name=? , s.key=? , s.value=? where s.name=? and s.key = ? ");
                query.setParameter(0, nscp.getName());
                query.setParameter(1, nscp.getKey());
                query.setParameter(2, nscp.getValue());
                query.setParameter(3, oscp.getName());
                query.setParameter(4, oscp.getKey());
                return query.executeUpdate();
            }
        });
    }
    @Override
    public SystemClientParams getSystemClientParamsBySystemAndKey(BusinessSystem system, String key) {
        List<SystemClientParams> list = systemClientParamsDao.list(
                "from SystemClientParams scp where scp.system.id=? and scp.key=?",
                new Serializable[] { system.getId(), key });
        if (list == null || list.size() == 0)
            return null;
        else
            return list.get(0);
    }
    @Override
    public Integer getCount(int type) {
        return systemClientParamsMapper.getCount(type);
    }
    @Override
    public List<CustomerName> customerNameList(int page, String key, int type) {
        int start = page * Constant.PAGE_SIZE;
        return systemHelpListDao.list(
            "from CustomerName cn where cn.type = ? and cn.name like ? order by cn.createTime asc", start,
            Constant.PAGE_SIZE, new Serializable[] {type, "%"+key+"%"});
    }
    @Override
    public void deleteHelp(long id) {
        systemHelpListDao.excute(new HibernateCallback() {
            public Object doInHibernate(Session session)
                                throws HibernateException {
                Query query = session.createQuery("delete from CustomerName cn where cn.id = ?");
                query.setParameter(0, id);
                query.executeUpdate();
        if (system == null) {
                return null;
            }
        });
        return systemClientParamsMapper.getSystemClientParamsBySystemAndKey(system.getId(), key);
    }
    
    @Override
    public CustomerName getHelpCenter(int type) {
        return systemClientParamsMapper.getHelpCenter(type);
    }
    @Override
    public Integer getProblemCount(long id) {
        return systemClientParamsMapper.getProblemCount(id);
    }
    @Override
    public List<CustomerContent> getSecondProblemList(int index, String key, long id) {
        int start = index * Constant.PAGE_SIZE;
        return systemSecondProblemDao.list(
                "from CustomerContent cc where cc.cnId = ? and cc.title like ? order by cc.createTime asc", start,
                Constant.PAGE_SIZE, new Serializable[] {id, "%"+key+"%"});
    }
    @Override
    public void deleteSecondProblem(long id) {
        systemSecondProblemDao.excute(new HibernateCallback() {
            public Object doInHibernate(Session session)
                                throws HibernateException {
                Query query = session.createQuery("delete from CustomerContent cc where cc.id = ?");
                query.setParameter(0, id);
                query.executeUpdate();
                return null;
            }
        });
    }
    @Override
    public CustomerContent getCustomerContent(long id) {
        return systemSecondProblemDao.find(CustomerContent.class, id);
    }
    @Override
    public void updateAnswerDetail(CustomerContent customerContent) {
        CustomerContent find = systemSecondProblemDao.find(CustomerContent.class, customerContent.getId());
        if(find == null ){
            return;
        }
        find.setTitle(customerContent.getTitle());
        find.setContent(customerContent.getContent());
        systemSecondProblemDao.update(find);
    }
    @Override
    public void addFirstMenu(CustomerName customerName, int type) {
        customerName.setName(customerName.getName());
        customerName.setCreateTime(new Date());
        customerName.setType(type);
        systemHelpListDao.save(customerName);
    }
    @Override
    public void addSecondMenu(CustomerContent customerContent, long cnId) {
        customerContent.setCnId(cnId);
        customerContent.setTitle(customerContent.getTitle());
        customerContent.setContent(customerContent.getContent());
        customerContent.setCreateTime(new Date());
        systemSecondProblemDao.save(customerContent);
    }
    @Override
    public List<CustomerContent> contactCustomerService(String title) {
        return systemClientParamsMapper.contactCustomerService(title);
    }
    
    @Override
    public List<SystemClientParams> listQuery(int start, int count, String key, Long systemId) {
        List<SystemClientParams> list = null;
        if (systemId == null) {
            if (StringUtil.isNullOrEmpty(key)) {
                list = systemClientParamsDao.list("from SystemClientParams scp", start, count, null);
            } else {
                list = systemClientParamsDao.list("from SystemClientParams scp where (scp.name like ? or scp.key like ?) ",
                        start, count, new Serializable[] { "%" + key + "%" ,"%" + key + "%"});
            }
        } else {
            if (StringUtil.isNullOrEmpty(key)) {
                list = systemClientParamsDao.list("from SystemClientParams scp where scp.system.id = ? ",
                        start, count, new Serializable[] {systemId});
            } else {
                list = systemClientParamsDao.list(
                        "from SystemClientParams scp where scp.system.id = ? and (scp.name like ? or scp.key like ?)",
                        start, count, new Serializable[] {systemId, "%" + key + "%" ,"%" + key + "%"});
            }
        }
        return list;
        return systemClientParamsMapper.listQuery(start, count, systemId, key);
    }
    
    @Override
    public long countQuery(String key, Long systemId) {
        if (systemId == null) {
            if (StringUtil.isNullOrEmpty(key)) {
                return systemClientParamsDao.getCount(" select count(id) from SystemClientParams scp");
            } else {
                return systemClientParamsDao.getCount(" select count(id) from SystemClientParams scp where (scp.name like ? or scp.key like ?) ",
                        new Serializable[] { "%" + key + "%" ,"%" + key + "%"});
            }
        } else {
            if (StringUtil.isNullOrEmpty(key)) {
                return systemClientParamsDao.getCount(" select count(id) from SystemClientParams scp where scp.system.id = ? ",
                         new Serializable[] {systemId});
            } else {
                return systemClientParamsDao.getCount(
                        " select count(id) from SystemClientParams scp where scp.system.id = ? and (scp.name like ? or scp.key like ?)",
                        new Serializable[] {systemId, "%" + key + "%" ,"%" + key + "%"});
            }
        }
        return systemClientParamsMapper.countQuery(systemId, key);
    }
    
    
@@ -377,32 +65,26 @@
            nscp.setValue(scp.getValue());
            nscp.setSystem(system);
            nscp.setUpdatetime(java.lang.System.currentTimeMillis());
            systemClientParamsDao.create(nscp);
            systemClientParamsMapper.insertSelective(nscp);
        }
    }
    
    @Override
    public void update(SystemClientParams systemClientParams) {
        systemClientParamsDao.update(systemClientParams);
        systemClientParamsMapper.updateByPrimaryKeySelective(systemClientParams);
    }
    
    @Override
    public List<SystemClientParams> getById(long id) {
        return systemClientParamsDao.list("from SystemClientParams scp where scp.id=?",
                new Serializable[] { id });
    public  SystemClientParams selectByPrimaryKey(long id) {
        return systemClientParamsMapper.selectByPrimaryKey(id);
    }
    
    @Transactional
    @Override
    public void deleteBatchByPrimaryKey(List<Long> ids) {
        for (Long id: ids) {
            systemClientParamsDao.excute(new HibernateCallback() {
                public Object doInHibernate(Session session) throws HibernateException {
                    Query query = session.createQuery("delete from SystemClientParams scp where scp.id= ?");
                    query.setParameter(0, id);
                    return query.executeUpdate();
                }
            });
            systemClientParamsMapper.deleteByPrimaryKey(id);
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/config/SystemConfigServiceImpl.java
@@ -1,149 +1,41 @@
package com.yeshi.fanli.service.impl.config;
import java.io.Serializable;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.annotation.Resource;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.config.SystemConfigDao;
import com.yeshi.fanli.dao.mybatis.SystemConfigMapper;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.entity.system.SystemConfig;
import com.yeshi.fanli.exception.NotExistObjectException;
import com.yeshi.fanli.service.inter.config.BusinessSystemService;
import com.yeshi.fanli.service.inter.config.SystemConfigService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.Utils;
@Service
public class SystemConfigServiceImpl implements SystemConfigService{
    @Resource
    private SystemConfigDao systemConfigDao;
    private SystemConfigMapper systemConfigMapper;
    
    @Resource
    private BusinessSystemService businessSystemService;
    
    public int getCount(BusinessSystem system,String key) {
        Long lcount;
        if(system!=null){
            lcount = systemConfigDao.getCount("select count(sc.id) from SystemConfig sc left join sc.systems s  where s.id=? and sc.name like ?",new Serializable[]{system.getId(),"%"+key+"%"});
        }else{
            lcount = systemConfigDao.getCount("select count(sc.id) from SystemConfig sc where sc.name like ?",new Serializable[]{"%"+key+"%"});
        }
        return lcount.intValue();
    }
    public List<SystemConfig> getSystemConfigList(int index,BusinessSystem system, String key) {
        int start =index * Constant.PAGE_SIZE;
        List<SystemConfig> list;
        if(system != null){
            list = systemConfigDao.list("from SystemConfig sc left outer join fetch sc.systems s where s.id = ? and sc.name like ?",start,Constant.PAGE_SIZE,new Serializable[]{system.getId(),"%"+key+"%"});
            StringBuffer hql=new StringBuffer("from SystemConfig sc ");
            Serializable[] params = new Serializable[list.size()];
            int ii=0;
            for (SystemConfig sc : list) {
                if(ii==0){
                    hql.append(" where sc. id = ? ");
                }else{
                    hql.append(" or sc. id = ? ");
                }
                params[ii]=sc.getId();
                ii++;
            }
            list=systemConfigDao.list(hql.toString(),params);
        }else{
            list = systemConfigDao.list("from SystemConfig sc where sc.name like ?",start,Constant.PAGE_SIZE,new Serializable[]{"%"+key+"%"});
        }
        return list;
    }
    public void addSystemConfig(SystemConfig sc) {
        Set<BusinessSystem> systems = sc.getSystems();
        Set<BusinessSystem> newSystems=new HashSet<BusinessSystem>();
        for (BusinessSystem system : systems) {
            String platform = Utils.getMap().get(String.valueOf(system.getPlatform()));
            String packages = system.getPackageName();
            BusinessSystem find = businessSystemService.getBusinessSystem(platform, packages);
            if(find != null){
                newSystems.add(find);
            }
        }
        sc.setSystems(newSystems);
        sc.setUpdatetime(java.lang.System.currentTimeMillis());
        systemConfigDao.save(sc);
    }
    public void deleteSystem(long id, BusinessSystem system) throws NotExistObjectException {
        SystemConfig find = systemConfigDao.find(SystemConfig.class, id);
        if(find==null){
            throw new NotExistObjectException("不存在该子系统");
        }
        find.getSystems().remove(system);
        find.setUpdatetime(java.lang.System.currentTimeMillis());
        systemConfigDao.update(find);
    }
    public void addSystem(long id, BusinessSystem system) throws NotExistObjectException {
        SystemConfig find = systemConfigDao.find(SystemConfig.class, id);
        if(find==null){
            throw new NotExistObjectException("不存在该子系统");
        }
        find.getSystems().add(system);
        find.setUpdatetime(java.lang.System.currentTimeMillis());
        systemConfigDao.update(find);
    }
    public SystemConfig getSystemConfig(long id) {
        return systemConfigDao.find(SystemConfig.class, id);
    }
    public void updateSystemConfig(SystemConfig sc) throws NotExistObjectException {
        SystemConfig find = systemConfigDao.find(SystemConfig.class, sc.getId());
        if(find==null){
            throw new NotExistObjectException("不存在该对象");
        }
        sc.setUpdatetime(java.lang.System.currentTimeMillis());
        Set<BusinessSystem> newSystems=new HashSet<BusinessSystem>();
        Set<BusinessSystem> systems = sc.getSystems();
        for (BusinessSystem system : systems) {
            String platform = Utils.getMap().get(String.valueOf(system.getPlatform()));
            String packages = system.getPackageName();
            BusinessSystem sfind = businessSystemService.getBusinessSystem(platform, packages);
            if(sfind != null){
                newSystems.add(sfind);
            }
        }
        sc.setSystems(newSystems);
        systemConfigDao.update(sc);
    }
    public void deleteSystemConfig(long id) {
        systemConfigDao.delete(new SystemConfig(id));
    }
    @Cacheable(value={"childSystemCache"}, key="#p0")
    public String get(String sigkey) throws NotExistObjectException {
        List<SystemConfig> list = systemConfigDao.list("from SystemConfig sc where sc.key = ?", new Serializable[]{sigkey});
        if(list.size() ==0 ){
         SystemConfig systemConfig = systemConfigMapper.getByKey(sigkey);
         if(systemConfig == null ){
            throw new NotExistObjectException("不存在该参数"); 
        }
        return list.get(0).getValue();
        return systemConfig.getValue();
    }
    @Cacheable(value={"childSystemCache"}, key="#p0+#system.id")
    public String get(String key, BusinessSystem system) {
        if(system==null || system.getId()==0){
            return "";
        }
        List<SystemConfig> list = systemConfigDao.list("select sc from SystemConfig sc join sc.systems syss where sc.key = ? and syss.id=?", new Serializable[]{key,system.getId()});
        if(list.size() != 0){
            return list.get(0).getValue();
        SystemConfig systemConfig = systemConfigMapper.getByKeyAndSystemId(key, system.getId());
        if(systemConfig != null){;
            return systemConfig.getValue();
        }
        return "";
    }
fanli/src/main/java/com/yeshi/fanli/service/impl/count/CommonOrderCountServiceImpl.java
@@ -239,17 +239,4 @@
        return countOrderNumberBySettleTime(uid, 2, 4); // 根据
    }
    
    @Override
    public boolean hasRebateAndShareOrder(Long uid) {
        boolean has = false;
        long count = commonOrderCountMapper.countValidOrder(uid);
        if (count > 0) {
            has = true;
        }
        return has;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsClassServiceImpl.java
@@ -1,464 +1,57 @@
package com.yeshi.fanli.service.impl.goods;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.net.URLEncoder;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.UUID;
import javax.annotation.Resource;
import javax.transaction.Transactional;
import org.apache.commons.beanutils.PropertyUtils;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.orm.hibernate4.HibernateCallback;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import org.yeshi.utils.tencentcloud.COSManager;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.yeshi.fanli.dao.goods.GoodsClassDao;
import com.yeshi.fanli.dao.mybatis.GoodsClassMapper;
import com.yeshi.fanli.dao.mybatis.lable.LabelClassMapper;
import com.yeshi.fanli.entity.admin.GoodsClassAdmin;
import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
import com.yeshi.fanli.entity.bus.clazz.GoodsSubClass;
import com.yeshi.fanli.entity.bus.su.clazz.SuperGoodsClass;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.service.inter.config.BusinessSystemService;
import com.yeshi.fanli.exception.GoodsClassException;
import com.yeshi.fanli.service.inter.goods.GoodsClassService;
import com.yeshi.fanli.service.inter.goods.GoodsSecondClassService;
import com.yeshi.fanli.service.inter.goods.GoodsSubClassService;
import com.yeshi.fanli.service.inter.goods.SuperGoodsClassService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.service.inter.lable.LabelClassService;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.Utils;
@Service
public class GoodsClassServiceImpl implements GoodsClassService {
    @Resource
    private GoodsClassDao goodsClassDao;
    @Resource
    private BusinessSystemService businessSystemService;
    @Resource
    private SuperGoodsClassService superGoodsClassService;
    @Resource
    private GoodsSecondClassService goodsSecondClassService;
    @Resource
    private GoodsClassMapper goodsClassMapper;
    @Resource
    private LabelClassMapper labelClassMapper;
    
    @Resource
    private GoodsSubClassService goodsSubClassService;
    
    @Resource
    private LabelClassService labelClassService;
    public GoodsClass getGoodsClass(long gcid) {
        return goodsClassDao.find(GoodsClass.class, gcid);
    public GoodsClass getGoodsClass(long id) {
        return goodsClassMapper.selectByPrimaryKey(id);
    }
    @Override
    public void deleteGoodsClass(final long id) {
        goodsClassDao.excute(new HibernateCallback() {
                public Object doInHibernate(Session session)
                        throws HibernateException {
                    Query query = session.createQuery("delete from GoodsClass  where  id = ? ");
                    query.setParameter(0, id);
                    query.executeUpdate();
                    return null;
                }
            });
    public int updateByPrimaryKey(GoodsClass record) {
        return goodsClassMapper.updateByPrimaryKey(record);
    }
    
    @Override
    @SuppressWarnings("unchecked")
    public List<GoodsClass> getByorderby(int orderby) {
        List<GoodsClass> goodsClassList = (List<GoodsClass>) goodsClassDao.excute(new HibernateCallback<List<GoodsClass>>() {
            public List<GoodsClass> doInHibernate(Session session) throws HibernateException {
                Query query = session.createQuery(" from GoodsClass rs where rs.orderby = ? ");
                query.setParameter(0, orderby);
                return query.list();
            }
        });
        return goodsClassList;
    }
    @SuppressWarnings("unchecked")
    public List<GoodsClassAdmin> getGoodsClassAdmins(int index, String platform, String packages, String key) {
        final int strat = index * Constant.PAGE_SIZE;
        platform = Utils.getMap().get(platform);
        BusinessSystem system = businessSystemService.getBusinessSystem(platform, packages);
        List<GoodsClass> GoodsClassList = null;
        List<SuperGoodsClass> superGoodsClassList = null;
        Map<Long, GoodsClassAdmin> goodsClassAdminMap = new HashMap<Long, GoodsClassAdmin>();
        List<GoodsClassAdmin> goodsClassAdmin = new ArrayList<GoodsClassAdmin>();
        if (system == null) {
            final String likekey = "%" + key + "%";
            GoodsClassList = (List<GoodsClass>) goodsClassDao.excute(new HibernateCallback<List<GoodsClass>>() {
                public List<GoodsClass> doInHibernate(Session session) throws HibernateException {
                    Query query = session.createQuery(" from GoodsClass rs where rs.name like ? ");
                    query.setFirstResult(strat);
                    query.setMaxResults(Constant.PAGE_SIZE);
                    query.setParameter(0, likekey);
                    return query.list();
                }
            });
            List<Long> gcIdList = new ArrayList<Long>();
            for (GoodsClass rs : GoodsClassList) {
                gcIdList.add(rs.getId());
            }
            superGoodsClassList = superGoodsClassService.getSuperGoodsClasss(gcIdList);
            Map<Long, List<BusinessSystem>> superMap = new HashMap<Long, List<BusinessSystem>>();
            Long rsId = null;
            List<BusinessSystem> systemList = null;
            for (SuperGoodsClass srs : superGoodsClassList) {
                rsId = srs.getGoodsClass().getId();
                systemList = superMap.get(rsId);
                if (systemList == null) {
                    systemList = new ArrayList<BusinessSystem>();
                }
                systemList.add(srs.getSystem());
                superMap.put(rsId, systemList);
            }
            GoodsClassAdmin rsa = null;
            for (GoodsClass GoodsClass : GoodsClassList) {
                long id = GoodsClass.getId();
                rsa = goodsClassAdminMap.get(id);
                if (rsa == null) {
                    rsa = new GoodsClassAdmin();
                }
                List<BusinessSystem> list = superMap.get(id);
                if (list != null) {
                    rsa.getSystemList().addAll(superMap.get(id));
                }
                rsa.setGoodsClass(GoodsClass);
                goodsClassAdminMap.put(id, rsa);
            }
        } else if (system != null) {
            String likekey = "%" + key + "%";
            superGoodsClassList = superGoodsClassService.getSuperGoodsClassList(system.getId(), strat,
                    Constant.PAGE_SIZE, likekey);
            List<Long> gcIdList = new ArrayList<Long>();
            for (SuperGoodsClass superGoodsClass : superGoodsClassList) {
                GoodsClass GoodsClass = superGoodsClass.getGoodsClass();
                gcIdList.add(GoodsClass.getId());
            }
            superGoodsClassList = superGoodsClassService.getSuperGoodsClasss(gcIdList);
            GoodsClassAdmin rsa = null;
            for (SuperGoodsClass superGoodsClass : superGoodsClassList) {
                GoodsClass goodsClass = superGoodsClass.getGoodsClass();
                rsa = goodsClassAdminMap.get(goodsClass.getId());
                if (rsa == null) {
                    rsa = new GoodsClassAdmin(goodsClass);
                }
                rsa.getSystemList().add(superGoodsClass.getSystem());
                goodsClassAdminMap.put(goodsClass.getId(), rsa);
            }
        }
        Map map = Utils.orderBy(goodsClassAdminMap);
        Collection<GoodsClassAdmin> values = map.values();
        goodsClassAdmin.addAll(values);
        return goodsClassAdmin;
    }
    public int getCount(String platform, String packages, final String key) {
        platform = Utils.getMap().get(platform);
        final BusinessSystem system = businessSystemService.getBusinessSystem(platform, packages);
        return (Integer) goodsClassDao.excute(new HibernateCallback<Integer>() {
            public Integer doInHibernate(Session session) throws HibernateException {
                String k = "%" + key + "%";
                if (system == null) {
                    // Query query = session.createSQLQuery("select
                    // count(a.name) from (select `name` from yeshi_ec_class
                    // where `name` like ?) a");
                    Query query = session.createQuery("select count(gc.id) from GoodsClass gc where gc.name like ?");
                    query.setParameter(0, k);
                    Long result = (Long) query.uniqueResult();
                    int intValue = result.intValue();
                    return intValue;
                } else {
                    // Query query =session.createSQLQuery("select count(a.name)
                    // from (select hs.name from yeshi_ec_super_goodsclass shs
                    // left join yeshi_ec_class hs on shs.goodsclass_id=hs.id
                    // where shs.system_id=? and hs.name like ?) a");
                    Query query = session.createQuery(
                            "select count(sgc.id) from SuperGoodsClass sgc where sgc.goodsClass.name like ? and sgc.system.id=?");
                    query.setParameter(0, k);
                    query.setParameter(1, system.getId());
                    Long result = (Long) query.uniqueResult();
                    int intValue = result.intValue();
                    return intValue;
                }
            }
        });
    }
    // @Transactional
    // public void addGoodsClass(GoodsClass goodsClass) {
    // goodsClass.setCreatetime(java.lang.System.currentTimeMillis());
    // Serializable id = goodsClassDao.save(goodsClass);
    // Properties properties = new Properties();
    // InputStream in = null;
    // try {
    // in = new BufferedInputStream (new FileInputStream("url.properties"));
    // properties.load(in);
    // String url = (String) properties.get("url");
    // goodsClass.setUrl(url+id);
    // goodsClassDao.update(goodsClass);
    // } catch (FileNotFoundException e) {
    // e.printStackTrace();
    // } catch (IOException e) {
    // e.printStackTrace();
    // }finally{
    // if(in !=null){
    // try {
    // in.close();
    // } catch (IOException e) {
    // e.printStackTrace();
    // }
    // }
    // }
    // }
    public Integer addGoodsClass(final GoodsClass goodsClass) {
        return (Integer) goodsClassDao.excute(new HibernateCallback() {
            public Object doInHibernate(Session session) throws HibernateException {
                session.getTransaction().begin();
                goodsClass.setCreatetime(java.lang.System.currentTimeMillis());
                Serializable id = session.save(goodsClass);
                Properties properties = new Properties();
                InputStream in = null;
                try {
                    in = this.getClass().getClassLoader().getResourceAsStream("url.properties");
                    properties.load(in);
                    String url = (String) properties.get("url");
                    url = MessageFormat.format(url, id, goodsClass.getKey(), goodsClass.getName());
                    goodsClass.setUrl(url);
                    session.update(goodsClass);
                    session.flush();
                    session.getTransaction().commit();
                } catch (FileNotFoundException e) {
                    session.getTransaction().rollback();
                    e.printStackTrace();
                    return 1;
                } catch (IOException e) {
                    session.getTransaction().rollback();
                    e.printStackTrace();
                    return 2;
                } finally {
                    if (in != null) {
                        try {
                            in.close();
                        } catch (IOException e) {
                            e.printStackTrace();
                        }
                    }
                }
                return null;
            }
        });
    }
    @Transactional
    public void deleteGoodsClasss(long[] gcids) {
        for (long id : gcids) {
            superGoodsClassService.deleteSuperGoodsClass(id);
            goodsSecondClassService.deleteSecondClassByGC(id);
            goodsClassDao.delete(new GoodsClass(id));
        }
    }
    public Integer updateGoodsClass(final GoodsClass goodsClass) {
        return (Integer) goodsClassDao.excute(new HibernateCallback() {
            public Object doInHibernate(Session session) throws HibernateException {
                session.getTransaction().begin();
                goodsClass.setCreatetime(java.lang.System.currentTimeMillis());
                session.update(goodsClass);
                Properties properties = new Properties();
                InputStream in = null;
                try {
                    in = this.getClass().getClassLoader().getResourceAsStream("url.properties");
                    properties.load(in);
                    String url = (String) properties.get("url");
                    java.lang.System.out.println(goodsClass.getKey());
                    java.lang.System.out.println(goodsClass.getName());
                    String encodeKey = URLEncoder.encode(goodsClass.getKey(), "utf-8");
                    String encodeName = URLEncoder.encode(goodsClass.getName(), "utf-8");
                    url = MessageFormat.format(url, goodsClass.getId(), encodeKey, encodeName);
                    goodsClass.setUrl(url);
                    session.update(goodsClass);
                    session.flush();
                    session.getTransaction().commit();
                } catch (FileNotFoundException e) {
                    session.getTransaction().rollback();
                    e.printStackTrace();
                    return 1;
                } catch (IOException e) {
                    session.getTransaction().rollback();
                    e.printStackTrace();
                    return 2;
                } finally {
                    if (in != null) {
                        try {
                            in.close();
                        } catch (IOException e) {
                            e.printStackTrace();
                        }
                    }
                }
                return null;
            }
        });
    }
    @SuppressWarnings("unchecked")
    @Override
    public List<GoodsClass> queryAll(String platform, String packages) throws Exception{
        List<BusinessSystem> defultList = businessSystemService.getBusinessSystems();
        platform = Utils.getMap().get(platform);
        BusinessSystem system = businessSystemService.getBusinessSystem(platform, packages);
        List<GoodsClass> goodsClassList = new ArrayList<GoodsClass>();
        List<SuperGoodsClass> superGoodsClassList = null;
        List<Long> gcIdList = new ArrayList<Long>();
        if (system == null) {
            goodsClassList = (List<GoodsClass>) goodsClassDao.excute(new HibernateCallback<List<GoodsClass>>() {
                public List<GoodsClass> doInHibernate(Session session) throws HibernateException {
                    Query query = session.createQuery(" from GoodsClass order by orderby");
                    return query.list();
                }
            });
            if (goodsClassList == null || goodsClassList.size() == 0) {
                return null;
            }
            /* 存放类别id集合 */
            for (GoodsClass rs : goodsClassList) {
                gcIdList.add(rs.getId());
            }
        } else if (system != null) {
            superGoodsClassList = superGoodsClassService.getSuperGoodsClassAll(system.getId());
            if (goodsClassList == null || goodsClassList.size() == 0) {
                return null;
            }
            for (SuperGoodsClass superGoodsClass : superGoodsClassList) {
                GoodsClass goodsClass = superGoodsClass.getGoodsClass();
                goodsClassList.add(goodsClass);
                gcIdList.add(goodsClass.getId());
            }
        }
        /* 根据类别 id 查询关联系统数据 */
        superGoodsClassList = superGoodsClassService.getSuperGoodsClasss(gcIdList);
        for (GoodsClass gclass : goodsClassList) {
            Long iosClick = gclass.getIosClick();
            Long androidClick = gclass.getAndroidClick();
            if (iosClick != null && androidClick != null) {
                gclass.setCountClick(iosClick + androidClick);
            } else if (androidClick != null) {
                gclass.setCountClick(androidClick);
            } else if (iosClick != null) {
                gclass.setCountClick(iosClick);
            } else {
                gclass.setCountClick(0l);
            }
            int countlabel = labelClassMapper.getCountQueryByClassId(gclass.getId());
            gclass.setCountlabel(countlabel);
            List<Long> gList = new ArrayList<Long>();
            if (superGoodsClassList != null && superGoodsClassList.size() > 0) {
                for (SuperGoodsClass srs : superGoodsClassList) {
                    long rsId = srs.getGoodsClass().getId();
                    if (gclass.getId() == rsId) {
                        BusinessSystem gsystem = srs.getSystem();
                        gList.add(gsystem.getId());
                    }
                }
            }
            List<BusinessSystem> newList = new ArrayList<BusinessSystem>();
            // 是否有关联系统选项
            for (BusinessSystem dsystem : defultList) {
                BusinessSystem newsystem = new BusinessSystem();
                PropertyUtils.copyProperties(newsystem, dsystem);
                newsystem.setCheck(0);
                if (gList != null && gList.size() > 0) {
                    Long did = newsystem.getId();
                    for (Long gid : gList) {
                        if (gid == did) {
                            newsystem.setCheck(1);
                        }
                    }
                }
                newList.add(newsystem);
            }
            gclass.setSystemList(newList);
        }
        return goodsClassList;
    }
    public List<GoodsClass> getGoodsClassAll() {
        return goodsClassDao.list("from GoodsClass order by orderby");
    }
    @Override
    public String getKwById(Long id) {
        return goodsClassMapper.getKwById(id);
    public String getKeysById(Long id) {
        return goodsClassMapper.getKeysById(id);
    }
    
    @Override
@@ -472,48 +65,165 @@
    }
    
    
    @Override
    public List<GoodsClass> queryAll() {
        return goodsClassMapper.queryAll();
    }
    @Cacheable(value="classCache",key="'getGoodsClass-'+#gcid")
    @Override
    public GoodsClass getGoodsClassCache(long gcid) {
        return getGoodsClass(gcid);
    }
    @Override
    @SuppressWarnings("unchecked")
    public long saveAdd(GoodsClass record, MultipartFile file) throws Exception{
        
        long result = 0;
    @Override
    public void deleteGoodsClass(long id) {
        goodsClassMapper.deleteByPrimaryKey(id);
    }
    @Override
    public List<GoodsClass> listquery() throws Exception{
         List<GoodsClass> list = goodsClassMapper.getGoodsClassAll();
         if (list != null && list.size() == 0) {
             return list;
         }
        for (GoodsClass gclass : list) {
            Long iosClick = gclass.getIosClick();
            Long androidClick = gclass.getAndroidClick();
            if (iosClick != null && androidClick != null) {
                gclass.setCountClick(iosClick + androidClick);
            } else if (androidClick != null) {
                gclass.setCountClick(androidClick);
            } else if (iosClick != null) {
                gclass.setCountClick(iosClick);
            } else {
                gclass.setCountClick(0l);
            }
            // 参数处理
            String searchParam = gclass.getSearchParam();
            if (searchParam == null) {
                gclass.setSearchParam("");
            } else {
                gclass.setSearchParam(searchParam);
            }
            // 标签
            int countlabel = labelClassService.getCountQueryByClassId(gclass.getId());
            gclass.setCountlabel(countlabel);
        }
        return list;
    }
    public List<GoodsClass> getGoodsClassAll() {
        return goodsClassMapper.getGoodsClassAll();
    }
    @Override
    public void saveObject(MultipartFile file, GoodsClass record) throws GoodsClassException, Exception{
        String name = record.getName();
        if (name == null || name.trim().length() == 0) {
            throw new GoodsClassException(1, "分类名称不能为空");
        }
        // 图片上传
        String picture = null;
        if (file != null) {
            picture = uploadPicture(file);
        }
        String params = record.getSearchParam();
        if (params == null || params.trim().length() == 0 || "null".equalsIgnoreCase(params)) {
            record.setSearchParam(null);
        } else if (!StringUtil.isJson(params)) {
            throw new GoodsClassException(1, "筛选条件非JSON格式");
        }
        Long id = record.getId();
        if (id == null) {
            record.setPicture(picture);
            record.setIosClick(0L);
            record.setAndroidClick(0L);
        record.setCreatetime(java.lang.System.currentTimeMillis());
        
        /*  上传新图片  */
        if (file != null) {
            Integer state = record.getState();
            if (state == null) {
                record.setState(0);
            }
            if (params== null || params.trim().length() == 0 || "null".equalsIgnoreCase(params)) {
                // 搜索条件:有券、在售价20-200、牛皮癣轻微
                record.setSearchParam("{\"quan\":1,\"endPrice\":220,\"includeGoodRate\":true,\"baoYou\":true,\"ip\":\"218.72.111.105\"}");
            }
            // 排序
            int maxOrder = goodsClassMapper.getMaxOrder();
            record.setOrderby(maxOrder + 1);
            goodsClassMapper.insert(record);
        } else {
            // 修改
            GoodsClass resultObj = goodsClassMapper.selectByPrimaryKey(id);
            if (resultObj == null) {
                throw new GoodsClassException(1, "修改内容已不存在");
            }
            if (picture != null && picture.trim().length() > 0) {
                // 删除老图
                removePicture(resultObj.getPicture());
                // 存储新图
                record.setPicture(picture);
            } else {
                record.setPicture(resultObj.getPicture());
            }
            record.setIosClick(resultObj.getIosClick());
            record.setOrderby(resultObj.getOrderby());
            record.setAndroidClick(resultObj.getAndroidClick());
            record.setCreatetime(resultObj.getCreatetime());
            goodsClassMapper.updateByPrimaryKey(record);
        }
    }
    /**
     * 上传图片
     * @param file
     * @return
     * @throws Exception
     */
    public String uploadPicture(MultipartFile file) throws Exception {
        // 文件解析
            InputStream inputStream = file.getInputStream();
            String contentType = file.getContentType();
            String type = contentType.substring(contentType.indexOf("/") + 1);
            // 上传文件相对位置
            String fileUrl="ClassImg/"+UUID.randomUUID().toString().replace("-", "") + "." + type;
            String uploadFilePath = COSManager.getInstance().uploadFile(inputStream, fileUrl).getUrl();
            
            record.setPicture(uploadFilePath);
        // 文件路径
        String filePath="/img/GoodsClass/"+UUID.randomUUID().toString().replace("-", "") + "." + type;
        // 执行上传
        String fileLink= COSManager.getInstance().uploadFile(inputStream, filePath).getUrl();
        return fileLink;
        }
        
        addGoodsClass(record);
        record.setOrderby((int)record.getId());
        updateGoodsClass(record);
        long id = record.getId();
        if (id > 0)
            return id;
        return result;
    /**
     * 删除图片-不更新数据库
     * @param record
     * @throws Exception
     */
    public void removePicture(String picture) throws Exception {
        if (picture != null && picture.trim().length() > 0) {
            COSManager.getInstance().deleteFile(picture);
    }
    }
    
    @Override
    public void uploadPicture(GoodsClass record, MultipartFile file) throws Exception {
@@ -540,7 +250,7 @@
        /*  更新数据库信息  */
        if (!StringUtil.isNullOrEmpty(uploadFilePath)) {
            record.setPicture(uploadFilePath);
            updateGoodsClass(record);
            goodsClassMapper.updateByPrimaryKey(record);
        }
        
    }
@@ -562,34 +272,22 @@
        if (deleteFile) {
            record.setPicture(null);
            // 更新数据库
             updateGoodsClass(record);
            goodsClassMapper.updateByPrimaryKey(record);
        } 
    }
    @Override
    @Cacheable(value="classCache",key="'getListClassCache-'+#systemId")
    public List<GoodsClass> getListClassCache(Long systemId) throws Exception {
        List<SuperGoodsClass> superGoodsClassList = superGoodsClassService.getSuperGoodsClassBySystemId(systemId);
        if (superGoodsClassList == null || superGoodsClassList.size() == 0) {
            return null;
        }
        List<GoodsClass> goodsClassList = new ArrayList<GoodsClass>();
        for (SuperGoodsClass superGoodsClass : superGoodsClassList) {
            GoodsClass goodsClass = superGoodsClass.getGoodsClass();
            goodsClassList.add(goodsClass);
        }
        return goodsClassList;
    @Cacheable(value="classCache",key="'getEffectiveClassCache'")
    public List<GoodsClass> getEffectiveClassCache() throws Exception {
        return goodsClassMapper.getEffectiveClass();
    }
    
    
    @Override
    @Cacheable(value="classCache",key="'getClassListAllCache-'+#systemId")
    public List<Map<String, Object>> getClassListAllCache(Long systemId) throws Exception {
    @Cacheable(value="classCache",key="'getClassListAllCache'")
    public List<Map<String, Object>> getClassListAllCache() throws Exception {
        List<GoodsClass> goodsClassList = goodsClassMapper.listGoodsClassBySystemId(systemId);
        List<GoodsClass> goodsClassList = goodsClassMapper.getEffectiveClass();
        if (goodsClassList == null || goodsClassList.size() == 0) {
            return null;
        }
@@ -631,4 +329,36 @@
        return list;
    }
    
    @Override
    @Transactional
    public void updateOrder(Long id, Integer moveType) throws GoodsClassException {
        if (id == null || moveType == null || (!moveType.equals(1) && !moveType.equals(-1))) {
            throw new GoodsClassException(1, "请传递正确参数");
        }
        GoodsClass resultObj = goodsClassMapper.selectByPrimaryKey(id);
        if (resultObj == null) {
            throw new GoodsClassException(1, "此内容已不存在");
        }
        Integer order = resultObj.getOrderby();
        // 获取交换对象
        GoodsClass exchangeObject = goodsClassMapper.getByAdjoinOrder( order, moveType);
        if (exchangeObject == null) {
            if (moveType == 1) {
                throw new GoodsClassException(1, "在相同使用地方中优先级已经最低了");
            } else {
                throw new GoodsClassException(1, "在相同使用地方中优先级已经最高了");
            }
        }
        resultObj.setOrderby(exchangeObject.getOrderby());
        exchangeObject.setOrderby(order);
        goodsClassMapper.updateByPrimaryKey(resultObj);
        goodsClassMapper.updateByPrimaryKey(exchangeObject);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsSecondClassServiceImpl.java
@@ -1,17 +1,13 @@
package com.yeshi.fanli.service.impl.goods;
import java.io.Serializable;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.orm.hibernate4.HibernateCallback;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.goods.GoodsSecondClassDao;
import com.yeshi.fanli.dao.mybatis.GoodsSecondClassMapper;
import com.yeshi.fanli.entity.bus.clazz.GoodsSecondClass;
import com.yeshi.fanli.exception.NotExistObjectException;
import com.yeshi.fanli.service.inter.goods.GoodsSecondClassService;
@@ -21,55 +17,39 @@
public class GoodsSecondClassServiceImpl implements GoodsSecondClassService {
    @Resource
    private GoodsSecondClassDao goodsSecondClassDao;
    private GoodsSecondClassMapper goodsSecondClassMapper;
    @Cacheable(value="classCache",key="'getGoodsSecondClassByGoodsClassId-'+#id")
    public List<GoodsSecondClass> getGoodsSecondClassByGoodsClassId(long id) {
        List<GoodsSecondClass> list = goodsSecondClassDao.list(
                "from GoodsSecondClass gsc " + "where gsc.parent.id=? order by gsc.orderby ",
                new Serializable[] { id });
        return list;
        return goodsSecondClassMapper.getByGoodsClassId(id);
    }
    public List<GoodsSecondClass> getSecondClassList(int index, String key,
            long cid) {
        int start = index * Constant.PAGE_SIZE;
        List<GoodsSecondClass> list = goodsSecondClassDao
                .list("from GoodsSecondClass gsc where gsc.parent.id=? and gsc.name like ? order by gsc.orderby",
                        start, Constant.PAGE_SIZE, new Serializable[] { cid,
                                "%" + key + "%" });
        return list;
    public List<GoodsSecondClass> getSecondClassList(int index, String key,    long cid) {
        return goodsSecondClassMapper.getByNameAndGoodsClassId(index * Constant.PAGE_SIZE, Constant.PAGE_SIZE, cid, key);
    }
    public int getCount(long cid, String key) {
        Long lcount = goodsSecondClassDao
                .getCount(
                        "select count(*) from GoodsSecondClass gsc where gsc.parent.id=? and gsc.name like ? ",
                        new Serializable[] { cid, "%" + key + "%" });
        return lcount.intValue();
        return goodsSecondClassMapper.countByNameAndGoodsClassId(cid, key);
    }
    public void addSecondClass(GoodsSecondClass secondClass) {
        secondClass.setCreatetime(System.currentTimeMillis());
        goodsSecondClassDao.save(secondClass);
        goodsSecondClassMapper.insert(secondClass);
    }
    public void deleteSecondClass(long sid) {
        goodsSecondClassDao.delete(new GoodsSecondClass(sid));
        goodsSecondClassMapper.deleteByPrimaryKey(sid);
    }
    public GoodsSecondClass getSecondClass(long scid) {
        return goodsSecondClassDao.find(GoodsSecondClass.class, scid);
        return goodsSecondClassMapper.selectByPrimaryKey(scid);
    }
    public void updateSecondClass(GoodsSecondClass secondClass)
            throws NotExistObjectException {
        GoodsSecondClass find = goodsSecondClassDao.find(
                GoodsSecondClass.class, secondClass.getId());
        GoodsSecondClass find = goodsSecondClassMapper.selectByPrimaryKey(secondClass.getId());
        if (find == null) {
            throw new NotExistObjectException("不存在该用户");
        }
@@ -77,19 +57,7 @@
        find.setPicture(secondClass.getPicture());
        find.setOrderby(secondClass.getOrderby());
        find.setKey(secondClass.getKey());
        goodsSecondClassDao.update(find);
    }
    public void deleteSecondClassByGC(final long id) {
        goodsSecondClassDao.excute(new HibernateCallback() {
            public Object doInHibernate(Session session)
                    throws HibernateException {
                session.createQuery(
                        "delete from GoodsSecondClass gsc where gsc.parent.id=?")
                        .setParameter(0, id).executeUpdate();
                return null;
            }
        });
        goodsSecondClassMapper.updateByPrimaryKey(find);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsSubClassServiceImpl.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.service.impl.goods;
import java.io.InputStream;
import java.util.Date;
import java.util.List;
import java.util.UUID;
@@ -10,14 +11,16 @@
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import org.yeshi.utils.tencentcloud.COSManager;
import com.yeshi.fanli.dao.mybatis.GoodsSubClassMapper;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
import com.yeshi.fanli.entity.bus.clazz.GoodsSubClass;
import com.yeshi.fanli.exception.GoodsSubClassException;
import com.yeshi.fanli.service.inter.goods.GoodsSubClassService;
import com.yeshi.fanli.service.inter.lable.LabelClassService;
import com.yeshi.fanli.util.StringUtil;
import org.yeshi.utils.tencentcloud.COSManager;
@Service
public class GoodsSubClassServiceImpl implements GoodsSubClassService {
@@ -55,10 +58,6 @@
        return goodsSubClassMapper.updateByPrimaryKeySelective(record);
    }
    @Override
    public int updateByPrimaryKey(GoodsSubClass record) {
        return goodsSubClassMapper.updateByPrimaryKey(record);
    }
    @Override
    @Transactional
@@ -86,8 +85,6 @@
    @Override
    @Transactional
    public void deleteSub(Long recordId) throws Exception {
        // TODO Auto-generated method stub
        GoodsSubClass goodsSubClass = goodsSubClassMapper.selectByPrimaryKey(recordId);
        if (goodsSubClass == null)
@@ -97,6 +94,12 @@
        String picture = goodsSubClass.getPicture();
        if (!StringUtil.isNullOrEmpty(picture)) {
            COSManager.getInstance().deleteFile(picture);
        }
        /* 删除网络图片 */
        String pictureSecond = goodsSubClass.getPictureSecond();
        if (!StringUtil.isNullOrEmpty(pictureSecond)) {
            COSManager.getInstance().deleteFile(pictureSecond);
        }
        /* 删除所有关联子类 */
@@ -116,52 +119,153 @@
        goodsSubClassMapper.deleteByPrimaryKey(recordId);
    }
    @Override
    public int save(GoodsSubClass record, MultipartFile file) throws Exception {
    public void saveObject(MultipartFile file, MultipartFile file2, GoodsSubClass record, Integer type, Long pid) throws GoodsSubClassException, Exception{
        int result = 0;
        String name = record.getName();
        if (name == null || name.trim().length() == 0) {
            throw new GoodsSubClassException(1, "分类名称不能为空");
        }
        result = goodsSubClassMapper.insertSelective(record);
        // 上传图片
        // 图片上传
        String picture = null;
        if (file != null) {
            result = goodsSubClassService.uploadPicture(record, file);
            picture = uploadPicture(file);
        }
        return result;
        // 图片上传
        String pictureSecond = null;
        if (file2 != null) {
            pictureSecond = uploadPicture(file2);
    }
    @Override
    public int uploadPicture(GoodsSubClass record, MultipartFile file) throws Exception {
        String params = record.getSearchParam();
        if (params== null || params.trim().length() == 0 || "null".equalsIgnoreCase(params)) {
            record.setSearchJson(null);
        } else if (!StringUtil.isJson(params)) {
            throw new GoodsSubClassException(1, "筛选条件非JSON格式");
        }
        Long id = record.getId();
        if (id == null) {
            if (type == null) {
                throw new GoodsSubClassException(1, "等级不能为空");
            }
            if (type > 5) {
                throw new GoodsSubClassException(1, "等级不能超过五级");
            }
            if (pid == null) {
                throw new GoodsSubClassException(1, "上级id为空");
            }
            if (type == 2) {
                record.setRootClass(new GoodsClass(pid));
                int weight = goodsSubClassMapper.getMaxWeightByRootId(pid);
                record.setWeight(weight + 1);
            } else {
                record.setParent(new GoodsSubClass(pid));
                int weight = goodsSubClassMapper.getMaxWeightByPid(pid);
                record.setWeight(weight + 1);
            }
            String key = record.getKey();
            if (StringUtil.isNullOrEmpty(key)) {
                record.setKey(name.trim());
            }
            record.setLevel(type);
            record.setPicture(picture);
            record.setPictureSecond(pictureSecond);
            record.setState(0);
            record.setAndroidClick(0L);
            record.setIosClick(0L);
            record.setCreatetime(new Date());
            record.setUpdatetime(new Date());
            if (params== null || params.trim().length() == 0 || "null".equalsIgnoreCase(params)) {
                // 搜索条件:有券、在售价20-200、牛皮癣轻微
                record.setSearchJson("{\"quan\":1,\"endPrice\":220,\"includeGoodRate\":true}");
            }
            goodsSubClassMapper.insert(record);
        } else {
            // 修改
            GoodsSubClass resultObj = goodsSubClassMapper.selectByPrimaryKey(id);
            if (resultObj == null) {
                throw new GoodsSubClassException(1, "修改内容已不存在");
            }
            if (picture != null && picture.trim().length() > 0) {
                // 删除老图
                removePicture(resultObj.getPicture());
                // 存储新图
                record.setPicture(picture);
            } else {
                record.setPicture(resultObj.getPicture());
            }
            if (pictureSecond != null && pictureSecond.trim().length() > 0) {
                // 删除老图
                removePicture(resultObj.getPictureSecond());
                // 存储新图
                record.setPictureSecond(pictureSecond);
            } else {
                record.setPictureSecond(resultObj.getPictureSecond());
            }
            record.setLevel(resultObj.getLevel());
            record.setRootClass(resultObj.getRootClass());
            record.setWeight(resultObj.getWeight());
            record.setIosClick(resultObj.getIosClick());
            record.setAndroidClick(resultObj.getAndroidClick());
            record.setCreatetime(resultObj.getCreatetime());
            record.setUpdatetime(new Date());
            goodsSubClassMapper.updateByPrimaryKey(record);
        }
    }
    /**
     * 上传图片
     * @param file
     * @return
     * @throws Exception
     */
    public String uploadPicture(MultipartFile file) throws Exception {
        // 文件解析
        InputStream inputStream = file.getInputStream();
        String contentType = file.getContentType();
        String type = contentType.substring(contentType.indexOf("/") + 1);
        // 上传文件相对位置
        String fileUrl = "ClassImg/" + UUID.randomUUID().toString().replace("-", "") + "." + type;
        boolean deleteFile = true;
        // 文件路径
        String filePath="/img/GoodsSubClass/"+UUID.randomUUID().toString().replace("-", "") + "." + type;
        // 执行上传
        String fileLink= COSManager.getInstance().uploadFile(inputStream, filePath).getUrl();
        /* 修改图片时,先删除已存在图片 */
        String picture = record.getPicture();
        if (!StringUtil.isNullOrEmpty(picture))
            deleteFile = COSManager.getInstance().deleteFile(picture);
        String uploadFilePath = null;
        /* 上传新图片 */
        if (deleteFile) {
            uploadFilePath = COSManager.getInstance().uploadFile(inputStream, fileUrl).getUrl();
        return fileLink;
        }
        /* 更新数据库信息 */
        int result = 0;
        if (!StringUtil.isNullOrEmpty(uploadFilePath)) {
            record.setPicture(uploadFilePath);
            result = goodsSubClassMapper.updateByPrimaryKeySelective(record);
    /**
     * 删除图片
     * @param record
     * @throws Exception
     */
    public void removePicture(String picture) throws Exception {
        if (picture != null && picture.trim().length() > 0) {
            COSManager.getInstance().deleteFile(picture);
        }
        return result;
    }
    /**
     * 删除图片
@@ -252,26 +356,6 @@
        return goodsSubClassMapper.countByPid(pid);
    }
    
    /**
     *  统计一级之下的所有二级分类最大权重
     * @param rootId  一级id
     * @returnL
     */
    @Override
    public int getMaxWeightByRootId(Long rootId) {
        return goodsSubClassMapper.getMaxWeightByRootId(rootId);
    }
    /**
     *  统计二级分类之下其他分类最大权重
     * @param rootId  一级id
     * @return
     */
    @Override
    public int getMaxWeightByPid(Long pid){
        return goodsSubClassMapper.getMaxWeightByPid(pid);
    }
    
    @Override
    public void countClick(AcceptData acceptData, GoodsSubClass record) {
@@ -297,4 +381,5 @@
    public List<GoodsSubClass> queryByListCid(List<Long> list){
        return goodsSubClassMapper.queryByListCid(list);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/SuperGoodsClassServiceImpl.java
@@ -1,20 +1,14 @@
package com.yeshi.fanli.service.impl.goods;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.orm.hibernate4.HibernateCallback;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.goods.SuperGoodsClassDao;
import com.yeshi.fanli.dao.mybatis.SuperGoodsClassMapper;
import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
import com.yeshi.fanli.entity.bus.su.clazz.SuperGoodsClass;
import com.yeshi.fanli.entity.system.BusinessSystem;
@@ -25,95 +19,64 @@
public class SuperGoodsClassServiceImpl implements SuperGoodsClassService {
    @Resource
    private SuperGoodsClassDao superGoodsClassDao;
    private SuperGoodsClassMapper superGoodsClassMapper;
    
    @Resource
    private BusinessSystemService businessSystemService;
    
    
    @Override
    @Cacheable(value="classCache", key="'getSuperGoodsClassBySystemId-'+#id")
    public List<SuperGoodsClass> getSuperGoodsClassBySystemId(long id) {
        return superGoodsClassDao.list("from SuperGoodsClass sgc where sgc.system.id=? order by sgc.goodsClass.orderby ", new Serializable[]{id});
        return superGoodsClassMapper.listBySystemId(id);
    }
    @Override
    public List<SuperGoodsClass> getSuperGoodsClasss(List<Long> gcIdList) {
        if (gcIdList.size() == 0) {
        if (gcIdList == null || gcIdList.size() == 0) {
            return new ArrayList<SuperGoodsClass>();
        }
        StringBuffer sb = new StringBuffer(" from SuperGoodsClass sgc ");
        Serializable[] serArr = new Serializable[gcIdList.size()];
        for (int i = 0; i < gcIdList.size(); i++) {
            if (i == 0) {
                sb.append(" where sgc.goodsClass.id=? ");
            } else {
                sb.append(" or sgc.goodsClass.id=? ");
            }
            serArr[i] = gcIdList.get(i);
        }
        //sb.append(" order by sgc.goodsClass.orderby  ");
        String hql = sb.toString();
        return superGoodsClassDao.list(hql, serArr);
        return superGoodsClassMapper.listByGoodsclassIds(gcIdList);
    }
    public List<SuperGoodsClass> getSuperGoodsClassList(long id, int start,
            int count, String key) {
        return superGoodsClassDao.list("from SuperGoodsClass srs where srs.system.id=? and srs.goodsClass.name like ? order by sgc.goodsClass.orderby ",start,count,new Serializable[]{id, "%"+key+"%"});
    @Override
    public List<SuperGoodsClass> getSuperGoodsClassList(long id, int start,    int count, String key) {
        return superGoodsClassMapper.listBySystemIdAmdClassName(start, count, key, id);
        
    }
    
    @Override
    public List<SuperGoodsClass> getSuperGoodsClassAll(long id) {
        return superGoodsClassDao.list("from SuperGoodsClass srs where srs.system.id=?  order by sgc.goodsClass.orderby ",new Serializable[]{id});
    public Integer deleteSuperGoodsClass(final long gcid, final String platform, final String packageName) {
        
    }
    public Integer deleteSuperGoodsClass(final long gcid, final String platform,
            final String packageName) {
        return  (Integer) superGoodsClassDao.excute(new HibernateCallback<Integer>() {
            public Integer doInHibernate(Session session)
                    throws HibernateException {
                BusinessSystem system = businessSystemService.getBusinessSystem(platform, packageName);
                Transaction transaction = session.beginTransaction();
                Query query = session.createQuery("delete SuperGoodsClass shs "
                            + " where shs.goodsClass.id=? and shs.system.id=?");
                query.setLong(0, gcid);
                query.setLong(1, system.getId());
                int i = query.executeUpdate();
                transaction.commit();
                return i ;
        if (system == null) {
            return 0;
            }
        });
        return superGoodsClassMapper.deleteBySystemIdAndClassId(gcid, system.getId());
    }
    public void addSuperGoodsClass(long gcid, String platform,
            String packageName) {
    @Override
    public void addSuperGoodsClass(long gcid, String platform, String packageName) {
        BusinessSystem system = businessSystemService.getBusinessSystem(platform,packageName);
        SuperGoodsClass superGoodsClass = new SuperGoodsClass();
        GoodsClass goodsClass = new GoodsClass();
        goodsClass.setId(gcid);
        SuperGoodsClass superGoodsClass = new SuperGoodsClass();
        superGoodsClass.setGoodsClass(goodsClass);;
        superGoodsClass.setSystem(system);
        superGoodsClassDao.create(superGoodsClass);
        superGoodsClassMapper.insert(superGoodsClass);
    }
    public void deleteSuperGoodsClass(final long gcid) {
        superGoodsClassDao.excute(new HibernateCallback() {
            public Object doInHibernate(Session session)
                    throws HibernateException {
                Query query = session.createQuery("delete from SuperGoodsClass sgc where sgc.goodsClass.id=?");
                query.setParameter(0, gcid);
                query.executeUpdate();
                return null;
            }
        });
    @Override
    public void deleteSuperGoodsClass(long gcid) {
        superGoodsClassMapper.deleteByClassId(gcid);
    }
    @Override
    public void insertSelective(SuperGoodsClass record){
        superGoodsClassMapper.insertSelective(record);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/FloatADServiceImpl.java
@@ -46,8 +46,10 @@
        }
        
        String params = record.getParams();
        if ((params != null && params.trim().length() == 0) || "null".equalsIgnoreCase(params) ) {
        if (params == null || params.trim().length() == 0 || "null".equalsIgnoreCase(params) ) {
            record.setParams(null);
        } else if (!StringUtil.isJson(params)) {
            throw new FloatADException(1, "跳转参数非JSON格式");
        }
        
        if (!StringUtil.isNullOrEmpty(jumpType)) {
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/HomeNavbarServiceImpl.java
@@ -1,7 +1,7 @@
package com.yeshi.fanli.service.impl.homemodule;
import java.io.InputStream;
import java.util.ArrayList;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.UUID;
@@ -9,18 +9,20 @@
import javax.annotation.Resource;
import javax.transaction.Transactional;
import org.apache.commons.beanutils.PropertyUtils;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import org.yeshi.utils.tencentcloud.COSManager;
import com.yeshi.fanli.dao.mybatis.homemodule.HomeNavbarMapper;
import com.yeshi.fanli.dao.mybatis.homemodule.SuperHomeNavbarMapper;
import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar;
import com.yeshi.fanli.entity.bus.homemodule.SuperHomeNavbar;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.service.inter.config.BusinessSystemService;
import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar.NavbarTypeEnum;
import com.yeshi.fanli.entity.bus.homemodule.SwiperBanner;
import com.yeshi.fanli.exception.homemodule.HomeNavbarException;
import com.yeshi.fanli.service.inter.goods.GoodsClassService;
import com.yeshi.fanli.service.inter.homemodule.HomeNavbarService;
import com.yeshi.fanli.service.inter.homemodule.SwiperBannerService;
import com.yeshi.fanli.util.StringUtil;
@@ -28,47 +30,21 @@
public class HomeNavbarServiceImpl implements HomeNavbarService {
    
    @Resource
    private BusinessSystemService businessSystemService;
    @Resource
    private HomeNavbarMapper homeNavbarMapper;
    @Resource
    private SuperHomeNavbarMapper superHomeNavbarMapper;
    private GoodsClassService goodsClassService;
    @Override
    public int deleteByPrimaryKey(Long id) {
        return homeNavbarMapper.deleteByPrimaryKey(id);
    }
    @Override
    public int insert(HomeNavbar record) {
        return homeNavbarMapper.insert(record);
    }
    @Override
    public int insertSelective(HomeNavbar record) {
        return homeNavbarMapper.insertSelective(record);
    }
    @Override
    public HomeNavbar selectByPrimaryKey(Long id) {
        return homeNavbarMapper.selectByPrimaryKey(id);
    }
    @Override
    public int updateByPrimaryKeySelective(HomeNavbar record) {
        return homeNavbarMapper.updateByPrimaryKeySelective(record);
    }
    @Override
    public int updateByPrimaryKey(HomeNavbar record) {
        return homeNavbarMapper.updateByPrimaryKey(record);
    }
    @Resource
    private SwiperBannerService swiperBannerService;
    @Override
    @Transactional
    public int deleteBatchByPrimaryKey(List<Long> list) {
        superHomeNavbarMapper.deleteBatchByNavbarIds(list);
        if (list == null || list.size() == 0) {
            return 0;
        }
        for (Long id: list) {
            HomeNavbar homeNavbar = homeNavbarMapper.selectByPrimaryKey(id);
            if (homeNavbar !=null) {
@@ -79,19 +55,189 @@
                }
            }
        }
        return homeNavbarMapper.deleteBatchByPrimaryKey(list);
    }
    @Override
    public int getMaxOrder() {
        return homeNavbarMapper.getMaxOrder();
    public void saveObject(MultipartFile file, HomeNavbar record) throws HomeNavbarException, Exception{
        String name = record.getName();
        if (name == null || name.trim().length() == 0) {
            throw new HomeNavbarException(1, "导航名称不能为空");
        }
        String startTime_str = record.getStartTime_str();
        if (record.isTimeTask() && (startTime_str == null || startTime_str.length() == 0)) {
            throw new HomeNavbarException(1, "控制时间不能为空");
        }
        NavbarTypeEnum type = record.getType();
        if (NavbarTypeEnum.category.equals(type)) {
            Long classId = record.getClassId();
            if (classId == 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) {
                throw new HomeNavbarException(1, "请输入URl链接");
            }
        } else {
            throw new HomeNavbarException(1, "类型的值不正确");
        }
        Long swiperBannerId = record.getSwiperBannerId();
        if (swiperBannerId != null && swiperBannerId == 0) {
            record.setSwiperBannerId(null);
        }
        // 时间转换
        conversionTime(record);
        // 图片上传
        String picture = null;
        if (file != null) {
            picture = uploadPicture(file);
        }
        Long id = record.getId();
        if (id == null) {
            record.setPicture(picture);
            record.setCreatetime(new Date());
            record.setUpdatetime(new Date());
            Integer state = record.getState();
            if (state == null) {
                record.setState(0);
            }
            int maxOrder = homeNavbarMapper.getMaxOrder();
            record.setOrderby(maxOrder + 1);
            homeNavbarMapper.insert(record);
        } else {
            // 修改
            HomeNavbar resultObj = homeNavbarMapper.selectByPrimaryKey(id);
            if (resultObj == null) {
                throw new HomeNavbarException(1, "修改内容已不存在");
            }
            if (picture != null && picture.trim().length() > 0) {
                // 删除老图
                removePicture(resultObj.getPicture());
                // 存储新图
                record.setPicture(picture);
            } else {
                record.setPicture(resultObj.getPicture());
            }
            record.setOrderby(resultObj.getOrderby());
            record.setCreatetime(resultObj.getCreatetime());
            record.setUpdatetime(new Date());
            homeNavbarMapper.updateByPrimaryKey(record);
        }
    }
    /**
     * 上传图片
     * @param file
     * @return
     * @throws Exception
     */
    public String uploadPicture(MultipartFile file) throws Exception {
        // 文件解析
        InputStream inputStream = file.getInputStream();
        String contentType = file.getContentType();
        String type = contentType.substring(contentType.indexOf("/") + 1);
        // 文件路径
        String filePath="/img/HomeNavbar/"+UUID.randomUUID().toString().replace("-", "") + "." + type;
        // 执行上传
        String fileLink= COSManager.getInstance().uploadFile(inputStream, filePath).getUrl();
        return fileLink;
    }
    /**
     * 删除图片-不更新数据库
     * @param record
     * @throws Exception
     */
    public void removePicture(String picture) throws Exception {
        if (picture != null && picture.trim().length() > 0) {
            COSManager.getInstance().deleteFile(picture);
        }
    }
    /**
     * web段时间转换
     * @param record
     */
    public void conversionTime(HomeNavbar record) throws HomeNavbarException, Exception {
        // 是否时间控制
        if(!record.isTimeTask()) {
            record.setStartTime(null);
            record.setEndTime(null);
        } else {
            String startTime_str = record.getStartTime_str();
            String endTime_str = record.getEndTime_str();
            if ((startTime_str == null|| startTime_str.trim().length() == 0)
                    && (endTime_str == null || endTime_str.trim().length() == 0)) {
                throw new HomeNavbarException(1, "请输入控制时间");
            } else {
                SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
                if (startTime_str != null && startTime_str.trim().length() > 0) {
                    startTime_str = startTime_str.replaceAll("T", " ");
                    record.setStartTime(format.parse(startTime_str));
                }
                if (endTime_str != null && endTime_str.trim().length() > 0) {
                    endTime_str = endTime_str.replaceAll("T", " ");
                    record.setEndTime(format.parse(endTime_str));
                }
            }
        }
    }
    @Override
    public List<HomeNavbar> getChangeOrder(Integer type, Integer order) {
        return homeNavbarMapper.getChangeOrder(type, order);
    public void updateOrder(Long id, Integer moveType) throws HomeNavbarException, Exception{
        if (moveType == null || (!moveType.equals(1) && !moveType.equals(-1))) {
            throw new HomeNavbarException(1, "传递的类型不正确");
    }
        if (id == null) {
            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 (changeObj == null ) {
            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) {
@@ -101,64 +247,51 @@
            return null;
        }
        
        List<BusinessSystem> systemList = businessSystemService.getBusinessSystems();
        List<Long> listId = new ArrayList<Long>();
        for (HomeNavbar homeNavbar: listObj) {
            listId.add(homeNavbar.getId());
        }
        List<SuperHomeNavbar> listSuper = superHomeNavbarMapper.listByNavbarIds(listId);
        
        if (listSuper == null || listSuper.size() == 0) {
            Date startTime = homeNavbar.getStartTime();
            Date endTime = homeNavbar.getEndTime();
            
            for (HomeNavbar homeNavbar: listObj) {
                homeNavbar.setSystemList(systemList);
            }
            if (startTime == null && endTime == null) {
                homeNavbar.setTimeTask(false);
                homeNavbar.setStartTime_str("");
                homeNavbar.setEndTime_str("");
        } else {
            for (HomeNavbar homeNavbar: listObj) {
                homeNavbar.setTimeTask(true);
                
                Long id = homeNavbar.getId();
                List<BusinessSystem> newList = new ArrayList<BusinessSystem>();
                // 是否有关联系统选项
                for (BusinessSystem dsystem : systemList) {
                    BusinessSystem newsystem = new BusinessSystem();
                    try {
                        PropertyUtils.copyProperties(newsystem, dsystem);
                    } catch (Exception e) {
                        e.printStackTrace();
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
                if (startTime == null) {
                    homeNavbar.setStartTime_str("");
                } else {
                    homeNavbar.setStartTime_str(sdf.format(startTime));
                    }
                    
                    if (listSuper != null && listSuper.size() > 0) {
                        Long systemId = newsystem.getId();
                        for (SuperHomeNavbar superHomeNavbar : listSuper) {
                            HomeNavbar navbar = superHomeNavbar.getHomeNavbar();
                            BusinessSystem system = superHomeNavbar.getSystem();
                            // 当前专题 、当前系统
                            if (navbar != null && system != null && id == navbar.getId()
                                    && systemId == system.getId()) {
                                newsystem.setCheck(1);
                                break;
                if (endTime == null) {
                    homeNavbar.setEndTime_str("");
                } else {
                    homeNavbar.setEndTime_str(sdf.format(endTime));
                            }
                        }
                        
                    }
                    if (newsystem.getCheck() != 1) {
                        newsystem.setCheck(0);
                    }
                    newList.add(newsystem);
                }
                homeNavbar.setSystemList(newList);
            Long classId = homeNavbar.getClassId();
            if (classId != null) {
                GoodsClass goodsClass = goodsClassService.selectByPrimaryKey(classId);
                if(goodsClass != null) {
                    homeNavbar.setClassName(goodsClass.getName());
            }
        }
        
            Long swiperBannerId = homeNavbar.getSwiperBannerId();
            if (swiperBannerId != null) {
                SwiperBanner swiperBanner = swiperBannerService.selectByPrimaryKey(swiperBannerId);
                if(swiperBanner != null) {
                    homeNavbar.setSwiperName(swiperBanner.getTitle());
                }
            } else {
                // 初始化
                homeNavbar.setSwiperBannerId(0L);
            }
        }
        return listObj;
    }
@@ -167,30 +300,15 @@
        return homeNavbarMapper.countListQuery(key);
    }
    @Override
    @Cacheable(value = "configCache", key = "'listQueryEffectiveNavbar'")
    public List<HomeNavbar> listQueryEffectiveNavbar() {
        return homeNavbarMapper.listQueryEffective();
    }
    @Override
    public void uploadPicture(MultipartFile file, HomeNavbar homeNavbar) throws Exception {
        InputStream inputStream = file.getInputStream();
        String contentType = file.getContentType();
        String type = contentType.substring(contentType.indexOf("/") + 1);
        // 上传文件相对位置
        String fileUrl="HomeNavbar/"+UUID.randomUUID().toString().replace("-", "") + "." + type;
        /*  修改图片时,先删除已存在图片  */
        String picture = homeNavbar.getPicture();
        if (!StringUtil.isNullOrEmpty(picture)) {
            COSManager.getInstance().deleteFile(picture);
    public HomeNavbar getEffectiveByClassId(Long classId) {
        return homeNavbarMapper.getEffectiveByClassId(classId);
        }
        String uploadFilePath = COSManager.getInstance().uploadFile(inputStream, fileUrl).getUrl();
        /*  更新数据库信息  */
        if (!StringUtil.isNullOrEmpty(uploadFilePath)) {
            homeNavbar.setUpdatetime(new Date());
            homeNavbar.setPicture(uploadFilePath);
            updateByPrimaryKeySelective(homeNavbar);
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialCardServiceImpl.java
@@ -1,21 +1,26 @@
package com.yeshi.fanli.service.impl.homemodule;
import java.util.ArrayList;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import javax.annotation.Resource;
import javax.transaction.Transactional;
import org.apache.commons.beanutils.PropertyUtils;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import org.yeshi.utils.tencentcloud.COSManager;
import com.yeshi.fanli.dao.mybatis.homemodule.SpecialCardMapper;
import com.yeshi.fanli.dao.mybatis.homemodule.SuperSpecialCardMapper;
import com.yeshi.fanli.entity.bus.homemodule.SpecialCard;
import com.yeshi.fanli.entity.bus.homemodule.SuperSpecialCard;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.entity.bus.homemodule.SpecialPlace;
import com.yeshi.fanli.exception.FloatADException;
import com.yeshi.fanli.exception.homemodule.SpecialCardException;
import com.yeshi.fanli.service.inter.config.BusinessSystemService;
import com.yeshi.fanli.service.inter.homemodule.SpecialCardService;
import com.yeshi.fanli.service.inter.homemodule.SpecialPlaceService;
import com.yeshi.fanli.service.inter.homemodule.SpecialService;
@@ -32,117 +37,181 @@
    private SpecialService specialService;
    
    @Resource
    private SuperSpecialCardMapper superSpecialCardMapper;
    private  SpecialPlaceService specialPlaceService;
    
    @Override
    public int deleteByPrimaryKey(Long id) {
        return specialCardMapper.deleteByPrimaryKey(id);
    public void saveObject(MultipartFile file, SpecialCard record) throws SpecialCardException, Exception{
        String name = record.getName();
        if (name == null || name.trim().length() == 0) {
            throw new SpecialCardException(1, "名称不能为空");
    }
    @Override
    public int insert(SpecialCard record) {
        return specialCardMapper.insert(record);
        Long placeId = record.getPlaceId();
        if (placeId == null || placeId == 0) {
            throw new SpecialCardException(1, "使用位置不能为空");
    }
    @Override
    public int insertSelective(SpecialCard record) {
        return specialCardMapper.insertSelective(record);
        // 时间任务控制
        conversionTime(record);
        // 图片上传
        String picture = null;
        if (file != null) {
            picture = uploadPicture(file);
    }
    @Override
    public SpecialCard selectByPrimaryKey(Long id) {
        return specialCardMapper.selectByPrimaryKey(id);
        Integer state = record.getState();
        if (state == null) {
            record.setState(0);
    }
    @Override
    public int updateByPrimaryKeySelective(SpecialCard record) {
        return specialCardMapper.updateByPrimaryKeySelective(record);
        Long id = record.getId();
        if (id == null) {
            record.setBottomPicture(picture);
            record.setCreatetime(new Date());
            record.setUpdatetime(new Date());
            specialCardMapper.insert(record);
        } else {
            // 修改
            SpecialCard resultObj = specialCardMapper.selectByPrimaryKey(id);
            if (resultObj == null) {
                throw new FloatADException(1, "修改内容已不存在");
    }
    @Override
    public int updateByPrimaryKey(SpecialCard record) {
        return specialCardMapper.updateByPrimaryKey(record);
            if (picture != null && picture.trim().length() > 0) {
                // 删除老图
                removePicture(resultObj.getBottomPicture());
                // 存储新图
                record.setBottomPicture(picture);
            } else {
                record.setBottomPicture(resultObj.getBottomPicture());
            }
            record.setCreatetime(resultObj.getCreatetime());
            record.setUpdatetime(new Date());
            specialCardMapper.updateByPrimaryKey(record);
        }
    }
    /**
     * web段时间转换
     * @param record
     */
    public void conversionTime(SpecialCard record) throws SpecialCardException, Exception {
        // 是否时间控制
        if(!record.isTimeTask()) {
            record.setStartTime(null);
            record.setEndTime(null);
        } else {
            String startTime_str = record.getStartTime_str();
            String endTime_str = record.getEndTime_str();
            if ((startTime_str == null|| startTime_str.trim().length() == 0)
                    && (endTime_str == null || endTime_str.trim().length() == 0)) {
                throw new SpecialCardException(1, "请输入控制时间");
            } else {
                SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
                if (startTime_str != null && startTime_str.trim().length() > 0) {
                    startTime_str = startTime_str.replaceAll("T", " ");
                    record.setStartTime(format.parse(startTime_str));
                }
                if (endTime_str != null && endTime_str.trim().length() > 0) {
                    endTime_str = endTime_str.replaceAll("T", " ");
                    record.setEndTime(format.parse(endTime_str));
                }
            }
        }
    }
    /**
     * 上传图片
     * @param file
     * @return
     * @throws Exception
     */
    public String uploadPicture(MultipartFile file) throws Exception {
        // 文件解析
        InputStream inputStream = file.getInputStream();
        String contentType = file.getContentType();
        String type = contentType.substring(contentType.indexOf("/") + 1);
        // 文件路径
        String filePath="/img/SpecialCard/"+UUID.randomUUID().toString().replace("-", "") + "." + type;
        // 执行上传
        String fileLink= COSManager.getInstance().uploadFile(inputStream, filePath).getUrl();
        return fileLink;
    }
    /**
     * 删除图片-不更新数据库
     * @param record
     * @throws Exception
     */
    public void removePicture(String picture) throws Exception {
        if (picture != null && picture.trim().length() > 0) {
            COSManager.getInstance().deleteFile(picture);
        }
    }
    
    @Override
    @Transactional
    public int deleteBatchByPrimaryKey(List<Long> list) throws Exception{
        specialService.deleteBatchByCardID(list);
        superSpecialCardMapper.deleteBatchByCardId(list);
        return specialCardMapper.deleteBatchByPrimaryKey(list);
    }
    
    @Override
    public List<SpecialCard> listQuery(long start, int count, String key, Integer sort) {
        
        List<SpecialCard> listObj = specialCardMapper.listQuery(start, count, key, sort);
        List<SpecialCard> listObj = specialCardMapper.listQuery(start, count, key);
        if (listObj == null || listObj.size() == 0) {
            return null;
        }
        
        List<BusinessSystem> systemList = businessSystemService.getBusinessSystems();
        List<Long> listCardId = new ArrayList<Long>();
        for (SpecialCard specialCard: listObj) {
            listCardId.add(specialCard.getId());
        }
            long totalSpecial= specialService.countlistQueryByCard(specialCard.getId(), null);
            specialCard.setTotalSpecial(totalSpecial);
        
        List<SuperSpecialCard> listSuper = superSpecialCardMapper.listByCardIDs(listCardId);
        if (listSuper == null || listSuper.size() == 0) {
            for (SpecialCard specialCard: listObj) {
                specialCard.setSystemList(systemList);
            }
            Date startTime = specialCard.getStartTime();
            Date endTime = specialCard.getEndTime();
            if (startTime == null && endTime == null) {
                specialCard.setTimeTask(false);
                specialCard.setStartTime_str("");
                specialCard.setEndTime_str("");
        } else {
            for (SpecialCard specialCard: listObj) {
                specialCard.setTimeTask(true);
                
                Long id = specialCard.getId();
                List<BusinessSystem> newList = new ArrayList<BusinessSystem>();
                // 是否有关联系统选项
                for (BusinessSystem dsystem : systemList) {
                    BusinessSystem newsystem = new BusinessSystem();
                    try {
                        PropertyUtils.copyProperties(newsystem, dsystem);
                    } catch (Exception e) {
                        e.printStackTrace();
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
                if (startTime == null) {
                    specialCard.setStartTime_str("");
                } else {
                    specialCard.setStartTime_str(sdf.format(startTime));
                    }
                    
                    if (listSuper != null && listSuper.size() > 0) {
                        Long systemId = newsystem.getId();
                        for (SuperSpecialCard superSpecialCard : listSuper) {
                            SpecialCard special = superSpecialCard.getSpecialCard();
                            BusinessSystem system = superSpecialCard.getSystem();
                            // 当前专题 、当前系统
                            if (special != null && system != null && id == special.getId()
                                    && systemId == system.getId()) {
                                newsystem.setCheck(1);
                                break;
                if (endTime == null) {
                    specialCard.setEndTime_str("");
                } else {
                    specialCard.setEndTime_str(sdf.format(endTime));
                            }
                        }
            Long placeId = specialCard.getPlaceId();
            if (placeId != null) {
                SpecialPlace specialPlace = specialPlaceService.selectByPrimaryKey(placeId);
                if (specialPlace != null) {
                    specialCard.setPlaceName(specialPlace.getName());
                }
                    }
                    
                    if (newsystem.getCheck() != 1) {
                        newsystem.setCheck(0);
                    }
                    newList.add(newsystem);
                }
                specialCard.setSystemList(newList);
            }
        }
        
        return listObj;
@@ -153,4 +222,12 @@
        return specialCardMapper.countlistQuery(key);
    }
    @Override
    public String getbottomPicture(String placeKey) {
        return specialCardMapper.getbottomPicture(placeKey);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialPlaceImpl.java
New file
@@ -0,0 +1,86 @@
package com.yeshi.fanli.service.impl.homemodule;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import javax.transaction.Transactional;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.homemodule.SpecialPlaceMapper;
import com.yeshi.fanli.entity.bus.homemodule.SpecialPlace;
import com.yeshi.fanli.exception.SpecialPlaceException;
import com.yeshi.fanli.service.inter.homemodule.SpecialPlaceService;
@Service
public class SpecialPlaceImpl implements SpecialPlaceService {
    @Resource
    private SpecialPlaceMapper specialPlaceMapper;
    @Override
    public SpecialPlace selectByPrimaryKey(Long id) {
        return specialPlaceMapper.selectByPrimaryKey(id);
    }
    @Override
    public void saveObject(SpecialPlace record) throws SpecialPlaceException, Exception{
        String placeName = record.getName();
        if (placeName == null || placeName.trim().length() == 0) {
            throw new SpecialPlaceException(1, "位置名称不能为空");
        }
        String key = record.getKey();
        if (key == null || key.trim().length() == 0) {
            throw new SpecialPlaceException(1, "位置标识不能为空");
        }
        Long id = record.getId();
        if (id == null) {
            record.setCreateTime(new Date());
            record.setUpdateTime(new Date());
            specialPlaceMapper.insert(record);
        } else {
            // 修改
            SpecialPlace resultObj = specialPlaceMapper.selectByPrimaryKey(id);
            if (resultObj == null) {
                throw new SpecialPlaceException(1, "修改内容已不存在");
            }
            record.setCreateTime(resultObj.getCreateTime());
            record.setUpdateTime(new Date());
            specialPlaceMapper.updateByPrimaryKey(record);
        }
    }
    @Override
    @Transactional
    public int deleteByPrimaryKeyList(List<Long> list) throws Exception{
        return specialPlaceMapper.deleteByPrimaryKeyList(list);
    }
    @Override
    public List<SpecialPlace> listQuery(long start, int count, String key) throws Exception {
        return specialPlaceMapper.listQuery(start, count, key);
    }
    @Override
    public long countQuery(String key) {
        return specialPlaceMapper.countQuery(key);
    }
    @Override
    public List<SpecialPlace> getEffectiveList() {
        return specialPlaceMapper.getAll();
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.service.impl.homemodule;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
@@ -11,12 +12,20 @@
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.tencentcloud.COSManager;
import com.yeshi.fanli.dao.mybatis.homemodule.SpecialMapper;
import com.yeshi.fanli.entity.bus.homemodule.Special;
import com.yeshi.fanli.entity.common.JumpDetailV2;
import com.yeshi.fanli.exception.homemodule.SpecialException;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
import com.yeshi.fanli.service.inter.homemodule.SpecialCardService;
import com.yeshi.fanli.service.inter.homemodule.SpecialPlaceService;
import com.yeshi.fanli.service.inter.homemodule.SpecialService;
import com.yeshi.fanli.util.StringUtil;
import net.sf.json.JSONObject;
@Service
@@ -25,49 +34,210 @@
    @Resource
    private SpecialMapper specialMapper;
    @Resource
    private SpecialPlaceService specialPlaceService;
    
    @Override
    public int deleteByPrimaryKey(Long id) {
        return specialMapper.deleteByPrimaryKey(id);
    }
    @Resource
    private SpecialCardService specialCardService;
    @Override
    public int insert(Special record) {
        return specialMapper.insert(record);
    }
    @Resource
    private JumpDetailV2Service jumpDetailV2Service;
    @Override
    public int insertSelective(Special record) {
        return specialMapper.insertSelective(record);
    }
    @Override
    public Special selectByPrimaryKey(Long id) {
        return specialMapper.selectByPrimaryKey(id);
    }
    @Override
    public int updateByPrimaryKeySelective(Special record) {
        return specialMapper.updateByPrimaryKeySelective(record);
    }
    @Override
    public int updateByPrimaryKey(Special record) {
        return specialMapper.updateByPrimaryKey(record);
    public void saveObject(MultipartFile file, MultipartFile file2, MultipartFile file3, Special record, String jumpType)
            throws SpecialException, Exception{
        Long cardId = record.getCardId();
        if (cardId == null) {
            throw new SpecialException(1, "管理ID不能为空");
    }
        String name = record.getName();
        if (name == null || name.trim().length() == 0) {
            throw new SpecialException(1, "专题名称不能为空");
        }
        String params = record.getParams();
        if (params == null || params.trim().length() == 0 || "null".equalsIgnoreCase(params) ) {
            record.setParams(null);
        } else if (!StringUtil.isJson(params)) {
            throw new SpecialException(1, "跳转参数非JSON格式");
        }
        if (!StringUtil.isNullOrEmpty(jumpType)) {
            List<JumpDetailV2> listByType = jumpDetailV2Service.listByType(jumpType);
            if (listByType !=null && listByType.size() > 0) {
                record.setJumpDetail(listByType.get(0));
            }
        }
        Long state = record.getState();
        if (state == null) {
            record.setState(0L);
        }
        // 图片上传
        String picture = null;
        if (file != null) {
            picture = uploadPicture(file);
        }
        // 图片上传
        String subPicture = null;
        if (file2 != null) {
            subPicture = uploadPicture(file2);
        }
        // 图片上传
        String icon = null;
        if (file3 != null) {
            icon = uploadPicture(file3);
        }
        Long id = record.getId();
        if (id == null) {
            record.setIcon(icon);
            record.setPicture(picture);
            record.setSubPicture(subPicture);
            int maxOrder = specialMapper.getMaxOrderByCard(cardId);
            record.setOrderby(maxOrder + 1);
            record.setCreatetime(new Date());
            record.setUpdatetime(new Date());
            specialMapper.insert(record);
        } else {
            // 修改
            Special resultObj = specialMapper.selectByPrimaryKey(id);
            if (resultObj == null) {
                throw new SpecialException(1, "修改内容已不存在");
            }
            if (picture != null && picture.trim().length() > 0) {
                // 删除老图
                removePicture(resultObj.getPicture());
                // 存储新图
                record.setPicture(picture);
            } else {
                record.setPicture(resultObj.getPicture());
            }
            if (subPicture != null && subPicture.trim().length() > 0) {
                // 删除老图
                removePicture(resultObj.getSubPicture());
                // 存储新图
                record.setSubPicture(subPicture);
            } else {
                record.setSubPicture(resultObj.getSubPicture());
            }
            if (icon != null && icon.trim().length() > 0) {
                // 删除老图
                removePicture(resultObj.getIcon());
                // 存储新图
                record.setIcon(icon);
            } else {
                record.setIcon(resultObj.getIcon());
            }
            record.setOrderby(resultObj.getOrderby());
            record.setCreatetime(resultObj.getCreatetime());
            record.setUpdatetime(new Date());
            specialMapper.updateByPrimaryKey(record);
        }
    }
    /**
     * 上传图片
     * @param file
     * @return
     * @throws Exception
     */
    public String uploadPicture(MultipartFile file) throws Exception {
        // 文件解析
        InputStream inputStream = file.getInputStream();
        String contentType = file.getContentType();
        String type = contentType.substring(contentType.indexOf("/") + 1);
        // 文件路径
        String filePath="/img/special/"+UUID.randomUUID().toString().replace("-", "") + "." + type;
        // 执行上传
        String fileLink= COSManager.getInstance().uploadFile(inputStream, filePath).getUrl();
        return fileLink;
    }
    /**
     * 删除图片-不更新数据库
     * @param record
     * @throws Exception
     */
    public void removePicture(String picture) throws Exception {
        if (picture != null && picture.trim().length() > 0) {
            COSManager.getInstance().deleteFile(picture);
        }
    }
    @Override
    @Transactional
    public void updateOrder(Long id, Integer moveType) throws SpecialException {
        if (id == null || moveType == null || (!moveType.equals(1) && !moveType.equals(-1))) {
            throw new SpecialException(1, "请传递正确参数");
        }
        Special resultObj = specialMapper.selectByPrimaryKey(id);
        if (resultObj == null) {
            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, "在相同使用地方中优先级已经最高了");
            }
        }
        resultObj.setOrderby(exchangeObject.getOrderby());
        exchangeObject.setOrderby(order);
        specialMapper.updateByPrimaryKey(resultObj);
        specialMapper.updateByPrimaryKey(exchangeObject);
    }
    
    @Override
    @Transactional
    public int deleteBatchByPrimaryKey(List<Long> list) throws Exception{
        List<Special> listSpecial = specialMapper.queryByListPrimaryKey(list);
        for (Special special: listSpecial) {
            String src = special.getPicture();
            if (!StringUtil.isNullOrEmpty(src)) {
                COSManager.getInstance().deleteFile(src);
            }
        }
        
            String subPicture = special.getSubPicture();
            if (!StringUtil.isNullOrEmpty(subPicture)) {
                COSManager.getInstance().deleteFile(subPicture);
            }
        }
        return specialMapper.deleteBatchByPrimaryKey(list);
    }
    
@@ -79,6 +249,11 @@
            if (!StringUtil.isNullOrEmpty(src)) {
                COSManager.getInstance().deleteFile(src);
            }
            String subPicture = special.getSubPicture();
            if (!StringUtil.isNullOrEmpty(subPicture)) {
                COSManager.getInstance().deleteFile(subPicture);
            }
        }
        
        return specialMapper.deleteBatchByCardID(list);
@@ -87,23 +262,42 @@
    
    @Override
    public List<Special> listQueryByCard(long start, int count, Long card, String key){
        return specialMapper.listQueryByCard(start, count, card, key);
        List<Special> list = specialMapper.listQueryByCard(start, count, card, key);
        if (list == null || list.size() == 0) {
            return list;
    }
        // 跳转链接
        for (Special special: list) {
            String params = special.getParams();
            if (StringUtil.isNullOrEmpty(params)) {
                special.setParams("");
            }
            String remark = special.getRemark();
            if (StringUtil.isNullOrEmpty(remark)) {
                special.setRemark("");
            }
            JumpDetailV2 jumpDetail = special.getJumpDetail();
            if (jumpDetail == null) {
                // 默认未选择
                JumpDetailV2 jumpDetailV2 = new JumpDetailV2();
                jumpDetailV2.setName("-未选择-");
                jumpDetailV2.setType("default");
                special.setJumpDetail(jumpDetailV2);
            }
        }
        return list;
    }
    
    @Override
    public long countlistQueryByCard(Long card, String key) {
        return specialMapper.countlistQueryByCard(card, key);
    }
    
    @Override
    public List<Special> getOrderByCardID(Long cardId, Integer type, Integer order) {
        return specialMapper.getOrderByCardID(cardId, type, order);
    }
    @Override
    public int getMaxOrderByCard(Long card) {
        return specialMapper.getMaxOrderByCard(card);
    }
    @Override
    @Cacheable(value = "configCache", key = "'listBySystemAndCard-'+#card+'-'+#systemId")
@@ -120,47 +314,81 @@
    
    @Override
    public void uploadPicture(MultipartFile file, Special record, Long cardId) throws Exception {
    @Cacheable(value = "configCache", key = "'listCacheSpecialToIndex'")
    public JSONObject listCacheSpecialToIndex() throws Exception{
        
        InputStream inputStream = file.getInputStream();
        String contentType = file.getContentType();
        String type = contentType.substring(contentType.indexOf("/") + 1);
        // 上传文件相对位置
        String fileUrl="SpecialPic/"+UUID.randomUUID().toString().replace("-", "") + "." + type;
        /*  修改图片时,先删除已存在图片  */
        if (record != null) {
            String src = record.getPicture();
            if (!StringUtil.isNullOrEmpty(src)) {
                COSManager.getInstance().deleteFile(src);
        // 首页-5圆形2排区域
        JSONObject arcMap = new JSONObject();
        List<Special> listArc = specialMapper.listByPlaceKey("index_arc");
        if (listArc == null) {
            listArc = new ArrayList<Special>();
        } else if(listArc.size() > 0){
            Special special = listArc.get(0);
            if (special != null) {
                // 背景图片
                arcMap.put("bottomPicture", special.getBottomPicture());
            }
        }
        // 数据处理
        handlelist(listArc);
        arcMap.put("list", JsonUtil.getApiCommonGson().toJson(listArc));
        
        String uploadFilePath = COSManager.getInstance().uploadFile(inputStream, fileUrl).getUrl();
        
        /*  更新数据库信息  */
        if (!StringUtil.isNullOrEmpty(uploadFilePath)) {
            if (record != null) {
                record.setUpdatetime(new Date());
                record.setPicture(uploadFilePath);
                updateByPrimaryKeySelective(record);
            } else {
                record = new Special();
                record.setPicture(uploadFilePath);
                record.setCreatetime(new Date());
                record.setUpdatetime(new Date());
                record.setCardId(cardId);
                record.setState(0L);
                int maxOrder = getMaxOrderByCard(cardId);
                record.setOrderby(maxOrder + 1);
                record.setShowType("default");
                insertSelective(record);
        // 首页-活动区域(女王节)
        JSONObject activityMap = new JSONObject();
        List<Special> listActivity = specialMapper.listByPlaceKey("index_activity");
        if (listActivity == null) {
            listActivity = new ArrayList<Special>();
        } else if(listActivity.size() > 0){
            Special special = listActivity.get(0);
            if (special != null) {
                // 背景图片
                activityMap.put("bottomPicture", special.getBottomPicture());
            }
        }
        // 数据处理
        handlelist(listActivity);
        activityMap.put("list", JsonUtil.getApiCommonGson().toJson(listActivity));
        // 首页-方形专题(品牌券、母婴...)
        JSONObject blockJsonMap = new JSONObject();
        List<Special> listBlock = specialMapper.listByPlaceKey("index_block");
        if (listBlock == null) {
            listBlock = new ArrayList<Special>();
        } else if(listBlock.size() > 0){
            Special special = listBlock.get(0);
            if (special != null) {
                // 背景图片
                blockJsonMap.put("bottomPicture", special.getBottomPicture());
            }
        }
        // 数据处理
        handlelist(listBlock);
        blockJsonMap.put("list", JsonUtil.getApiCommonGson().toJson(listBlock));
        JSONObject root = new JSONObject();
        root.put("arcArea", arcMap);
        root.put("activityArea", activityMap);
        root.put("blockArea", blockJsonMap);
        return root;
    }
    
    /**
     * 处理 数据
     * @param list
     */
    public void handlelist(List<Special> list) {
        if (list != null && list.size() > 0) {
            for (Special special: list) {
                boolean needLogin = special.isJumpLogin();
                JumpDetailV2 jumpDetail = special.getJumpDetail();
                if (jumpDetail != null) {
                    jumpDetail.setNeedLogin(needLogin);
                    special.setJumpDetail(jumpDetail);
                }
            }
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SwiperBannerServiceImpl.java
@@ -28,22 +28,22 @@
    
    
    @Override
    public int deleteByPrimaryKey(Long id)  throws SwiperBannerException{
    public int deleteByPrimaryKey(Long id){
        return swiperBannerMapper.deleteByPrimaryKey(id);
    }
    @Override
    public int insert(SwiperBanner record) throws SwiperBannerException{
    public int insert(SwiperBanner record){
        return swiperBannerMapper.insert(record);
    }
    @Override
    public int insertSelective(SwiperBanner record) throws SwiperBannerException{
    public int insertSelective(SwiperBanner record){
        return swiperBannerMapper.insertSelective(record);
    }
    @Override
    public SwiperBanner selectByPrimaryKey(Long id) throws SwiperBannerException{
    public SwiperBanner selectByPrimaryKey(Long id){
        return swiperBannerMapper.selectByPrimaryKey(id);
    }
@@ -89,5 +89,9 @@
        return swiperBannerMapper.deleteBatchByPrimaryKey(list);
    }
    
    @Override
    public List<SwiperBanner> getEffectiveOption() {
        return swiperBannerMapper.getEffectiveOption();
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SwiperPictureServiceImpl.java
@@ -78,8 +78,10 @@
        }
        
        String params = record.getParams();
        if ((params != null && params.trim().length() == 0) || "null".equalsIgnoreCase(params) ) {
        if (params == null || params.trim().length() == 0 || "null".equalsIgnoreCase(params) ) {
            record.setParams(null);
        } else if (!StringUtil.isJson(params)) {
            throw new SwiperPictureException(1, "跳转参数非JSON格式");
        }
        
        if (!StringUtil.isNullOrEmpty(jumpType)) {
@@ -233,7 +235,25 @@
    @Override
    @Cacheable(value = "bannerCache", key = "'getByBannerCard-'+#card")
    public List<SwiperPicture> getByBannerCard(String card) throws SwiperPictureException {
        return swiperPictureMapper.getByBannerCard(card);
        List<SwiperPicture> list = swiperPictureMapper.getByBannerCard(card);
        if (list != null && list.size() > 0) {
            for (SwiperPicture swiperPicture: list) {
                boolean needLogin = swiperPicture.isJumpNeedLogin();
                JumpDetailV2 jumpDetail = swiperPicture.getJumpDetail();
                if (jumpDetail != null) {
                    jumpDetail.setNeedLogin(needLogin);
                    swiperPicture.setJumpDetail(jumpDetail);
                }
            }
        }
        return list;
    }
    @Override
    @Cacheable(value = "bannerCache", key = "'getByBannerId-'+#bannerId")
    public List<SwiperPicture> getByBannerId(Long bannerId) throws SwiperPictureException {
        return swiperPictureMapper.getByBannerId(bannerId);
    }
    
}
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/ThreeSaleSerivceImpl.java
@@ -297,20 +297,12 @@
        return threeSaleMapper.countSuperiorQuery(state, uid);
    }
    @Override
    public List<ThreeSale> listFirstTeam(long start, int count, Long uid) {
        return threeSaleMapper.listFirstTeam(start, count, uid);
    }
    @Override
    public long countFirstTeam(Long uid, Integer state) {
        return threeSaleMapper.countFirstTeam(uid, state);
    }
    @Override
    public List<ThreeSale> listSecondTeam(long start, int count, Long uid) {
        return threeSaleMapper.listSecondTeam(start, count, uid);
    }
    @Override
    public long countSecondTeam(Long uid, Integer state) {
@@ -333,26 +325,26 @@
    }
    @Override
    public JSONObject getMyFirstTeam(long start, int count, Long uid) {
    public JSONObject getMyFirstTeam(long start, int count, Long uid, Integer state) {
        List<ThreeSale> list = threeSaleMapper.listFirstTeam(start, count, uid);
        List<ThreeSale> list = threeSaleMapper.listFirstTeam(start, count, uid, state);
        if (list == null) {
            list = new ArrayList<ThreeSale>();
        }
        long countTotal = threeSaleMapper.countFirstTeam(uid, null);
        long countTotal = threeSaleMapper.countFirstTeam(uid, state);
        return organizeTeam(countTotal, list);
    }
    @Override
    public JSONObject getMySecondTeam(long start, int count, Long uid) {
        List<ThreeSale> list = threeSaleMapper.listSecondTeam(start, count, uid);
    public JSONObject getMySecondTeam(long start, int count, Long uid, Integer state) {
        List<ThreeSale> list = threeSaleMapper.listSecondTeam(start, count, uid, state);
        if (list == null) {
            list = new ArrayList<ThreeSale>();
        }
        long countTotal = threeSaleMapper.countSecondTeam(uid, null);
        long countTotal = threeSaleMapper.countSecondTeam(uid, state);
        return organizeTeam(countTotal, list);
    }
@@ -510,7 +502,6 @@
            threeSale.setCreateTime(java.lang.System.currentTimeMillis());
            threeSale.setUpdateTime(java.lang.System.currentTimeMillis());
            threeSaleMapper.insertSelective(threeSale);
        }
        List<ThreeSale> listExpire = threeSaleMapper.getExpireRecord(inviter.getId(), invitee.getId());
@@ -531,6 +522,67 @@
    }
    @Override
    @Transactional
    public void bindRelationshipByWX(UserInfo invitee, Long inviterId, ThreeSale threeSaleOld) throws ThreeSaleException {
        if (invitee == null || (inviterId == null && threeSaleOld == null))
            throw new ThreeSaleException(1, "用户信息为空");
        ThreeSale threeSale = null;
        if (inviterId != null ) {
            // 新建立确定关系
            threeSale  = new ThreeSale();
            threeSale.setBoss(new UserInfo(inviterId));
            threeSale.setWorker(invitee);
            threeSale.setState(true);
            threeSale.setExpire(ThreeSale.EXPIRE_NORMAL);
            threeSale.setSucceedTime(java.lang.System.currentTimeMillis());
            threeSale.setCreateTime(java.lang.System.currentTimeMillis());
            threeSale.setUpdateTime(java.lang.System.currentTimeMillis());
            threeSaleMapper.insertSelective(threeSale);
            // 邀请关系失效  1.5.3 之前失效
            if (threeSaleOld != null) {
                ThreeSale three  = new ThreeSale();
                three.setId(threeSaleOld.getId());
                three.setExpire(ThreeSale.EXPIRE_OUTOFDATE);
                three.setUpdateTime(java.lang.System.currentTimeMillis());
                threeSaleMapper.updateByPrimaryKeySelective(three);
            }
        } else if (threeSaleOld != null && inviterId == null) {
            // 1.5.3 之前生效
            threeSaleOld.setState(true);
            threeSaleOld.setExpire(ThreeSale.EXPIRE_NORMAL);
            threeSaleOld.setSucceedTime(java.lang.System.currentTimeMillis());
            threeSaleOld.setUpdateTime(java.lang.System.currentTimeMillis());
            threeSaleMapper.updateByPrimaryKeySelective(threeSaleOld);
            threeSale = threeSaleOld;
        }
        if (threeSale == null) {
            throw new ThreeSaleException(1, "关系绑定失败");
        }
        // 添加到队列
        ThreeSaleCMQManager.getInstance().addThreeSaleMsg(threeSale);
        // 邀请消息
        userInviteMsgNotificationService.inviteSuccess(threeSale.getBoss().getId(), threeSale);
    }
    /**
     * 根据邀请者查询关系
     *
     * @param workerId
     * @return
     */
    @Override
    public ThreeSale getByWorkerId(Long workerId) {
        return threeSaleMapper.getByWorkerId(workerId);
    }
    @Override
    public long countSuccessFirstTeam(Long uid) {
        return threeSaleMapper.countFirstTeam(uid, 1);
    }
fanli/src/main/java/com/yeshi/fanli/service/impl/lable/LabelServiceImpl.java
@@ -36,8 +36,6 @@
    @Resource
    private LabelMapper labelMapper;
    @Resource
    private LabelService labelService;
    
    @Resource
    private LabelGoodsMapper labelGoodsMapper;
@@ -92,7 +90,7 @@
        
        // 上传图片
        if (file != null) {
            labelService.uploadPicture(file, label);
            uploadPicture(file, label);
        }
                
        
@@ -140,7 +138,7 @@
            Label label = labelMapper.selectByPrimaryKey(id);
            if (label != null) {
                // 删除图片
                labelService.deleteImg(label);
                deleteImg(label);
                // 删除数据信息
                labelMapper.deleteByPrimaryKey(id);
                
@@ -215,7 +213,7 @@
            
            for (String title : titles) {
                
                List<Label> labels = labelService.selectByTitle(title.trim());
                List<Label> labels = selectByTitle(title.trim());
                // 若已存在则不存入数据库
                if (labels == null || labels.size() == 0) {
                    Label label = new Label();
@@ -226,7 +224,7 @@
                    label.setUpdatetime(nowTime);
                    label.setCreateUser(admin);
                    
                    labelService.insertSelective(label);
                    insertSelective(label);
                }
            }
@@ -266,7 +264,7 @@
                label.setPicture(uploadFilePath);
                label.setUpdatetime(nowTime);
                
                result = labelService.updateByPrimaryKeySelective(label);
                result = updateByPrimaryKeySelective(label);
            }
        }
        
@@ -295,7 +293,7 @@
                label.setPicture(null);
                label.setUpdatetime(nowTime);
                // 更新数据库
                result = labelService.updateByPrimaryKey(label);
                result = updateByPrimaryKey(label);
            }
            
        }
@@ -366,7 +364,7 @@
        
        for (String title : arrtitles) {
            /* 遍历标签名称:查询数据库中是否已存在 */
            List<Label> labels = labelService.selectByTitle(title.trim());
            List<Label> labels = selectByTitle(title.trim());
            if (labels != null && labels.size() > 0) {
                Label label = labels.get(0);
                listLabs.add(label);
@@ -380,7 +378,7 @@
                label.setCreateUser(admin);
                label.setIosClick(0l);
                label.setAndroidClick(0l);
                labelService.insertSelective(label);
                insertSelective(label);
                
                listLabs.add(label);
            }
fanli/src/main/java/com/yeshi/fanli/service/impl/lable/QualityGoodsServiceImpl.java
@@ -79,6 +79,12 @@
        return qualityFactoryMapper.countQueryByFlashSale();
    }
    
    @Override
    public List<QualityFactory> listFlashSaleRandGoods() {
        return qualityFactoryMapper.listFlashSaleRandGoods();
    }
    /**
     * 今日必抢 - 9k9
     * @param start
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserSystemMsgServiceImpl.java
@@ -7,7 +7,6 @@
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.config.SystemZnxDao;
import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
import com.yeshi.fanli.dao.mybatis.msg.UserSystemMsgMapper;
import com.yeshi.fanli.entity.bus.msg.UserSystemMsg;
@@ -17,6 +16,7 @@
import com.yeshi.fanli.exception.msg.UserSystemMsgException;
import com.yeshi.fanli.service.inter.msg.UserMsgReadStateService;
import com.yeshi.fanli.service.inter.msg.UserSystemMsgService;
import com.yeshi.fanli.service.inter.user.SystemZnxService;
import com.yeshi.fanli.util.StringUtil;
@Service
@@ -32,7 +32,7 @@
    private UserInfoMapper userInfoMapper;
    @Resource
    private SystemZnxDao systemZnxDao;
    private SystemZnxService systemZnxService;
    @Override
    public void addUserSystemMsg(Long uid, UserSystemMsgTypeEnum type, String title, String content, int timeTag,
@@ -117,8 +117,8 @@
        UserInfo user = userInfoMapper.selectByPrimaryKey(uid);
        if (user == null)
            return;
        long createtTime = user.getCreatetime();
        List<SystemZnx> list = systemZnxDao.list("from SystemZnx s where s.createTime>=" + createtTime);
        long createTime = user.getCreatetime();
        List<SystemZnx> list = systemZnxService.listbyCreateTime(createTime);
        if (list != null && list.size() > 0) {
            for (SystemZnx znx : list) {
                UserSystemMsg msg = userSystemMsgMapper.selectBySystemZNXId(znx.getId());
fanli/src/main/java/com/yeshi/fanli/service/impl/push/PushGoodsServiceImpl.java
@@ -270,7 +270,7 @@
            Long goodsId = commonGoods.getGoodsId();
            String url = "https://item.taobao.com/item.htm?id=" + goodsId;
        
            pushService.pushGoods(pushGoods.getUid(), url, alertTitle, alertContent, listIOS, listAndroid);
            pushService.pushGoods(pushGoods.getUid(), alertTitle, alertContent, url,listIOS, listAndroid);
            
        } else {
            /*   多个商品推送    */
@@ -281,7 +281,7 @@
            // 生成链接
            url = url + "?id=" + id;
            pushService.pushUrl(pushGoods.getUid(), url, alertTitle, alertContent, listIOS, listAndroid);
            pushService.pushUrl(pushGoods.getUid(), alertTitle, alertContent, url, listIOS, listAndroid);
        }
        
        // 已推送
fanli/src/main/java/com/yeshi/fanli/service/impl/push/PushServiceImpl.java
@@ -66,7 +66,7 @@
    
    
    @Override
    public void pushGoods(Long uid, String url, String title, String content, List<String> listIOS,
    public void pushGoods(Long uid,  String title, String content, String url, List<String> listIOS,
            List<String> listAndroid) throws PushException {
        String gids = url.split("id=")[1];
        String gid = gids.split("&")[0];
@@ -98,6 +98,7 @@
        
        
        PushRecord pushRecord = new PushRecord();
        pushRecord.setUid(uid);
        pushRecord.setState(1);
        pushRecord.setType(PushController.GOODS); // 都成功
        pushRecord.setUrl(url);
@@ -110,7 +111,7 @@
    
    @Override
    public void pushUrl(Long uid, String url, String title, String content, List<String> listIOS,
    public void pushUrl(Long uid, String title, String content, String url, List<String> listIOS,
            List<String> listAndroid) throws PushException {
        if (StringUtil.isNullOrEmpty(url))
@@ -142,6 +143,7 @@
        
        
        PushRecord pushRecord = new PushRecord();
        pushRecord.setUid(uid);
        pushRecord.setState(1);
        pushRecord.setType(PushController.URL);
        pushRecord.setUrl(url);
fanli/src/main/java/com/yeshi/fanli/service/impl/statistic/OrderClassStatisticServiceImpl.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoUnionAuthRecordServiceImpl.java
@@ -22,4 +22,9 @@
        taoBaoUnionAuthRecordMapper.insertSelective(record);
    }
    @Override
    public String getTaoBaoUserNick(Long uid) {
        return taoBaoUnionAuthRecordMapper.getTaoBaoUserNick(uid);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/AccountMessageServiceImpl.java
@@ -9,13 +9,13 @@
import org.springframework.orm.hibernate4.HibernateCallback;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.config.SystemZnxDao;
import com.yeshi.fanli.dao.mybatis.AccountMessageMapper;
import com.yeshi.fanli.dao.user.UserInfoDao;
import com.yeshi.fanli.entity.bus.user.AccountMessage;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.system.SystemZnx;
import com.yeshi.fanli.service.inter.user.AccountMessageService;
import com.yeshi.fanli.service.inter.user.SystemZnxService;
import com.yeshi.fanli.util.Constant;
@Service
@@ -25,8 +25,9 @@
    private AccountMessageMapper accountMessageMapper;
    @Resource
    private UserInfoDao userInfoDao;
    @Resource
    private SystemZnxDao systemZnxDao;
    private SystemZnxService systemZnxService;
    @Override
    public List<AccountMessage> findAccountMessageList(long uid, int page) {
@@ -67,22 +68,9 @@
        UserInfo userInfo = userInfoDao.find(UserInfo.class, uid);
        if (userInfo == null)
            return;
        List<SystemZnx> list = (List<SystemZnx>) systemZnxDao.excute(new HibernateCallback<List<SystemZnx>>() {
            @SuppressWarnings("unchecked")
            @Override
            public List<SystemZnx> doInHibernate(Session session) throws HibernateException {
                List result = session
                        .createSQLQuery(
                                "SELECT sm.* FROM `yeshi_ec_system_msg` sm LEFT JOIN  (SELECT * FROM `yeshi_ec_account_message` a WHERE a.`uid`=? AND a.`system_msg_id` IS NOT NULL)  s ON s.`system_msg_id`=sm.`id` WHERE s.`system_msg_id` IS NULL and sm.createTime>="
                                        + userInfo.getCreatetime())
                        .addEntity(SystemZnx.class).setParameter(0, uid).list();
                if (result != null) {
                    List<SystemZnx> list = (List<SystemZnx>) result;
                    return list;
                }
                return null;
            }
        });
        List<SystemZnx> list = systemZnxService.listbyUidAndCreateTime(uid, userInfo.getCreatetime());
        if (list != null)
            for (SystemZnx systemZnx : list) {
                AccountMessage accountMessage = new AccountMessage();
fanli/src/main/java/com/yeshi/fanli/service/impl/user/SMSServiceImpl.java
@@ -26,12 +26,12 @@
    private RedisManager redisManager;
    @Override
    public String sendLoginVCode(String phone) throws SMSException {
    public String sendLoginVCode(String phone, int codeLength) throws SMSException {
        boolean limit = redisManager.isSmsFrequencyLimit(phone, SMSHistory.TYPE_LOGIN);
        if (limit)
            throw new SMSException(1001, "请过60秒再试");
        String msgCode = StringUtil.getVerifyCode(6);
        System.out.println(msgCode);
        String msgCode = StringUtil.getVerifyCode(codeLength);
        // 验证码模板
        String msg = Constant.smsConfig.getSmsLogin().replace("[签名]", Constant.smsConfig.getSmsSign()).replace("[验证码]",
                msgCode);
@@ -40,6 +40,7 @@
        // 缓存
        redisManager.sendSms(phone, SMSHistory.TYPE_LOGIN);
        redisManager.saveSMSVCode(phone, SMSHistory.TYPE_LOGIN, msgCode);
        SMSHistory smsHistory = new SMSHistory();
        smsHistory.setContent(msg);
        smsHistory.setCreateTime(new Date());
@@ -50,18 +51,28 @@
    }
    @Override
    public void sendBindVCode(String phone) throws SMSException {
    public void sendBindVCode(String phone, int codeLength) throws SMSException {
        boolean limit = redisManager.isSmsFrequencyLimit(phone, SMSHistory.TYPE_BIND);
        if (limit)
            throw new SMSException(1001, "请过60秒再试");
        String msgCode = StringUtil.getRandomCode(6);
        String msgCode = StringUtil.getVerifyCode(codeLength);
        // 验证码模板
        String msg = Constant.smsConfig.getSmsBind().replace("[签名]", Constant.smsConfig.getSmsSign()).replace("[验证码]",
                msgCode);
        // 发送短信
        TencentSMSUtil.sendSingleMsg(phone, msg);
        // 缓存
        redisManager.sendSms(phone, SMSHistory.TYPE_BIND);
        redisManager.saveSMSVCode(phone, SMSHistory.TYPE_BIND, msgCode);
        SMSHistory smsHistory = new SMSHistory();
        smsHistory.setContent(msg);
        smsHistory.setCreateTime(new Date());
        smsHistory.setPhone(phone);
        smsHistory.setType(SMSHistory.TYPE_BIND);
        smsHistoryMapper.insertSelective(smsHistory);
    }
    @Override
fanli/src/main/java/com/yeshi/fanli/service/impl/user/ShamUserServiceImpl.java
@@ -105,7 +105,7 @@
            transformId(shamUser);
            shamUser.setMsg(listTime.get(listTime.size() - i) + "秒前领券购买了这个商品");
            shamUser.setMsg(listTime.get(listTime.size() - i) + "秒前购买了此商品");
        }
        return listRand;
@@ -157,12 +157,52 @@
    public void transformId(ShamUser shamUser) {
        String id = shamUser.getId() + "";
        if (id.length() == 1) {
            shamUser.setShowId("2****" + id);
        } else {
            shamUser.setShowId(id.substring(0, 1) + "****" + id.substring(id.length() - 2, id.length() - 1));
        }
        String name = shamUser.getName();
        if(StringUtil.isNullOrEmpty(name)) {
            // 名字为空时
            String start = randomName();
            String end = randomName();
            shamUser.setName(start + "**" +end);
        } else if (name.length() == 1) {
            // 一个字
            String start = name;
            if (start.trim().length() == 0 || start.equals("*")) {
                start = randomName();
            }
            String end = randomName();
            shamUser.setName(start + "**" +end);
        } else {
            // 两个字及其以上
            String start = name.substring(0, 1);
            String end = name.substring(name.length() - 2, name.length() - 1);
            if (start.trim().length() == 0 || start.equals("*")) {
                start = randomName();
            }
            if (end.trim().length() == 0 || end.equals("*")) {
                end = randomName();
            }
            shamUser.setName(start + "**" +end);
        }
    }
    /**
     * 随机名称
     * @return
     */
    public String randomName() {
        String[] array = {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z",
                "我","半","士","思","一","成","城","罗","落","花","化","夫","福","扶","浮","生","若","梦","你","繁","华","三","起","七","易","已","意","衣",
                "且","听","风","峰","枫","音","吟","绝","倔","空","离","丽","厘","留","六","流","瘤","陆","鏐","陸","紅","誰","為","美","陳","塵","車","晨",
                "光","零","鱗","藺","離","口","了","酒","舊","傷","賞","殤","橋","巧","喬","愛","啊","嗄","譚","談","貪","銀","汗","航","孔","名","明","明","闵"
                ,"铭","鸣","冥","飞","费","非","废","达","去","曲","渠","小","笑","晓","消","校","西","妖","娆","破","眸","凉","微","兮","つ","越","黑","舊","素",
                "憾","无","っ","つ","烟","東","烁","弃","绕","雪","月","航"};
        return array[(int) (Math.random() * array.length-1)];
    }
    @Override
fanli/src/main/java/com/yeshi/fanli/service/impl/user/SystemZnxServiceImpl.java
@@ -1,28 +1,35 @@
package com.yeshi.fanli.service.impl.user;
import java.io.Serializable;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.config.SystemZnxDao;
import com.yeshi.fanli.dao.mybatis.msg.SystemZnxMapper;
import com.yeshi.fanli.entity.system.SystemZnx;
import com.yeshi.fanli.service.inter.user.SystemZnxService;
@Service
public class SystemZnxServiceImpl implements SystemZnxService{
    
    @Resource
    private SystemZnxDao systemZnxDao;
    private SystemZnxMapper systemZnxMapper;
    
    /**
     * 插入数据
     */
    @Override
    public void save(SystemZnx systemZnx) {
        Serializable id = systemZnxDao.save(systemZnx);
        if(id!=null) {
            systemZnx.setId(Long.parseLong(id+""));
        systemZnxMapper.insertSelective(systemZnx);
        }
    @Override
    public List<SystemZnx> listbyCreateTime(long createTime){
        return systemZnxMapper.listbyCreateTime(createTime);
    }
    @Override
    public List<SystemZnx> listbyUidAndCreateTime(long uid, long createTime) {
        return systemZnxMapper.listbyUidAndCreateTime(uid, createTime);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountServiceImpl.java
@@ -40,8 +40,10 @@
import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
import com.yeshi.fanli.service.inter.user.UserAccountService;
import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.FileUtil;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.util.factory.msg.MsgAccountDetailFactory;
@@ -51,6 +53,9 @@
@Service
public class UserAccountServiceImpl implements UserAccountService {
    @Resource
    private RedisManager redisManager;
    @Resource
    private UserInfoMapper userInfoMapper;
@@ -78,6 +83,9 @@
    @Resource
    private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService;
    @Resource
    private UserInfoExtraService userInfoExtraService;
    @Transactional
    @Override
@@ -532,6 +540,7 @@
     * @param unionId
     * @return
     */
    @Override
    public UserInfo getUserInfoByWXUnionId(String appId, String unionId) throws UserAccountException {
        if (StringUtil.isNullOrEmpty(appId))
            throw new UserAccountException(1, "appId为空");
@@ -890,4 +899,219 @@
        return user.getPortrait();
    }
    @Transactional
    @Override
    public UserInfo loginPhone(HttpServletRequest request,int loginType, String vcode, String phone,
            String appId) throws UserAccountException {
        // 空额清理
        if (phone == null || phone.trim().length() == 0) {
            throw new UserAccountException(1, "请输入手机号码");
        }
        phone = phone.replaceAll(" ", "");
//        // 苹果应用商店上线测试号码
//        if ("17316780233".equalsIgnoreCase(phone) && "258168".equalsIgnoreCase(vcode)) {
//            ;
//        } else {
//
//            if (StringUtil.isNullOrEmpty(vcode)) {
//                throw new UserAccountException(1, "请输入验证码");
//            }
//
//            String oldVcode = redisManager.getSMSVCode(phone, SMSHistory.TYPE_LOGIN);
//            LogHelper.test("----------------------登录验证码: " + oldVcode);
//            if (StringUtil.isNullOrEmpty(oldVcode) || !oldVcode.equalsIgnoreCase(vcode)) {
//                throw new UserAccountException(1, "验证码错误,重新输入");
//            }
//        }
//        redisManager.clearSMSFrequencyLimit(phone, SMSHistory.TYPE_LOGIN);
        JSONObject logInfo = new JSONObject();
        logInfo.put("appId", appId);
        logInfo.put("phone", phone);
        logInfo.put("loginType", loginType);
        LogHelper.lgoinInfo(logInfo.toString());
        // 判断手机号码是否被封禁
        ForbiddenUserIdentifyCode identifyCode1 = forbiddenUserIdentifyCodeService
                .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.phone, phone);
        if (identifyCode1 != null && identifyCode1.getEffective() != null && identifyCode1.getEffective()) {
            throw new UserAccountException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
        }
        // 查询是否存在该电话历史用户
        UserInfo userInfo = userInfoMapper.getEffectiveUserInfoByPhone(phone);
        if (userInfo != null) {
            // 更新账户登录信息
            updateLonginInfo(userInfo, loginType, request);
        } else {
            userInfo = new UserInfo();
            userInfo.setAppId(appId);
            userInfo.setNickName(Constant.systemCommonConfig.getDefaultNickName());
            userInfo.setPortrait(Constant.systemCommonConfig.getDefaultPortrait());
            userInfo.setPhone(phone);
            userInfo.setLoginType(loginType);
            userInfo.setState(UserInfo.STATE_NORMAL);
            // 创建用户
            addUser(userInfo);
            try {
                // 第一次登录时创建用户额外信息
                userInfoExtraService.createUserInfoExtra(userInfo.getId());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return userInfo;
    }
    @Transactional
    @Override
    public UserInfo loginWinXin(HttpServletRequest request,int loginType, String code, String appId) throws UserAccountException {
        // 日志信息
        JSONObject logInfo = new JSONObject();
        logInfo.put("appId", appId);
        logInfo.put("code", code);
        logInfo.put("loginType", loginType);
        LogHelper.lgoinInfo(logInfo.toString());
        // 通过Code换取信息
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code);
        if (weiXinUser == null) {
            throw new UserAccountException(1, "微信帐号授权失败");
        }
        LogHelper.test("微信授权用户信息:" + new Gson().toJson(weiXinUser));
        // 判断微信unionid是否被封禁
        ForbiddenUserIdentifyCode identifyCode = forbiddenUserIdentifyCodeService
                .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.wxUnionId, weiXinUser.getUnionid());
        if (identifyCode != null && identifyCode.getEffective() != null && identifyCode.getEffective()) {
            throw new UserAccountException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
        }
        UserInfo userInfo = userInfoMapper.getEffectiveUserInfoByWXUnionId(weiXinUser.getUnionid());
        // 直接用的微信登录
        if (userInfo != null) {
            // 更新账户登录信息
            updateLonginInfo(userInfo, loginType, request);
        } else {
            // 创建新账户
            userInfo = new UserInfo();
            userInfo.setPortrait(weiXinUser.getHeadimgurl());
            userInfo.setAppId(appId);
            userInfo.setNickName(weiXinUser.getNickname());
            userInfo.setWxName(weiXinUser.getNickname());
            userInfo.setWxOpenId(weiXinUser.getOpenid());
            userInfo.setWxUnionId(weiXinUser.getUnionid());
            userInfo.setWxPic(weiXinUser.getHeadimgurl());
            userInfo.setLastLoginTime(System.currentTimeMillis());
            userInfo.setLoginType(loginType);
            userInfo.setLastLoginIp(request.getRemoteHost());
            userInfo.setState(UserInfo.STATE_NORMAL);
            addUser(userInfo);
            try {
                // 第一次登录时创建用户额外信息
                userInfoExtraService.createUserInfoExtra(userInfo.getId());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return userInfo;
    }
    /**
     * 更新账户登录信息
     * @param userInfo
     * @param loginType
     * @param request
     */
    public void updateLonginInfo(UserInfo userInfo, int loginType, HttpServletRequest request) {
        // 设置登录时间与登录类型
        UserInfo updateUserInfo = new UserInfo(userInfo.getId());
        updateUserInfo.setLastLoginTime(System.currentTimeMillis());
        updateUserInfo.setLoginType(loginType);
        updateUserInfo.setLastLoginIp(request.getRemoteHost());
        userInfoMapper.updateByPrimaryKeySelective(updateUserInfo);
    }
    @Override
    public void bindPhoneNew(Long uid, String phone) throws UserAccountException {
        UserInfo user = userInfoMapper.selectByPrimaryKey(uid);
        if (user == null) {
            throw new UserAccountException(1, "用户不存在");
        }
        String hasPhone = user.getPhone();
        if (!StringUtil.isNullOrEmpty(hasPhone) && hasPhone.equals(phone)) {
            throw new UserAccountException(2, "您已经绑定了该电话号码");
        }
        UserInfo phoneUser = userInfoMapper.getEffectiveUserInfoByPhone(phone);
        if (phoneUser != null) {
            throw new UserAccountException(2, "号码已经被占用");
        }
        // 更新电话号码
        UserInfo update = new UserInfo(user.getId());
        update.setPhone(phone);
        userInfoMapper.updateByPrimaryKeySelective(update);
        // 发送消息
        userAccountMsgNotificationService.bindingSuccess(uid, MsgAccountDetailFactory.TYPE_PHONE);
    }
    @Override
    public void bindWeiXin(Long uid, String code) throws UserAccountException {
        UserInfo user = userInfoMapper.selectByPrimaryKey(uid);
        if (user == null) {
            throw new UserAccountException(1, "用户不存在");
        }
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code);
        if (weiXinUser == null) {
            throw new UserAccountException(2, "微信帐号授权失败");
        }
        if (weiXinUser.getUnionid().equalsIgnoreCase(user.getWxUnionId())) {
            throw new UserAccountException(3, "微信帐号一致无需更换");
        }
        UserInfo newUser = userInfoMapper.getEffectiveUserInfoByWXUnionId(weiXinUser.getUnionid());
        if (newUser != null) {
            throw new UserAccountException(4, "该微信号已被其他帐号绑定");
        }
        String wxUnionId = user.getWxUnionId();
        if (!StringUtil.isNullOrEmpty(wxUnionId) && StringUtil.isNullOrEmpty(user.getPhone())) {
            throw new UserAccountException(5, "该帐号没有绑定手机号码,需绑定手机号码才能完成微信更换");
        }
        UserInfo updateUserInfo = new UserInfo(uid);
        updateUserInfo.setWxName(weiXinUser.getNickname());
        updateUserInfo.setWxOpenId(weiXinUser.getOpenid());
        updateUserInfo.setWxPic(weiXinUser.getHeadimgurl());
        updateUserInfo.setWxUnionId(weiXinUser.getUnionid());
        updateUserInfo.setNickName(weiXinUser.getNickname());
        updateUserInfo.setPortrait(weiXinUser.getHeadimgurl());
        if (StringUtil.isNullOrEmpty(weiXinUser.getNickname())) {
            updateUserInfo.setNickName(Constant.systemCommonConfig.getDefaultNickName());
        }
        if (StringUtil.isNullOrEmpty(weiXinUser.getHeadimgurl())) {
            updateUserInfo.setPortrait(Constant.systemCommonConfig.getDefaultPortrait());
        }
        userInfoMapper.updateByPrimaryKeySelective(updateUserInfo);
        userAccountMsgNotificationService.bindingSuccess(uid, MsgAccountDetailFactory.TYPE_WX);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserExtraTaoBaoInfoServiceImpl.java
@@ -1,15 +1,22 @@
package com.yeshi.fanli.service.impl.user;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import javax.transaction.Transactional;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.user.UserExtraTaoBaoInfoMapper;
import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode;
import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode.ForbiddenUserIdentifyCodeTypeEnum;
import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.exception.user.UserExtraTaoBaoInfoException;
import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
@Service
@@ -18,54 +25,175 @@
    @Resource
    private UserExtraTaoBaoInfoMapper userExtraTaoBaoInfoMapper;
    @Resource
    private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService;
    @Transactional
    @Override
    public void addRelationId(Long uid, String relationId, String taoBaoUid, boolean valid) {
        if (uid == null || relationId == null)
            return;
        UserExtraTaoBaoInfo info = getByUid(uid);
        if (info == null) {
            info = new UserExtraTaoBaoInfo();
            info.setUser(new UserInfo(uid));
            info.setCreateTime(new Date());
            info.setRelationId(relationId);
            info.setRelationUpdateTime(new Date());
            info.setRelationValid(valid);
            info.setTaoBaoUid(taoBaoUid);
            userExtraTaoBaoInfoMapper.insertSelective(info);
    public void addRelationId(Long uid, String relationId, String taoBaoUid,String nickName,
            boolean valid) throws UserExtraTaoBaoInfoException{
        if (uid == null || StringUtil.isNullOrEmpty(relationId) || StringUtil.isNullOrEmpty(taoBaoUid)) {
            throw new UserExtraTaoBaoInfoException(1, "传递参数为空");
        }
        // 验证taoBaoUid是否被封禁
        if(validateTaoBaoUidForbidden(taoBaoUid)) {
            throw new UserExtraTaoBaoInfoException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
        }
        UserExtraTaoBaoInfo taoBaoInfo = new UserExtraTaoBaoInfo();
        taoBaoInfo.setUser(new UserInfo(uid));
        taoBaoInfo.setTaoBaoNickName(nickName);
        taoBaoInfo.setTaoBaoUid(taoBaoUid);
        taoBaoInfo.setRelationId(relationId);
        taoBaoInfo.setRelationValid(valid);
        taoBaoInfo.setRelationUpdateTime(new Date());
        List<UserExtraTaoBaoInfo> list = userExtraTaoBaoInfoMapper.listByTaoBaoUid(taoBaoUid);
        if (list == null || list.size() == 0) {
            //新增
            taoBaoInfo.setCreateTime(new Date());
            userExtraTaoBaoInfoMapper.insertSelective(taoBaoInfo);
        } else {
            UserExtraTaoBaoInfo update = new UserExtraTaoBaoInfo();
            update.setId(info.getId());
            update.setRelationId(relationId);
            update.setRelationValid(valid);
            update.setRelationUpdateTime(new Date());
            update.setTaoBaoUid(taoBaoUid);
            userExtraTaoBaoInfoMapper.updateByPrimaryKeySelective(update);
            // 取第一个替换uid 等信息
            taoBaoInfo.setId(list.get(0).getId());
            taoBaoInfo.setUpdateTime(new Date());
            userExtraTaoBaoInfoMapper.updateByPrimaryKeySelective(taoBaoInfo);
            // 清空多余已绑定数据
            if (list.size() > 1) {
                for (int i = 1; i < list.size(); i++) {
                    clearTaoBaoInfo(list.get(i));
                }
            }
        }
    }
    @Transactional
    @Override
    public void addSpecialId(Long uid, String specialId, String taoBaoUid, boolean valid) {
        if (uid == null || specialId == null)
            return;
        UserExtraTaoBaoInfo info = getByUid(uid);
        if (info == null) {
            info = new UserExtraTaoBaoInfo();
            info.setUser(new UserInfo(uid));
            info.setCreateTime(new Date());
            info.setSpecialId(specialId);
            info.setSpecialUpdateTime(new Date());
            info.setSpecialValid(valid);
            info.setTaoBaoUid(taoBaoUid);
            userExtraTaoBaoInfoMapper.insertSelective(info);
        } else {
            UserExtraTaoBaoInfo update = new UserExtraTaoBaoInfo();
            update.setId(info.getId());
            update.setSpecialId(specialId);
            update.setSpecialUpdateTime(new Date());
            update.setSpecialValid(valid);
            update.setTaoBaoUid(taoBaoUid);
            userExtraTaoBaoInfoMapper.updateByPrimaryKeySelective(update);
    public void addSpecialId(Long uid, String specialId, String taoBaoUid, String nickName,
            boolean valid) throws UserExtraTaoBaoInfoException{
        if (uid == null || StringUtil.isNullOrEmpty(specialId) || StringUtil.isNullOrEmpty(taoBaoUid)) {
            throw new UserExtraTaoBaoInfoException(1, "传递参数为空");
        }
        // 验证taoBaoUid是否被封禁
        if(validateTaoBaoUidForbidden(taoBaoUid)) {
            throw new UserExtraTaoBaoInfoException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
        }
        UserExtraTaoBaoInfo taoBaoInfo = new UserExtraTaoBaoInfo();
        taoBaoInfo.setUser(new UserInfo(uid));
        taoBaoInfo.setTaoBaoNickName(nickName);
        taoBaoInfo.setTaoBaoUid(taoBaoUid);
        taoBaoInfo.setSpecialValid(valid);
        taoBaoInfo.setSpecialId(specialId);
        taoBaoInfo.setSpecialUpdateTime(new Date());
        List<UserExtraTaoBaoInfo> list = userExtraTaoBaoInfoMapper.listByTaoBaoUid(taoBaoUid);
        if (list == null || list.size() == 0) {
            //新增
            taoBaoInfo.setCreateTime(new Date());
            userExtraTaoBaoInfoMapper.insertSelective(taoBaoInfo);
        } else {
            // 取第一个替换uid 等信息
            taoBaoInfo.setId(list.get(0).getId());
            taoBaoInfo.setUpdateTime(new Date());
            userExtraTaoBaoInfoMapper.updateByPrimaryKeySelective(taoBaoInfo);
            // 清空多余已绑定数据
            if (list.size() > 1) {
                for (int i = 1; i < list.size(); i++) {
                    clearTaoBaoInfo(list.get(i));
                }
            }
        }
    }
    @Transactional
    @Override
    public void saveUserTaoBaoInfo(Long uid, String relationId, String specialId, String taoBaoUid,
            String nickName, boolean valid) throws UserExtraTaoBaoInfoException {
        if (uid == null || StringUtil.isNullOrEmpty(relationId) || StringUtil.isNullOrEmpty(specialId)
                || StringUtil.isNullOrEmpty(taoBaoUid)) {
            throw new UserExtraTaoBaoInfoException(1, "传递参数部分为空");
        }
        // 验证taoBaoUid是否被封禁
        if(validateTaoBaoUidForbidden(taoBaoUid)) {
            throw new UserExtraTaoBaoInfoException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
        }
        UserExtraTaoBaoInfo taoBaoInfo = new UserExtraTaoBaoInfo();
        taoBaoInfo.setTaoBaoUid(taoBaoUid);
        taoBaoInfo.setTaoBaoNickName(nickName);
        taoBaoInfo.setUser(new UserInfo(uid));
        // 渠道
        taoBaoInfo.setRelationValid(valid);
        taoBaoInfo.setRelationId(relationId);
        taoBaoInfo.setRelationUpdateTime(new Date());
        // 绑定
        taoBaoInfo.setSpecialValid(valid);
        taoBaoInfo.setSpecialId(specialId);
        taoBaoInfo.setSpecialUpdateTime(new Date());
        List<UserExtraTaoBaoInfo> list = userExtraTaoBaoInfoMapper.listByTaoBaoUid(taoBaoUid);
        if (list == null || list.size() == 0) {
            //新增
            taoBaoInfo.setCreateTime(new Date());
            userExtraTaoBaoInfoMapper.insertSelective(taoBaoInfo);
        } else {
            // 取第一个替换uid 等信息
            taoBaoInfo.setId(list.get(0).getId());
            taoBaoInfo.setUpdateTime(new Date());
            userExtraTaoBaoInfoMapper.updateByPrimaryKeySelective(taoBaoInfo);
            // 清空多余已绑定数据
            if (list.size() > 1) {
                for (int i = 1; i < list.size(); i++) {
                    clearTaoBaoInfo(list.get(i));
                }
            }
        }
    }
    /**
     * 验证taoBaoUid  是否被封
     * @param taoBaoUid
     * @return
     */
    public boolean validateTaoBaoUidForbidden(String taoBaoUid) {
        boolean validate = false;
        ForbiddenUserIdentifyCode identifyCode = forbiddenUserIdentifyCodeService.listByTypeAndIdentifyCode(
                ForbiddenUserIdentifyCodeTypeEnum.taobaoUid, taoBaoUid);
        // 账号被封
        if (identifyCode != null && identifyCode.getEffective() != null && identifyCode.getEffective()) {
            validate = true;
        }
        return validate;
    }
    /**
     * 清空多余绑定淘宝账号信息
     * @param otherInfo
     */
    public void clearTaoBaoInfo(UserExtraTaoBaoInfo otherInfo ) {
        otherInfo.setUser(null);
        otherInfo.setTaoBaoUid(null);
        otherInfo.setTaoBaoNickName(null);
        otherInfo.setRelationValid(null);
        otherInfo.setRelationId(null);
        otherInfo.setRelationUpdateTime(null);
        otherInfo.setSpecialValid(null);
        otherInfo.setSpecialId(null);
        otherInfo.setSpecialUpdateTime(new Date());
        userExtraTaoBaoInfoMapper.updateByPrimaryKey(otherInfo);
    }
    @Override
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.service.impl.user;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
@@ -11,24 +12,32 @@
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.yeshi.utils.DateUtil;
import com.yeshi.fanli.dao.mybatis.user.UserInfoExtraMapper;
import com.yeshi.fanli.dao.mybatis.user.UserRankRecordMapper;
import com.yeshi.fanli.entity.bus.user.ThreeSale;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.bus.user.UserRank;
import com.yeshi.fanli.entity.bus.user.UserRankRecord;
import com.yeshi.fanli.entity.bus.user.WeiXinUser;
import com.yeshi.fanli.exception.ThreeSaleException;
import com.yeshi.fanli.exception.user.UserInfoExtraException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
import com.yeshi.fanli.service.inter.order.CommonOrderCountService;
import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
import com.yeshi.fanli.service.inter.user.UserAccountService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.service.inter.user.UserInviteRecordService;
import com.yeshi.fanli.service.inter.user.UserRankService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.account.UserUtil;
import com.yeshi.fanli.util.wx.WXLoginUtil;
import com.yeshi.fanli.vo.user.UserInfoExtraVO;
@@ -55,6 +64,15 @@
    
    @Resource
    private UserInfoService userInfoService;
    @Resource
    private UserAccountService userAccountService;
    @Resource
    private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService;
    @Resource
    private UserInviteRecordService userInviteRecordService;
    
    @Override
@@ -157,6 +175,21 @@
        }
        
        return userInfoExtra;
    }
    @Override
    public void createUserInfoExtra (Long uid) throws UserInfoExtraException{
        UserInfoExtra userInfoExtra = userInfoExtraMapper.getInfoExtraByUid(uid);
        if (userInfoExtra != null) {
            return;
        }
        userInfoExtra = new UserInfoExtra();
        userInfoExtra.setUserInfo(new UserInfo(uid));
        userInfoExtra.setFirstLoginTime(new Date());
        userInfoExtra.setCreateTime(new Date());
        userInfoExtra.setUpdateTime(new Date());
        userInfoExtraMapper.insertSelective(userInfoExtra);
    }
    
    
@@ -293,6 +326,12 @@
            throw new UserInfoExtraException(1, "用户id、邀请码不能为空");
        }
        
        // 被邀请人信息
        UserInfo invitee = userInfoService.selectByPKey(uid);
        if (invitee == null) {
            throw new UserInfoExtraException(1, "用户不存在");
        }
        UserInfoExtra extra = userInfoExtraMapper.getInfoExtraByUid(uid);
        if (extra != null) {
            String inviteCodeHas = extra.getInviteCode();
@@ -301,16 +340,10 @@
            }
        }
        
        // 被邀请人信息
        UserInfo invitee = userInfoService.selectByPKey(uid);
        if (invitee == null) {
            throw new UserInfoExtraException(1, "用户不存在");
        }
        // 邀请人信息
        UserInfo inviter = userInfoService.getInfoByPhoneOrInviteCode(inviteCode, inviteCode);
        if (inviter == null) {
            throw new UserInfoExtraException(1, "请输入有效的邀请码");
            throw new UserInfoExtraException(1, "上级邀请码不存在");
        }
        
        // 绑定关系
@@ -347,6 +380,114 @@
        
        return code;
    }
    @Override
    public void activationInviteWX(Long uid, String code) throws UserInfoExtraException{
        if (uid == null || code == null) {
            throw new UserInfoExtraException(1, "用户id、邀请码不能为空");
        }
        // 用户信息
        UserInfo invitee = userInfoService.selectByPKey(uid);
        if (invitee == null) {
            throw new UserInfoExtraException(1, "用户不存在");
        }
        // 用户额外信息
        UserInfoExtra extra = userInfoExtraMapper.getInfoExtraByUid(uid);
        if (extra != null) {
            String inviteCodeHas = extra.getInviteCode();
            if (inviteCodeHas != null && inviteCodeHas.trim().length() > 0) {
                throw new UserInfoExtraException(1, "已经激活, 无需再次激活");
            }
        }
        // 获取微信信息
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinWYUser(code);
        if (weiXinUser == null) {
            throw new UserInfoExtraException(1, "微信授权失败");
        }
        String wxUnionId = weiXinUser.getUnionid();
        if (wxUnionId == null || wxUnionId.trim().length() == 0) {
            throw new UserInfoExtraException(1, "微信授权失败");
        }
        // 自动绑定微信
        UserInfo updateUserInfo = new UserInfo(uid);
        updateUserInfo.setWxName(weiXinUser.getNickname());
        updateUserInfo.setWxOpenId(weiXinUser.getOpenid());
        updateUserInfo.setWxPic(weiXinUser.getHeadimgurl());
        updateUserInfo.setWxUnionId(weiXinUser.getUnionid());
        updateUserInfo.setNickName(weiXinUser.getNickname());
        updateUserInfo.setPortrait(weiXinUser.getHeadimgurl());
        if (StringUtil.isNullOrEmpty(weiXinUser.getNickname())) {
            updateUserInfo.setNickName(Constant.systemCommonConfig.getDefaultNickName());
        }
        if (StringUtil.isNullOrEmpty(weiXinUser.getHeadimgurl())) {
            updateUserInfo.setPortrait(Constant.systemCommonConfig.getDefaultPortrait());
        }
        userInfoService.updateByPrimaryKeySelective(updateUserInfo);
        // 邀请人ID -1.5.3新版
        Long inviterId = userInviteRecordService.getNewestInviterId(wxUnionId);
        // 兼容1.5.3 之前版本
        ThreeSale threeSale = threeSaleSerivce.getByWorkerId(uid);
        if (inviterId == null && threeSale != null) {
            Long bossId = threeSale.getBoss().getId();
            UserInfoExtra inviterExtra = userInfoExtraMapper.getInfoExtraByUid(bossId);
            if (inviterExtra != null && inviterExtra.getInviteCode() == null ) {
                // 更新邀请码
                UserInfoExtra inviterInfoExtra = new UserInfoExtra();
                inviterInfoExtra.setId(inviterExtra.getId());
                inviterInfoExtra.setInviteCode(UserUtil.getInviteCode(bossId));
                userInfoExtraMapper.updateByPrimaryKeySelective(inviterInfoExtra);
            }
        }
        // 没有被邀请过
        if (inviterId == null && threeSale == null) {
            throw new UserInfoExtraException(1, "微信激活失败");
        }
        // 绑定关系
        try {
            threeSaleSerivce.bindRelationshipByWX(invitee, inviterId, threeSale);
        } catch (ThreeSaleException e) {
            try {
                LogHelper.errorDetailInfo(e);
            } catch (Exception e1) {
                e1.printStackTrace();
            }
            throw new UserInfoExtraException(1, "激活失败");
        }
        // 邀请码有效、生成邀请码
        String inviteCode = UserUtil.getInviteCode(uid);
        if (inviteCode == null || inviteCode.trim().length() == 0) {
            throw new UserInfoExtraException(1, "激活码生成失败");
        }
        // 保存邀请码
        UserInfoExtra userInfoExtra = new UserInfoExtra();
        userInfoExtra.setUserInfo(invitee);
        userInfoExtra.setInviteCode(inviteCode);
        userInfoExtra.setUpdateTime(new Date());
        if (extra != null) {
            userInfoExtra.setId(extra.getId());
            userInfoExtraMapper.updateByPrimaryKeySelective(userInfoExtra);
        } else {
            userInfoExtra.setCreateTime(new Date());
            userInfoExtraMapper.insertSelective(userInfoExtra);
        }
    }
    
    @Override
    public UserInfoExtra getUserInfoExtra(Long uid) {
@@ -397,6 +538,25 @@
        return userInfoExtraMapper.countByRankId(rankId);
    }
    
    @Override
    public boolean isNewUser(Long uid) {
        boolean isNew = false;
        if (uid == null) {
            return isNew;
        }
    
        UserInfoExtra extra = userInfoExtraMapper.getInfoExtraByUid(uid);
        if (extra != null && extra.getFirstLoginTime() != null) {
            try {
                int day = DateUtil.daysBetween(extra.getFirstLoginTime(), new Date());
                if (day <= 15) {
                    isNew = true;
                }
            } catch (ParseException e) {
                e.printStackTrace();
            }
        }
        return isNew;
    }
    
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoServiceImpl.java
@@ -36,14 +36,19 @@
import com.yeshi.fanli.dao.user.UserInfoDao;
import com.yeshi.fanli.entity.bus.user.BindingAccount;
import com.yeshi.fanli.entity.bus.user.InviteUser;
import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.WeiXinUser;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.exception.ThreeSaleException;
import com.yeshi.fanli.exception.user.UserInfoException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionAuthRecordService;
import com.yeshi.fanli.service.inter.user.UserActiveLogService;
import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.service.inter.user.UserRankService;
import com.yeshi.fanli.util.Constant;
@@ -93,6 +98,16 @@
    
    @Resource
    private UserRankService userRankService;
    @Resource
    private UserActiveLogService userActiveLogService;
    @Resource
    private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
    @Resource
    private TaoBaoUnionAuthRecordService taoBaoUnionAuthRecordService;
    
    public UserInfo getUserByLoginTypeAndOpenId(int loginType, String openid, String appid) {
@@ -692,15 +707,13 @@
            userInfoVO.setLastLoginTime(null);
        }
        String wxUnionId = userInfoVO.getWxUnionId();
        if (wxUnionId == null || wxUnionId.trim().length() == 0) {
            userInfoVO.setWxName(null);
        }
        String taoBaoUid = userInfoVO.getTaoBaoUid();
        if (taoBaoUid == null || taoBaoUid.trim().length() == 0) {
            userInfoVO.setTbName(null);
        }
        /* 显示用户微信 淘宝  老版本存在
         * String wxUnionId = userInfoVO.getWxUnionId(); if (wxUnionId == null ||
         * wxUnionId.trim().length() == 0) { userInfoVO.setWxName(null); }
         *
         * String taoBaoUid = userInfoVO.getTaoBaoUid(); if (taoBaoUid == null ||
         * taoBaoUid.trim().length() == 0) { userInfoVO.setTbName(null); }
         */
        
        
        Long uid = userInfoVO.getId();
@@ -835,4 +848,61 @@
        return userInfoMapper.getInfoByPhoneOrInviteCode(phone, inviteCode);
    }
    
    @Override
    public UserInfo getEffectiveUserInfoByPhone(String phone) {
        return userInfoMapper.getEffectiveUserInfoByPhone(phone);
    }
    @Override
    public UserInfo getEffectiveUserInfoByWXUnionId(String unionId) {
        return userInfoMapper.getEffectiveUserInfoByWXUnionId(unionId);
    }
    @Override
    public UserInfo getUserInfo(Long uid) throws UserInfoException{
        if (uid == null) {
            throw new UserInfoException(1, "请求参数为空");
        }
        UserInfo userInfo = userInfoMapper.selectByPKey(uid);
        if(userInfo == null) {
            throw new UserInfoException(1, "用户不存在");
        }
        if (userInfo.getState() == UserInfo.STATE_FORBIDDEN) {
            throw new UserInfoException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
        }
        if (userInfo.getState()!= UserInfo.STATE_NORMAL) {
            throw new UserInfoException(1, "用户不存在");
        }
        // 淘宝昵称 组织
        boolean clearTbName = true;
        UserExtraTaoBaoInfo extraTaoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid);
        if (extraTaoBaoInfo != null) {
            String specialId = extraTaoBaoInfo.getSpecialId();
            String relationId = extraTaoBaoInfo.getRelationId();
            String taoBaoNickName = extraTaoBaoInfo.getTaoBaoNickName();
            if(!StringUtil.isNullOrEmpty(specialId) && !StringUtil.isNullOrEmpty(relationId)) {
                if(!StringUtil.isNullOrEmpty(taoBaoNickName)) {
                    userInfo.setTbName(taoBaoNickName);
                    clearTbName = false;
                } else {
                    String taoBaoUserNick = taoBaoUnionAuthRecordService.getTaoBaoUserNick(uid);
                    if(!StringUtil.isNullOrEmpty(taoBaoUserNick)) {
                        userInfo.setTbName(taoBaoUserNick);
                        clearTbName = false;
                    }
                }
            }
        }
        if (clearTbName) {
            userInfo.setTbName(null);
        }
        return userInfo;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInviteRecordServiceImpl.java
New file
@@ -0,0 +1,82 @@
package com.yeshi.fanli.service.impl.user;
import java.util.Date;
import javax.annotation.Resource;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.user.UserInviteRecordMapper;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInviteRecord;
import com.yeshi.fanli.entity.bus.user.WeiXinUser;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.service.inter.user.UserInviteRecordService;
import com.yeshi.fanli.util.wx.WXLoginUtil;
@Service
public class UserInviteRecordServiceImpl implements UserInviteRecordService {
    @Resource
    private UserInviteRecordMapper userInviteRecordMapper;
    @Resource
    private UserInfoService  userInfoService;
    @Async("pushExecutor")
    @Override
    public void saveInviteRecord(String code, String uid) {
        // 用户code 未获取到
        if (code == null || uid == null || uid.trim().length() == 0) {
            return;
        }
        // 没得这个人
        Long invitId = Long.parseLong(uid);
        UserInfo inviter = userInfoService.getUserById(invitId);
        if (inviter == null) {
            return;
        }
        // 获取微信信息
        WeiXinUser weiXinUser = WXLoginUtil.getWeiXinWYUser(code);
        if (weiXinUser == null) {
            return;
        }
        String wxUnionId = weiXinUser.getUnionid();
        if (wxUnionId == null || wxUnionId.trim().length() == 0) {
            return;
        }
        // 是否是邀请者自己识别
        if (wxUnionId.equals(inviter.getWxUnionId())) {
            return;
        }
        UserInviteRecord record  = userInviteRecordMapper.getByInviterIdAndUnionid(invitId, wxUnionId);
        if (record != null) {
            UserInviteRecord userInviteRecord = new UserInviteRecord();
            userInviteRecord.setId(record.getId());
            userInviteRecord.setUpdateTime(new Date());
            userInviteRecordMapper.updateByPrimaryKey(record);
        } else {
            UserInviteRecord userInviteRecord = new UserInviteRecord();
            userInviteRecord.setInviterId(invitId);
            userInviteRecord.setWxUnionid(wxUnionId);
            userInviteRecord.setCreateTime(new Date());
            userInviteRecord.setUpdateTime(new Date());
            userInviteRecordMapper.insertSelective(userInviteRecord);
        }
    }
    @Override
    public Long getNewestInviterId(String wxUnionId) {
        return userInviteRecordMapper.getNewestInviterId(wxUnionId);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserLotteryRecordServiceImpl.java
New file
@@ -0,0 +1,385 @@
package com.yeshi.fanli.service.impl.user;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.yeshi.utils.DateUtil;
import com.yeshi.fanli.dao.mybatis.user.UserLotteryRecordMapper;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.bus.user.UserLotteryRecord;
import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
import com.yeshi.fanli.entity.system.SystemCoupon;
import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
import com.yeshi.fanli.exception.user.UserInfoExtraException;
import com.yeshi.fanli.exception.user.UserLotteryRecordException;
import com.yeshi.fanli.exception.user.UserSystemCouponException;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.config.SystemCouponService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.UserLotteryRecordService;
import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
import net.sf.json.JSONObject;
@Service
public class UserLotteryRecordServiceImpl implements UserLotteryRecordService {
    @Resource
    private UserLotteryRecordMapper userLotteryRecordMapper;
    @Resource
    private ConfigService configService;
    @Resource
    private UserSystemCouponService userSystemCouponService;
    @Resource
    private SystemCouponService systemCouponService;
    @Resource
    private UserInfoExtraService userInfoExtraService;
    public UserLotteryRecord getLotteryByTypeAndUid(Long uid, String type) {
        int num = 0;
        UserLotteryRecord record = userLotteryRecordMapper.getByTypeAndUid(uid, type);
        if (record != null) {
            // 今日之内是否已抽过奖
            Date updateTime = record.getUpdateTime();
            if (updateTime != null && DateUtil.isSameDay(updateTime, new Date())) {
                num = record.getCount();
            } else {
                if (UserLotteryRecord.TYPE_DAILY_REBATE.equals(type)) {
                    // 1、天天送抽奖次数
                    num = UserLotteryRecord.COUNT_DAILY_REBATE;
                } else if(UserLotteryRecord.TYPE_NEWBIES.equals(type))  {
                    // 2、新人抽奖
                    num = record.getCount();
                }
            }
        } else {
            if (UserLotteryRecord.TYPE_DAILY_REBATE.equals(type)) {
                // 1、天天送抽奖次数
                num = UserLotteryRecord.COUNT_DAILY_REBATE;
            } else if(UserLotteryRecord.TYPE_NEWBIES.equals(type))  {
                // 2、新人抽奖 : 15天之内首次登录系统
                boolean isNewUser = userInfoExtraService.isNewUser(uid);
                if (isNewUser) {
                    num = UserLotteryRecord.COUNT_NEWBIES;
                }
            }
            if (num > 0)  {
                // 插入抽奖记录
                record = new UserLotteryRecord();
                record.setUid(uid);
                record.setType(type);
                record.setCount(num);
                record.setCreateTime(new Date());
                record.setUpdateTime(new Date());
                userLotteryRecordMapper.insertSelective(record);
            }
        }
        if (record == null) {
            record = new UserLotteryRecord();
            record.setUid(uid);
            record.setType(type);
            record.setCount(num);
        }
        return record;
    }
    @Override
    public JSONObject getLotteryCountNewbies(Long uid) throws UserLotteryRecordException,Exception {
        if (uid == null || uid == 0) {
             throw new UserLotteryRecordException(1, "未登录系统");
        }
        // 兼容1.5.3之前版本
        UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
        if (userInfoExtra == null) {
            throw new UserLotteryRecordException(1, "未登录系统");
        }
        //抽奖次数
        int count = 0;
        Integer lotteryNewbies = userInfoExtra.getLotteryNewbies();
        if (lotteryNewbies != null) {
            count = lotteryNewbies;
        } else {
            UserLotteryRecord record = getLotteryByTypeAndUid(uid, UserLotteryRecord.TYPE_NEWBIES);
            if (record != null) {
                count = record.getCount();
            }
        }
        // 抽奖规则
        String lotteryRule = configService.get("lottery_rule_newbies");
        JSONObject data = new JSONObject();
        data.put("count", count);
        data.put("rule", lotteryRule);
        return data;
    }
    @Override
    public Map<String, Object> executeLotteryNewbies(Long uid) throws UserLotteryRecordException, Exception{
        if (uid == null || uid == 0) {
             throw new UserLotteryRecordException(1, "未登录系统");
        }
        UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
        if (userInfoExtra == null) {
            throw new UserLotteryRecordException(1, "未登录系统");
        }
        int count = 0;
        boolean isold = true;
        UserLotteryRecord record = null;
        Integer lotteryNewbies = userInfoExtra.getLotteryNewbies();
        if (lotteryNewbies != null) {
            // 老版的次数   兼容1.5.3之前版本
            count = lotteryNewbies;
        } else {
            isold = false; // 新版
            record = getLotteryByTypeAndUid(uid, UserLotteryRecord.TYPE_NEWBIES);
            if (record != null) {
                count = record.getCount();
            }
        }
        if (count <= 0) {
            throw new UserLotteryRecordException(2, "抽奖次数不足");
        }
        // 新人抽奖 -已抽中奖品
        List<UserSystemCoupon> list = userSystemCouponService.getUserCouponBySource(uid, UserSystemCoupon.SOURCE_NEWBIES);
        String prize = null;
        if (list == null || list.size() == 0) {
            prize = getLotteryPrizeNewbies(count, 0, null);
        } else if (list.size() == 1) {
            String couponType = null;
            UserSystemCoupon userSystemCoupon = list.get(0);
            SystemCoupon systemCoupon = userSystemCoupon.getSystemCoupon();
            if (systemCoupon != null) {
                SystemCoupon coupon = systemCouponService.selectByPrimaryKey(systemCoupon.getId());
                couponType = coupon.getType().name();
            }
            if (couponType != null && couponType.trim().length() > 0) {
                prize = getLotteryPrizeNewbies(count, 1, couponType);
            }
        }
        if (prize == null || prize.trim().length() == 0) {
            prize = "NoPrize";
        } else {
            try {
                userSystemCouponService.insertUserCoupon(uid, prize, UserSystemCoupon.SOURCE_NEWBIES);
            } catch (UserSystemCouponException e) {
                e.printStackTrace();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        // 减少次数
        count--;
        // 更新记录
        if (isold) {
            UserInfoExtra extra = new UserInfoExtra();
            extra.setId(userInfoExtra.getId());
            extra.setLotteryNewbies(count);
            try {
                userInfoExtraService.saveUserInfoExtra(extra);
            } catch (UserInfoExtraException e) {
                e.printStackTrace();
            }
        } else {
            UserLotteryRecord updateRecord = new UserLotteryRecord();
            updateRecord.setId(record.getId());
            updateRecord.setCount(count);
            updateRecord.setUpdateTime(new Date());
            userLotteryRecordMapper.updateByPrimaryKeySelective(updateRecord);
        }
        Map<String,Object> map = new HashMap<String, Object>();
        map.put("count", count);
        map.put("result", prize);
        return map;
    }
    /**
     * 新人用户抽奖
     * @param count
     * @param countPrize
     * @param couponType
     * @return
     */
    @Override
    public String getLotteryPrizeNewbies(int count, int countPrize, String couponType) {
        String prize = null;
        String freeCoupon = CouponTypeEnum.welfareFreeCoupon.name(); // 福利免费券
        String rebateCoupon = CouponTypeEnum.rebatePercentCoupon.name(); // 奖励券
        if (countPrize == 1 && count == 1) {
            // 最后一次: 只收到一个奖品
            if (rebateCoupon.equals(couponType)) {
                prize = freeCoupon; // 福利免费券
            } else {
                prize = rebateCoupon; // 奖励券
            }
        } else if (countPrize == 0 && count == 2) {
            // 后面两次必中
            long result = (1 + Math.round(Math.random() * (9)));
            if (result <= 5) {
                prize = freeCoupon; // 福利免费券
            } else {
                prize = rebateCoupon; // 奖励券
            }
        } else {
            long result = (1 + Math.round(Math.random() * (9)));
            if (result <= 3) {
                prize = freeCoupon; // 福利免费券
            } else if (result <= 6) {
                prize = rebateCoupon; // 奖励券
            }
        }
        return prize;
    }
    @Override
    public JSONObject getLotteryCountDaily(Long uid) throws UserLotteryRecordException,Exception {
        if (uid == null || uid == 0) {
             throw new UserLotteryRecordException(1, "未登录系统");
        }
        //抽奖次数
        int count = 0;
        UserLotteryRecord record = getLotteryByTypeAndUid(uid, UserLotteryRecord.TYPE_DAILY_REBATE);
        if (record != null) {
            count = record.getCount();
        }
        // 抽奖规则
        String lotteryRule = configService.get("lottery_rule_daily_rebate");
        JSONObject data = new JSONObject();
        data.put("count", count);
        data.put("rule", lotteryRule);
        return data;
    }
    @Override
    public Map<String, Object> executeLotteryDaily(Long uid) throws UserLotteryRecordException, Exception{
        if (uid == null || uid == 0) {
             throw new UserLotteryRecordException(1, "未登录系统");
        }
        UserLotteryRecord record = getLotteryByTypeAndUid(uid, UserLotteryRecord.TYPE_DAILY_REBATE);
        if (record == null) {
            throw new UserLotteryRecordException(1, "暂无抽奖机会");
        }
        int count = record.getCount();
        // 抽奖次数不足
        if (count == 0) {
            throw new UserLotteryRecordException(2,  "抽奖次数不足");
        }
        String prize = "";
        // 今日天天抽奖-已抽中拥有券数量
        int todayHas = userSystemCouponService.countTodatyUserCouponBySource(uid, UserSystemCoupon.SOURCE_DAILY_REBATE);
        if (todayHas == 0) {
            // 抽奖
            prize = getLotteryPrizeDaily(count);
            try {
                int num = 0;
                if ("rebateCoupon".equals(prize)) {
                    num = 1;
                } else if ("doubleCoupon".equals(prize)) {
                    num = 2;
                }
                // 插入奖励券
                userSystemCouponService.randomRewardCoupon(num, uid, UserSystemCoupon.SOURCE_DAILY_REBATE);
            } catch (UserSystemCouponException e) {
                throw new UserLotteryRecordException(1, "抽奖失败");
            }
        }
        // 减少次数
        count--;
        // 更新记录
        UserLotteryRecord updateRecord = new UserLotteryRecord();
        updateRecord.setId(record.getId());
        updateRecord.setCount(count);
        updateRecord.setUpdateTime(new Date());
        userLotteryRecordMapper.updateByPrimaryKeySelective(updateRecord);
        if (prize == null || prize.trim().length() == 0) {
            prize = "NoPrize";
        }
        Map<String,Object> map = new HashMap<String, Object>();
        map.put("count", count);
        map.put("result", prize);
        return map;
    }
    /**
     *  奖品抽取
     *
     * @param count 剩余次数
     * @return
     */
    public String getLotteryPrizeDaily(int count) {
        String prize = null;
        String rebateCoupon = "rebateCoupon"; // 一张奖励券
        String doubleCoupon = "doubleCoupon"; // 两张奖励券
        if (count== 1) {
            // 剩余最后一次必中
            long result = (1 + Math.round(Math.random() * (9)));
            if (result <= 7) {
                prize = rebateCoupon;
            } else {
                prize = doubleCoupon;
            }
        } else {
            long result = (1 + Math.round(Math.random() * (9)));
            if (result <= 2) {
                prize = rebateCoupon;
            } else if (result <= 5) {
                prize = doubleCoupon;
            }
        }
        return prize;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
@@ -168,6 +168,11 @@
    }
    @Override
    public int countTodatyUserCouponBySource(Long uid, String source) {
        return userSystemCouponMapper.countTodatyUserCouponBySource(uid, source);
    }
    @Override
    public long countUserCouponList(Long uid) {
        return userSystemCouponMapper.countUserCouponList(uid);
    }
@@ -266,7 +271,7 @@
    @Transactional
    @Override
    public List<UserSystemCouponVO> getUserCouponVOList(long start, int count, Long uid)
    public List<UserSystemCouponVO> getUserCouponVOList(long start, int count, Long uid, boolean changeJump)
            throws UserSystemCouponException, Exception {
        if (uid == null) {
@@ -284,7 +289,7 @@
        }
        // 数据组织
        listDataFactory(listVO, uid);
        listDataFactory(listVO, uid, changeJump);
        return listVO;
    }
@@ -294,7 +299,13 @@
     * 
     * @param listVO
     */
    public void listDataFactory(List<UserSystemCouponVO> listVO, Long uid) throws Exception {
    public void listDataFactory(List<UserSystemCouponVO> listVO, Long uid, boolean changeJump) throws Exception {
        String inviteCode = null;
        UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
        if (userInfoExtra != null) {
            inviteCode = userInfoExtra.getInviteCode();
        }
        for (UserSystemCouponVO userCouponVO : listVO) {
@@ -331,7 +342,6 @@
                // 显示规则
                userCouponVO.setCouponRule(systemCoupon.getRemark());
                userCouponVO.setCouponEffect("待激活");
                // 状态未激活 -且未被使用
                if (UserSystemCoupon.STATE_CAN_USE == state) {
                    userCouponVO.setState(0);
@@ -339,21 +349,18 @@
                jumpBtn = new HashMap<String, Object>();
                // 邀请队员界面
                /*
                 * Map<String, Object> jumpLink = new HashMap<String, Object>();
                 * UserInfoExtra userInfoExtra =
                 * userInfoExtraService.getUserInfoExtra(uid); if (userInfoExtra
                 * != null && userInfoExtra.getInviteCode() != null &&
                 * userInfoExtra.getInviteCode().trim().length() > 0) { //
                 * 邀请激活成功界面 jumpLink.put("url",
                 * configService.get("invite_activation_success_url") +
                 * "?alert=true"); } else { // 激活邀请码界面 jumpLink.put("url",
                 * configService.get("invite_activation_url")); }
                 * jumpBtn.put("params", jumpLink);
                 */
                // 福利券需要激活界面
                if (!changeJump) {
                jumpBtn.put("jumpDetail", jumpDetailV2Service.getByTypeCache("invite"));
                } else {
                    if (inviteCode != null && inviteCode.trim().length() > 0) {
                        // 邀请好友界面
                        jumpBtn.put("jumpDetail", jumpDetailV2Service.getByTypeCache("invite_friends"));
                    } else {
                        // 邀请激活界面
                        jumpBtn.put("jumpDetail", jumpDetailV2Service.getByTypeCache("invite_activate"));
                    }
                }
            } else if (stateActivated == 1) {
                // 显示规则
@@ -569,7 +576,7 @@
        sendBackTimeOutCoupon(uid);
        
        // 活动领取券
//        receivedCoupon(uid);
        receivedCoupon(uid);
        // 商品相关的券
        List<SystemCoupon> couponList = systemCouponService.getGoodsCouponList();
@@ -1231,8 +1238,8 @@
    @Transactional
    @Override
    public void sendBackTimeOutCoupon(Long uid) {
        // 超过120秒 未被匹配的券
        List<UserSystemCouponRecord> list = userSystemCouponRecordService.getCouponByUsingTimeOut(uid, 120L);
        // 超过10分钟   未被匹配的券
        List<UserSystemCouponRecord> list = userSystemCouponRecordService.getCouponByUsingTimeOut(uid,600L);
        if (list == null || list.size() == 0) {
            return;
        }
@@ -1416,9 +1423,9 @@
            return;
        }
        // 是否有过订单:返利、分享订单
        boolean hasOrder = commonOrderCountService.hasRebateAndShareOrder(uid);
        if (hasOrder) {
        // 是否是新用户
        boolean isNewUser = userInfoExtraService.isNewUser(uid);
        if (!isNewUser) {
            return;
        }
@@ -1456,7 +1463,7 @@
            UserSystemCoupon userCoupon = new UserSystemCoupon();
            userCoupon.setUid(uid);
            userCoupon.setSource(UserSystemCoupon.SOURCE_CHOUJIANG);
            userCoupon.setSource(UserSystemCoupon.SOURCE_NEWBIES);
            userCoupon.setSystemCoupon(systemCoupon);
            userCoupon.setState(UserSystemCoupon.STATE_CAN_USE);
            userCoupon.setStateActivated(stateActivated);
@@ -1562,14 +1569,13 @@
                pushCouponRecordService.insertSelective(pushCouponRecord);
                
                // 插入券
                randomRewardCoupon(pushCoupon, uid);
                randomRewardCouponForPush(pushCoupon, uid);
            }
        }
    }
    
    @Override
    @Transactional
    public void randomRewardCoupon(PushCoupon pushCoupon, Long uid) throws Exception {
    public void randomRewardCouponForPush(PushCoupon pushCoupon, Long uid) throws Exception {
        int coupon = 0;
        
        Integer amount = pushCoupon.getAmount();
@@ -1607,14 +1613,7 @@
            
            // 消息推送
            try {
                if (systemCoupon.getType() == CouponTypeEnum.welfareFreeCoupon) {
                    userOtherMsgNotificationService.welfareCouponGet(userCoupon);
                } else if (systemCoupon.getType() == CouponTypeEnum.freeCoupon) {
                    userOtherMsgNotificationService.freeSheetCouponGet(userCoupon);
                } else if (systemCoupon.getType() == CouponTypeEnum.rebatePercentCoupon) {
                    userOtherMsgNotificationService.rewardCouponGet(userCoupon,systemCoupon.getPercent().intValue());
                }
            } catch(Exception e) {
                try {
                    LogHelper.errorDetailInfo(e);
@@ -1639,6 +1638,69 @@
        userInfoExtraService.saveUserInfoExtra(userInfoExtra);
    }
        
    @Override
    @Transactional
    public void randomRewardCoupon(int num, Long uid, String source) throws Exception {
        if (num < 1) {
            return;
        }
        for (int i = 0; i < num; i++) {
            // 返利比-随机
            BigDecimal percent = new BigDecimal(randomNum());
            // 查询奖励券
            SystemCoupon systemCoupon = systemCouponService.getCouponByTypeAndPercent(
                    CouponTypeEnum.rebatePercentCoupon.name(),percent);
            if (systemCoupon == null) {
                return;
            }
            // 结束日期 今天在内  减去一天
            String endDay = DateUtil.plusDay(systemCoupon.getExpiryDay() - 1, new Date());
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
            Date endTime = format.parse(endDay);
            UserSystemCoupon userCoupon = new UserSystemCoupon();
            userCoupon.setUid(uid);
            userCoupon.setSource(source);
            userCoupon.setSystemCoupon(systemCoupon);
            userCoupon.setState(UserSystemCoupon.STATE_CAN_USE);
            userCoupon.setStateActivated(1);
            userCoupon.setStartTime(new Date());
            userCoupon.setEndTime(endTime);
            userCoupon.setCreateTime(new Date());
            userCoupon.setUpdateTime(new Date());
            // 插入数据库
            insertSelective(userCoupon);
            // 消息推送
            try {
                userOtherMsgNotificationService.rewardCouponGet(userCoupon,systemCoupon.getPercent().intValue());
            } catch(Exception e) {
                try {
                    LogHelper.errorDetailInfo(e);
                } catch (Exception e1) {
                    e1.printStackTrace();
                }
            }
        }
        // 福利中心红点
        UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
        if (userInfoExtra == null) {
            return;
        }
        Integer couponNews = userInfoExtra.getCouponNews();
        if (couponNews == null) {
            userInfoExtra.setCouponNews(num);
        } else {
            userInfoExtra.setCouponNews(couponNews + num);
        }
        userInfoExtraService.saveUserInfoExtra(userInfoExtra);
    }
    /**
     * 随机券比例
     * @return
fanli/src/main/java/com/yeshi/fanli/service/inter/activity/ActivityService.java
@@ -46,8 +46,7 @@
     * @param top
     * @return
     */
    public RecommendActivity addShareGoodsRecommendActivity(Long activityUid, String title, List<Long> goodsList,
            boolean top, int shareCount) throws ActivityException;
    public RecommendActivity addShareGoodsRecommendActivity(Long activityUid, List<Long> goodsList,RecommendActivity activity) throws ActivityException, Exception;
    /**
     * 修改商品分享动态
@@ -61,8 +60,8 @@
     * @return
     * @throws ActivityException
     */
    public RecommendActivity updateShareGoodsRecommendActivity(Long id, Long activityUid, String title,
            List<Long> goodsList, boolean top, int shareCount) throws ActivityException;
    public RecommendActivity updateShareGoodsRecommendActivity(Long activityUid, List<Long> goodsList,
            RecommendActivity activity) throws ActivityException, Exception;
    /**
     * 更新分享商品动态的商品
@@ -95,8 +94,8 @@
     * @return
     * @throws ActivityException
     */
    public RecommendActivity addInviteImgRecommendActivity(Long activityUid, String title, String url, boolean top,
            int shareCount, int px, int py, int erCodeSize) throws ActivityException;
    public RecommendActivity addInviteImgRecommendActivity(Long activityUid, RecommendActivity activity, String url,
            int px, int py, int erCodeSize) throws ActivityException, Exception;
    /**
     * 修改邀请图动态
@@ -113,8 +112,8 @@
     * @return
     * @throws ActivityException
     */
    public RecommendActivity updateInviteImgRecommendActivity(Long id, Long activityUid, String title, String url,
            boolean top, int shareCount, int px, int py, int erCodeSize) throws ActivityException;
    public RecommendActivity updateInviteImgRecommendActivity(Long activityUid, RecommendActivity activity, String url,
         int px, int py, int erCodeSize) throws ActivityException, Exception;
    /**
     * 添加图文动态
@@ -125,8 +124,8 @@
     * @param top
     * @return
     */
    public RecommendActivity addTextAndImgRecommendActivity(Long activityUid, String title, List<String> imgList,
            boolean top, int shareCount) throws ActivityException;
    public RecommendActivity addTextAndImgRecommendActivity(Long activityUid, List<String> imgList,
            RecommendActivity activity) throws ActivityException, Exception;
    /**
     * 修改图文动态
@@ -140,8 +139,8 @@
     * @return
     * @throws ActivityException
     */
    public RecommendActivity updateTextAndImgRecommendActivity(Long id, Long activityUid, String title,
            List<String> imgList, boolean top, int shareCount) throws ActivityException;
    public RecommendActivity updateTextAndImgRecommendActivity(Long activityUid, List<String> imgList,
            RecommendActivity activity) throws ActivityException, Exception;
    /**
     * 获取推荐活动列表
fanli/src/main/java/com/yeshi/fanli/service/inter/config/CustomerContentService.java
New file
@@ -0,0 +1,16 @@
package com.yeshi.fanli.service.inter.config;
import java.util.List;
import com.yeshi.fanli.entity.system.CustomerContent;
public interface CustomerContentService {
    public List<CustomerContent> getSecondProblemList(int index, String key, long id);
    public CustomerContent getCustomerContent(long id);
    public List<CustomerContent> contactCustomerService(String title);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/config/CustomerNameService.java
New file
@@ -0,0 +1,13 @@
package com.yeshi.fanli.service.inter.config;
import java.util.List;
import com.yeshi.fanli.entity.system.CustomerName;
public interface CustomerNameService {
    public List<CustomerName> customerNameList(int page, String key, int type);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/config/SystemClientParamsService.java
@@ -2,31 +2,13 @@
import java.util.List;
import com.yeshi.fanli.entity.admin.SystemClientParamsAdmin;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.entity.system.CustomerContent;
import com.yeshi.fanli.entity.system.CustomerName;
import com.yeshi.fanli.entity.system.SystemClientParams;
public interface SystemClientParamsService {
    
    public List<SystemClientParams> getSystemClientParamsBySystemId(long id);
    
    public List<SystemClientParams> getSystemClientParamsBySystemId(long id,int version);
    public List<SystemClientParamsAdmin> getAdminList(BusinessSystem system, String key);
    public void addSystemClientParamsList(SystemClientParams scp, List<BusinessSystem> list) throws Exception;
    public void deleteSystemClientParams(SystemClientParams scp, BusinessSystem system);
    public void addSystemClientParams(SystemClientParams scp, BusinessSystem system);
    public void deleteSystemClientParams(SystemClientParams scp);
    public SystemClientParamsAdmin getSystemClientParamsAdmin(SystemClientParams scp);
    public void update(SystemClientParams oscp, SystemClientParams nscp);
    /**
     * 按照系统和关键字获取客户端参数
@@ -37,29 +19,6 @@
     */
    public SystemClientParams getSystemClientParamsBySystemAndKey(BusinessSystem system, String key);
    public Integer getCount(int type);
    public List<CustomerName> customerNameList(int i, String key, int type);
    public void deleteHelp(long id);
    public CustomerName getHelpCenter(int type);
    public Integer getProblemCount(long id);
    public List<CustomerContent> getSecondProblemList(int i, String key, long id);
    public void deleteSecondProblem(long id);
    public CustomerContent getCustomerContent(long id);
    public void updateAnswerDetail(CustomerContent customerContent);
    public void addFirstMenu(CustomerName customerName, int type);
    public void addSecondMenu(CustomerContent customerContent, long cnId);
    public List<CustomerContent> contactCustomerService(String title);
    /**
     * 新版后台查询
@@ -84,7 +43,7 @@
     * @param id
     * @return
     */
    public List<SystemClientParams> getById(long id);
    public SystemClientParams selectByPrimaryKey(long id);
    /**
     * 根据id批量删除
@@ -92,6 +51,7 @@
     */
    public void deleteBatchByPrimaryKey(List<Long> ids);
    public void saveAdd(SystemClientParams scp, List<Long> listId) throws Exception;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/config/SystemConfigService.java
@@ -1,31 +1,9 @@
package com.yeshi.fanli.service.inter.config;
import java.util.List;
import org.springframework.cache.annotation.CacheEvict;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.entity.system.SystemConfig;
import com.yeshi.fanli.exception.NotExistObjectException;
public interface SystemConfigService {
    public int getCount(BusinessSystem system,String key);
    public List<SystemConfig> getSystemConfigList(int index,BusinessSystem system, String key);
    public void addSystemConfig(SystemConfig sc);
    @CacheEvict(value="childSystemCache",allEntries=true)
    public void deleteSystem(long id, BusinessSystem system) throws NotExistObjectException;
    @CacheEvict(value="childSystemCache",allEntries=true)
    public void addSystem(long id, BusinessSystem system)  throws NotExistObjectException;
    public SystemConfig getSystemConfig(long id);
    public void updateSystemConfig(SystemConfig sc) throws NotExistObjectException;
    public void deleteSystemConfig(long id);
    
    public String get(String key) throws NotExistObjectException;
    
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/GoodsClassService.java
@@ -5,8 +5,8 @@
import org.springframework.web.multipart.MultipartFile;
import com.yeshi.fanli.entity.admin.GoodsClassAdmin;
import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
import com.yeshi.fanli.exception.GoodsClassException;
public interface GoodsClassService {
    
@@ -15,16 +15,7 @@
    
    public GoodsClass getGoodsClassCache(long gcid);
    public List<GoodsClassAdmin> getGoodsClassAdmins(int i, String platform,
            String packages, String key);
    public int getCount(String platform, String packages, String key);
    public Integer addGoodsClass(GoodsClass goodsClass);
    public void deleteGoodsClasss(long[] gcids);
    public Integer updateGoodsClass(GoodsClass goodsClass);
    /**
     * 获取所有分类
     * @return
@@ -39,7 +30,7 @@
     * @param id
     * @return
     */
    public String getKwById(Long id);
    public String getKeysById(Long id);
    /**
     * 上传图片
@@ -50,35 +41,15 @@
     */
    public void uploadPicture(GoodsClass record, MultipartFile file) throws Exception;
    
    /**
     * 新增类别
     * @param record
     * @param file
     * @return
     * @throws Exception
     */
    public long saveAdd(GoodsClass record, MultipartFile file) throws Exception;
    public void deleteGoodsClass(long id);
    public void removePicture(GoodsClass record) throws Exception;
    
    
    public List<GoodsClass> queryAll(String platform, String packages) throws Exception;
    /**
     * 根据排序id查询
     * @param orderby
     * @return
     */
    public List<GoodsClass> getByorderby(int orderby);
    public List<GoodsClass> listquery() throws Exception;
    
    /**
     * 查询所有
     * @return
     */
    public List<GoodsClass> queryAll();
    /**
     * 选择性更新
@@ -87,16 +58,20 @@
     */
    public int updateByPrimaryKeySelective(GoodsClass record);
    int updateByPrimaryKey(GoodsClass record);
    public GoodsClass selectByPrimaryKey(Long gcid);
    /**
     *    根据系统ID查询所有分类-加入缓存
     *  查询所有有效分类-加入缓存
     * @param systemId 系统ID
     * @return
     * @throws Exception
     */
    public List<GoodsClass> getListClassCache(Long systemId) throws Exception;
    public List<GoodsClass> getEffectiveClassCache() throws Exception;
    /**
     * 查询所有分类、主子类目
@@ -104,7 +79,26 @@
     * @return
     * @throws Exception
     */
    public List<Map<String, Object>> getClassListAllCache(Long systemId) throws Exception;
    public List<Map<String, Object>> getClassListAllCache() throws Exception;
    /**
     * 保存分类信息
     * @param file
     * @param record
     * @throws GoodsClassException
     * @throws Exception
     */
    public void saveObject(MultipartFile file, GoodsClass record) throws GoodsClassException, Exception;
    /**
     * 后台顺序调整
     * @param id
     * @param moveType
     * @throws GoodsClassException
     */
    public void updateOrder(Long id, Integer moveType) throws GoodsClassException;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/GoodsSecondClassService.java
@@ -2,8 +2,6 @@
import java.util.List;
import org.springframework.cache.annotation.Cacheable;
import com.yeshi.fanli.entity.bus.clazz.GoodsSecondClass;
import com.yeshi.fanli.exception.NotExistObjectException;
@@ -23,7 +21,5 @@
    public GoodsSecondClass getSecondClass(long scid);
    public void updateSecondClass(GoodsSecondClass secondClass) throws NotExistObjectException;
    public void deleteSecondClassByGC(long id);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/GoodsSubClassService.java
@@ -7,6 +7,7 @@
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.clazz.GoodsSubClass;
import com.yeshi.fanli.exception.GoodsSubClassException;
public interface  GoodsSubClassService {
@@ -21,7 +22,6 @@
    public int updateByPrimaryKeySelective(GoodsSubClass record);
    public int updateByPrimaryKey(GoodsSubClass record);
    
    /**
     * 批量删除
@@ -29,24 +29,6 @@
     * @return
     */
    public void deleteByPrimaryKeyBatch(List<String> recordIds) throws Exception ;
    /**
     * 保存分类信息
     * @param record
     * @param file
     * @throws Exception
     */
    public int save(GoodsSubClass record, MultipartFile file) throws Exception;
    /**
     * 上传图片文件  并更新对象信息
     * @param file
     * @param record
     * @return
     * @throws Exception
     */
    public int uploadPicture(GoodsSubClass record, MultipartFile file)    throws Exception;
    
    /**
@@ -99,19 +81,6 @@
    public int countByPid(Long pid);
    /**
     *  统计一级之下的所有二级分类最大权重
     * @param rootId  一级id
     * @returnL
     */
    public int getMaxWeightByRootId(Long rootId);
    /**
     *  统计二级分类之下其他分类最大权重
     * @param rootId  一级id
     * @return
     */
    public int getMaxWeightByPid(Long pid);
    /**
     * 获取二级分类+ 加入缓存
@@ -145,4 +114,16 @@
     */
    public List<GoodsSubClass> queryByListCid(List<Long> list);
    /**
     * 保存分类信息
     * @param file
     * @param record
     * @param type
     * @param pid
     * @throws GoodsSubClassException
     * @throws Exception
     */
    public void saveObject(MultipartFile file,MultipartFile file2,  GoodsSubClass record, Integer type, Long pid)
            throws GoodsSubClassException, Exception;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/SuperGoodsClassService.java
@@ -2,8 +2,6 @@
import java.util.List;
import org.springframework.cache.annotation.Cacheable;
import com.yeshi.fanli.entity.bus.su.clazz.SuperGoodsClass;
public interface SuperGoodsClassService {
@@ -12,17 +10,14 @@
    public List<SuperGoodsClass> getSuperGoodsClasss(List<Long> gcIdList);
    public List<SuperGoodsClass> getSuperGoodsClassList(long id, int strat,
            int pAGE_SIZE, String likekey);
    public List<SuperGoodsClass> getSuperGoodsClassList(long id, int strat, int pAGE_SIZE, String likekey);
    public Integer deleteSuperGoodsClass(long gcid, String platform,
            String packageName);
    public Integer deleteSuperGoodsClass(long gcid, String platform, String packageName);
    public void addSuperGoodsClass(long gcid, String platform,
            String packageName);
    public void addSuperGoodsClass(long gcid, String platform, String packageName);
    public void deleteSuperGoodsClass(long gcid);
    public List<SuperGoodsClass> getSuperGoodsClassAll(long id);
    public void insertSelective(SuperGoodsClass record);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/HomeNavbarService.java
@@ -2,9 +2,11 @@
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.multipart.MultipartFile;
import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar;
import com.yeshi.fanli.exception.homemodule.HomeNavbarException;
/**
 *  APP导航栏
@@ -14,17 +16,6 @@
 */
public interface HomeNavbarService {
    public int deleteByPrimaryKey(Long id);
    public int insert(HomeNavbar record);
    public int insertSelective(HomeNavbar record);
    public HomeNavbar selectByPrimaryKey(Long id);
    public int updateByPrimaryKeySelective(HomeNavbar record);
    public int updateByPrimaryKey(HomeNavbar record);
    
    /**
     * 根据主键批量删除
@@ -33,23 +24,29 @@
     */
    public int deleteBatchByPrimaryKey(List<Long> list);
    
    /**
     * 获取最大的排序值
     * @param card
     * @return
     */
    public int getMaxOrder();
    
    /**
     * 查询交换排序对象
     * @param type
     * @param order 排序值
     * @return
     * 保存
     * @param file
     * @param record
     * @param jumpType
     * @throws HomeNavbarException
     * @throws Exception
     */
    public List<HomeNavbar> getChangeOrder(Integer type, Integer order);
    public void saveObject(MultipartFile file, HomeNavbar record) throws HomeNavbarException, Exception;
    
    /**
     * 后端列表查询
     * 更新排序顺序
     * @param id
     * @param moveType
     * @throws HomeNavbarException
     * @throws Exception
     */
    public void updateOrder(Long id, Integer moveType) throws HomeNavbarException, Exception;
    /**
     * 后端查询
     * @param start
     * @param count
     * @param key
@@ -59,12 +56,18 @@
    
    public long countlistQuery(String key);
    /**
     * 图片上传
     * @param file
     * @param homeNavbar
     * @throws Exception
     * 查询有效导航栏
     * @return
     */
    public void uploadPicture(MultipartFile file, HomeNavbar homeNavbar) throws Exception;
    public List<HomeNavbar> listQueryEffectiveNavbar();
    /**
     * 根据分类查询有效导航栏
     * @param classId
     * @return
     */
    public HomeNavbar getEffectiveByClassId(@Param("classId") Long classId);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SpecialCardService.java
@@ -2,7 +2,10 @@
import java.util.List;
import org.springframework.web.multipart.MultipartFile;
import com.yeshi.fanli.entity.bus.homemodule.SpecialCard;
import com.yeshi.fanli.exception.homemodule.SpecialCardException;
/**
 *  专题标识
@@ -11,18 +14,6 @@
 *
 */
public interface SpecialCardService {
    public int deleteByPrimaryKey(Long id);
    public int insert(SpecialCard record);
    public int insertSelective(SpecialCard record);
    public SpecialCard selectByPrimaryKey(Long id);
    public int updateByPrimaryKeySelective(SpecialCard record);
    public int updateByPrimaryKey(SpecialCard record);
    public List<SpecialCard> listQuery(long start, int count, String key, Integer sort);
@@ -36,4 +27,20 @@
     */
    public int deleteBatchByPrimaryKey(List<Long> list) throws Exception;
    /**
     * 新增、修改
     * @param file
     * @param record
     * @throws SpecialCardException
     * @throws Exception
     */
    public void saveObject(MultipartFile file, SpecialCard record) throws SpecialCardException, Exception;
    /**
     * 获取背景图片
     * @param placeKey
     * @return
     */
    public String getbottomPicture(String placeKey);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SpecialPlaceService.java
New file
@@ -0,0 +1,46 @@
package com.yeshi.fanli.service.inter.homemodule;
import java.util.List;
import com.yeshi.fanli.entity.bus.homemodule.SpecialPlace;
import com.yeshi.fanli.exception.SpecialPlaceException;
public interface SpecialPlaceService {
    public SpecialPlace selectByPrimaryKey(Long id);
    /**
     * 保存、修改
     * @param record
     * @throws SpecialPlaceException
     * @throws Exception
     */
    public void saveObject(SpecialPlace record) throws SpecialPlaceException, Exception;
    /**
     * 批量删除
     * @param list
     * @return
     * @throws Exception
     */
    public int deleteByPrimaryKeyList(List<Long> list) throws Exception;
    /**
     * 后端查询
     * @param start
     * @param count
     * @param key
     * @return
     * @throws Exception
     */
    public List<SpecialPlace> listQuery(long start, int count, String key) throws Exception;
    public long countQuery(String key);
    /**
     * 获取所有专题位置
     * @return
     */
    public List<SpecialPlace> getEffectiveList();
}
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SpecialService.java
@@ -5,6 +5,9 @@
import org.springframework.web.multipart.MultipartFile;
import com.yeshi.fanli.entity.bus.homemodule.Special;
import com.yeshi.fanli.exception.homemodule.SpecialException;
import net.sf.json.JSONObject;
/**
 *  专题
@@ -14,36 +17,14 @@
 */
public interface SpecialService {
    public int deleteByPrimaryKey(Long id);
    public int insert(Special record);
    public int insertSelective(Special record);
    public Special selectByPrimaryKey(Long id);
    public int updateByPrimaryKeySelective(Special record);
    public int updateByPrimaryKey(Special record);
    public List<Special> listQueryByCard(long start, int count, Long card, String key);
    public long countlistQueryByCard(Long card, String key);
    /**
     * 查询排序值
     * @param card
     * @return
     */
    public int getMaxOrderByCard(Long card);
    /**
     * 专题图片上传
     * @param file
     * @param record
     * @throws Exception
     */
    public void uploadPicture(MultipartFile file, Special record, Long cardId) throws Exception;
    /**
     * 根据id批量删除
@@ -62,16 +43,6 @@
    public int deleteBatchByCardID(List<Long> list) throws Exception;
    /**
     * 排序交换对象查询
     * @param cardId
     * @param type
     * @param order
     * @return
     */
    public List<Special> getOrderByCardID(Long cardId, Integer type, Integer order);
    /**
     * 根据标识、系统查询启用专题
     * @param card
     * @param systemId
@@ -89,4 +60,31 @@
     */
    public List<Special> listPageBySystemAndCard(long start, int count, String card, Long systemId);
    /**
     * 保存
     * @param file
     * @param record
     * @param jumpType
     * @throws SpecialException
     * @throws Exception
     */
    public void saveObject(MultipartFile file, MultipartFile file2, MultipartFile file3, Special record, String jumpType) throws SpecialException, Exception;
    /**
     * 更换顺序
     * @param id
     * @param moveType
     * @throws SpecialException
     */
    public void updateOrder(Long id, Integer moveType) throws SpecialException;
    /**
     * 首页-专题数据
     * @return
     * @throws Exception
     */
    public JSONObject listCacheSpecialToIndex() throws Exception;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SwiperBannerService.java
@@ -9,13 +9,13 @@
public interface SwiperBannerService {
    public int deleteByPrimaryKey(Long id) throws SwiperBannerException;
    public int deleteByPrimaryKey(Long id) ;
    public int insert(SwiperBanner record) throws SwiperBannerException;
    public int insert(SwiperBanner record);
    public int insertSelective(SwiperBanner record) throws SwiperBannerException;
    public int insertSelective(SwiperBanner record);
    public SwiperBanner selectByPrimaryKey(Long id) throws SwiperBannerException;
    public SwiperBanner selectByPrimaryKey(Long id);
    public int updateByPrimaryKeySelective(SwiperBanner record) throws SwiperBannerException;
@@ -27,4 +27,11 @@
    
    public int deleteBatchByPrimaryKey(List<Long> list) throws Exception;
    
    /**
     * 有效
     * @return
     * @throws SwiperBannerException
     */
    public List<SwiperBanner> getEffectiveOption();
}
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SwiperPictureService.java
@@ -87,4 +87,13 @@
     * @throws SwiperPictureException
     */
    public void saveObject(MultipartFile file, SwiperPicture record, String jumpType) throws SwiperPictureException, Exception;
    /**
     * 根据管理id 查询有效轮播图
     * @param bannerId
     * @return
     * @throws SwiperPictureException
     */
    public List<SwiperPicture> getByBannerId(Long bannerId) throws SwiperPictureException;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/hongbao/ThreeSaleSerivce.java
@@ -134,15 +134,6 @@
    public long countSuperiorQuery(Integer state, Long uid);
    /**
     * app端一级查询1.4.1
     *
     * @param start
     * @param count
     * @param uid
     * @return
     */
    public List<ThreeSale> listFirstTeam(long start, int count, Long uid);
    /**
     * 统计所有一级队员
@@ -153,16 +144,6 @@
     * @return
     */
    public long countFirstTeam(Long uid, Integer state);
    /**
     * app端二级查询1.4.1
     *
     * @param start
     * @param count
     * @param uid
     * @return
     */
    public List<ThreeSale> listSecondTeam(long start, int count, Long uid);
    /**
     * 统计二级队员
@@ -182,7 +163,7 @@
     * @param uid
     * @return
     */
    public JSONObject getMyFirstTeam(long start, int count, Long uid);
    public JSONObject getMyFirstTeam(long start, int count, Long uid, Integer state);
    /**
     * 前端查询二级队员
@@ -192,7 +173,7 @@
     * @param uid
     * @return
     */
    public JSONObject getMySecondTeam(long start, int count, Long uid);
    public JSONObject getMySecondTeam(long start, int count, Long uid, Integer state);
    /**
     * 获取上级
@@ -249,6 +230,23 @@
    public long countSuccessFirstTeam(Long uid);
    /**
     * 根据邀请者查询关系
     *
     * @param workerId
     * @return
     */
    public ThreeSale getByWorkerId(Long workerId);
    /**
     * 微信激活邀请队员关系
     * @param invitee
     * @param inviterId
     * @param threeSaleOld
     * @throws ThreeSaleException
     */
    public void bindRelationshipByWX(UserInfo invitee, Long inviterId, ThreeSale threeSaleOld) throws ThreeSaleException;
    /**
     * 根据下级查找对象
     * @param workerId
     * @return
fanli/src/main/java/com/yeshi/fanli/service/inter/lable/QualityGoodsService.java
@@ -195,4 +195,10 @@
    public List<QualityFactory> listFreeGoods(long start, int count, Double tkRate, String lableName);
    public long countFreeGoods(Double tkRate, String lableName);
    /**
     * 限时秒杀随机3个商品
     * @return
     */
    public List<QualityFactory> listFlashSaleRandGoods();
}
fanli/src/main/java/com/yeshi/fanli/service/inter/order/CommonOrderCountService.java
@@ -62,12 +62,4 @@
     */
    public Map<String, Object> lastMonthSettleOrderNumber(Long uid);
    /**
     *   是否产生订单:自购、分享有效订单数量
     * @param uid
     * @return
     */
    public boolean hasRebateAndShareOrder(Long uid);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/push/PushService.java
@@ -15,7 +15,7 @@
     * @param listAndroid
     * @throws PushException
     */
    void pushGoods(Long uid, String url, String title, String content, List<String> listIOS,
    void pushGoods(Long uid, String title, String content, String url, List<String> listIOS,
            List<String> listAndroid) throws PushException;
    /**
@@ -28,7 +28,7 @@
     * @param listAndroid
     * @throws PushException
     */
    void pushUrl(Long uid, String url, String title, String content,List<String> listIOS,
    void pushUrl(Long uid, String title, String content, String url, List<String> listIOS,
            List<String> listAndroid) throws PushException;
    /**
fanli/src/main/java/com/yeshi/fanli/service/inter/statistic/OrderClassStatisticService.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/service/inter/taobao/TaoBaoUnionAuthRecordService.java
@@ -11,4 +11,12 @@
     */
    public void addAuthRecord(TaoBaoUnionAuthRecord record);
    /**
     * 获取淘宝昵称
     * @param uid
     * @return
     */
    public String getTaoBaoUserNick(Long uid);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/SMSService.java
@@ -18,7 +18,7 @@
     * @param phone
     * @throws SMSException
     */
    public String sendLoginVCode(String phone) throws SMSException;
    public String sendLoginVCode(String phone, int codeLength) throws SMSException;
    /**
     * 发送绑定验证码
@@ -26,7 +26,7 @@
     * @param phone
     * @throws SMSException
     */
    public void sendBindVCode(String phone) throws SMSException;
    public void sendBindVCode(String phone, int codeLength) throws SMSException;
    /**
     * 发送提现验证码
fanli/src/main/java/com/yeshi/fanli/service/inter/user/SystemZnxService.java
@@ -1,5 +1,7 @@
package com.yeshi.fanli.service.inter.user;
import java.util.List;
import com.yeshi.fanli.entity.system.SystemZnx;
public interface SystemZnxService {
@@ -13,4 +15,10 @@
     */
    public void save(SystemZnx systemZnx);
    public List<SystemZnx> listbyCreateTime(long createTime);
    public List<SystemZnx> listbyUidAndCreateTime(long uid, long createTime);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserAccountService.java
@@ -167,4 +167,45 @@
     * @param uid
     */
    public String repairPortrait(Long uid);
    /**
     * 电话号码登录 1.5.3
     * @param request
     * @param first
     * @param appId
     * @param phone
     * @return
     * @throws UserAccountException
     */
    public UserInfo loginPhone(HttpServletRequest request, int loginType, String vcode, String phone,  String appId)
            throws UserAccountException;
    /**
     *微信登录 1.5.3
     * @param request
     * @param first
     * @param appId
     * @param code
     * @param loginType
     * @return
     * @throws UserAccountException
     */
    public UserInfo loginWinXin(HttpServletRequest request,int loginType, String code, String appId)
            throws UserAccountException;
    /**
     *   绑定电话号码  V1.5.3
     * @param uid
     * @param phone
     * @throws UserAccountException
     */
    public void bindPhoneNew(Long uid, String phone) throws UserAccountException;
    /**
     *  绑定微信 V1.5.3
     * @param uid
     * @param code
     * @throws UserAccountException
     */
    public void bindWeiXin(Long uid, String code) throws UserAccountException;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserExtraTaoBaoInfoService.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.service.inter.user;
import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
import com.yeshi.fanli.exception.user.UserExtraTaoBaoInfoException;
/**
 * 用户淘宝联盟服务
@@ -16,7 +17,8 @@
     * @param uid
     * @param relationId
     */
    public void addRelationId(Long uid, String relationId, String taoBaoUid, boolean valid);
    public void addRelationId(Long uid, String relationId, String taoBaoUid, String nickName,
            boolean valid)  throws UserExtraTaoBaoInfoException;
    /**
     * 添加会员ID
@@ -24,7 +26,8 @@
     * @param uid
     * @param specialId
     */
    public void addSpecialId(Long uid, String specialId, String taoBaoUid, boolean valid);
    public void addSpecialId(Long uid, String specialId, String taoBaoUid,  String nickName,
            boolean valid)  throws UserExtraTaoBaoInfoException;
    /**
     * 通过UID获取淘宝联盟渠道信息
@@ -69,4 +72,17 @@
     * @return
     */
    public UserExtraTaoBaoInfo getBySpecialId(String specialId);
    /**
     * 添加会员ID/渠道ID
     * @param uid
     * @param relationId 渠道ID
     * @param specialId 会员ID
     * @param taoBaoUid
     * @param valid
     * @throws UserExtraTaoBaoInfoException
     */
    public void saveUserTaoBaoInfo(Long uid, String relationId, String specialId, String taoBaoUid, String nickName,
            boolean valid) throws UserExtraTaoBaoInfoException;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInfoExtraService.java
@@ -72,5 +72,27 @@
     *  统计各个等级用户数
     */
    public long countByRankId(Long rankId);
    /**
     * 微信邀请激活上级关系 1.5.3
     * @param uid
     * @param code
     * @throws UserInfoExtraException
     */
    public void activationInviteWX(Long uid, String code) throws UserInfoExtraException;
    /**
     * 判断是否是新用户
     * @param uid
     * @return
     */
    public boolean isNewUser(Long uid);
    /**
     * 创建额外信息
     * @param uid
     * @throws UserInfoExtraException
     */
    public void createUserInfoExtra(Long uid) throws UserInfoExtraException;
    
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInfoService.java
@@ -7,6 +7,7 @@
import com.yeshi.fanli.entity.bus.user.InviteUser;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.exception.user.UserInfoException;
import com.yeshi.fanli.vo.user.UserInfoVO;
public interface UserInfoService {
@@ -155,4 +156,26 @@
     */
    public UserInfo getInfoByPhoneOrInviteCode(String phone, String inviteCode);
    /**
     * 根据电话号码 获取有效用户
     * @param phone
     * @return
     */
    public UserInfo getEffectiveUserInfoByPhone(String phone);
    /**
     * 获取用户信息
     * @param uid
     * @return
     * @throws UserInfoException
     */
    public UserInfo getUserInfo(Long uid) throws UserInfoException;
    /**
     * 根据微信获取有效用户
     * @param unionId
     * @return
     */
    public UserInfo getEffectiveUserInfoByWXUnionId(String unionId);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInviteRecordService.java
New file
@@ -0,0 +1,18 @@
package com.yeshi.fanli.service.inter.user;
public interface UserInviteRecordService {
    /**
     *   添加/更新邀请记录
     * @param code
     * @param inviter
     */
    public void saveInviteRecord(String code, String uid);
    /**
     *    获取最新 inviterId 邀请人id
     * @param wxUnionId 微信id
     * @return
     */
    public Long getNewestInviterId(String wxUnionId);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserLotteryRecordService.java
New file
@@ -0,0 +1,58 @@
package com.yeshi.fanli.service.inter.user;
import java.util.Map;
import com.yeshi.fanli.exception.user.UserLotteryRecordException;
import net.sf.json.JSONObject;
public interface UserLotteryRecordService {
    /**
     * 根据uid以及抽奖类型 获取抽奖次数
     * @param uid
     * @param type
     * @return
     */
    public JSONObject getLotteryCountDaily(Long uid) throws UserLotteryRecordException, Exception;
    /**
     * 抽奖-天天抽奖励券
     * @param uid
     * @return
     * @throws UserLotteryRecordException
     * @throws Exception
     */
    public Map<String, Object> executeLotteryDaily(Long uid) throws UserLotteryRecordException, Exception;
    /**
     * 新人抽奖-次数
     * @param uid
     * @return
     * @throws UserLotteryRecordException
     * @throws Exception
     */
    public JSONObject getLotteryCountNewbies(Long uid) throws UserLotteryRecordException, Exception;
    /**
     * 新人抽奖-抽奖结果
     * @param uid
     * @return
     * @throws UserLotteryRecordException
     * @throws Exception
     */
    public Map<String, Object> executeLotteryNewbies(Long uid) throws UserLotteryRecordException, Exception;
    /**
     * 新人抽奖 -返回奖品
     * @param count
     * @param countPrize
     * @param couponType
     * @return
     */
    public String getLotteryPrizeNewbies(int count, int countPrize, String couponType);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserSystemCouponService.java
@@ -4,7 +4,6 @@
import java.util.List;
import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
import com.yeshi.fanli.entity.push.PushCoupon;
import com.yeshi.fanli.entity.system.SystemCoupon;
import com.yeshi.fanli.exception.user.UserSystemCouponException;
import com.yeshi.fanli.vo.user.UserSystemCouponRecordVO;
@@ -36,7 +35,7 @@
     * @param uid
     * @return
     */
    public List<UserSystemCouponVO> getUserCouponVOList(long start, int count, Long uid) throws UserSystemCouponException, Exception;
    public List<UserSystemCouponVO> getUserCouponVOList(long start, int count, Long uid, boolean changeJump ) throws UserSystemCouponException, Exception;
    /**
     * 统计数量
@@ -195,12 +194,22 @@
     */
    public void receivedCoupon(Long uid) throws Exception;
    
    /**
     * 根据推送 获取对应的券
     * @param pushCoupon
     * 统计今日抽奖中的券数量
     * @param uid
     * @param source
     * @return
     */
    public int countTodatyUserCouponBySource(Long uid, String source);
    /**
     * 随机生成奖励券
     * @param num
     * @param uid
     * @param source
     * @throws Exception
     */
    public void randomRewardCoupon(PushCoupon pushCoupon, Long uid) throws Exception;
    public void randomRewardCoupon(int num, Long uid, String source) throws Exception;
    
}
fanli/src/main/java/com/yeshi/fanli/util/RedisManager.java
@@ -284,19 +284,38 @@
        String value = "";
        if (Constant.IS_OUTNET)
            value = getCommonString(key);
        if (StringUtil.isNullOrEmpty(value)) {
            TaoBaoGoodsBrief goods = new TaoBaoGoodsBrief();
            goods.setShopTitle(shopTitle);
            goods.setSellerId(sellerId);
            goods.setAuctionId(auctionId);
            TaoBaoShopInfo info = taoBaoShopService.getTaoBaoShopInfo(goods);
            if(info != null) {
                String shopUrl = info.getShopUrl();
                if(shopUrl != null && shopUrl.contains("tmall://page.tm/shop")) {
                    shopUrl = "http://store.taobao.com/shop/view_shop.htm?user_number_id=" + sellerId;
                    info.setShopUrl(shopUrl);
                }
            }
            if (Constant.IS_OUTNET && info != null) {
                value = new Gson().toJson(info);
                cacheCommonString(key, value, 60 * 60 * 2);
            }
            return info;
        } else {
            return new Gson().fromJson(value, TaoBaoShopInfo.class);
            TaoBaoShopInfo info = new Gson().fromJson(value, TaoBaoShopInfo.class);
            String shopUrl = info.getShopUrl();
            if(shopUrl != null && shopUrl.contains("tmall://page.tm/shop")) {
                shopUrl = "http://store.taobao.com/shop/view_shop.htm?user_number_id=" + sellerId;
                info.setShopUrl(shopUrl);
            }
            return info;
        }
    }
fanli/src/main/java/com/yeshi/fanli/util/StringUtil.java
@@ -11,6 +11,7 @@
import org.apache.commons.codec.binary.Base64;
import net.sf.json.JSONObject;
import sun.misc.BASE64Encoder;
public class StringUtil {
@@ -283,4 +284,12 @@
        return lArr;
    }
    public static boolean isJson(String content) {
        try {
            JSONObject.fromObject(content);
            return true;
        } catch (Exception e) {
            return false;
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/util/taobao/DaTaoKeUtil.java
@@ -78,7 +78,7 @@
        int[] ids = new int[] { 1, 9, 10, 2, 3, 4, 5, 6, 7, 8 };
        for (int i = 0; i < names.length; i++) {
            GoodsClass gc = new GoodsClass();
            gc.setId(ids[i]);
            gc.setId(Long.parseLong(ids[i]+""));
            gc.setName(names[i]);
            list.add(gc);
        }
fanli/src/main/java/com/yeshi/fanli/vo/msg/ActivityInfo.java
New file
@@ -0,0 +1,43 @@
package com.yeshi.fanli.vo.msg;
import java.util.Date;
public class ActivityInfo {
    private String icon;
    private String title;
    private Date time;
    private String picture;
    private String content;
    public String getIcon() {
        return icon;
    }
    public void setIcon(String icon) {
        this.icon = icon;
    }
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    public Date getTime() {
        return time;
    }
    public void setTime(Date time) {
        this.time = time;
    }
    public String getPicture() {
        return picture;
    }
    public void setPicture(String picture) {
        this.picture = picture;
    }
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
}
fanli/src/main/java/com/yeshi/fanli/vo/msg/UserMsgCenter.java
New file
@@ -0,0 +1,32 @@
package com.yeshi.fanli.vo.msg;
import java.util.Map;
import com.yeshi.fanli.entity.bus.homemodule.Special;
public class UserMsgCenter {
    private Special special;
    private UserMsgVO userMsg;
    private Map<String, Object> welcomeMsg;
    public Special getSpecial() {
        return special;
    }
    public void setSpecial(Special special) {
        this.special = special;
    }
    public UserMsgVO getUserMsg() {
        return userMsg;
    }
    public void setUserMsg(UserMsgVO userMsg) {
        this.userMsg = userMsg;
    }
    public Map<String, Object> getWelcomeMsg() {
        return welcomeMsg;
    }
    public void setWelcomeMsg(Map<String, Object> welcomeMsg) {
        this.welcomeMsg = welcomeMsg;
    }
}
fanli/src/main/java/com/yeshi/fanli/vo/msg/UserMsgVO.java
@@ -7,6 +7,7 @@
    private String icon;
    private String title;
    private Date time;
    private String type; // order(订单)/money(资金)/account(账号)/invite(邀请)/other(其他)
    private List<CommonMsgItemVO> contentItems;
    public UserMsgVO(String icon, String title, Date time, List<CommonMsgItemVO> contentItems) {
@@ -50,4 +51,12 @@
    public void setContentItems(List<CommonMsgItemVO> contentItems) {
        this.contentItems = contentItems;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
}