Administrator
2018-11-21 c558c4f1130debfd785c74ff0e963afc6455f196
Merge branch 'master' into dev1
30个文件已添加
118个文件已修改
4 文件已重命名
1个文件已删除
9894 ■■■■■ 已修改文件
fanli/.gitignore 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/aspect/LoginAspect.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/aspect/SignValidateAspect.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/ClientJspController.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/ActivityAdminController.java 115 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/AppPageNotificationAdminController.java 292 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/ConfigAdminController.java 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/ExtractAdminController.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsSubClassAdminController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/HotSearchAdminController.java 178 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/InviteGetMoneyAdminController.java 162 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/JumpDetailAdminController.java 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/LostOrderAdminController.java 154 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/PushController.java 136 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/PushRecordAdminController.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/TaoBaoGoodsBriefAdminController.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/UploadController.java 249 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java 150 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/config/JumpDetailAdminController.java 273 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/config/SystemAdminController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/config/SystemClientParamsAdminController.java 171 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/config/SystemConfigAdminController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/HomeNavbarAdminController.java 366 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/SpecialCardAdminController.java 658 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/SwiperBannerAdminController.java 96 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/ConfigController.java 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/DynamicRecommendController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/GoodsClassController.java 185 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/GoodsController.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/LostOrderController.java 188 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/PushController.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/RecommendController.java 802 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/SearchController.java 260 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/ShareController.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/SystemClientController.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserInfoController.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/AppVersionInfoMapper.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/ThreeSaleMapper.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/common/JumpDetailV2Mapper.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/help/AppPageNotificationMapper.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/HomeNavbarMapper.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/SpecialCardMapper.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/SpecialMapper.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/SuperHomeNavbarMapper.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/SuperSpecialCardMapper.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/lable/QualityFactoryMapper.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/monitor/ClientAPIMonitorMapper.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/order/LostOrderMapper.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/push/DeviceTokenIOSMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/ShamUserMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/AppVersionInfo.java 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/GoodsSourceTypeEnum.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/help/AppPageNotification.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/HomeNavbar.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/Special.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/SpecialCard.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/SuperSpecialCard.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/SwiperPicture.java 94 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/content/MsgMoneyHongBaoMap.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/content/MsgTypeInvite.java 120 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/content/MsgTypeMoney.java 157 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/search/HotSearch.java 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/LostOrder.java 92 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/ShamUser.java 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/monitor/ClientAPIMonitor.java 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/push/DeviceTokenIOS.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/taobao/SearchFilter.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/taobao/TaoBaoGoodsBriefExtra.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/taobao/TaoBaoShopInfo.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/UpdateOrderJob.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/AppVersionInfoMapper.xml 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/ThreeSaleMapper.xml 149 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/common/JumpDetailV2Mapper.xml 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/help/AppPageNotificationMapper.xml 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/HomeNavbarMapper.xml 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SpecialCardMapper.xml 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SpecialMapper.xml 103 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SuperHomeNavbarMapper.xml 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SuperSpecialCardMapper.xml 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SwiperPictureMapper.xml 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/lable/QualityFactoryMapper.xml 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/monitor/ClientAPIMonitorMapper.xml 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/order/LostOrderMapper.xml 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/taobao/TaoBaoGoodsBriefMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/ShamUserMapper.xml 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/activity/ActivityServiceImpl.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/common/JumpDetailV2ServiceImpl.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/config/AppVersionServiceImpl.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/config/ConfigServiceImpl.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/config/HotSearchServiceImpl.java 128 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/config/InviteGetMoneyServiceImpl.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/config/SuperHotSearchSerivceImpl.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/config/SystemClientParamsServiceImpl.java 111 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/config/SystemServiceImpl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/CollectionGoodsServiceImpl.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/help/AppPageNotificationServiceImpl.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/HomeNavbarServiceImpl.java 149 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialCardServiceImpl.java 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SuperHomeNavbarServiceImpl.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SuperSpecialCardServiceImpl.java 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SwiperPictureServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/HongBaoServiceImpl.java 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/ThreeSaleSerivceImpl.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/lable/QualityGoodsServiceImpl.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/monitor/MonitorServiceImpl.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/LostOrderServiceImpl.java 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderItemServcieImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/PidOrderServiceImpl.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/push/IOSPushServiceImpl.java 188 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/push/PushServiceImpl.java 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoGoodsUpdateServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoOrderServiceImpl.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/ShamUserServiceImpl.java 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/activity/ActivityService.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/common/JumpDetailV2Service.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/config/AppVersionService.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/config/ConfigService.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/config/HotSearchService.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/config/InviteGetMoneyService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/config/SuperHotSearchService.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/config/SystemClientParamsService.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/config/SystemService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/CollectionGoodsService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/help/AppPageNotificationService.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/HomeNavbarService.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SpecialCardService.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SpecialService.java 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SuperHomeNavbarService.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SuperSpecialCardService.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/hongbao/ThreeSaleSerivce.java 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/lable/QualityGoodsService.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/monitor/MonitorService.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/order/LostOrderService.java 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/ShamUserService.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/HongBaoUtil.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/ImageUtil.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/MoneyBigDecimalUtil.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/RedisManager.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/SpringContext.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/MonitorFactory.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoOrderUtil.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeBaseUtil.java 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/druid.properties 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/test/java/org/fanli/AppTest.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/test/java/org/fanli/AppVersionTest.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/test/java/org/fanli/DeviceTokenTest.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/test/java/org/fanli/TBImgTest.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/test/java/org/fanli/TaoKeTest.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/.gitignore
@@ -1,4 +1,8 @@
/target/
/.settings/
druid.properties
Constant.java
Constant.java
/error.log
/.gitignore
/c3p0/
/logs/
fanli/src/main/java/com/yeshi/fanli/aspect/LoginAspect.java
@@ -14,12 +14,12 @@
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.yeshi.utils.JsonUtil;
import com.yeshi.fanli.entity.common.AdminUser;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.annotation.RequestNoLogin;
import org.yeshi.utils.JsonUtil;
@Component
@Aspect
fanli/src/main/java/com/yeshi/fanli/aspect/SignValidateAspect.java
@@ -17,12 +17,12 @@
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.yeshi.utils.JsonUtil;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import org.yeshi.utils.JsonUtil;
import net.sf.json.JSONObject;
fanli/src/main/java/com/yeshi/fanli/controller/ClientJspController.java
@@ -226,17 +226,22 @@
    }
    @RequestMapping("findThreeFriendsCount")
    public void findThreeFriendsCount(long id, PrintWriter out) {
    public void findThreeFriendsCount(long id, String callback, PrintWriter out) {
        int count1 = userInfoService.findFriendsCount(id, 1);
        int count2 = userInfoService.findFriendsCount(id, 2);
        JSONObject data = new JSONObject();
        data.put("count1", count1);
        data.put("count2", count2);
        out.print(JsonUtil.loadTrueResult(data));
        if (!StringUtil.isNullOrEmpty(callback)) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
        } else {
            out.print(JsonUtil.loadTrueResult(data));
        }
    }
    @RequestMapping("findThreeFriends")
    public void findThreeFriends(long id, int type, int page, PrintWriter out) {
    public void findThreeFriends(long id, int type, int page, String callback, PrintWriter out) {
        int pageSize = 30;
        List<InviteUser> list = userInfoService.getFriendsList(id, type, page, pageSize);
        JSONArray array = new JSONArray();
@@ -251,7 +256,11 @@
        JSONObject data = new JSONObject();
        data.put("list", array);
        data.put("pages", count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
        out.print(JsonUtil.loadTrueResult(data));
        if (!StringUtil.isNullOrEmpty(callback)) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
        } else {
            out.print(JsonUtil.loadTrueResult(data));
        }
    }
    @RequestMapping("findThreeSales")
fanli/src/main/java/com/yeshi/fanli/controller/admin/ActivityAdminController.java
@@ -2,6 +2,7 @@
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -13,9 +14,14 @@
import org.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.JsonUtil;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.entity.bus.activity.ActivityUser;
import com.yeshi.fanli.entity.bus.activity.RecommendActivity;
import com.yeshi.fanli.entity.bus.activity.RecommendActivityInviteInfo;
import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar;
import com.yeshi.fanli.entity.common.JumpDetailV2;
import com.yeshi.fanli.exception.ActivityException;
import com.yeshi.fanli.service.inter.activity.ActivityService;
import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
@@ -400,6 +406,113 @@
        activityService.deleteRecommendActivity(rsids);
        out.print(JsonUtil.loadTrueResult("删除成功"));
    }
    // deleteRecommendActivity
    /**
     *
     * @param pageIndex
     *            页数
     * @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<RecommendActivity> list = null;
            if (StringUtil.isNullOrEmpty(key)) {
                list = activityService.getRecommendActivityList(pageIndex, Constant.PAGE_SIZE);
            } else {
                list = activityService.queryRecommendActivityList(key, pageIndex, Constant.PAGE_SIZE);
            }
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
                return;
            }
            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);
            JSONObject data = new JSONObject();
            data.put("pe", pe);
            data.put("result_list", list);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("查询失败"));
            e.printStackTrace();
        }
    }
    @RequestMapping(value = "saveModify")
    public void saveModify(String callback, RecommendActivity recommendActivity, PrintWriter out) {
        try {
            Long id = recommendActivity.getId();
            if (id == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
                return;
            }
            RecommendActivity resultObj = activityService.selectByPrimaryKey(id);
            if (resultObj == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作数据已不存在"));
                return;
            }
            activityService.updateByPrimaryKeySelective(recommendActivity);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("修改成功"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
            e.printStackTrace();
        }
    }
    @RequestMapping(value = "delete")
    public void delete(String callback, String idArray, PrintWriter out) {
        if (StringUtil.isNullOrEmpty(idArray)) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择操作的数据"));
            return;
        }
        try {
            Gson gson = new Gson();
            long[] hsids = gson.fromJson(idArray, new TypeToken<long[]>() {}.getType());
            if (hsids == null || hsids.length == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("未检测到删除的数据"));
                return;
            }
            activityService.deleteRecommendActivity(hsids);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("删除成功"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/admin/AppPageNotificationAdminController.java
New file
@@ -0,0 +1,292 @@
package com.yeshi.fanli.controller.admin;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import net.sf.json.JSONObject;
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.help.AppPageNotification;
import com.yeshi.fanli.entity.bus.help.AppPageNotification.AppPageNotificationTypeEnum;
import com.yeshi.fanli.service.inter.help.AppPageNotificationService;
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
@Controller
@RequestMapping("admin/new/api/v1/notification")
public class AppPageNotificationAdminController {
    @Resource
    private AppPageNotificationService appPageNotificationService;
    /**
     * 新增
     * @param callback
     * @param special
     * @param out
     */
//    @RequestMapping(value = "saveAdd")
    public void saveAdd(String callback, AppPageNotification appPageNotification, PrintWriter out) {
        try {
            String content = appPageNotification.getContent();
            if (StringUtil.isNullOrEmpty(content) ) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("显示内容不能为空"));
                return;
            }
            AppPageNotificationTypeEnum type = appPageNotification.getType();
            if (type != null) {
                AppPageNotification old = appPageNotificationService.getAppPageNotificationByType(type.name());
                if (old != null) {
                    JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("已存在此类型"));
                    return;
                }
                appPageNotification.setMd5(StringUtil.Md5(type.name()
                        + "#" + content + "#" + appPageNotification.getContentUrl()));
            } else {
                appPageNotification.setMd5(StringUtil.Md5(null + "#" + content + "#" + appPageNotification.getContentUrl()));
            }
            appPageNotification.setCreateTime(new Date());
            appPageNotification.setUpdateTime(new Date());
            appPageNotificationService.insertSelective(appPageNotification);
            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, AppPageNotification appPageNotification, PrintWriter out) {
        try {
            AppPageNotificationTypeEnum type = appPageNotification.getType();
            if (type == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
                return;
            }
            AppPageNotification old = appPageNotificationService.getAppPageNotificationByType(type.name());
            if (old == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作对象已不存在"));
                return;
            }
            String content = appPageNotification.getContent();
            if (StringUtil.isNullOrEmpty(content) ) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("显示内容不能为空"));
                return;
            }
            appPageNotification.setMd5(StringUtil.Md5(type.name() + "#" + content + "#" + appPageNotification.getContentUrl()));
            appPageNotification.setId(old.getId());
            appPageNotification.setUpdateTime(new Date());
            appPageNotificationService.updateByPrimaryKeySelective(appPageNotification);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("修改成功"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
            e.printStackTrace();
        }
    }
    /**
     * 查询列表
     * @param callback
     * @param pageIndex
     * @param pageSize
     * @param key 内容、类型
     * @param show  是否显示 1 0
     * @param canClose 是否可以关闭 1 0
     * @param out
     */
    @RequestMapping(value = "query")
    public void query(String callback, Integer pageIndex, Integer pageSize, String key,
             Integer show, Integer canClose, PrintWriter out) {
        if (pageIndex == null || pageIndex < 1) {
            pageIndex = 1;
        }
        if (pageSize == null || pageSize < 1) {
            pageSize = Constant.PAGE_SIZE;
        }
        try {
            List<AppPageNotification> list = appPageNotificationService.listQuery((pageIndex - 1) * pageSize,
                    pageSize, key, show, canClose);
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
                return;
            }
            for (AppPageNotification notification: list) {
                AppPageNotificationTypeEnum type = notification.getType();
                notification.setPageName(type.getDesc());
            }
            long count = appPageNotificationService.countQuery(key, show, canClose);
            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 id
     * @param out
     */
    @RequestMapping(value = "updateCanCloseState")
    public void updateCanCloseState(String callback, String type, PrintWriter out) {
        try {
            if (type == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
                return;
            }
            AppPageNotification resultObj = appPageNotificationService.getAppPageNotificationByType(type);
            if (resultObj == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作数据已不存在"));
                return;
            }
            Boolean canClose = resultObj.getCanClose();
            if (canClose) {
                resultObj.setCanClose(false);
            } else {
                resultObj.setCanClose(true);
            }
            appPageNotificationService.updateByPrimaryKeySelective(resultObj);
            JSONObject data = new JSONObject();
            data.put("state", resultObj.getCanClose());
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
            e.printStackTrace();
        }
    }
    /**
     * 修该显示状态
     * @param callback
     * @param id
     * @param out
     */
    @RequestMapping(value = "updateShowState")
    public void updateShowState(String callback, String type, PrintWriter out) {
        try {
            if (type == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
                return;
            }
            AppPageNotification resultObj = appPageNotificationService.getAppPageNotificationByType(type);
            if (resultObj == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作数据已不存在"));
                return;
            }
            Boolean show = resultObj.getShow();
            if (show) {
                resultObj.setShow(false);
            } else {
                resultObj.setShow(true);
            }
            appPageNotificationService.updateByPrimaryKeySelective(resultObj);
            JSONObject data = new JSONObject();
            data.put("state", resultObj.getShow());
            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 = appPageNotificationService.deleteBatchByPrimaryKey(list);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("成功删除["+ count +"]条数据"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/admin/ConfigAdminController.java
@@ -7,12 +7,17 @@
import javax.annotation.Resource;
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 com.yeshi.fanli.entity.common.Config;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
import org.yeshi.utils.JsonUtil;
@Controller
@@ -47,4 +52,75 @@
        out.print(JsonUtil.loadTrueResult("修改成功"));
        return;
    }
    /**
     * 查询列表 - 新后台
     * @param callback
     * @param key 查询词  名称
     * @param pageIndex
     * @param out
     */
    @RequestMapping(value = "getNewConfigList")
    public void getNewConfigList(String callback, String key, Integer pageIndex, PrintWriter out){
        try {
            if (pageIndex == null || pageIndex < 0){
                pageIndex = 1;
            }
            List<Config> list =  configService.listObjects(key, pageIndex);
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无更多数据"));
                return;
            }
            int count = configService.getCount(key, pageIndex);
            PageEntity pe = new PageEntity(pageIndex, Constant.PAGE_SIZE, count);
            JSONObject data = new JSONObject();
            data.put("pe", pe);
            data.put("result_list", list);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("查询失败"));
            e.printStackTrace();
        }
    }
    /**
     * 参数修改 - 新后台
     * @param callback
     * @param config
     * @param out
     */
    @RequestMapping(value = "saveModify")
    public void saveModify(String callback, Config config, PrintWriter out) {
        Long id = config.getId();
        if (id == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
            return;
        }
        try {
            Config crentconfig = configService.getConfig(id);
            if (crentconfig == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作数据已不存在"));
                return;
            }
            // key 不可修改
            config.setKey(crentconfig.getKey());
            configService.update(config);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("修改成功"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("修改失败"));
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/admin/ExtractAdminController.java
@@ -1411,4 +1411,34 @@
        
    }
    
    /**
     * 校验用户资金是否异常
     *
     * @param uid
     * @param out
     */
    @RequestMapping(value = "checkMoney")
    public void checkMoney(String callback, String uid, PrintWriter out) {
        if (StringUtil.isNullOrEmpty(uid)) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("UID不能为空"));
            return;
        }
        List<Integer> listChecked = extractService.checkExtract(uid);
        if (listChecked == null || listChecked.size() == 0) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("资金异常"));
            return;
        }
        Integer diversity = listChecked.get(0);
        if (diversity == 0) {
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("资金正常"));
        } else {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("资金异常"));
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsSubClassAdminController.java
@@ -171,7 +171,8 @@
            
            subClass.setId(id);
            subClass.setUpdatetime(new Date());
            subClass.setAndroidClick(resultObj.getAndroidClick());
            subClass.setIosClick(resultObj.getIosClick());
            goodsSubClassService.updateByPrimaryKeySelective(subClass);
            
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("修改成功"));
fanli/src/main/java/com/yeshi/fanli/controller/admin/HotSearchAdminController.java
@@ -7,22 +7,26 @@
import javax.annotation.Resource;
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.reflect.TypeToken;
import com.yeshi.fanli.entity.admin.HotSearchAdmin;
import com.yeshi.fanli.entity.bus.search.HotSearch;
import com.yeshi.fanli.entity.bus.su.search.SuperHotSearch;
import com.yeshi.fanli.entity.system.System;
import com.yeshi.fanli.service.inter.config.HotSearchService;
import com.yeshi.fanli.service.inter.config.SuperHotSearchService;
import com.yeshi.fanli.service.inter.config.SystemService;
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 org.yeshi.utils.JsonUtil;
import net.sf.json.JSONObject;
@Controller
@RequestMapping("admin/new/api/v1/search")
@@ -110,9 +114,169 @@
        }
    }
    
    @RequestMapping(value = "updateHotSearch", method = RequestMethod.POST)
    public void updateSection(HotSearch hotSearch,PrintWriter out){
        hotSearchService.updateHotSearch(hotSearch);
        out.print(JsonUtil.loadTrueResult("修改成功"));
    @RequestMapping(value = "updateHotSearch")
    public void updateSection(String callback, HotSearch hotSearch, PrintWriter out){
        try {
            if (hotSearch.getId() == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
                return;
            }
            if (StringUtil.isNullOrEmpty(hotSearch.getName())) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("热门搜索词不能为空"));
                return;
            }
            hotSearchService.updateHotSearch(hotSearch);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("修改成功"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("修改失败"));
            e.printStackTrace();
        }
    }
    /**
     * 查询列表- 新后台
     * @param callback
     * @param pageIndex
     * @param platform
     * @param packages
     * @param key
     * @param out
     */
    @RequestMapping(value = "newHotSearchList")
    public void newHotSearchList(String callback, Integer pageIndex, String key, Long systemId,
            PrintWriter out) {
        if (pageIndex == null || pageIndex < 1) {
            pageIndex = 1;
        }
        int pageSize = Constant.PAGE_SIZE;
        try {
            List<HotSearch> list = hotSearchService.listQuery(pageIndex - 1, pageSize, key, systemId);
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无更多数据"));
                return;
            }
            int count = hotSearchService.countList(key, systemId);
            int totalPage = count % pageSize == 0 ? count / pageSize : count / pageSize + 1;
            PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
            JSONObject data = new JSONObject();
            data.put("pe", pe);
            data.put("result_list", list);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("查询失败"));
            e.printStackTrace();
        }
    }
    /**
     * 新增-新后台
     * @param callback
     * @param hotSearch
     * @param out
     */
    @RequestMapping(value = "saveAdd")
    public void saveAdd(String callback, HotSearch hotSearch, PrintWriter out) {
        if (hotSearch == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("热门搜索不能为空"));
            return;
        }
        if (StringUtil.isNullOrEmpty(hotSearch.getName())) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("热门搜索词不能为空"));
            return;
        }
        try {
            hotSearch.setId(null);
            hotSearchService.addHotSearch(hotSearch);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("添加成功"));
        } 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){
        if (StringUtil.isNullOrEmpty(idArray)) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择操作的数据"));
            return;
        }
        try {
            Gson gson = new Gson();
            long[] hsids = gson.fromJson(idArray, new TypeToken<long[]>() {}.getType());
            if (hsids == null || hsids.length == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("未检测到删除的数据"));
                return;
            }
            Integer type = hotSearchService.deleteHotSearch(hsids);
            if(type==null){
                JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("删除成功"));
            }else{
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
            }
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
            e.printStackTrace();
        }
    }
    @RequestMapping(value = "setSystem")
    public void setSystem(String callback, String type, Long id, Long systemId, PrintWriter out) {
        if (id == null || systemId == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择操作的数据"));
            return;
        }
        try {
            System system = systemService.getById(systemId);
            List<SuperHotSearch> list = superHotSearchService.getHotSearchSystem(id, systemId);
            if (list == null || list.size() == 0) {
                superHotSearchService.addSuper(systemId, system);
                JSONObject data = new JSONObject();
                data.put("check", 1);
                JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
            } else {
                Integer count = superHotSearchService.deleteSuper(id, systemId);
                if (count > 0) {
                    JSONObject data = new JSONObject();
                    data.put("check", 0);
                    JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
                } else {
                    JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("修改失败"));
                }
            }
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("修改异常"));
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/admin/InviteGetMoneyAdminController.java
@@ -1,30 +1,45 @@
package com.yeshi.fanli.controller.admin;
import java.io.InputStream;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
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.commons.CommonsMultipartFile;
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.tencentcloud.COSManager;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.entity.admin.EveryDayTask;
import com.yeshi.fanli.entity.admin.InviteGetMoney;
import com.yeshi.fanli.entity.bus.invite.SpreadImg;
import com.yeshi.fanli.entity.common.AdminUser;
import com.yeshi.fanli.service.AdminUserService;
import com.yeshi.fanli.service.inter.config.EveryDayTaskService;
import com.yeshi.fanli.service.inter.config.InviteGetMoneyService;
import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.GsonUtil;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.annotation.RequestNoLogin;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import org.yeshi.utils.JsonUtil;
@Controller
@RequestMapping("admin/new/api/v1/inviteGetMoney")
@@ -38,6 +53,9 @@
    
    @Resource
    private TaoBaoGoodsBriefService taoBaoGoodsBriefService; 
    @Resource
    private AdminUserService adminUserService;
    
    /**
     * 
@@ -311,5 +329,147 @@
        inviteGetMoneyService.editActivityRules(value, key);
        out.print(JsonUtil.loadTrueResult("修改成功"));
    }
    /**
     * 专题图片上传
     * @param file
     * @param uid
     * @param id
     * @param request
     * @param response
     * @param out
     */
    @RequestNoLogin()
    @RequestMapping(value = "saveAdd")
    public void saveAdd(@RequestParam("file") CommonsMultipartFile file, Long uid,
            Long id,  HttpServletRequest request, HttpServletResponse response, PrintWriter out) {
        response.setHeader("Access-Control-Allow-Origin", "*");
        response.setHeader("Access-Control-Allow-Methods", "*");
        AdminUser admin = adminUserService.selectByPrimaryKey(uid);
        if (admin == null) {
            out.print(JsonUtil.loadFalseResult("当前账户验证失败"));
            return;
        }
        if (file == null) {
            out.print(JsonUtil.loadFalseResult("上传文件为空"));
            return;
        }
        try {
            InputStream inputStream = file.getInputStream();
            String contentType = file.getContentType();
            String type = contentType.substring(contentType.indexOf("/") + 1);
            // 上传文件相对位置
            String fileUrl="/img/invite/"+UUID.randomUUID().toString().replace("-", "") + "." + type;
            String uploadFilePath = COSManager.getInstance().uploadFile(inputStream, fileUrl).getUrl();
            if (StringUtil.isNullOrEmpty(uploadFilePath)) {
                out.print(JsonUtil.loadFalseResult("图片上传失败"));
                return;
            }
            SpreadImg spreadImg = new SpreadImg();
            inviteGetMoneyService.addInviteFriendImg(spreadImg, uploadFilePath);
            out.print(JsonUtil.loadTrueResult("上传成功"));
        } catch (Exception e) {
            out.print(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,
            Integer sort, PrintWriter out) {
        if (pageIndex == null || pageIndex < 1) {
            pageIndex = 1;
        }
        if (pageSize == null || pageSize < 1) {
            pageSize = Constant.PAGE_SIZE;
        }
        try {
            List<SpreadImg> list = inviteGetMoneyService.listQuery((pageIndex - 1) * pageSize, pageSize, key);
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
                return;
            }
            long count = inviteGetMoneyService.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;
            }
            for (Long id: list) {
                SpreadImg spreadImg = inviteGetMoneyService.getInviteSpreadImg(id);
                String url = spreadImg.getUrl();
                if (!StringUtil.isNullOrEmpty(url)) {
                    COSManager.getInstance().deleteFile(url);
                }
                inviteGetMoneyService.deleteInviteFriendImg(id);
            }
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("删除成功"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/admin/JumpDetailAdminController.java
File was deleted
fanli/src/main/java/com/yeshi/fanli/controller/admin/LostOrderAdminController.java
@@ -2,20 +2,25 @@
import java.io.PrintWriter;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import net.sf.json.JSONObject;
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.yeshi.fanli.entity.bus.user.LostOrder;
import com.yeshi.fanli.entity.bus.user.Order;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.service.inter.order.LostOrderService;
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.GsonUtil;
import org.yeshi.utils.JsonUtil;
import net.sf.json.JSONObject;
@Controller
@RequestMapping("admin/new/api/v1/lostOrder")
@@ -66,4 +71,147 @@
        out.print(JsonUtil.loadTrueResult(""));
    }
    /**
     * 新版后台 列表查询
     * @param callback
     * @param pageIndex
     * @param key
     * @param out
     */
    @RequestMapping("query")
    public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer state,
            Integer handleType, PrintWriter out) {
        if (pageIndex == null || pageIndex < 0){
            pageIndex = 1;
        }
        if (pageSize == null || pageSize < 1) {
            pageSize = Constant.PAGE_SIZE;
        }
        try {
            List<LostOrder> list = lostOrderService.listQuery((pageIndex - 1) * pageSize, pageSize, key, state, handleType);
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无更多数据"));
                return;
            }
            for (LostOrder lostOrder: list) {
                Order order = lostOrder.getOrder();
                if (order == null) {
                    lostOrder.setOrder(new Order());
                }
                UserInfo userInfo = lostOrder.getUserInfo();
                if (userInfo == null) {
                    lostOrder.setUserInfo(new UserInfo());
                } else {
                    Map<String, Object> countData = lostOrderService.countByUid(userInfo.getId());
                    lostOrder.setTotal(Integer.parseInt(countData.get("total")+""));
                    lostOrder.setTotalPass(Integer.parseInt(countData.get("totalPass")+""));
                    lostOrder.setTotalReject(Integer.parseInt(countData.get("totalReject")+""));
                }
            }
            long count = lostOrderService.countQuery(key, state, handleType);
            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 id
     * @param out
     */
    @RequestMapping("passOrder")
    public void passOrder(String callback, Long id, PrintWriter out) {
        if (id == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
            return;
        }
        try {
            LostOrder lostOrder = lostOrderService.getOne(id);
            if (lostOrder == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("不存在该查询订单"));
                return;
            }
            if (lostOrder.getState() != 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该订单已处理"));
                return;
            }
            lostOrderService.pass(lostOrder);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
            e.printStackTrace();
        }
    }
    /**
     *  新版后台 拒绝
     * @param callback
     * @param id
     * @param reason
     * @param out
     */
    @RequestMapping("rejectOrder")
    public void rejectOrder(String callback, Long id, String reason, PrintWriter out) {
        if (id == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
            return;
        }
        try {
            LostOrder lostOrder = lostOrderService.getOne(id);
            if (lostOrder == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("不存在该查询订单"));
                return;
            }
            if (lostOrder.getState() != 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该订单已处理"));
                return;
            }
            lostOrder.setRemake(reason);
            lostOrderService.reject(lostOrder);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/admin/PushController.java
@@ -8,6 +8,7 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.yeshi.fanli.exception.PushException;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.config.SystemService;
import com.yeshi.fanli.service.inter.push.PushRecordService;
@@ -16,6 +17,7 @@
import com.yeshi.fanli.service.inter.user.SystemZnxService;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.factory.IOSPushFactory;
import org.yeshi.utils.HttpUtil;
import org.yeshi.utils.JsonUtil;
@@ -136,17 +138,133 @@
     * @param out
     * @throws Exception
     */
    @RequestMapping(value = "convertLink", method = RequestMethod.POST)
    public void convertLink(String url, PrintWriter out) throws Exception {
    @RequestMapping(value = "convertLink")
    public void convertLink(String callback, String url, PrintWriter out) {
        String shortLink = org.yeshi.utils.HttpUtil.getShortLink(url);
        if (StringUtil.isNullOrEmpty(url)) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("转链数据不能为空"));
            return;
        }
        try {
            String shortLink = org.yeshi.utils.HttpUtil.getShortLink(url);
        JSONObject jsonData = new JSONObject();
        jsonData.put("url", url);
        jsonData.put("shortLink", shortLink);
        out.print(JsonUtil.loadTrueResult(jsonData));
            JSONObject jsonData = new JSONObject();
            jsonData.put("url", url);
            jsonData.put("shortLink", shortLink);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(jsonData));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("转换失败"));
            e.printStackTrace();
        }
    }
    /**
     * 商品推送  -(新后台)
     *
     * @param uId
     *            -用户ID 可为空
     * @param url
     *            -商品链接
     * @param title
     *            -推送标题
     * @param content
     *            -推送内容
     * @param out
     * @throws Exception
     */
    @RequestMapping(value = "newPushGoodsAll")
    public void newPushGoodsAll(String callback, Long uid, String url, String title, String content, PrintWriter out) throws Exception {
        String auctionId = null;
        if (!StringUtil.isNullOrEmpty(url) && url.contains("id=")) {
            String[] sts = url.split("\\?")[1].split("&");
            for (String st : sts)
                if (st.contains("id=")) {
                    auctionId = st.replace("id=", "");
                }
        }
        if (StringUtil.isNullOrEmpty(auctionId)) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("提取商品ID失败"));
            return;
        }
        JSONObject json = IOSPushFactory.createGoodsPush(Long.parseLong(auctionId), title, content);
        if (json.toString().getBytes().length > 256) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("标题或内容过长,请删减后再试"));
            return;
        }
        try {
            pushService.pushGoods(uid, url, title, content);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("推送成功"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("推送失败"));
            e.printStackTrace();
        }
    }
    /**
     * 网页推送 -(新后台)
     *
     * @param url
     * @param title
     * @param content
     * @param out
     * @throws Exception
     */
    @RequestMapping(value = "newPushUrlAll")
    public void newPushUrlAll(String callback, String url, String title, String content, PrintWriter out) {
        if (StringUtil.isNullOrEmpty(url) || StringUtil.isNullOrEmpty(title) || StringUtil.isNullOrEmpty(content)) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请填写链接,标题与内容"));
            return;
        }
        JSONObject json = IOSPushFactory.createURLPush(HttpUtil.getShortLink(url), title, content);
        if (json.toString().getBytes().length > 256) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("标题或内容过长,请删减后再试"));
            return;
        }
        try {
            pushService.pushUrl(null, url, title, content);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("推送成功"));
        } catch (PushException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("推送失败"));
            e.printStackTrace();
        }
    }
    /**
     *
     * 方法说明: 站内信推送 -(新后台)
     *
     * @param uId
     * @param title
     * @param content
     * @throws Exception
     */
    @RequestMapping(value = "newPushFanZNX")
    public void newPushFanZNX(String callback, Long uid, String title, String content, PrintWriter out) {
        if (StringUtil.isNullOrEmpty(title) || StringUtil.isNullOrEmpty(content)) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请填写标题与内容"));
            return;
        }
        try {
            pushService.pushZNX(uid, title, content);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("推送成功"));
        } catch (PushException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("推送失败"));
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/admin/PushRecordAdminController.java
@@ -13,6 +13,7 @@
import com.yeshi.fanli.service.inter.push.PushRecordService;
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
import org.yeshi.utils.JsonUtil;
import net.sf.json.JSONObject;
@@ -36,4 +37,51 @@
        out.print(JsonUtil.loadTrueResult(data));
    }
    
    /**
     * 推荐记录 -(新后台)
     * @param callback
     * @param key
     * @param type
     * @param pageIndex
     * @param out
     */
    @RequestMapping(value = "getNewPushRecordList")
    public void getNewPushRecordList(String callback, String key, Integer type, Integer pageIndex, PrintWriter out){
        try {
            if (pageIndex == null || pageIndex < 0){
                pageIndex = 1;
            }
            if (type == null) {
                type = 0;
            }
            List<PushRecord> list = pushRecordService.getPushRecordList(key, type, pageIndex);
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无更多数据"));
                return;
            }
            int pageSize = Constant.PAGE_SIZE;
            int count = pushRecordService.getCount(key, type, pageIndex);
            int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
            PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
            JSONObject data = new JSONObject();
            data.put("pe", pe);
            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/TaoBaoGoodsBriefAdminController.java
@@ -45,6 +45,7 @@
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import org.yeshi.utils.JsonUtil;
@Controller
@@ -329,8 +330,6 @@
                filter.setKey("女装");
            }
            
            // 折扣价范围下限
            if (startPrice != null)
                filter.setStartPrice(new BigDecimal(startPrice));
@@ -341,17 +340,13 @@
            // 淘客佣金比率下限 如:1234表示12.34%
            if (!StringUtil.isNullOrEmpty(startTkRate)) {
                BigDecimal b = new BigDecimal(startTkRate);
                double df = b.setScale(2, BigDecimal.ROUND_FLOOR).doubleValue();
                int tkRate = (int) (df * 100);
                filter.setStartTkRate(tkRate);
                int tkRate = (int) (Float.parseFloat(startTkRate) * 100);
                    filter.setStartTkRate(tkRate);
            }
            // 淘客佣金比率上限 如:1234表示12.34%
            if (!StringUtil.isNullOrEmpty(endTkRate)) {
                BigDecimal b = new BigDecimal(endTkRate);
                double df = b.setScale(2, BigDecimal.ROUND_FLOOR).doubleValue();
                int tkRate = (int) (df * 100);
                int tkRate = (int) (Float.parseFloat(endTkRate) * 100);
                filter.setEndTkRate(tkRate);
            }
fanli/src/main/java/com/yeshi/fanli/controller/admin/UploadController.java
@@ -3,15 +3,16 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.sf.json.JSONObject;
import org.springframework.core.task.TaskExecutor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@@ -22,12 +23,22 @@
import com.yeshi.fanli.entity.common.AdminUser;
import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.AdminUserService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoService;
import com.yeshi.fanli.service.inter.order.OrderProcessService;
import com.yeshi.fanli.service.inter.order.OrderService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoOrderService;
import com.yeshi.fanli.util.CMQManager;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.util.annotation.RequestNoLogin;
import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
import freemarker.core.ArithmeticEngine.ConservativeEngine;
import net.sf.json.JSONObject;
@Controller
@RequestMapping("admin/new/api/v1/upload")
@@ -41,10 +52,18 @@
    @Resource
    private OrderProcessService orderProcessService;
    @Resource
    private AdminUserService adminUserService;
    @Resource(name = "taskExecutor")
    private TaskExecutor executor;
    @Resource
    private TaoBaoOrderService taoBaoOrderService;
    @Resource
    private RedisManager redisManager;
    // private static final String PAYSUCCESS = "支付成功";
    // private static final String ORDERCLOSE="订单关闭";
@@ -61,8 +80,8 @@
            InputStream inputStream = file.getInputStream();
            String contentType = file.getContentType();
            String type = contentType.substring(contentType.indexOf("/") + 1);
            String uploadFilePath = COSManager.getInstance().uploadFile(inputStream,
                    UUID.randomUUID().toString().replace("-", "") + "." + type).getUrl();
            String uploadFilePath = COSManager.getInstance()
                    .uploadFile(inputStream, UUID.randomUUID().toString().replace("-", "") + "." + type).getUrl();
            out.print(JsonUtil.loadTrueResult(uploadFilePath));
        } catch (IOException e) {
            e.printStackTrace();
@@ -84,8 +103,9 @@
            InputStream inputStream = file.getInputStream();
            String contentType = file.getContentType();
            String type = contentType.substring(contentType.indexOf("/") + 1);
            String uploadFilePath = COSManager.getInstance().uploadFile(inputStream,
                    UUID.randomUUID().toString().replace("-", "") + "." + type + ".apk").getUrl();
            String uploadFilePath = COSManager.getInstance()
                    .uploadFile(inputStream, UUID.randomUUID().toString().replace("-", "") + "." + type + ".apk")
                    .getUrl();
            out.print(JsonUtil.loadTrueResult(uploadFilePath));
        } catch (Exception e) {
            e.printStackTrace();
@@ -101,8 +121,8 @@
            String date = TimeUtil.getyyyyMMdd(timeMillis);
            String contentType = file.getContentType();
            String type = contentType.substring(contentType.indexOf("/") + 1);
            String uploadFilePath = COSManager.getInstance().uploadFile(inputStream,
                    "section/" + date + "/" + timeMillis + "." + type).getUrl();
            String uploadFilePath = COSManager.getInstance()
                    .uploadFile(inputStream, "section/" + date + "/" + timeMillis + "." + type).getUrl();
            JSONObject data = new JSONObject();
            data.put("original", file.getOriginalFilename());
            data.put("name", file.getOriginalFilename());
@@ -118,13 +138,73 @@
        }
    }
    private void addOrder(List<TaoBaoOrder> orderList) {
        try {
            taoBaoOrderService.addTaoBaoOrderList(orderList);
        } catch (Exception e) {
            try {
                LogHelper.errorDetailInfo(e);
            } catch (Exception e1) {
                e1.printStackTrace();
            }
        }
        try {
            Map<String, List<TaoBaoOrder>> map = TaoBaoOrderUtil.classifyTaoBaoOrderByOrderId(orderList);
            if (map != null) {
                Iterator<String> its = map.keySet().iterator();
                while (its.hasNext()) {
                    String key = its.next();
                    List<TaoBaoOrder> orders = map.get(key);
                    String redisKey = "addorderqueue-" + key;
                    // redis做频率限制
                    if (Constant.IS_OUTNET) {
                        try {
                            if (!StringUtil.isNullOrEmpty(redisManager.getCommonString(redisKey))) {
                                continue;
                            }
                        } catch (Exception e) {
                        }
                    }
                    CMQManager.getInstance().addTaoBaoOrderMsg(key, orders);
                    try {
                        // 6小时内不再处理
                        if (Constant.IS_OUTNET) {
                            redisManager.cacheCommonString(redisKey, "1", 60 * 60 * 6);
                        }
                    } catch (Exception e) {
                    }
                }
            }
        } catch (Exception e) {
            try {
                LogHelper.errorDetailInfo(e);
            } catch (Exception e1) {
                e1.printStackTrace();
            }
        }
    }
    @RequestMapping(value = "uploadOrder", method = RequestMethod.POST)
    public void uploadOrder(@RequestParam("file") CommonsMultipartFile file, PrintWriter out) {
        if (file != null) {
            try {
                List<TaoBaoOrder> orderList = TaoBaoOrderUtil.parseOrder(file.getInputStream());
                orderProcessService.processOrder(TaoBaoOrderUtil.classifyTaoBaoOrderByOrderId(orderList));
                // for(int i=0;i<orderList.size();i++)
                // {
                // if(!orderList.get(i).getOrderId().equalsIgnoreCase("229978886132510070")&&!orderList.get(i).getOrderId().equalsIgnoreCase("246314979024510070"))
                // {
                // orderList.remove(i--);
                // continue;
                // }
                //
                // }
                // orderProcessService.processOrder(TaoBaoOrderUtil.classifyTaoBaoOrderByOrderId(orderList));
                addOrder(orderList);
            } catch (IOException e) {
                e.printStackTrace();
                out.print(JsonUtil.loadFalseResult(e.getMessage()));
@@ -137,44 +217,161 @@
    }
    /**
     * 新后台端 上传订单文件
     * @param file  excel文件
     * @param uid  当前用户id
     *
     * @param file
     *            excel文件
     * @param uid
     *            当前用户id
     * @param request
     * @param response
     * @param out
     */
    @RequestNoLogin()
    @RequestMapping(value = "uploadOrderFile")
    public void uploadOrderFile(@RequestParam("file") CommonsMultipartFile file, Long uid,
             HttpServletRequest request, HttpServletResponse response, PrintWriter out) {
    public void uploadOrderFile(@RequestParam("file") CommonsMultipartFile file, Long uid, HttpServletRequest request,
            HttpServletResponse response, PrintWriter out) {
        response.setHeader("Access-Control-Allow-Origin", "*");
        response.setHeader("Access-Control-Allow-Methods", "*");
        AdminUser admin = adminUserService.selectByPrimaryKey(uid);
        if (admin == null) {
            out.print(JsonUtil.loadFalseResult("用户验证未通过"));
            return;
        }
        if (file == null) {
            out.print(JsonUtil.loadFalseResult("上传文件不能为空"));
            return;
        }
        List<TaoBaoOrder> orderList = null;
        try {
            orderList = TaoBaoOrderUtil.parseOrder(file.getInputStream());
            out.print(JsonUtil.loadTrueResult("上传成功,系统正在处理中..."));
        } catch (IOException e) {
            out.print(JsonUtil.loadFalseResult("上传文件失败"));
            e.printStackTrace();
        }
        final List<TaoBaoOrder> list = orderList;
        executor.execute(new Runnable() {
            @Override
            public void run() {
                try {
                    orderProcessService.processOrder(TaoBaoOrderUtil.classifyTaoBaoOrderByOrderId(list));
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
    }
    /**
     * 上传图片jsonp
     *
     * @param file
     * @param out
     */
    @RequestNoLogin()
    @RequestMapping(value = "uploadPicture")
    public void uploadPicture(@RequestParam("file") CommonsMultipartFile file, Long uid, HttpServletResponse response,
            PrintWriter out) {
        response.setHeader("Access-Control-Allow-Origin", "*");
        response.setHeader("Access-Control-Allow-Methods", "*");
        AdminUser admin = adminUserService.selectByPrimaryKey(uid);
        if (admin == null) {
            out.print(JsonUtil.loadFalseResult("当前账户验证失败"));
            return;
        }
        if (file == null) {
            out.print(JsonUtil.loadFalseResult("上传文件为空"));
            return;
        }
        try {
            InputStream inputStream = file.getInputStream();
            String contentType = file.getContentType();
            String type = contentType.substring(contentType.indexOf("/") + 1);
            // 上传文件相对位置
            String fileUrl="/img/admin/" + UUID.randomUUID().toString().replace("-", "") + "." + type;
            String uploadPath = COSManager.getInstance().uploadFile(inputStream, fileUrl).getUrl();
            JSONObject data = new JSONObject();
            data.put("original", file.getOriginalFilename());
            data.put("name", file.getOriginalFilename());
            data.put("url", uploadPath);
            data.put("size", file.getSize() + "");
            data.put("type", "." + type);
            data.put("state", "SUCCESS");
            out.print(JsonUtil.loadTrueResult(data));
            out.print(JsonUtil.loadTrueResult(uploadPath));
        } catch (IOException e) {
            out.print(JsonUtil.loadFalseResult("上传图片失败"));
            e.printStackTrace();
        }
    }
    /**
     *
     * 方法说明: 上传Apk安装包
     *
     * @param file
     * @param out
     */
    @RequestMapping(value = "installPackage")
    public void installPackage(@RequestParam("file") CommonsMultipartFile file, Long uid,
            HttpServletResponse response, PrintWriter out) {
        
        response.setHeader("Access-Control-Allow-Origin", "*");
        response.setHeader("Access-Control-Allow-Methods", "*");
        
        AdminUser admin = adminUserService.selectByPrimaryKey(uid);
        if (admin == null) {
            out.print(JsonUtil.loadFalseResult("用户验证未通过"));
            out.print(JsonUtil.loadFalseResult("当前账户验证失败"));
            return;
        }
        
        if (file == null) {
            out.print(JsonUtil.loadFalseResult("上传文件不能为空"));
            out.print(JsonUtil.loadFalseResult("上传文件为空"));
            return;
        }
        
        try {
            List<TaoBaoOrder> orderList = TaoBaoOrderUtil.parseOrder(file.getInputStream());
            InputStream inputStream = file.getInputStream();
            String contentType = file.getContentType();
            String type = contentType.substring(contentType.indexOf("/") + 1);
            
            orderProcessService.processOrder(TaoBaoOrderUtil.classifyTaoBaoOrderByOrderId(orderList));
            // 上传文件相对位置
            String fileUrl="/apk/admin/" + UUID.randomUUID().toString().replace("-", "") + "." + type + ".apk";
            
            out.print(JsonUtil.loadTrueResult("上传成功"));
        } catch (IOException e) {
            String uploadFilePath = COSManager.getInstance().uploadFile(inputStream, fileUrl).getUrl();
            JSONObject data = new JSONObject();
            data.put("original", file.getOriginalFilename());
            data.put("name", file.getOriginalFilename());
            data.put("url", uploadFilePath);
            data.put("size", file.getSize() + "");
            data.put("type", "." + type);
            data.put("state", "SUCCESS");
            out.print(JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult("上传失败"));
            e.printStackTrace();
            out.print(JsonUtil.loadFalseResult("上传异常"));
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java
@@ -29,6 +29,7 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.yeshi.fanli.entity.admin.UserInfoAdmin;
import com.yeshi.fanli.entity.bus.user.AccountDetails;
import com.yeshi.fanli.entity.bus.user.Extract;
import com.yeshi.fanli.entity.bus.user.HongBao;
import com.yeshi.fanli.entity.bus.user.MoneyRecord;
@@ -57,6 +58,7 @@
import com.yeshi.fanli.util.HongBaoUtil;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TimeUtil;
import org.yeshi.utils.JsonUtil;
@Controller
@@ -1024,8 +1026,154 @@
        }
    }
    
    public static void main(String[] args) {
    /**
     * 队员关系
     * @param pageIndex
     * @param key
     * @param state
     * @param startTime
     * @param endTime
     * @param out
     */
    @RequestMapping(value = "getRelationList")
    public void getRelationList(String callback, Integer pageIndex, Integer pageSize, Long uid, Integer type,
            Integer state, String startTime, String endTime, PrintWriter out) {
        
        if (pageIndex == null || pageIndex < 1) {
            pageIndex = 1;
        }
        if (pageSize == null || pageSize < 1) {
            pageSize = Constant.PAGE_SIZE;
        }
        try {
            if (!StringUtil.isNullOrEmpty(endTime)) {
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                Date enddate = sdf.parse(endTime);
                Calendar c = Calendar.getInstance();
                c.setTime(enddate);
                c.add(Calendar.DAY_OF_MONTH, 1);// 今天+1天
                endTime = sdf.format(c.getTime());
            }
            List<ThreeSale> listQuery = null;
            if (type == 0) {
                // 上级用户
                if (uid == null) {
                    JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("查询上级需输入用户id"));
                    return;
                }
                listQuery = threeSaleService.listSuperiorQuery((pageIndex - 1) * pageSize, pageSize, state, uid);
            } else if (type == 1) {
                // 一级用户
                listQuery = threeSaleService.listFirstTeamQuery((pageIndex - 1) * pageSize, pageSize, uid,
                        state, startTime, endTime);
            } else if (type == 2) {
                // 二级用户
                listQuery = threeSaleService.listSecondTeamQuery((pageIndex - 1) * pageSize, pageSize, uid,
                        state, startTime, endTime);
            }
            if (listQuery == null || listQuery.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
                return;
            }
            for (ThreeSale threeSale: listQuery) {
                Integer expire = threeSale.getExpire();
                if (threeSale.getState()) {
                    threeSale.setExpire(1); // 邀请成功
                } else {
                    if (expire != null && expire == 1) {
                        threeSale.setExpire(2); // 邀请失效
                    } else {
                        threeSale.setExpire(0);// 已邀请
                    }
                }
            }
            long count = 0;
            if (type == 0) {
                // 上级用户
                count = threeSaleService.countSuperiorQuery(state, uid);
            } else if (type == 1) {
                // 一级用户
                count = threeSaleService.countFirstTeamQuery(uid, state, startTime, endTime);
            } else if (type == 2) {
                // 二级用户
                count = threeSaleService.countSecondTeamQuery(uid, state, startTime, endTime);
            }
            int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
            PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
            JSONObject data = new JSONObject();
            data.put("pe", pe);
            data.put("result_list", listQuery);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("查询失败"));
            e.printStackTrace();
        }
    }
    /**
     * 用户账户明细
     * @param callback
     * @param pageIndex
     * @param pageSize
     * @param id
     * @param out
     */
    @RequestMapping(value = "getAccountDetails")
    public void getAccountDetails(String callback, Integer pageIndex,Integer pageSize, Long uid, PrintWriter out) {
        if (pageIndex == null || pageIndex < 1) {
            pageIndex = 1;
        }
        if (pageSize == null || pageSize < 1) {
            pageSize = Constant.PAGE_SIZE;
        }
        if (uid == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请传递正确数据"));
            return;
        }
        try {
            List<AccountDetails> detailsList = accountDetailsService.findAccountDetailsList(uid, pageIndex);
            if (detailsList == null || detailsList.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
                return;
            }
            int count = accountDetailsService.getCount(uid);
            int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
            PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
            JSONObject data = new JSONObject();
            data.put("pe", pe);
            data.put("result_list", GsonUtil.toJsonExpose(detailsList));
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            e.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("查询失败"));
        }
    }
    public static void main(String[] args) {
        java.lang.System.out.println(java.lang.System.currentTimeMillis());
    }
    
fanli/src/main/java/com/yeshi/fanli/controller/admin/config/JumpDetailAdminController.java
New file
@@ -0,0 +1,273 @@
package com.yeshi.fanli.controller.admin.config;
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 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;
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.entity.common.JumpDetail;
import com.yeshi.fanli.entity.common.JumpDetailV2;
import com.yeshi.fanli.exception.NotExistObjectException;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
import com.yeshi.fanli.service.inter.config.JumpDetailService;
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
@Controller
@RequestMapping("admin/new/api/v1/jumpDetail")
public class JumpDetailAdminController {
    @Resource
    private JumpDetailService jumpDetailService;
    @Resource
    private JumpDetailV2Service JumpDetailV2Service;
    @RequestMapping(value="getJumpDetailList",method=RequestMethod.POST)
    public void getJumpDetailList(int pageIndex,String key,PrintWriter out){
        List<JumpDetail> jumpDetailList = jumpDetailService.getJumpDetailList(pageIndex-1,key);
        int count = jumpDetailService.getCount(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("key", key);
         pe.setParams(map);
         JSONObject data = new JSONObject();
         data.put("pe", pe);
         data.put("jumpDetailList", jumpDetailList);
         out.print(JsonUtil.loadTrueResult(data));
         return;
    }
    @RequestMapping(value="getJumpDetailAllList",method=RequestMethod.POST)
    public void getJumpDetailAllList(PrintWriter out){
        List<JumpDetail> jumpDetailList = jumpDetailService.getJumpDetailAllList();
         JSONObject data = new JSONObject();
         data.put("jumpDetailList", jumpDetailList);
         out.print(JsonUtil.loadTrueResult(data));
         return;
    }
    @RequestMapping(value="addJumpDetail",method=RequestMethod.POST)
    public void addJumpDetail(JumpDetail jd,PrintWriter out){
        jumpDetailService.addJumpDetail(jd);
        out.print(JsonUtil.loadTrueResult("添加成功"));
    }
    @RequestMapping(value="updateJumpDetail",method=RequestMethod.POST)
    public void updateJumpDetail(JumpDetail jd,PrintWriter out){
        try {
            jumpDetailService.updateJumpDetail(jd);
            out.print(JsonUtil.loadTrueResult("修改成功"));
        } catch (NotExistObjectException e) {
            out.append(JsonUtil.loadFalseResult(e.getMessage()));
        }
    }
    @RequestMapping(value="getJumpDetail",method=RequestMethod.POST)
    public void getJumpDetail(long id,PrintWriter out){
        JumpDetail jumpDetail =jumpDetailService.getJumpDetail(id);
        if(jumpDetail ==null){
            out.append(JsonUtil.loadFalseResult("不存在该对象"));
            return;
        }
        out.print(JsonUtil.loadTrueResult(jumpDetail));
    }
    @RequestMapping(value="deleteJumpDetail",method=RequestMethod.POST)
    public void deleteJumpDetail(long[] ids,PrintWriter out){
        for (long id : ids) {
            jumpDetailService.deleteJumpDetail(id);
        }
        out.print(JsonUtil.loadTrueResult("删除成功"));
    }
    @RequestMapping({ "getJumpOption" })
    public void getJumpOption(String callback, PrintWriter out) {
        try {
            List<JumpDetailV2> listJump = JumpDetailV2Service.listJump();
            JSONObject data = new JSONObject();
            JumpDetailV2 jumpDetailV2 = new JumpDetailV2();
            jumpDetailV2.setName("-未选择-");
            jumpDetailV2.setType("default");
            List<JumpDetailV2> result = new ArrayList<JumpDetailV2>();
            result.add(jumpDetailV2);
            for (JumpDetailV2 jumpDetail : listJump) {
                result.add(jumpDetail);
            }
            data.put("result_list", result);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            e.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
        }
    }
    /**
     * 新增
     * @param callback
     * @param special
     * @param out
     */
    @RequestMapping(value = "saveAdd")
    public void saveAdd(String callback, JumpDetailV2 jumpDetailV2, PrintWriter out) {
        try {
            String name = jumpDetailV2.getName();
            if (StringUtil.isNullOrEmpty(name)) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("跳转参数不能为空"));
                return;
            }
            JumpDetailV2Service.insert(jumpDetailV2);
            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, JumpDetailV2 jumpDetailV2, PrintWriter out) {
        try {
            Long id = jumpDetailV2.getId();
            if (id == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
                return;
            }
            JumpDetailV2 resultObj = JumpDetailV2Service.selectByPrimaryKey(id);
            if (resultObj == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作数据已不存在"));
                return;
            }
            JumpDetailV2Service.updateByPrimaryKeySelective(jumpDetailV2);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("修改成功"));
        } 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<JumpDetailV2> list = JumpDetailV2Service.listQuery((pageIndex - 1) * pageSize,
                    pageSize, key);
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
                return;
            }
            long count = JumpDetailV2Service.countListQuery(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 = JumpDetailV2Service.deleteBatchByPrimaryKey(list);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("成功删除["+ count +"]条数据"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/admin/config/SystemAdminController.java
File was renamed from fanli/src/main/java/com/yeshi/fanli/controller/admin/SystemAdminController.java
@@ -1,4 +1,4 @@
package com.yeshi.fanli.controller.admin;
package com.yeshi.fanli.controller.admin.config;
import java.io.PrintWriter;
import java.util.List;
fanli/src/main/java/com/yeshi/fanli/controller/admin/config/SystemClientParamsAdminController.java
File was renamed from fanli/src/main/java/com/yeshi/fanli/controller/admin/SystemClientParamsAdminController.java
@@ -1,7 +1,8 @@
package com.yeshi.fanli.controller.admin;
package com.yeshi.fanli.controller.admin.config;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -13,7 +14,11 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.entity.admin.SystemClientParamsAdmin;
import com.yeshi.fanli.entity.bus.help.AppPageNotification;
import com.yeshi.fanli.entity.bus.help.AppPageNotification.AppPageNotificationTypeEnum;
import com.yeshi.fanli.entity.system.CustomerContent;
import com.yeshi.fanli.entity.system.CustomerName;
import com.yeshi.fanli.entity.system.System;
@@ -23,7 +28,9 @@
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.GsonUtil;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.Utils;
import org.yeshi.utils.JsonUtil;
import net.sf.json.JSONObject;
@@ -302,5 +309,167 @@
        out.print(JsonUtil.loadTrueResult("添加成功"));
    }
    
    /**
     * 后端查询-新后台
     * @param callback
     * @param pageIndex
     * @param pageSize
     * @param key
     * @param systemId
     * @param out
     */
    @RequestMapping(value="query")
    public void query(String callback, Integer pageIndex, Integer pageSize, String key,
            Long systemId, PrintWriter out) {
        if (pageIndex == null || pageIndex < 1) {
            pageIndex = 1;
        }
        if (pageSize == null || pageSize < 1) {
            pageSize = Constant.PAGE_SIZE;
        }
        try {
            List<SystemClientParams> list = systemClientParamsService.listQuery((pageIndex - 1) * pageSize, pageSize,
                    key, systemId);
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
                return;
            }
            long count = systemClientParamsService.countQuery(key, systemId);
            int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
            PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
            JSONObject data = new JSONObject();
            data.put("pe", pe);
            data.put("result_list", list);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
            e.printStackTrace();
        }
    }
    
    /**
     * 新增
     * @param callback
     * @param special
     * @param out
     */
    @RequestMapping(value = "saveAdd")
    public void saveAdd(String callback, SystemClientParams systemClientParams, String idArray, PrintWriter out) {
        String key = systemClientParams.getKey();
        String name = systemClientParams.getName();
        String value = systemClientParams.getValue();
        if (StringUtil.isNullOrEmpty(key) || StringUtil.isNullOrEmpty(name)
                || StringUtil.isNullOrEmpty(value) || StringUtil.isNullOrEmpty(idArray)) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("名称、key、value、系统不能为空"));
            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;
        }
        try {
            systemClientParamsService.addSystemClientParams(systemClientParams, null);
            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, SystemClientParams systemClientParams, PrintWriter out) {
        String key = systemClientParams.getKey();
        String name = systemClientParams.getName();
        String value = systemClientParams.getValue();
        if (StringUtil.isNullOrEmpty(key) || StringUtil.isNullOrEmpty(name)
                || StringUtil.isNullOrEmpty(value)) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("名称、key、value不能为空"));
            return;
        }
        try {
            List<SystemClientParams> list =
                    systemClientParamsService.getSystemClientParamsBySystemId(systemClientParams.getId());
            if (list == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作数据已不存在"));
                return;
            }
            SystemClientParams resultObject = list.get(0);
            systemClientParams.setSystem(resultObject.getSystem());
            systemClientParams.setUpdatetime(java.lang.System.currentTimeMillis());
            systemClientParamsService.update(systemClientParams);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("修改成功"));
        } 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;
            }
            systemClientParamsService.deleteBatchByPrimaryKey(list);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("删除成功"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/admin/config/SystemConfigAdminController.java
File was renamed from fanli/src/main/java/com/yeshi/fanli/controller/admin/SystemConfigAdminController.java
@@ -1,4 +1,4 @@
package com.yeshi.fanli.controller.admin;
package com.yeshi.fanli.controller.admin.config;
import java.io.PrintWriter;
import java.util.HashMap;
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/HomeNavbarAdminController.java
New file
@@ -0,0 +1,366 @@
package com.yeshi.fanli.controller.admin.homemodule;
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 javax.servlet.http.HttpServletResponse;
import net.sf.json.JSONObject;
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.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.common.AdminUser;
import com.yeshi.fanli.entity.system.System;
import com.yeshi.fanli.service.AdminUserService;
import com.yeshi.fanli.service.inter.config.SystemService;
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;
import com.yeshi.fanli.util.annotation.RequestNoLogin;
@Controller
@RequestMapping("admin/new/api/v1/navbar")
public class HomeNavbarAdminController {
    @Resource
    private SystemService systemService;
    @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) {
        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));
            } else {
                HomeNavbar homeNavbar = new HomeNavbar();
                homeNavbar.setId(id);
                System system = new System();
                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));
            }
        } catch (Exception e1) {
            e1.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("修改失败"));
        }
    }
    /**
     * 修改排序
     *
     * @param callback
     * @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;
        }
        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);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
        } catch (Exception e) {
            e.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
        }
    }
    /**
     * 查询
     * @param callback
     * @param pageIndex
     * @param pageSize
     * @param key  模糊查询:说明、标识
     * @param out
     */
    @RequestMapping(value = "query")
    public void query(String callback, Integer pageIndex, Integer pageSize, String key,
            Integer sort, PrintWriter out) {
        if (pageIndex == null || pageIndex < 1) {
            pageIndex = 1;
        }
        if (pageSize == null || pageSize < 1) {
            pageSize = Constant.PAGE_SIZE;
        }
        try {
            List<HomeNavbar> list = homeNavbarService.listQuery((pageIndex - 1) * pageSize, pageSize, key);
            if (list == null || list.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
                return;
            }
            long count = homeNavbarService.countlistQuery(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 = homeNavbarService.deleteBatchByPrimaryKey(list);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("成功删除["+ count +"]条数据"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
            e.printStackTrace();
        }
    }
    /**
     * 专题图片上传
     * @param file
     * @param uid
     * @param id
     * @param request
     * @param response
     * @param out
     */
    @RequestNoLogin()
    @RequestMapping(value = "uploadPic")
    public void uploadPic(@RequestParam("file") CommonsMultipartFile file, Long uid,
            Long id,  HttpServletRequest request, HttpServletResponse response, PrintWriter out) {
        response.setHeader("Access-Control-Allow-Origin", "*");
        response.setHeader("Access-Control-Allow-Methods", "*");
        AdminUser admin = adminUserService.selectByPrimaryKey(uid);
        if (admin == null) {
            out.print(JsonUtil.loadFalseResult("当前账户验证失败"));
            return;
        }
        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
New file
@@ -0,0 +1,658 @@
package com.yeshi.fanli.controller.admin.homemodule;
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 javax.servlet.http.HttpServletResponse;
import net.sf.json.JSONObject;
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.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.Special;
import com.yeshi.fanli.entity.bus.homemodule.SpecialCard;
import com.yeshi.fanli.entity.bus.homemodule.SuperSpecialCard;
import com.yeshi.fanli.entity.common.AdminUser;
import com.yeshi.fanli.entity.common.JumpDetailV2;
import com.yeshi.fanli.service.AdminUserService;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
import com.yeshi.fanli.service.inter.config.SystemConfigService;
import com.yeshi.fanli.service.inter.config.SystemService;
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;
import com.yeshi.fanli.util.annotation.RequestNoLogin;
import com.yeshi.fanli.entity.system.System;
@Controller
@RequestMapping("admin/new/api/v1/specialcard")
public class SpecialCardAdminController {
    @Resource
    private SpecialService specialService;
    @Resource
    private SpecialCardService specialCardService;
    @Resource
    private SuperSpecialCardService superSpecialCardService;
    @Resource
    private SystemConfigService systemConfigService;
    @Resource
    private JumpDetailV2Service jumpDetailV2Service;
    @Resource
    private AdminUserService adminUserService;
    @Resource
    private SystemService systemService;
    /**
     * 新增
     * @param callback
     * @param special
     * @param out
     */
    @RequestMapping(value = "saveAdd")
    public void saveAdd(String callback, SpecialCard specialCard, 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<System> systemList = systemService.getSystems();
            if (systemList != null && systemList.size() > 0) {
                for (System 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);
            } else {
                resultObj.setState(1);
            }
            specialCardService.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();
        }
    }
    /**
     * 修改系统状态
     * @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);
                System system = new System();
                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("修改失败"));
        }
    }
    /**
     * 查询
     * @param callback
     * @param pageIndex
     * @param pageSize
     * @param key  模糊查询:说明、标识
     * @param out
     */
    @RequestMapping(value = "query")
    public void query(String callback, Integer pageIndex, Integer pageSize, String key,
            Integer sort, PrintWriter out) {
        if (pageIndex == null || pageIndex < 1) {
            pageIndex = 1;
        }
        if (pageSize == null || pageSize < 1) {
            pageSize = Constant.PAGE_SIZE;
        }
        try {
            List<SpecialCard> list = specialCardService.listQuery((pageIndex - 1) * pageSize,
                    pageSize, key, sort);
            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);
            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 = specialCardService.deleteBatchByPrimaryKey(list);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("成功删除["+ count +"]条数据"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
            e.printStackTrace();
        }
    }
    /**
     *  查询专题
     * @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
     */
    @RequestNoLogin()
    @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);
                record.setParams(params);
            }
            if (!StringUtil.isNullOrEmpty(jumpType)) {
                List<JumpDetailV2> listByType = jumpDetailV2Service.listByType(jumpType);
                if (listByType !=null && listByType.size() > 0) {
                    record.setJumpDetail(listByType.get(0));
                }
            }
            specialService.updateByPrimaryKeySelective(record);
            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 out
     */
    @RequestNoLogin()
    @RequestMapping(value = "saveSpecial")
    public void saveSpecial(@RequestParam("file") CommonsMultipartFile file, Long uid,
            Long id, Long cardId, HttpServletRequest request, HttpServletResponse response, PrintWriter out) {
        response.setHeader("Access-Control-Allow-Origin", "*");
        response.setHeader("Access-Control-Allow-Methods", "*");
        AdminUser admin = adminUserService.selectByPrimaryKey(uid);
        if (admin == null) {
            out.print(JsonUtil.loadFalseResult("当前账户验证失败"));
            return;
        }
        if (file == null) {
            out.print(JsonUtil.loadFalseResult("上传文件为空"));
            return;
        }
        try {
            Special resultObj = null;
            if (id != null) {
                resultObj = specialService.selectByPrimaryKey(id);
                if (resultObj == null) {
                    out.print(JsonUtil.loadFalseResult("该专题已不存在"));
                    return;
                }
            }
            specialService.uploadPicture(file, resultObj, cardId);
            out.print(JsonUtil.loadTrueResult("上传成功"));
        } catch (Exception e) {
            out.print(JsonUtil.loadFalseResult("操作失败"));
            e.printStackTrace();
        }
    }
    /**
     * 删除专题
     * @param callback
     * @param idArray
     * @param out
     */
    @RequestMapping(value = "deleteSpecial")
    public void deleteSpecial(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 = specialService.deleteBatchByPrimaryKey(list);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("成功删除["+ count +"]条数据"));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
            e.printStackTrace();
        }
    }
    /**
     * 修该状态
     * @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();
        }
    }
    /**
     * 修改排序
     *
     * @param callback
     * @param goodsClass
     * @param out
     */
    @RequestMapping(value = "saveSpecialOrder")
    public void saveSpecialOrder(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;
        }
        try {
            Special resultObj = specialService.selectByPrimaryKey(id);
            if (resultObj == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作数据已不存在"));
                return;
            }
            Long cid = resultObj.getCardId();
            Integer oldOrder = resultObj.getOrderby();
            List<Special> list = specialService.getOrderByCardID(cid, moveType, oldOrder);
            if (list != null && list.size() > 0) {
                Special changeObj = list.get(0);
                // 交换排序序号
                resultObj.setOrderby(changeObj.getOrderby());
                changeObj.setOrderby(oldOrder);
                specialService.updateByPrimaryKeySelective(changeObj);
            }
            specialService.updateByPrimaryKeySelective(resultObj);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
        } catch (Exception e) {
            e.printStackTrace();
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/SwiperBannerAdminController.java
File was renamed from fanli/src/main/java/com/yeshi/fanli/controller/admin/SwiperBannerAdminController.java
@@ -1,4 +1,4 @@
package com.yeshi.fanli.controller.admin;
package com.yeshi.fanli.controller.admin.homemodule;
import java.io.PrintWriter;
import java.util.ArrayList;
@@ -15,6 +15,7 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import org.yeshi.utils.JsonUtil;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -22,16 +23,18 @@
import com.yeshi.fanli.entity.bus.homemodule.SwiperBanner;
import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
import com.yeshi.fanli.entity.common.AdminUser;
import com.yeshi.fanli.entity.common.JumpDetailV2;
import com.yeshi.fanli.exception.banner.SwiperBannerException;
import com.yeshi.fanli.exception.banner.SwiperPictureException;
import com.yeshi.fanli.service.AdminUserService;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
import com.yeshi.fanli.service.inter.config.SystemConfigService;
import com.yeshi.fanli.service.inter.homemodule.SwiperBannerService;
import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.annotation.RequestNoLogin;
import org.yeshi.utils.JsonUtil;
/**
 * 轮播图管理
@@ -50,6 +53,12 @@
    
    @Resource
    private SwiperPictureService swiperPictureService;
    @Resource
    private SystemConfigService systemConfigService;
    @Resource
    private JumpDetailV2Service jumpDetailV2Service;
    
    
    /**
@@ -155,10 +164,10 @@
            }
            
            Integer state = resultObj.getState();
            if (state != null && state.equals(0)) {
                resultObj.setState(1);
            } else {
            if (state == null ||  state.equals(1) || state == 1) {
                resultObj.setState(0);
            } else {
                resultObj.setState(1);
            }
            swiperBannerService.updateByPrimaryKeySelective(resultObj);
@@ -302,6 +311,29 @@
                return;
            }
            
            // 跳转链接
            for (SwiperPicture swiperPicture: list) {
                String params = swiperPicture.getParams();
                if (!StringUtil.isNullOrEmpty(params)) {
                    JSONObject jsonData = JSONObject.fromObject(params);
                    if (jsonData.get("url") != null){
                        swiperPicture.setParams(jsonData.get("url").toString());
                    } else {
                        swiperPicture.setParams(null);
                    }
                }
                JumpDetailV2 jumpDetail = swiperPicture.getJumpDetail();
                if (jumpDetail == null) {
                    // 默认未选择
                    JumpDetailV2 jumpDetailV2 = new JumpDetailV2();
                    jumpDetailV2.setName("-未选择-");
                    jumpDetailV2.setType("default");
                    swiperPicture.setJumpDetail(jumpDetailV2);
                }
            }
            long count = swiperPictureService.countQueryByBannerID(bannerId);
            
@@ -364,10 +396,24 @@
            
            int maxOrder = swiperPictureService.getMaxOrderByBannerID(bannerId);
            record.setOrder(maxOrder + 1);
            // 默认停用
            record.setState(1);
            record.setCreatetime(new Date());
            record.setUpdatetime(new Date());
            String params = record.getParams();
            if (!StringUtil.isNullOrEmpty(params)) {
                String jumpValue = systemConfigService.get("jump");
                if (StringUtil.isNullOrEmpty(jumpValue)) {
                    jumpValue = "{\"url\":\"#\"}";
                }
                params = jumpValue.replace("#", params);
                record.setParams(params);
            }
            swiperPictureService.insertSelective(record);
            
            // 上传图片
@@ -440,7 +486,8 @@
     */
    @RequestNoLogin()
    @RequestMapping(value = "changePicInfo")
    public void changePicInfo(String callback, SwiperPicture record, PrintWriter out) {
    public void changePicInfo(String callback, SwiperPicture record, String jumpType,
            PrintWriter out) {
        
        try {
            Long id = record.getId();
@@ -455,11 +502,38 @@
                return;
            }
            
            String params = record.getParams();
            String remark = record.getRemark();
            if (StringUtil.isNullOrEmpty(params) && StringUtil.isNullOrEmpty(jumpType)
                    && StringUtil.isNullOrEmpty(remark)) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作内容不能为空"));
                return;
            }
            if (!StringUtil.isNullOrEmpty(params)) {
                String jumpValue = systemConfigService.get("jump");
                if (StringUtil.isNullOrEmpty(jumpValue)) {
                    jumpValue = "{\"url\":\"#\"}";
                }
                params = jumpValue.replace("#", params);
                record.setParams(params);
            }
            if (!StringUtil.isNullOrEmpty(jumpType)) {
                List<JumpDetailV2> listByType = jumpDetailV2Service.listByType(jumpType);
                if (listByType !=null && listByType.size() > 0) {
                    record.setJumpDetail(listByType.get(0));
                }
            }
            swiperPictureService.updateByPrimaryKeySelective(record);
            
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
            
        } catch (SwiperPictureException e) {
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
            e.printStackTrace();
        }
@@ -522,10 +596,10 @@
            }
            
            Integer state = resultObj.getState();
            if (state != null && state.equals(0)) {
                resultObj.setState(1);
            } else {
            if (state == null ||  state.equals(1) || state == 1) {
                resultObj.setState(0);
            } else {
                resultObj.setState(1);
            }
            swiperPictureService.updateByPrimaryKeySelective(resultObj);
fanli/src/main/java/com/yeshi/fanli/controller/client/ConfigController.java
@@ -7,11 +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 org.yeshi.utils.encrypt.DESUtil;
import com.yeshi.fanli.entity.accept.AcceptData;
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 org.yeshi.utils.JsonUtil;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
import com.yeshi.fanli.service.inter.user.TBPidService;
import com.yeshi.fanli.util.StringUtil;
import net.sf.json.JSONObject;
@@ -28,6 +36,12 @@
    @Resource
    private ConfigService configService;
    @Resource
    private TBPidService tbPidService;
    @Resource
    private TaoBaoUnionConfigService taoBaoUnionConfigService;
    /**
     * 首页配置信息
     * 
@@ -43,4 +57,48 @@
        out.print(JsonUtil.loadTrueResult(data));
    }
    @RequestMapping(value = "getTaoBaoCartConfig", method = RequestMethod.POST)
    public void getTaoBaoCartConfig(AcceptData acceptData, Long uid, PrintWriter out) {
        if (uid == null || uid <= 0) {
            out.print(JsonUtil.loadFalseResult("用户尚未登录"));
            return;
        }
        ClientTBPid clientTBPid = null;
        if ("ios".equalsIgnoreCase(acceptData.getPlatform())) {
            TBPid tbPid = tbPidService.getTBPid(uid, PidUser.TYPE_FANLI_IOS);
            if (tbPid == null)
                clientTBPid = tbPidService.getIOSDefault();
            else {
                String siteId = tbPid.getPid().split("_")[2];
                String adzoneId = tbPid.getPid().split("_")[3];
                TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(siteId);
                clientTBPid = new ClientTBPid(config.getAppKey(), tbPid.getPid(), siteId, adzoneId);
            }
        } else {
            TBPid tbPid = tbPidService.getTBPid(uid, PidUser.TYPE_FANLI_ANDROID);
            if (tbPid == null)
                clientTBPid = tbPidService.getAndroidDefault();
            else {
                String siteId = tbPid.getPid().split("_")[2];
                String adzoneId = tbPid.getPid().split("_")[3];
                TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(siteId);
                clientTBPid = new ClientTBPid(config.getAppKey(), tbPid.getPid(), siteId, adzoneId);
            }
        }
        String cartJS = configService.get("taobao_cart_js");
        String js = null;
        try {
             js = DESUtil.encode(cartJS, StringUtil.getBase64String("YeShiFANLI889*+"),
                    StringUtil.getBase64String("*M#34f?,"));
        } catch (Exception e) {
            e.printStackTrace();
        }
        JSONObject data = new JSONObject();
        data.put("js", js);
        data.put("tbPidInfo", clientTBPid);
        out.print(JsonUtil.loadTrueResult(data));
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/DynamicRecommendController.java
@@ -178,6 +178,11 @@
        if (!matcher.find()) {// 不包含链接
            // 商品详情
            // 发现
            // 没有链接,标题过长也不处理
            if (text.length() > 50) {
                out.print(JsonUtil.loadFalseResult("值过长"));
                return;
            }
            SearchFilter sf = new SearchFilter();
            sf.setKey(text);
fanli/src/main/java/com/yeshi/fanli/controller/client/GoodsClassController.java
@@ -8,6 +8,7 @@
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@@ -46,11 +47,13 @@
import com.yeshi.fanli.service.inter.lable.QualityFactoryService;
import com.yeshi.fanli.service.inter.lable.QualityGoodsService;
import com.yeshi.fanli.service.inter.lable.TaoKeGoodsService;
import com.yeshi.fanli.service.inter.monitor.MonitorService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.util.Utils;
import com.yeshi.fanli.util.factory.MonitorFactory;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import org.yeshi.utils.JsonUtil;
@@ -102,6 +105,9 @@
    @Resource
    private QualityGoodsService qualityGoodsService;
    @Resource
    private MonitorService monitorService;
    /**
     * 获取主类目
@@ -348,9 +354,11 @@
     * @param page
     * @param scid
     * @param filter
     * @param order  来源:【推荐:0  | 综合:4  、综合只看有券 1  、综合只看天猫 1  | 价格:低到高3  高到低2  |  销量:1】
     *               排序值:【销量由高到低: 1 ; 销量由低到高 5;  价格从高到低: 2 ; 价格从低到高:3  ;  推广量高到低:4    ; 其他默认: 销量由高到低】
     *
     * @param order
     *            来源:【推荐:0 | 综合:4 、综合只看有券 1 、综合只看天猫 1 | 价格:低到高3 高到低2 | 销量:1】
     *            排序值:【销量由高到低: 1 ; 销量由低到高 5; 价格从高到低: 2 ; 价格从低到高:3 ; 推广量高到低:4 ;
     *            其他默认: 销量由高到低】
     *
     * @param startprice
     *            起始价格
     * @param endprice
@@ -371,71 +379,69 @@
        }
        try {
            GoodsSubClass goodsSubClass = goodsSubClassService.getSubClassByPrimaryKeyCache(scid);
            if (goodsSubClass == null) {
                out.print(JsonUtil.loadFalseResult("不存在该分类"));
                return;
            }
            if (page == 0) {
                // 统计点击量
                goodsSubClassService.countClick(acceptData, goodsSubClass);
            }
            /* 搜索关键词 */
            String searchKey = goodsSubClass.getName();
            String key = goodsSubClass.getKey();
            if (key != null && !"".equals(key.trim())) {
                searchKey = key;
            }
            /* 商品系统分类id */
            Long systemCid = null;
            GoodsClass rootClass = goodsSubClass.getRootClass();
            if (rootClass != null) {
                systemCid = rootClass.getId();
            }
            // page从1开始
            page += 1;
            // 请求淘宝接口页码
            int pageNo = page;
            int pageNo = page;
            int pageSize = Constant.PAGE_SIZE;
            /*  查询推荐模块  清空其他非必要筛选项和排序项   */
            /* 查询推荐模块 清空其他非必要筛选项和排序项 */
            if (!StringUtil.isNullOrEmpty(order) && Integer.parseInt(order) == 0) {
                // 分类关联标签id集合
                List<Long> listLabId =
                        labelClassService.getRelationLabIds((page - 1) * pageSize, pageSize, goodsSubClass.getId());
                List<Long> listLabId = labelClassService.getRelationLabIds((page - 1) * pageSize, pageSize,
                        goodsSubClass.getId());
                /* 计算精选库数据 总页数 */
                long incount = taoKeGoodsService.countByQuality(searchKey, systemCid, listLabId);
                int totalPage = (int) (incount % pageSize == 0 ? incount / pageSize : incount / pageSize + 1);
                pageNo = page - totalPage;
                /* 查询精选库数据 */
                if (pageNo <= 0 ) {
                    List<QualityFactory> listQuality = taoKeGoodsService.queryByQuality((page - 1) * pageSize,
                            pageSize,searchKey, systemCid, listLabId);
                if (pageNo <= 0) {
                    List<QualityFactory> listQuality = taoKeGoodsService.queryByQuality((page - 1) * pageSize, pageSize,
                            searchKey, systemCid, listLabId);
                    List<TaoBaoGoodsBrief> searchWuLiaoList = null;
                    /*  精选库数据不足10条  */
                    /* 精选库数据不足10条 */
                    if (listQuality != null && listQuality.size() != 0 && listQuality.size() < 10) {
                        String searchParam = goodsSubClass.getSearchJson();
                        Gson gs = new Gson();
                        SearchFilter searchfilter = gs.fromJson(searchParam, SearchFilter.class);
                        int quanfilter = searchfilter.getQuan();
                        if (quanfilter != 1) {
                            searchfilter.setQuan(1);
@@ -445,53 +451,51 @@
                        if (endPricefilter == null) {
                            searchfilter.setEndPrice(new BigDecimal(220));
                        }
                        boolean includeGoodRate = searchfilter.isIncludeGoodRate();
                        if (!includeGoodRate) {
                            searchfilter.setIncludeGoodRate(true);
                        }
                        //请求第一页数据
                        // 请求第一页数据
                        searchfilter.setPage(1);
                        searchfilter.setPageSize(pageSize);
                        searchfilter.setKey(searchKey);
                        searchfilter.setMaterialId("6707");
                        searchWuLiaoList = taoKeGoodsService.searchWuLiaoList(searchfilter);
                    }
                    Map<String, String> map = manageService.convertMap();
                    JSONObject data = taoKeGoodsService.listQualityGoods(listQuality, searchWuLiaoList, map);
                    out.print(JsonUtil.loadTrueResult(data));
                    return;
                }
                if (pageNo > 0  && totalPage > 0) {
                    List<QualityFactory>  list = taoKeGoodsService.queryByQuality((totalPage - 1) * pageSize,
                            pageSize, searchKey, systemCid, listLabId);
                if (pageNo > 0 && totalPage > 0) {
                    List<QualityFactory> list = taoKeGoodsService.queryByQuality((totalPage - 1) * pageSize, pageSize,
                            searchKey, systemCid, listLabId);
                    if (list != null && list.size() != 0 && list.size() < 10) {
                        // 页码+ 1 已请求一次淘宝接口
                        pageNo += 1 ;
                        pageNo += 1;
                    }
                }
            }
            /* 网络请求  */
            /* 网络请求 */
            SearchFilter searchfilter = null;
            String searchParam = goodsSubClass.getSearchJson();
            if (!StringUtil.isNullOrEmpty(searchParam) && !StringUtil.isNullOrEmpty(order)
            if (!StringUtil.isNullOrEmpty(searchParam) && !StringUtil.isNullOrEmpty(order)
                    && Integer.parseInt(order) == 0) {
                // 推荐 使用子分类默认查询条件
                Gson gs = new Gson();
                searchfilter = gs.fromJson(searchParam, SearchFilter.class);
                int quanfilter = searchfilter.getQuan();
                if (quanfilter != 1) {
                    searchfilter.setQuan(1);
@@ -501,26 +505,28 @@
                if (endPricefilter == null) {
                    searchfilter.setEndPrice(new BigDecimal(220));
                }
                boolean includeGoodRate = searchfilter.isIncludeGoodRate();
                if (!includeGoodRate) {
                    searchfilter.setIncludeGoodRate(true);
                }
            } else {
                searchfilter = new SearchFilter();
                // 设置SearchFilter
                taoKeGoodsService.setSearchFilter(searchfilter, filter, order, startprice, endprice, fastFilter, totalSales);
                taoKeGoodsService.setSearchFilter(searchfilter, filter, order, startprice, endprice, fastFilter,
                        totalSales);
                searchfilter.setEndPrice(new BigDecimal(10000));
            }
            searchfilter.setPage(pageNo);
            searchfilter.setPageSize(pageSize);
            searchfilter.setKey(searchKey);
            if (!StringUtil.isNullOrEmpty(order) && Integer.parseInt(order) != 4 ) {
            if (!StringUtil.isNullOrEmpty(order) && Integer.parseInt(order) != 4) {
                searchfilter.setMaterialId("6707");
            }
            // 查询物料接口
            JSONObject result = taoKeGoodsService.searchWuLiao(searchfilter);
            out.print(JsonUtil.loadTrueResult(result));
@@ -673,7 +679,7 @@
    }
    @RequestMapping("getCouponList")
    public void getCouponList(AcceptData acceptData, int page, PrintWriter out) {
    public void getCouponList(AcceptData acceptData, int page, HttpServletRequest request, PrintWriter out) {
        page = page > 0 ? page : 1;
        List<TaoBaoGoodsBrief> taoBaoGoodsBriefs = taoBaoCouponService.getTaoBaoCouponList(page);
        Map<String, String> map = manageService.convertMap();
@@ -692,6 +698,12 @@
        data.put("taoBaoCoupons", array);
        data.put("count", count);
        out.print(JsonUtil.loadTrueResult(data));
        try {
            monitorService.addClientAPIMonitor(MonitorFactory.createClientAPI(request, 0, 0, null));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    /**
@@ -796,5 +808,62 @@
            }
        }
    }
    @RequestMapping(value = { "getcategory" }, method = { org.springframework.web.bind.annotation.RequestMethod.POST })
    public void getcategory(AcceptData acceptData, PrintWriter out) {
        com.yeshi.fanli.entity.system.System system = this.systemService.getSystemCache(acceptData.getPlatform(),
                acceptData.getPackages());
        if (system == null) {
            out.print(JsonUtil.loadFalseResult("系统不存在"));
            return;
        }
        List<SuperGoodsClass> superGoodsClassList = this.superGoodsClassService
                .getSuperGoodsClassBySystemId(system.getId().longValue());
        if ((superGoodsClassList == null) || (superGoodsClassList.size() == 0)) {
            out.print(JsonUtil.loadFalseResult("暂无数据"));
            return;
        }
        List<GoodsClass> goodsClassList = new ArrayList<GoodsClass>();
        for (SuperGoodsClass superGoodsClass : superGoodsClassList) {
            GoodsClass goodsClass = superGoodsClass.getGoodsClass();
            goodsClassList.add(goodsClass);
        }
        JSONArray array = new JSONArray();
        Gson gson = new GsonBuilder().create();
        if (goodsClassList.size() > 0) {
            for (GoodsClass goodsClass : goodsClassList) {
                goodsClass.setKey(null);
                goodsClass.setCreatetime(0L);
                goodsClass.setSearchParam(null);
                goodsClass.setIosClick(null);
                goodsClass.setAndroidClick(null);
                JSONObject data = new JSONObject();
                data.put("gclass", goodsClass);
                long gcid = goodsClass.getId();
                try {
                    List<GoodsSubClass> subClassList = this.goodsSubClassService.getSubClassCache(Long.valueOf(gcid),
                            Integer.valueOf(1));
                    if ((subClassList == null) || (subClassList.size() == 0)) {
                        subClassList = new ArrayList<GoodsSubClass>();
                    }
                    data.put("subList", gson.toJson(subClassList));
                } catch (Exception e) {
                    e.printStackTrace();
                }
                array.add(data);
            }
        }
        JSONObject data = new JSONObject();
        data.put("categoryList", array);
        out.print(JsonUtil.loadTrueResult(data));
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/GoodsController.java
@@ -3,6 +3,7 @@
import java.io.PrintWriter;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -14,8 +15,11 @@
import com.yeshi.fanli.entity.taobao.TaoBaoLink;
import com.yeshi.fanli.entity.taobao.TaoBaoUnionConfig;
import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
import com.yeshi.fanli.service.inter.monitor.MonitorService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
import com.yeshi.fanli.service.inter.user.TBPidService;
import com.yeshi.fanli.util.factory.MonitorFactory;
import org.yeshi.utils.JsonUtil;
import net.sf.json.JSONObject;
@@ -33,6 +37,9 @@
    @Resource
    private TaoBaoUnionConfigService taoBaoUnionConfigService;
    @Resource
    private MonitorService monitorService;
    /**
     * 获取淘宝的分享链接
     * 
@@ -43,7 +50,8 @@
     * @param out
     */
    @RequestMapping(value = "gettaobaolink")
    public void getTaobaoShareLink(AcceptData acceptData, Long uid, Long auctionId, PrintWriter out) {
    public void getTaobaoShareLink(AcceptData acceptData, Long uid, Long auctionId, HttpServletRequest request,
            PrintWriter out) {
        if (uid == null || uid <= 0) {
            out.print(JsonUtil.loadFalseResult(1, "用户ID不能为空"));
            return;
@@ -68,7 +76,14 @@
            data.put("type", 1);
            data.put("link", link);
            out.print(JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            try {
                monitorService.addClientAPIMonitor(MonitorFactory.createClientAPI(request, 0, 0, "购买淘宝商品转链出错"));
            } catch (Exception e1) {
                e1.printStackTrace();
            }
            TBPid tbPid = null;
            if (acceptData.getPlatform().equalsIgnoreCase("android")) {
                tbPid = tbPidService.getTBPid(uid, PidUser.TYPE_FANLI_ANDROID);
fanli/src/main/java/com/yeshi/fanli/controller/client/LostOrderController.java
New file
@@ -0,0 +1,188 @@
package com.yeshi.fanli.controller.client;
import java.io.PrintWriter;
import java.util.List;
import javax.annotation.Resource;
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 com.google.gson.Gson;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.LostOrder;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.order.LostOrderService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.util.Utils;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
/**
 * 动态
 *
 * @author Administrator
 *
 */
@Controller
@RequestMapping("api/v1/lostOrder")
public class LostOrderController {
    @Resource
    private LostOrderService lostOrderService;
    @Resource
    private ConfigService configService;
    /**
     * 获取动态推荐
     *
     * @param acceptData
     * @param page
     *            -页码
     * @param out
     */
    @RequestMapping(value = "getLostOrderList", method = RequestMethod.POST)
    public void getLostOrderList(AcceptData acceptData, Long uid, Integer page, PrintWriter out) {
        if (uid == null || uid <= 0) {
            out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
        }
        if (page == null || page <= 0) {
            out.print(JsonUtil.loadFalseResult(1, "page格式错误"));
            return;
        }
        if (page < 1) {
            out.print(JsonUtil.loadFalseResult(2, "页码必须大于0"));
            return;
        }
        long count = lostOrderService.getLostOrderCountByUid(uid);
        List<LostOrder> list = lostOrderService.getLostOrderListByUid(uid, page, Constant.PAGE_SIZE);
        JSONArray data = new JSONArray();
        Gson gson = new Gson();
        if (list != null)
            for (LostOrder order : list) {
                order.setOrder(null);
                order.setUserInfo(null);
                JSONObject json = JSONObject.fromObject(gson.toJson(order));
                json.remove("resultCode");
                json.remove("remake");
                json.remove("judge");
                json.put("createTime", TimeUtil.getGernalTime(order.getCreateTime(), "yyyy.MM.dd HH:mm"));
                if (order.getState() == 1 && order.getResultCode() != null
                        && order.getResultCode() == LostOrder.RESULT_CODE_SUCCESS) {
                    // 申诉成功
                    json.put("state", 1);
                    json.put("stateDesc", "申诉成功,请在订单列表中查看");
                } else if (order.getState() == 2 || (order.getState() == 1 && order.getResultCode() != null
                        && order.getResultCode() == LostOrder.RESULT_CODE_FAIL)) {
                    // 申诉失败
                    json.put("state", 2);
                    json.put("stateDesc", "申诉失败");
                } else {
                    // 处理中
                    json.put("state", 0);
                    json.put("stateDesc", "审核中");
                }
                data.add(json);
            }
        JSONObject root = new JSONObject();
        root.put("data", data);
        root.put("count", count);
        out.print(JsonUtil.loadTrueResult(root));
    }
    @RequestMapping(value = "deleteLostOrder", method = RequestMethod.POST)
    public void deleteLostOrder(AcceptData acceptData, Long uid, Long id, PrintWriter out) {
        if (id == null || id <= 0) {
            out.print(JsonUtil.loadFalseResult(1, "请选择删除项"));
            return;
        }
        if (uid == null || uid <= 0) {
            out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
        }
        LostOrder lostOrder = lostOrderService.getOne(id);
        if (lostOrder != null && lostOrder.getUserInfo().getId() == uid.longValue()) {
            lostOrderService.deleteLostOrder(id);
            out.print(JsonUtil.loadTrueResult(""));
        } else {
            out.print(JsonUtil.loadFalseResult(1, "删除失败"));
        }
    }
    @RequestMapping(value = "deleteAllLostOrder", method = RequestMethod.POST)
    public void deleteAllLostOrder(AcceptData acceptData, Long uid, PrintWriter out) {
        if (uid == null || uid <= 0) {
            out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
        }
        lostOrderService.deleteLostOrderByUid(uid);
        out.print(JsonUtil.loadTrueResult(""));
    }
    @RequestMapping("findLostOrder")
    public void findLostOrder(AcceptData acceptData, LostOrder lostOrder, PrintWriter out) {
        boolean orderNum = true;
        if (!NumberUtil.isNumeric(lostOrder.getOrderId())) {
            orderNum = false;
        } else if (lostOrder.getOrderId().length() < 12 || lostOrder.getOrderId().length() > 20) {
            orderNum = false;
        } else
            orderNum = Utils.isOrderNum(lostOrder.getOrderId());
        if (lostOrder.getUserInfo() == null || lostOrder.getUserInfo().getId() == null
                || lostOrder.getUserInfo().getId() <= 0) {
            out.print(JsonUtil.loadFalseResult(1, "请登录返利券账号"));
            return;
        }
        int state;
        String stateInfo = "提交成功,请等待审核结果";
        if (!orderNum) {
            state = -4;
            stateInfo = "请提交准确的订单号";
        } else {
            lostOrder.setResultCode(LostOrder.RESULT_CODE_VERFING);
            state = lostOrderService.addLostOrder(lostOrder);
            if (state == -3) {
                stateInfo = "该订单已被统计,无需申诉";
            } else if (state == -2) {
                stateInfo = "请勿重复提交,该订单正在审核中";
            } else if (state == -1) {
                stateInfo = "该订单申诉已通过,请在订单列表中查看";
            } else if (state == -5) {
                stateInfo = "分享奖金订单无需申诉";
            } else if (state == -6) {
                stateInfo = "该订单申诉已失败,请在订单列表中查看";
            }
        }
        JSONObject data = new JSONObject();
        data.put("state", state);
        data.put("info", stateInfo);
        out.print(JsonUtil.loadTrueResult(data));
    }
    @RequestMapping("getConfig")
    public void getConfig(AcceptData acceptData, PrintWriter out) {
        JSONObject data = new JSONObject();
        data.put("what", configService.get("lost_order_help_what"));
        data.put("reason", configService.get("lost_order_help_reason"));
        out.print(JsonUtil.loadTrueResult(data));
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/PushController.java
@@ -60,12 +60,12 @@
    @RequestMapping(value = "/insertDeviceToken", method = RequestMethod.POST)
    public void insertIOSDeviceToken(AcceptData acceptData, String deviceToken, PrintWriter out) {
        if (!StringUtil.isNullOrEmpty(acceptData.getDevice()) && !StringUtil.isNullOrEmpty(deviceToken)) {
            DeviceTokenIOS deviceTokenIOS = iosPushService.getDeviceTokenByDevice(acceptData.getDevice());
            DeviceTokenIOS deviceTokenIOS = iosPushService.getDeviceTokenByDeviceToken(deviceToken);
            if (deviceTokenIOS == null)
                iosPushService.addDeviceToken(null, Integer.parseInt(acceptData.getVersion()), deviceToken,
                        acceptData.getDevice());
            else {
                deviceTokenIOS.setDeviceToken(deviceToken);
                deviceTokenIOS.setDevice(acceptData.getDevice());
                iosPushService.updateDeviceToken(deviceTokenIOS);
            }
            out.print(JsonUtil.loadTrue(0, null, "成功"));
@@ -80,21 +80,20 @@
     * @param deviceToken
     */
    // 传一个device 如果存在device 根据device执行update操作 , 如果不存在 都执行insert操作三个参数
    @RequestMapping(value = "/uidBindDeviceToken", method = RequestMethod.POST)
    public void uidBindIOSDeviceToken(AcceptData acceptData, Long uid, String deviceToken, PrintWriter out) {
        if (uid != null && uid != 0 && !StringUtil.isNullOrEmpty(deviceToken)) {
            DeviceTokenIOS deviceTokenIOS = iosPushService.getDeviceTokenByDevice(acceptData.getDevice());
            DeviceTokenIOS deviceTokenIOS = iosPushService.getDeviceTokenByDeviceToken(acceptData.getDevice());
            if (deviceTokenIOS != null) {
                if (!StringUtil.isNullOrEmpty(deviceToken))
                    deviceTokenIOS.setDeviceToken(deviceToken);
                deviceTokenIOS.setUid(uid);
                deviceTokenIOS.setDevice(acceptData.getDevice());
                deviceTokenIOS.setVersion(Integer.parseInt(acceptData.getVersion()));
                iosPushService.updateDeviceToken(deviceTokenIOS);
            } else {
                iosPushService.addDeviceToken(uid, Integer.parseInt(acceptData.getVersion()), deviceToken,
                        acceptData.getDevice());
            }
            out.print(JsonUtil.loadTrueResult(""));
        }
    }
@@ -106,8 +105,8 @@
     */
    @RequestMapping(value = "/unBind", method = RequestMethod.POST)
    public void unBind(AcceptData acceptData, String deviceToken, PrintWriter out) {
        if (deviceToken != null && !"".equals(deviceToken)) {
            DeviceTokenIOS deviceTokenIOS = iosPushService.getDeviceTokenByDevice(acceptData.getDevice());
        if (!StringUtil.isNullOrEmpty(deviceToken)) {
            DeviceTokenIOS deviceTokenIOS = iosPushService.getDeviceTokenByDeviceToken(deviceToken);
            if (deviceTokenIOS != null) {
                deviceTokenIOS.setUid(null);
                iosPushService.updateDeviceToken(deviceTokenIOS);
fanli/src/main/java/com/yeshi/fanli/controller/client/RecommendController.java
@@ -12,9 +12,16 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
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.IPUtil;
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.NumberUtil;
import org.yeshi.utils.taobao.TbImgUtil;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -22,6 +29,8 @@
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;
@@ -34,6 +43,7 @@
import com.yeshi.fanli.entity.bus.su.recommend.SuperRecommendSpecial;
import com.yeshi.fanli.entity.bus.user.CollectionGoods;
import com.yeshi.fanli.entity.bus.user.Order;
import com.yeshi.fanli.entity.bus.user.ShamUser;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.common.ImageInfo;
import com.yeshi.fanli.entity.common.JumpDetail;
@@ -47,6 +57,7 @@
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
import com.yeshi.fanli.entity.taobao.TaoBaoShopInfo;
import com.yeshi.fanli.entity.taobao.TaoBaoUnionConfig;
import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
@@ -67,13 +78,17 @@
import com.yeshi.fanli.service.inter.goods.SuperRecommendSpecialService;
import com.yeshi.fanli.service.inter.goods.TaoBaoCouponService;
import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
import com.yeshi.fanli.service.inter.homemodule.SpecialService;
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.QualityGoodsService;
import com.yeshi.fanli.service.inter.monitor.MonitorService;
import com.yeshi.fanli.service.inter.order.OrderService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
import com.yeshi.fanli.service.inter.user.ScanHistoryService;
import com.yeshi.fanli.service.inter.user.ShamUserService;
import com.yeshi.fanli.service.inter.user.ShareManageService;
import com.yeshi.fanli.service.inter.user.TBPidService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
@@ -83,16 +98,11 @@
import com.yeshi.fanli.util.ThreadUtil;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.util.Utils;
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 org.yeshi.utils.IPUtil;
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.NumberUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@Controller
@RequestMapping("api/v1/user")
@@ -184,6 +194,18 @@
    @Resource
    private SuperRecommendBannerV2Service superRecommendBannerV2Service;
    @Resource
    private ShamUserService shamUserService;
    @Resource
    private SpecialService specialService;
    @Resource
    private SwiperPictureService swiperPictureService;
    @Resource
    private MonitorService monitorService;
    @RequestMapping(value = "getrecommendsection")
    public void getRecommendSection(AcceptData acceptData, int index, PrintWriter out) {
@@ -599,18 +621,58 @@
            out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
            return;
        }
        // TaoBaoGoodsBrief alimama = TaoBaoUtil.isAlimama(id);
        // 获取淘客参数
        ClientTBPid clientTBPid = null;
        // 用户已经登录
        if (!StringUtil.isNullOrEmpty(uid) && Long.parseLong(uid) > 0) {
            TBPid tbPid = null;
            if (acceptData.getPlatform().equalsIgnoreCase("android")) {
                tbPid = tbPidService.getTBPid(Long.parseLong(uid), PidUser.TYPE_FANLI_ANDROID);
                if (tbPid != null) {
                    String siteId = tbPid.getPid().split("_")[2];
                    String adzoneId = tbPid.getPid().split("_")[3];
                    TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(siteId);
                    clientTBPid = new ClientTBPid(config.getAppKey(), tbPid.getPid(), siteId, adzoneId);
                } else {
                    clientTBPid = tbPidService.getAndroidDefault();
                }
            } else {
                tbPid = tbPidService.getTBPid(Long.parseLong(uid), PidUser.TYPE_FANLI_IOS);
                if (tbPid != null) {
                    String siteId = tbPid.getPid().split("_")[2];
                    String adzoneId = tbPid.getPid().split("_")[3];
                    TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(siteId);
                    clientTBPid = new ClientTBPid(config.getAppKey(), tbPid.getPid(), siteId, adzoneId);
                } else {
                    clientTBPid = tbPidService.getIOSDefault();
                }
            }
        } else {
            if (acceptData.getPlatform().equalsIgnoreCase("android"))
                clientTBPid = tbPidService.getAndroidDefault();
            else
                clientTBPid = tbPidService.getIOSDefault();
        }
        TaoBaoGoodsBrief tb = null;
        try {
            tb = redisManager.getTaoBaoGoodsBrief(Long.parseLong(id));
            TaoKeAppInfo app = new TaoKeAppInfo();
            TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(clientTBPid.getSiteId());
            app.setAdzoneId(clientTBPid.getAdZoneId());
            app.setAppKey(clientTBPid.getAppKey());
            app.setAppSecret(config.getAppSecret());
            app.setPid(clientTBPid.getPid());
            tb = TaoKeApiUtil.searchGoodsDetail(Long.parseLong(id), app);
        } catch (NumberFormatException e1) {
            e1.printStackTrace();
        } catch (TaobaoGoodsDownException e1) {
            e1.printStackTrace();
            out.print(JsonUtil.loadFalseResult(2, "商品已下架"));
            return;
        }
        if (tb != null) {
            tb.setAuctionUrl(null);
            // tb.setAuctionUrl(null);
            tb.setId(null);
            int type = 0;
            if ("android".equalsIgnoreCase(acceptData.getPlatform()))
@@ -623,61 +685,25 @@
            Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
            JSONObject data = new JSONObject();
            TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(tb, configList.get(0));
            if (!StringUtil.isNullOrEmpty(tb.getCouponLink()) && taoBaoGoodsBriefExtra.getTaoBaoQuanInfo() != null)
                taoBaoGoodsBriefExtra.getTaoBaoQuanInfo().setCouponLink(tb.getCouponLink());
            taoBaoGoodsBriefExtra.setAuctionUrl(tb.getAuctionUrl());
            if (uid != null && !"".equals(uid.trim())) {
                CollectionGoods collectionGoods = collectionGoodsService.findByUidAndAuctionId(Long.parseLong(uid),
                        Long.parseLong(id));
                data.put("collection", collectionGoods != null ? true : false);
            }
            // 获取淘客参数
            ClientTBPid clientTBPid = null;
            // 用户已经登录
            if (!StringUtil.isNullOrEmpty(uid) && Long.parseLong(uid) > 0) {
                TBPid tbPid = null;
                if (acceptData.getPlatform().equalsIgnoreCase("android")) {
                    tbPid = tbPidService.getTBPid(Long.parseLong(uid), PidUser.TYPE_FANLI_ANDROID);
                    if (tbPid != null) {
                        String siteId = tbPid.getPid().split("_")[2];
                        String adzoneId = tbPid.getPid().split("_")[3];
                        TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(siteId);
                        clientTBPid = new ClientTBPid(config.getAppKey(), tbPid.getPid(), siteId, adzoneId);
                    } else {
                        clientTBPid = tbPidService.getAndroidDefault();
                    }
                } else {
                    tbPid = tbPidService.getTBPid(Long.parseLong(uid), PidUser.TYPE_FANLI_IOS);
                    if (tbPid != null) {
                        String siteId = tbPid.getPid().split("_")[2];
                        String adzoneId = tbPid.getPid().split("_")[3];
                        TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(siteId);
                        clientTBPid = new ClientTBPid(config.getAppKey(), tbPid.getPid(), siteId, adzoneId);
                    } else {
                        clientTBPid = tbPidService.getIOSDefault();
                    }
                }
                if (!StringUtil.isNullOrEmpty(tb.getCouponLink()) && taoBaoGoodsBriefExtra.getTaoBaoQuanInfo() != null)
                    taoBaoGoodsBriefExtra.getTaoBaoQuanInfo().setCouponLink(TaoBaoCouponUtil
                            .getCoupleUrl(tb.getCouponActivityId(), tbPid.getPid(), tb.getAuctionId() + ""));
            } else {
                if (acceptData.getPlatform().equalsIgnoreCase("android"))
                    clientTBPid = tbPidService.getAndroidDefault();
                else
                    clientTBPid = tbPidService.getIOSDefault();
            }
            data.put("tbPidInfo", clientTBPid);
            taoBaoGoodsBriefExtra.setAuctionUrl(null);
            // taoBaoGoodsBriefExtra.setAuctionUrl(null);
            data.put("taobao", gson.toJson(taoBaoGoodsBriefExtra));
            String info = configService.get("detail_prompt");
            data.put("info", info);
            String onlyInfo = configService.get("only_info");
            data.put("only", onlyInfo);
            data.put("helpUrl", configService.get("old_goods_detail_help_url"));
            int showType = taoBaoGoodsBriefExtra.getShowType();
            String price = "";
            if (showType == 1 || showType == 3) {
@@ -700,6 +726,8 @@
                            + taoBaoGoodsBriefExtra.getTitle() + shareSinaContent);
            data.put("sharemoney", "分享奖金 ¥" + taoBaoGoodsBriefService.getShareGoodsUserHongBao(tb) + "元");
            data.put("shareHongBao", "¥" + taoBaoGoodsBriefService.getShareGoodsUserHongBao(tb));
            out.print(JsonUtil.loadTrueResult(data));
            final TaoBaoGoodsBrief tbb = tb;
@@ -737,7 +765,8 @@
    // 新版商品图文详情
    @RequestMapping(value = "getnewgoodsdetail", method = RequestMethod.POST)
    public void getNewGoodsDetail(AcceptData acceptData, String id, String uid, PrintWriter out) {
    public void getNewGoodsDetail(AcceptData acceptData, String id, String uid, HttpServletRequest request,
            PrintWriter out) {
        if ("0".equalsIgnoreCase(uid))
            uid = "";
        if (StringUtil.isNullOrEmpty(id)) {
@@ -834,12 +863,21 @@
                    } catch (NumberFormatException e) {
                        e.printStackTrace();
                    } catch (TaobaoGoodsDownException e) {
                        e.printStackTrace();
                        try {
                            monitorService.addClientAPIMonitor(MonitorFactory.createClientAPI(request, 0, 0, "商品下架"));
                        } catch (Exception e1) {
                            e1.printStackTrace();
                        }
                    }
                } else {
                    try {
                        goods = redisManager.getTaoBaoGoodsBrief(Long.parseLong(id));
                    } catch (TaobaoGoodsDownException e) {
                        try {
                            monitorService.addClientAPIMonitor(MonitorFactory.createClientAPI(request, 0, 0, "商品下架"));
                        } catch (Exception e1) {
                            e1.printStackTrace();
                        }
                        // 商品下架
                        ThreadUtil.run(new Runnable() {
                            public void run() {
@@ -872,10 +910,18 @@
                    detailImgsSize.clear();
                    for (ImageInfo imgInfo : imgs) {
                        detailImgs.add(imgInfo.getPicture());
                        JSONObject size = new JSONObject();
                        size.put("w", imgInfo.getWidth());
                        size.put("h", imgInfo.getHeight());
                        detailImgsSize.add(size);
                    }
                    for (ImageInfo imgInfo : imgs) {
                        if (imgInfo.getWidth() <= 0) {
                            detailImgsSize.clear();
                            break;
                        } else {
                            JSONObject size = new JSONObject();
                            size.put("w", imgInfo.getWidth());
                            size.put("h", imgInfo.getHeight());
                            detailImgsSize.add(size);
                        }
                    }
                }
@@ -1177,10 +1223,7 @@
            for (TaoBaoGoodsBrief taoBaoGoodsBrief : recommendGoodsList) {
                if (taoBaoGoodsBrief == null)
                    continue;
                if (taoBaoGoodsBrief.getBiz30day() != null)
                    taoBaoGoodsBrief.setSalesCount(0 + "");
                else
                    taoBaoGoodsBrief.setSalesCount(TaoBaoUtil.getSaleCount(taoBaoGoodsBrief.getBiz30day()));
                re.add(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion, fcRate, ""));
            }
        out.print(JsonUtil.loadTrueResult(JsonUtil.getApiCommonGson().toJson(re)));
@@ -1364,7 +1407,8 @@
     *            -IOS的idfa广告标识信息
     */
    @RequestMapping(value = "guessLikeByDevice")
    public void guessUserLikeByDevice(AcceptData acceptData, String imei, String idfa, int page, PrintWriter out) {
    public void guessUserLikeByDevice(AcceptData acceptData, String imei, String idfa, int page,
            HttpServletRequest request, PrintWriter out) {
        int pageSize = Constant.PAGE_SIZE;
        JSONArray array = new JSONArray();
        Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create();
@@ -1377,7 +1421,6 @@
            if (!StringUtil.isNullOrEmpty(imei) || !StringUtil.isNullOrEmpty(idfa)) {
                long startTime = java.lang.System.currentTimeMillis();
                TaoBaoSearchResult result = TaoKeApiUtil.guessDeviceLike(page, 50, imei, idfa);
                LogHelper.test("首页为你推荐(淘宝)加载时间:" + (java.lang.System.currentTimeMillis() - startTime));
                if (result != null && result.getTaoBaoGoodsBriefs() != null) {
                    // 筛选
@@ -1389,11 +1432,24 @@
                                && goods.getBiz30day() > 1000)
                            goodsList.add(goods);
                    }
                    try {
                        monitorService.addClientAPIMonitor(MonitorFactory.createClientAPI(request, 0,
                                (int) (java.lang.System.currentTimeMillis() - startTime), "推荐数量:" + goodsList.size()));
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    Collections.shuffle(goodsList);
                    goodsList = goodsList.size() > 20 ? goodsList.subList(0, 20) : goodsList;
                    for (TaoBaoGoodsBrief goods : goodsList) {
                        array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(goods, proportion, fcRate, "")));
                    }
                } else {
                    try {
                        monitorService.addClientAPIMonitor(MonitorFactory.createClientAPI(request, 0,
                                (int) (java.lang.System.currentTimeMillis() - startTime), "无推荐"));
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }
@@ -1524,4 +1580,622 @@
        out.print(JsonUtil.loadTrueResult(root));
    }
    /**
     * 新版推荐专题管理(1.4.0)
     *
     * @param acceptData
     * @param out
     */
    @RequestMapping(value = "getNewRecommendInfo")
    public void getNewRecommendInfo(AcceptData acceptData, String specialCard, String swiperCard, PrintWriter out) {
        System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
        if (system == null) {
            out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
            return;
        }
        List<SwiperPicture> listswiper = null;
        if (!StringUtil.isNullOrEmpty(specialCard)) {
            try {
                listswiper = swiperPictureService.getByBannerCard(swiperCard);
                if (listswiper != null && listswiper.size() > 0) {
                    for (SwiperPicture swiperPicture : listswiper) {
                        swiperPicture.setBannerId(null);
                        swiperPicture.setCreatetime(null);
                        swiperPicture.setUpdatetime(null);
                        swiperPicture.setState(null);
                        swiperPicture.setRemark(null);
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        Special miaoShaSpecial = null;
        List<Special> honestList = new ArrayList<Special>();
        List<Special> specialList = new ArrayList<Special>();
        if (!StringUtil.isNullOrEmpty(specialCard)) {
            try {
                List<Special> listSpecial = specialService.listBySystemAndCard(specialCard, system.getId());
                if (listSpecial != null && listSpecial.size() > 0) {
                    for (Special special : listSpecial) {
                        special.setCreatetime(null);
                        special.setUpdatetime(null);
                        special.setState(null);
                        special.setRemark(null);
                        special.setCard(null);
                        special.setCardId(null);
                        if ("限时秒杀".equals(special.getName())) {
                            miaoShaSpecial = special;
                            continue;
                        }
                        if ("arc".equals(special.getShowType())) {
                            // 同一行专题
                            honestList.add(special);
                        } else {
                            // 其他专题
                            specialList.add(special);
                        }
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        /* 限时秒杀 - 时间处理 */
        JSONObject msJSON = JSONObject.fromObject(new Gson().toJson(miaoShaSpecial));
        if (miaoShaSpecial != null) {
            // 获取秒杀
            int[] hours = new int[] { 0, 9, 12, 14, 16, 20, 22 };
            int hour = -1;
            Calendar calendar = Calendar.getInstance();
            calendar.setTimeInMillis(Long.parseLong(acceptData.getTime()));
            int nowHour = calendar.get(Calendar.HOUR_OF_DAY);
            for (int i = 0; i < hours.length - 1; i++) {
                if (nowHour >= hours[i] && nowHour < hours[i + 1]) {
                    hour = hours[i + 1];
                    break;
                }
            }
            if (hour < 0)
                hour = 24;
            long time = TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(calendar.getTimeInMillis(), "yyyy-MM-dd"),
                    "yyyy-MM-dd") + 1000 * 60 * 60 * hour;
            msJSON.put("time", time);
        }
        JSONObject root = new JSONObject();
        root.put("banner", listswiper);
        root.put("honest", honestList);
        root.put("special", specialList);
        root.put("miaoSha", msJSON);
        out.print(JsonUtil.loadTrueResult(root));
    }
    /**
     * 商品基本详情 (1.4.0)
     *
     * @param acceptData
     * @param id
     * @param uid
     * @param out
     */
    @RequestMapping(value = "getgoodsinfo", method = RequestMethod.POST)
    public void getGoodsInfo(AcceptData acceptData, String id, String uid, PrintWriter out) {
        if ("0".equalsIgnoreCase(uid)) {
            uid = "";
        }
        if (StringUtil.isNullOrEmpty(id)) {
            out.print(JsonUtil.loadFalseResult(1, "请上传id"));
            return;
        }
        System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
        if (system == null) {
            out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
            return;
        }
        JSONObject data = new JSONObject();
        data.put("invalid", false);
        // IOS是否正在上线
        if ("ios".equalsIgnoreCase(acceptData.getPlatform())) {
            String version = acceptData.getVersion();
            data.put("iosOnling", configService.iosOnLining(Integer.parseInt(version)));
        }
        long startTime = java.lang.System.currentTimeMillis();
        // 获取淘客参数
        ClientTBPid clientTBPid = null;
        if (StringUtil.isNullOrEmpty(uid)) {
            // 用户未登录
            if (acceptData.getPlatform().equalsIgnoreCase("android")) {
                clientTBPid = tbPidService.getAndroidDefault();
            } else {
                clientTBPid = tbPidService.getIOSDefault();
            }
        } else {
            // 用户已经登录
            TBPid tbPid = null;
            if (acceptData.getPlatform().equalsIgnoreCase("android")) {
                tbPid = tbPidService.getTBPid(Long.parseLong(uid), PidUser.TYPE_FANLI_ANDROID);
                if (tbPid == null) {
                    clientTBPid = tbPidService.getAndroidDefault();
                } else {
                    String siteId = tbPid.getPid().split("_")[2];
                    String adzoneId = tbPid.getPid().split("_")[3];
                    TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(siteId);
                    clientTBPid = new ClientTBPid(config.getAppKey(), tbPid.getPid(), siteId, adzoneId);
                }
            } else {
                tbPid = tbPidService.getTBPid(Long.parseLong(uid), PidUser.TYPE_FANLI_IOS);
                if (tbPid == null) {
                    clientTBPid = tbPidService.getIOSDefault();
                } else {
                    String siteId = tbPid.getPid().split("_")[2];
                    String adzoneId = tbPid.getPid().split("_")[3];
                    TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(siteId);
                    clientTBPid = new ClientTBPid(config.getAppKey(), tbPid.getPid(), siteId, adzoneId);
                }
            }
        }
        LogHelper.test("获取PID耗时:" + (java.lang.System.currentTimeMillis() - startTime));
        final String clientPid = clientTBPid.getPid();
        final List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
        // 是否在服务端进行转链
        boolean convertInServer = configService.isConvertTaoBaoLinkInServer();
        List<String> taskList = new ArrayList<>();
        // 获取商品基本信息
        taskList.add("goods");
        taskList.stream().parallel().forEach(task -> {
            if (task.equalsIgnoreCase("goods")) {
                JSONObject ticket = new JSONObject();
                TaoBaoGoodsBrief goods = null;
                if (!convertInServer) {
                    try {
                        goods = redisManager.getTaoBaoGoodsBrief(Long.parseLong(id));
                    } catch (TaobaoGoodsDownException e) {
                        // 商品下架
                        ThreadUtil.run(new Runnable() {
                            public void run() {
                                taoBaoGoodsUpdateService.deleteTaoBaoGoods(Long.parseLong(id));
                            }
                        });
                    }
                } else {
                    String appId = clientPid.split("_")[2];
                    TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(appId);
                    TaoKeAppInfo app = new TaoKeAppInfo();
                    app.setAdzoneId(clientPid.split("_")[3]);
                    app.setAppKey(config.getAppKey());
                    app.setAppSecret(config.getAppSecret());
                    app.setPid(clientPid);
                    try {
                        goods = TaoKeApiUtil.searchGoodsDetail(Long.parseLong(id), app);
                        if (goods != null) {
                            ticket.put("clickUrl", goods.getAuctionUrl());
                            // 测试使用
                            ticket.put("couponUrl", goods.getCouponLink());
                            data.put("ticket", ticket);
                        }
                    } catch (NumberFormatException e) {
                        e.printStackTrace();
                    } catch (TaobaoGoodsDownException e) {
                        e.printStackTrace();
                    }
                }
                if (goods != null) {
                    goodsList.add(goods);
                    final TaoBaoGoodsBrief newGoods = goods;
                    ThreadUtil.run(new Runnable() {
                        public void run() {
                            try {
                                // 更新商品
                                LogHelper.test("更新商品详情:" + newGoods.getAuctionId());
                                taoBaoGoodsUpdateService.updateTaoBaoGoods(newGoods);
                            } catch (TaobaoGoodsUpdateException e) {
                            }
                        }
                    });
                }
            }
        });
        TaoBaoGoodsBrief tb = null;
        if (goodsList.size() > 0) {
            tb = goodsList.get(0);
        }
        if (tb == null) {
            out.print(JsonUtil.loadFalseResult(2, "商品不存在"));
            return;
        }
        if (tb.getImgList() == null) {
            tb.setImgList(new ArrayList<>());
        }
        tb.getImgList().add(0, tb.getPictUrl());
        List<String> finalImgList = new ArrayList<>();
        for (String img : tb.getImgList()) {
            finalImgList.add(img);
        }
        JSONObject goods = new JSONObject();
        goods.put("auctionId", tb.getAuctionId());
        goods.put("imgList", finalImgList);
        goods.put("title", tb.getTitle());
        goods.put("userType", tb.getUserType() == 1 ? 2 : 1);
        goods.put("price", tb.getReservePrice().toString());
        goods.put("zkPrice", tb.getZkPrice().toString());
        // 红包
        String rateStr = hongBaoManageService.get("hongbao_goods_proportion");
        String hongBao = TaoBaoUtil.getGoodsHongBaoInfo(tb, new BigDecimal(rateStr));
        goods.put("hongBao", hongBao);
        // 30天销量
        goods.put("saleCount", TaoBaoUtil.getSaleCount(tb.getBiz30day()));
        // 分享赚
        BigDecimal shareMoney = taoBaoGoodsBriefService.getShareGoodsUserHongBao(tb);
        data.put("shareMoney", "¥" + shareMoney);
        // 分享赚人提示
        List<ShamUser> listShareUser = new ArrayList<ShamUser>();
        if (tb.getBiz30day() >= 1000) {
            listShareUser = shamUserService.listRandShareUser(10, shareMoney, 1, 5);
        }
        // 判断收藏
        if (StringUtil.isNullOrEmpty(uid)) {
            data.put("collected", false);
        } else {
            CollectionGoods collectionGoods = collectionGoodsService.findByUidAndAuctionId(Long.parseLong(uid),
                    Long.parseLong(id));
            data.put("collected", collectionGoods != null ? true : false);
        }
        // 测试
        SystemClientParams params = systemClientParamsService.getSystemClientParamsBySystemAndKey(system,
                "goods_detail_jump_taobao");
        if ("1".equalsIgnoreCase((params.getValue() + "").trim())) {
            data.put("native", true);
        } else {
            data.put("native", false);
        }
        // 获取PID
        String pid = clientTBPid.getPid();
        LogHelper.test(String.format("PID: uid-%s  pid-%s", uid + "", pid));
        // 是否有券
        goods.put("coupon", StringUtil.isNullOrEmpty(tb.getCouponInfo()) ? false : true);
        // 领券人列表
        List<ShamUser> listCouponUser = new ArrayList<ShamUser>();
        // 获取券信息
        if (!StringUtil.isNullOrEmpty(tb.getCouponInfo())) {
            BigDecimal quanPrice = TaoBaoUtil.getAfterUseCouplePrice(tb);
            JSONObject couponInfo = new JSONObject();
            couponInfo.put("couponPrice", quanPrice.toString());
            // 服务端转链
            if (convertInServer && !StringUtil.isNullOrEmpty(tb.getCouponLink())) {
                couponInfo.put("couponUrl", tb.getCouponLink());
            } else {
                couponInfo.put("couponUrl",
                        TaoBaoCouponUtil.getCoupleUrl(tb.getCouponActivityId() + "", pid, tb.getAuctionId() + ""));
            }
            couponInfo.put("couponAmount", NumberUtil.subZeroAndDot(tb.getCouponAmount().toString()));
            couponInfo.put("couponTime", "使用期限:" + tb.getCouponEffectiveStartTime().replace("-", ".") + "-"
                    + tb.getCouponEffectiveEndTime().replace("-", "."));
            goods.put("couponInfo", couponInfo);
            if (tb.getBiz30day() >= 1000) {
                // 领券人列表
                listCouponUser = shamUserService.listRandCouponUser(5, 1, 300);
            }
        }
        data.put("tbPidInfo", clientTBPid);
        String jumpUrl = "https://item.taobao.com/item.htm?id=" + tb.getAuctionId();
        if (!StringUtil.isNullOrEmpty(tb.getCouponActivityId())) {// 有券,跳转券链接
            jumpUrl = TaoBaoCouponUtil.getCoupleUrl(tb.getCouponActivityId(), clientTBPid.getPid(),
                    "" + tb.getAuctionId());
        }
        // 设置跳转链接
        if (convertInServer) {
            if (!StringUtil.isNullOrEmpty(tb.getCouponLink()))
                jumpUrl = tb.getCouponLink();
            else
                jumpUrl = tb.getAuctionUrl();
        }
        goods.put("jumpUrl", jumpUrl);
        TaoBaoShopInfo tbShopInfo = redisManager.getTBShopInfo(tb.getShopTitle(), tb.getSellerId(), tb.getAuctionId());
        if (tbShopInfo != null) {
            String shopType = tbShopInfo.getShopType();
            if (!StringUtil.isNullOrEmpty(shopType) && shopType.contains("tm.png")) {
                tbShopInfo.setUserType("1");
            } else {
                tbShopInfo.setUserType("0");
            }
        }
        // 店铺
        goods.put("shopInfo", tbShopInfo);
        // 分享路径
        String shareUrl = String.format("%s?id=" + tb.getAuctionId(), Constant.systemCommonConfig.getAppShareInfoUrl());
        data.put("shareUrl", shareUrl);
        data.put("goods", goods);
        data.put("shareUsers", listShareUser);
        data.put("couponUsers", listCouponUser);
        out.print(JsonUtil.loadTrueResult(data));
        final String tempUid = uid;
        final TaoBaoGoodsBrief goodsInfo = tb;
        ThreadUtil.run(new Runnable() {
            public void run() {
                // 添加浏览记录
                ScanHistory sh = TaoBaoUtil.getScanHistory(goodsInfo);
                sh.setId(0);
                sh.setDevice(acceptData.getDevice());
                sh.setSystem(systemService.getSystem(acceptData.getPlatform(), acceptData.getPackages()));
                sh.setCreatetime(new Date());
                if (!StringUtil.isNullOrEmpty(tempUid)) {
                    sh.setUid(Long.parseLong(tempUid));
                }
                try {
                    scanHistoryService.addScanHistory(sh);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
    }
    /**
     * 获取图文详情(1.4.0)
     *
     * @param acceptData
     * @param id
     * @param out
     */
    @RequestMapping(value = "getgoodsdetailimgs", method = RequestMethod.POST)
    public void getgoodsdetailimgs(AcceptData acceptData, String id, PrintWriter out) {
        if (StringUtil.isNullOrEmpty(id)) {
            out.print(JsonUtil.loadFalseResult(1, "请上传id"));
            return;
        }
        List<String> detailImgs = new ArrayList<>();
        JSONArray detailImgsSize = new JSONArray();
        List<ImageInfo> imgs = redisManager.getTaoBaoGoodsDetailImgs(Long.parseLong(id));
        if (imgs != null && imgs.size() > 0) {
            for (ImageInfo imgInfo : imgs) {
                detailImgs.add(imgInfo.getPicture());
            }
            for (ImageInfo imgInfo : imgs) {
                if (imgInfo.getWidth() <= 0) {
                    detailImgsSize.clear();
                    break;
                }
                JSONObject size = new JSONObject();
                size.put("w", imgInfo.getWidth());
                size.put("h", imgInfo.getHeight());
                detailImgsSize.add(size);
            }
        }
        JSONObject data = new JSONObject();
        data.put("detailImgs", detailImgs);
        data.put("detailImgsSize", detailImgsSize);
        out.print(JsonUtil.loadTrueResult(data));
    }
    /**
     * 商品详情推荐1.4.0
     *
     * @param acceptData
     * @param id
     * @param out
     */
    @RequestMapping(value = "getgoodsderivation", method = RequestMethod.POST)
    public void getRecommendGoods(AcceptData acceptData, long id, PrintWriter out) {
        System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
        if (system == null) {
            out.print(JsonUtil.loadFalseResult(1, "系统不存在"));
            return;
        }
        List<TaoBaoGoodsBrief> goodsList = TaoKeApiUtil.getRelationGoodsRecommend(id, 10);
        // 重新做推荐
        if (goodsList == null || goodsList.size() == 0) {
            goodsList = new ArrayList<>();
            TaoBaoGoodsBrief goods = null;
            try {
                goods = redisManager.getTaoBaoGoodsBrief(id);
            } catch (TaobaoGoodsDownException e) {
                e.printStackTrace();
            }
            if (goods == null) {
                // 从我们的商品库搜索
                CollectionGoods cgoods = collectionGoodsService.findByAuctionId(id);
                // 商品有本地缓存
                if (cgoods != null) {
                    // 按名字搜索商品
                    SearchFilter sf = new SearchFilter();
                    sf.setKey(cgoods.getTitle().substring(0, cgoods.getTitle().length() / 2));
                    TaoBaoSearchResult result = TaoBaoUtil.search(sf);
                    if (result != null && result.getTaoBaoGoodsBriefs() != null
                            && result.getTaoBaoGoodsBriefs().size() > 0) {
                        for (TaoBaoGoodsBrief gds : result.getTaoBaoGoodsBriefs()) {
                            if (goodsList.size() == 10) {
                                break;
                            }
                            goodsList.add(gds);
                        }
                    }
                }
            }
            // 需要另做推荐
            if (goodsList.size() < 2) {
                try {
                    List<RecommendSectionGoods> list = recommendSectionGoodsService.getSectionGoods(10);
                    if (list != null) {
                        for (int i = 0; i < list.size(); i++) {
                            if (i == 10) {
                                break;
                            }
                            goodsList.add(list.get(i).getTaoBaoGoodsBrief());
                        }
                    }
                } catch (Exception e2) {
                    e2.printStackTrace();
                }
            }
        }
        Map<String, String> map = hongBaoManageService.convertMap();
        String proportion = map.get("hongbao_goods_proportion");
        String fcRate = map.get("hongbao_fc_ratio");
        List<TaoBaoGoodsBriefExtra> listExtra = new ArrayList<TaoBaoGoodsBriefExtra>();
        goodsList.parallelStream().forEach(goods -> {
            // 获取详情
            TaoBaoGoodsBrief taoBaoGoodsBrief = null;
            try {
                taoBaoGoodsBrief = redisManager.getTaoBaoGoodsBrief(goods.getAuctionId());
            } catch (Exception e) {
                e.printStackTrace();
            }
            if (taoBaoGoodsBrief != null) {
                listExtra.add(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion, fcRate, ""));
            }
        });
        List<TaoBaoGoodsBrief> listQuality = new ArrayList<TaoBaoGoodsBrief>();
        try {
            List<QualityFactory> listRecommend = qualityGoodsService.recommendByAuctionId(id);
            if (listRecommend != null && listRecommend.size() > 1) {
                for (QualityFactory quality : listRecommend) {
                    TaoBaoGoodsBrief taoBaoGoodsBrief = quality.getTaoBaoGoodsBrief();
                    if (taoBaoGoodsBrief == null) {
                        continue;
                    }
                    int biz30day = taoBaoGoodsBrief.getBiz30day();
                    if (biz30day >= 10000) {
                        double sales = biz30day;
                        String salesCountMidea = String.format("%.1f", sales / 10000);
                        taoBaoGoodsBrief.setSalesCount(salesCountMidea + "万");
                    } else {
                        taoBaoGoodsBrief.setSalesCount(biz30day + "");
                    }
                    // 改变图片尺寸
                    String pictUrl = taoBaoGoodsBrief.getPictUrl();
                    if (!StringUtil.isNullOrEmpty(pictUrl) && !pictUrl.contains("320x320")) {
                        taoBaoGoodsBrief.setPictUrl(TbImgUtil.getTBSize320Img(pictUrl));
                    }
                    listQuality.add(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion, fcRate, null));
                }
            }
        } catch (Exception e2) {
            e2.printStackTrace();
        }
        // 取偶数个数据
        if (listExtra.size() % 2 != 0) {
            listExtra.remove(listExtra.size() - 1);
        }
        if (listQuality.size() % 2 != 0) {
            listQuality.remove(listQuality.size() - 1);
        }
        JSONObject data = new JSONObject();
        data.put("listGuess", JsonUtil.getApiCommonGson().toJson(listExtra));
        data.put("listQuality", JsonUtil.getApiCommonGson().toJson(listQuality));
        out.print(JsonUtil.loadTrueResult(data));
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/SearchController.java
@@ -38,6 +38,7 @@
import com.yeshi.fanli.entity.taobao.TaoBaoSearchNav;
import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
import com.yeshi.fanli.entity.taobao.TaoBaoUnionConfig;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.config.SuperHotSearchService;
import com.yeshi.fanli.service.inter.config.SystemService;
import com.yeshi.fanli.service.inter.goods.HonestService;
@@ -58,7 +59,10 @@
    @Resource
    private SystemService systemService;
    @Resource
    private ConfigService configService;
    @Resource
    private SuperHotSearchService superHotSearchSerivce;
@@ -73,13 +77,12 @@
    @Resource
    private TaoBaoUnionConfigService taoBaoUnionConfigService;
    @Resource
    private TaoKeGoodsService taoKeGoodsService;
    @Resource
    private QualityGoodsService qualityGoodsService;
    @RequestMapping(value = "gethotsearch", method = RequestMethod.POST)
    public void getHotSearch(AcceptData acceptData, PrintWriter out) {
@@ -289,7 +292,7 @@
                } else if ("fahuodi".equalsIgnoreCase(ty)) {
                    int id = array.optJSONObject(i).optInt("id");
                    sf.setProvinceId(id);
                }else if ("materialId".equalsIgnoreCase(ty)) {
                } else if ("materialId".equalsIgnoreCase(ty)) {
                    int id = array.optJSONObject(i).optInt("id");
                    sf.setProvinceId(id);
                }
@@ -406,14 +409,16 @@
        return StringUtil.Md5(sb.toString());
    }
    /**
     * 搜索-新版
     *
     * @param acceptData
     * @param kw
     * @param page
     * @param filter
     * @param order  销量由高到低:1 、 价格从高到低:2 、 价格从低到高:3 、 推广量高到低:4(综合默认)、返利比高到低:5 、返利比低到高:6  、推荐20
     * @param order
     *            销量由高到低:1 、 价格从高到低:2 、 价格从低到高:3 、 推广量高到低:4(综合默认)、返利比高到低:5
     *            、返利比低到高:6 、推荐20
     * @param startprice
     * @param endprice
     * @param fastFilter
@@ -421,12 +426,12 @@
     */
    @RequestMapping(value = "searchgoods")
    public void searchgoods(AcceptData acceptData, String kw, int page, String filter, String order, String startprice,
            String endprice, String fastFilter, PrintWriter out) {
            String endprice, Double startTkRate, Double endTkRate, String fastFilter, PrintWriter out) {
        String bid = getHistorySearchBid(acceptData);
        historySearchService.addHistorySearch(kw, bid);
        System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
        if (system == null) {
            out.print(JsonUtil.loadFalseResult("系统不存在"));
@@ -437,7 +442,7 @@
            out.print(JsonUtil.loadFalseResult("无法搜索链接"));
            return;
        }
        if (!StringUtil.isNullOrEmpty(fastFilter)) {
            if (!StringUtil.isNullOrEmpty(filter)) {
                JSONArray filterArray = JSONArray.fromObject(filter);
@@ -448,8 +453,7 @@
                filter = fastFilter;
            }
        }
        // 是否是推荐
        boolean recommend = false;
        if (!StringUtil.isNullOrEmpty(fastFilter)) {
@@ -457,14 +461,13 @@
            JSONArray array = JSONArray.fromObject(filter);
            for (int i = 0; i < array.size(); i++) {
                String ty = array.optJSONObject(i).optString("type");
                if ("recommend".equalsIgnoreCase(ty)) {
                    recommend = true;
                }
            }
        }
        JSONObject data = null;
        if (!recommend) {
            // 淘宝接口请求
@@ -473,26 +476,26 @@
            // 推荐:精选库
            data = searchQualityGoods(kw, page, filter, order, startprice, endprice);
        }
        // 获取推荐词
        List<String> listRecommendWords = new ArrayList<String>();
        // 综合 查询第一页时获取候选词
        if (page == 0 && !StringUtil.isNullOrEmpty(order) && "4".equalsIgnoreCase(order)) {
        if (page == 0) {
            listRecommendWords = TaoBaoUtil.getSuguestSearch(kw);
            if (listRecommendWords == null || listRecommendWords.size() == 0) {
                listRecommendWords = new ArrayList<String>();
            }
            }
        }
        Gson gson = new GsonBuilder().create();
        data.put("words", gson.toJson(listRecommendWords));
        out.print(JsonUtil.loadTrueResult(data));
    }
    /**
     * 执行搜索-新版
     *
     * @param kw
     * @param page
     * @param filter
@@ -501,7 +504,8 @@
     * @param endprice
     * @return
     */
    private JSONObject searchGoods(String kw, int page, String filter, String order, String startprice, String endprice) {
    private JSONObject searchGoods(String kw, int page, String filter, String order, String startprice,
            String endprice) {
        page = page + 1;
        SearchFilter sf = new SearchFilter();
@@ -516,7 +520,7 @@
        if (!com.yeshi.fanli.util.StringUtil.isNullOrEmpty(endprice)) {
            sf.setEndPrice(new BigDecimal(endprice));
        }
        if (!com.yeshi.fanli.util.StringUtil.isNullOrEmpty(order)) {
            if (Integer.parseInt(order) == 1) {
                sf.setSort(TaoBaoUtil.SORT_SALE_HIGH_TO_LOW);
@@ -600,13 +604,24 @@
                } else if ("fahuodi".equalsIgnoreCase(ty)) {
                    int id = array.optJSONObject(i).optInt("id");
                    sf.setProvinceId(id);
                }else if ("materialId".equalsIgnoreCase(ty)) {
                } else if ("materialId".equalsIgnoreCase(ty)) {
                    int id = array.optJSONObject(i).optInt("id");
                    sf.setProvinceId(id);
                }
                } else if ("tkRate1".equalsIgnoreCase(ty)) {
                    setSearchTkRate(0, sf);
                } else if ("tkRate2".equalsIgnoreCase(ty)) {
                    setSearchTkRate(1, sf);
                } else if ("tkRate3".equalsIgnoreCase(ty)) {
                    setSearchTkRate(2, sf);
                } else if ("tkRate4".equalsIgnoreCase(ty)) {
                    setSearchTkRate(3, sf);
                } else if ("tkRate5".equalsIgnoreCase(ty)) {
                    setSearchTkRate(4, sf);
                }
            }
            sf.setParams(params);
        }
        TaoBaoSearchResult result = TaoBaoUtil.search(sf);
        if (result == null) {
            return null;
@@ -666,11 +681,10 @@
        data.put("count", result.getTaoBaoHead().getDocsfound());
        return data;
    }
    /**
     * 执行搜索精选库
     *
     * @param kw
     * @param page
     * @param filter
@@ -679,77 +693,158 @@
     * @param endprice
     * @return
     */
    private JSONObject searchQualityGoods(String key, int page, String filter, String order, String startprice, String endprice) {
    private JSONObject searchQualityGoods(String key, int page, String filter, String order, String startprice,
            String endprice ) {
        Integer hasQuan = null;
        Integer userType = null;
        Double start_Price = null;
        Double end_Price= null;
        Double end_Price = null;
        Integer sort = null;
        Double startTkRate = null;
        Double endTkRate = null;
        
        int provinceId = -100;
        // 起始价格
        if (!com.yeshi.fanli.util.StringUtil.isNullOrEmpty(startprice)) {
            start_Price = Double.parseDouble(startprice);
        }
        // 结束价格
        if (!com.yeshi.fanli.util.StringUtil.isNullOrEmpty(endprice)) {
            end_Price =  Double.parseDouble(endprice);
            end_Price = Double.parseDouble(endprice);
        }
        // 排序
        // 排序
        if (!com.yeshi.fanli.util.StringUtil.isNullOrEmpty(order)) {
            if (Integer.parseInt(order) == 4) {
                sort = 20; // 综合时:采用默认权重排序
            } else {
                sort =Integer.parseInt(order);
                sort = Integer.parseInt(order);
            }
        }
        /* 其他筛选条件 */
        /* 其他筛选条件 */
        if (!com.yeshi.fanli.util.StringUtil.isNullOrEmpty(filter)) {
            // 查询淘宝天猫
            JSONArray array = JSONArray.fromObject(filter);
            for (int i = 0; i < array.size(); i++) {
                String ty = array.optJSONObject(i).optString("type");
                if ("userType".equalsIgnoreCase(ty)) {
                    userType = 1; // 天猫
                } else if ("quantype".equalsIgnoreCase(ty)) {
                    hasQuan = 1; // 有券
                } else if ("hongbaotype".equalsIgnoreCase(ty)) {
                } else if ("fahuodi".equalsIgnoreCase(ty)) {
                    provinceId = array.optJSONObject(i).optInt("id");
                }
                } else if ("tkRate1".equalsIgnoreCase(ty)) {
                    // 获取对应参数
                    String value = configService.get("tkRate_range");
                    if (!StringUtil.isNullOrEmpty(value)) {
                        JSONArray tkRatearray = JSONArray.fromObject(value);
                        if (tkRatearray != null) {
                            String start = tkRatearray.optJSONObject(0).optString("start");
                            if (!StringUtil.isNullOrEmpty(start)) {
                                startTkRate = Double.parseDouble(start);
                            }
                            String end = tkRatearray.optJSONObject(0).optString("end");
                            if (!StringUtil.isNullOrEmpty(end)) {
                                endTkRate = Double.parseDouble(end);
                            }
                        }
                    }
                } else if ("tkRate2".equalsIgnoreCase(ty)) {
                    // 获取对应参数
                    String value = configService.get("tkRate_range");
                    if (!StringUtil.isNullOrEmpty(value)) {
                        JSONArray tkRatearray = JSONArray.fromObject(value);
                        if (tkRatearray != null) {
                            String start = tkRatearray.optJSONObject(1).optString("start");
                            if (!StringUtil.isNullOrEmpty(start)) {
                                startTkRate = Double.parseDouble(start);
                            }
                            String end = tkRatearray.optJSONObject(1).optString("end");
                            if (!StringUtil.isNullOrEmpty(end)) {
                                endTkRate = Double.parseDouble(end);
                            }
                        }
                    }
                } else if ("tkRate3".equalsIgnoreCase(ty)) {
                    // 获取对应参数
                    String value = configService.get("tkRate_range");
                    if (!StringUtil.isNullOrEmpty(value)) {
                        JSONArray tkRatearray = JSONArray.fromObject(value);
                        if (tkRatearray != null) {
                            String start = tkRatearray.optJSONObject(2).optString("start");
                            if (!StringUtil.isNullOrEmpty(start)) {
                                startTkRate = Double.parseDouble(start);
                            }
                            String end = tkRatearray.optJSONObject(2).optString("end");
                            if (!StringUtil.isNullOrEmpty(end)) {
                                endTkRate = Double.parseDouble(end);
                            }
                        }
                    }
                } else if ("tkRate4".equalsIgnoreCase(ty)) {
                    // 获取对应参数
                    String value = configService.get("tkRate_range");
                    if (!StringUtil.isNullOrEmpty(value)) {
                        JSONArray tkRatearray = JSONArray.fromObject(value);
                        if (tkRatearray != null) {
                            String start = tkRatearray.optJSONObject(3).optString("start");
                            if (!StringUtil.isNullOrEmpty(start)) {
                                startTkRate = Double.parseDouble(start);
                            }
                            String end = tkRatearray.optJSONObject(3).optString("end");
                            if (!StringUtil.isNullOrEmpty(end)) {
                                endTkRate = Double.parseDouble(end);
                            }
                        }
                    }
                } else if ("tkRate5".equalsIgnoreCase(ty)) {
                    // 获取对应参数
                    String value = configService.get("tkRate_range");
                    if (!StringUtil.isNullOrEmpty(value)) {
                        JSONArray tkRatearray = JSONArray.fromObject(value);
                        if (tkRatearray != null) {
                            String start = tkRatearray.optJSONObject(4).optString("start");
                            if (!StringUtil.isNullOrEmpty(start)) {
                                startTkRate = Double.parseDouble(start);
                            }
                            String end = tkRatearray.optJSONObject(4).optString("end");
                            if (!StringUtil.isNullOrEmpty(end)) {
                                endTkRate = Double.parseDouble(end);
                            }
                        }
                    }
                }
            }
        }
        int pageSize = Constant.PAGE_SIZE;
        List<QualityFactory> listQuery = qualityGoodsService.listRecommendBykey(page * pageSize,
                pageSize, key, hasQuan, userType, start_Price, end_Price, sort);
        List<QualityFactory> listQuery = qualityGoodsService.listRecommendBykey(page * pageSize, pageSize, key, hasQuan,
                userType, start_Price, end_Price, startTkRate, endTkRate, sort);
        List<TaoBaoGoodsBriefExtra> listExtra = new ArrayList<TaoBaoGoodsBriefExtra>();
        Map<String, String> map = manageService.convertMap();
        String proportion = map.get("hongbao_goods_proportion");
        String fcRate = map.get("hongbao_fc_ratio");
        /* 遍历列表数据 */
        if (listQuery != null && listQuery.size() > 0) {
            for (QualityFactory selectionGoods : listQuery) {
                TaoBaoGoodsBrief taoBaoGoodsBrief = selectionGoods.getTaoBaoGoodsBrief();
                if (taoBaoGoodsBrief == null) {
                    continue;
                }
                int biz30day = taoBaoGoodsBrief.getBiz30day();
                if (biz30day >= 10000) {
                    double sales = biz30day;
@@ -758,30 +853,28 @@
                } else {
                    taoBaoGoodsBrief.setSalesCount(biz30day + "");
                }
                // 改变图片尺寸
                // 改变图片尺寸
                String pictUrl = taoBaoGoodsBrief.getPictUrl();
                if (!StringUtil.isNullOrEmpty(pictUrl) && !pictUrl.contains("320x320")) {
                    taoBaoGoodsBrief.setPictUrl(TbImgUtil.getTBSize320Img(pictUrl));
                }
                listExtra.add(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion, fcRate, null));
            }
        }
        long count = qualityGoodsService.countRecommendBykey(key, hasQuan, userType, start_Price, end_Price);
        long count = qualityGoodsService.countRecommendBykey(key, hasQuan, userType, start_Price, end_Price, startTkRate, endTkRate);
        // 设置发货地址
        TaoBaoSearchNav nav = new TaoBaoSearchNav();
        nav.setName("发货地");
        nav.setName("发货地选择");
        nav.setFlag("address");
        nav.setId(11110);
        nav.setType("fahuodi");
        List<TaoBaoSearchNav> navList = new ArrayList<>();
        List<TaoBaoSearchNav> childNavList = new ArrayList<>();
        List<TaoBaoProvince> provinceList = TaoBaoUtil.getTaoBaoProvinceList();
        for (TaoBaoProvince province : provinceList) {
@@ -796,17 +889,48 @@
        nav.setSubIds(childNavList);
        navList.add(nav);
        Gson gson = new GsonBuilder().create();
        Gson gson2 = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                .excludeFieldsWithoutExposeAnnotation().create();
        JSONObject data = new JSONObject();
        data.put("nav", gson.toJson(navList));
        data.put("result", gson2.toJson(listExtra));
        data.put("count", count);
        return data;
    }
    /**
     * 设置查询佣金比例范围
     * @param i
     * @param sf
     */
    public void setSearchTkRate(int i, SearchFilter sf) {
        // 获取对应参数
        String value = configService.get("tkRate_range");
        if (!StringUtil.isNullOrEmpty(value)) {
            JSONArray tkRatearray = JSONArray.fromObject(value);
            if (tkRatearray != null) {
                String start = tkRatearray.optJSONObject(i).optString("start");
                if (!StringUtil.isNullOrEmpty(start)) {
                    int tkRate = (int) (Float.parseFloat(start) * 100);
                    sf.setStartTkRate(tkRate);
                }
                String end = tkRatearray.optJSONObject(i).optString("end");
                if (!StringUtil.isNullOrEmpty(end)) {
                    int tkRate = (int) (Float.parseFloat(end) * 100);
                    sf.setEndTkRate(tkRate);
                }
            }
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/ShareController.java
@@ -7,27 +7,28 @@
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.yeshi.utils.HttpUtil;
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.taobao.TbImgUtil;
import com.mongodb.util.ThreadUtil;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.share.UserShareGoodsHistory;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.taobao.TaoBaoLink;
import com.yeshi.fanli.exception.ShareGoodsException;
import com.yeshi.fanli.service.impl.goods.ShareGoodsServiceImpl;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.monitor.MonitorService;
import com.yeshi.fanli.util.AESUtil;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.factory.MonitorFactory;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import org.yeshi.utils.HttpUtil;
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.taobao.TbImgUtil;
import net.sf.json.JSONObject;
@@ -43,6 +44,9 @@
    @Resource
    private HongBaoManageService hongBaoManageService;
    @Resource
    private MonitorService monitorService;
    // 获取商品分享链接
    @RequestMapping(value = "getGoodsShareUrl")
@@ -61,7 +65,8 @@
     * @param out
     */
    @RequestMapping(value = "gettaobaosharelink")
    public void getTaobaoShareLink(AcceptData acceptData, Long uid, Long auctionId, PrintWriter out) {
    public void getTaobaoShareLink(AcceptData acceptData, Long uid, Long auctionId, HttpServletRequest request,
            PrintWriter out) {
        if (uid == null || uid <= 0) {
            out.print(JsonUtil.loadFalseResult(1, "用户ID不能为空"));
            return;
@@ -87,7 +92,8 @@
            data.put("clickUrl", url);
            data.put("token", taoBaoLink.getTaoToken());
            data.put("rule", "http://flq.yeshitv.com/fanli/client/html/help_item.html?id=8");
            data.put("rule",
                    "http://apph5.yeshitv.com/apppage/all_help_content.html?id=148&from=singlemessage&isappinstalled=0");
            data.put("pictUrl", TbImgUtil.getTBSizeImg(taoBaoLink.getGoods().getPictUrl(), 500));
            String shareText = "";
@@ -107,6 +113,10 @@
            }
            shareText = shareText.replace("[价格类型]", shopType);
            data.put("shareText", shareText);
            String descText = shareText.replace(taoBaoLink.getGoods().getTitle() + "\r\n", "");
            if (descText.startsWith("\\r\\n"))
                descText = descText.substring(0);
            data.put("descText", descText);
            // 添加分享记录
            BigDecimal rate = new BigDecimal(hongBaoManageService.get("hongbao_goods_proportion"));
@@ -139,6 +149,10 @@
            });
            return;
        } catch (ShareGoodsException e) {
            try {
                monitorService.addClientAPIMonitor(MonitorFactory.createClientAPI(request, e.getCode(), 0, "分享出错"));
            } catch (Exception e1) {
            }
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMessage()));
        }
fanli/src/main/java/com/yeshi/fanli/controller/client/SystemClientController.java
@@ -71,16 +71,17 @@
        data.put("count", list.size());
        data.put("systemClientParamsList", gson.toJson(list));
        out.print(JsonUtil.loadTrueResult(data));
        ThreadUtil.run(new Runnable() {
            @Override
            public void run() {
                try {
                    iosPushService.addDeviceToken(null, Integer.parseInt(acceptData.getVersion()), null,
                            acceptData.getDevice());
                } catch (Exception e) {
                }
            }
        });
//        ThreadUtil.run(new Runnable() {
//            @Override
//            public void run() {
//                try {
//                    if ("ios".equalsIgnoreCase(acceptData.getPlatform()))
//                        iosPushService.addDeviceToken(null, Integer.parseInt(acceptData.getVersion()), null,
//                                acceptData.getDevice());
//                } catch (Exception e) {
//                }
//            }
//        });
        return;
    }
fanli/src/main/java/com/yeshi/fanli/controller/client/UserInfoController.java
@@ -2,9 +2,11 @@
import java.io.PrintWriter;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;
@@ -16,9 +18,19 @@
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.BigDecimalUtil;
import org.yeshi.utils.HttpUtil;
import org.yeshi.utils.IPUtil;
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.NumberUtil;
import org.yeshi.utils.tencentcloud.COSManager;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.AccountDetails;
import com.yeshi.fanli.entity.bus.user.AccountMessage;
@@ -76,11 +88,6 @@
import com.yeshi.fanli.util.account.UserUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.wx.WXLoginUtil;
import org.yeshi.utils.HttpUtil;
import org.yeshi.utils.IPUtil;
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.NumberUtil;
import org.yeshi.utils.tencentcloud.COSManager;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@@ -456,9 +463,7 @@
            data.put("inviteList", String.format("http://%s/%s/client/share/friends_new_online.html",
                    Constant.systemCommonConfig.getProjectHost(), Constant.systemCommonConfig.getProjectName()));
        else
            data.put("inviteList", String.format("http://%s/%s/client/share/friends_new.html",
                    Constant.systemCommonConfig.getProjectHost(), Constant.systemCommonConfig.getProjectName()));
            data.put("inviteList", configService.get("team_list"));
        out.print(JsonUtil.loadTrueResult(data));
        final UserInfo uuser = user;
        ThreadUtil.run(new Runnable() {
@@ -1429,9 +1434,10 @@
        }
    }
    /**
     * h5收藏
     *
     * @param callback
     * @param acceptData
     * @param uid
@@ -1439,26 +1445,26 @@
     * @param out
     */
    @RequestMapping("collectionGoodsJp")
    public void collectionGoodsJp(String callback, AcceptData acceptData, Long uid, Long auctionId,  PrintWriter out) {
    public void collectionGoodsJp(String callback, AcceptData acceptData, Long uid, Long auctionId, PrintWriter out) {
        if (uid == null || auctionId == null) {
            JsonUtil.printMode(out, callback,JsonUtil.loadFalseResult(""));
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(""));
            return;
        }
        CollectionGoods find = collectionGoodsService.findByUidAndAuctionId(uid, auctionId);
        if (find == null) {
            // 添加收藏
            CollectionGoods cg = TaoBaoUtil.getCollectionGoods(auctionId, new UserInfo(uid));
            collectionGoodsService.save(cg);
            JsonUtil.printMode(out, callback,JsonUtil.loadTrueResult(1));
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(1));
        } else {
            // 取消收藏
            collectionGoodsService.delete(find);
            JsonUtil.printMode(out, callback,JsonUtil.loadTrueResult(0));
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(0));
        }
    }
    @RequestMapping("collectionGoodsList")
@@ -1475,12 +1481,23 @@
            goodsBrief.setSalesCount(TaoBaoUtil.getSaleCount(goodsBrief.getBiz30day()));
            TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(goodsBrief, proportion,
                    fcRate, "");
            taoBaoGoodsBriefExtra.setCreatetime(new Date(cg.getCreateTime()));
            list.add(taoBaoGoodsBriefExtra);
        });
        Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                .excludeFieldsWithoutExposeAnnotation().create();
        GsonBuilder builder = new GsonBuilder().registerTypeAdapter(Date.class, new JsonSerializer<Date>() {
            @Override
            public JsonElement serialize(Date value, Type theType, JsonSerializationContext context) {
                if (value == null) {
                    return new JsonPrimitive("");
                } else {
                    return new JsonPrimitive(value.getTime() + "");
                }
            }
        });
        Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(builder).excludeFieldsWithoutExposeAnnotation()
                .create();
        data.put("list", gson.toJson(list));
        data.put("count", count);
        out.print(JsonUtil.loadTrueResult(data));
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/AppVersionInfoMapper.java
New file
@@ -0,0 +1,41 @@
package com.yeshi.fanli.dao.mybatis;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.entity.AppVersionInfo;
public interface AppVersionInfoMapper {
    int deleteByPrimaryKey(Long id);
    int insert(AppVersionInfo record);
    int insertSelective(AppVersionInfo record);
    AppVersionInfo selectByPrimaryKey(Long id);
    /**
     * 根据平台获取版本信息
     *
     * @param platform
     * @return
     */
    List<AppVersionInfo> selectByPlatform(String platform);
    /**
     * 根据平台和版本号获取版本信息
     *
     * @param platform
     * @param versionCode
     * @return
     */
    AppVersionInfo selectByPlatformAndVersionCode(@Param("platform") String platform,
            @Param("versionCode") int versionCode);
    int updateByPrimaryKeySelective(AppVersionInfo record);
    int updateByPrimaryKey(AppVersionInfo record);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/ThreeSaleMapper.java
@@ -78,4 +78,49 @@
     */
    int updateExpire(List<Long> list);
    
    /**
     * 一级查询
     * @param start
     * @param count
     * @param key
     * @param startTime
     * @param endTime
     * @return
     */
    List<ThreeSale> listFirstTeamQuery(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid,
            @Param("state")Integer state, @Param("startTime") String startTime, @Param("endTime") String endTime);
    long countFirstTeamQuery(@Param("uid") Long uid, @Param("state")Integer state, @Param("startTime") String startTime,
            @Param("endTime") String endTime);
    /**
     * 二级查询
     * @param start
     * @param count
     * @param key
     * @param startTime
     * @param endTime
     * @return
     */
    List<ThreeSale> listSecondTeamQuery(@Param("start")long start, @Param("count")int count, @Param("uid")Long uid,
            @Param("state")Integer state, @Param("startTime")String startTime, @Param("endTime")String endTime);
    long countSecondTeamQuery(@Param("uid")Long uid, @Param("state")Integer state, @Param("startTime")String startTime,
            @Param("endTime") String endTime);
    /**
     * 上级查询
     * @param start
     * @param count
     * @param uid
     * @return
     */
    List<ThreeSale> listSuperiorQuery(@Param("start") long start, @Param("count") int count,
            @Param("state")Integer state, @Param("uid") Long uid);
    long countSuperiorQuery(@Param("state")Integer state, @Param("uid") Long uid);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/common/JumpDetailV2Mapper.java
@@ -2,6 +2,8 @@
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.entity.common.JumpDetailV2;
public interface JumpDetailV2Mapper {
@@ -25,5 +27,30 @@
     */
    List<JumpDetailV2> listByType(String type);
    
    /**
     * 所有方式
     * @return
     */
    List<JumpDetailV2> listJump();
    /**
     * 根据主键批量删除
     * @param list
     * @return
     */
    int deleteBatchByPrimaryKey(List<Long> list);
    /**
     * 后端列表查询
     * @param start
     * @param count
     * @param key
     * @return
     */
    List<JumpDetailV2> listQuery(@Param("start") long start, @Param("count") int count, @Param("key") String key);
    long countListQuery(@Param("key") String key);
    
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/help/AppPageNotificationMapper.java
@@ -1,5 +1,9 @@
package com.yeshi.fanli.dao.mybatis.help;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.entity.bus.help.AppPageNotification;
public interface AppPageNotificationMapper {
@@ -23,4 +27,20 @@
    int updateByPrimaryKeySelective(AppPageNotification record);
    int updateByPrimaryKey(AppPageNotification record);
    /**
     * 根据主键批量删除
     * @param list
     * @return
     */
    int deleteBatchByPrimaryKey(List<Long> list);
    /**
     * 后端列表查询
     * @return
     */
    List<AppPageNotification> listQuery(@Param("start") long start, @Param("count") int count,
            @Param("key") String key, @Param("show") Integer show, @Param("canClose") Integer canClose);
    long countQuery(@Param("key") String key,@Param("show") Integer show, @Param("canClose") Integer canClose);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/HomeNavbarMapper.java
@@ -1,5 +1,9 @@
package com.yeshi.fanli.dao.mybatis.homemodule;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar;
public interface HomeNavbarMapper {
@@ -15,4 +19,37 @@
    int updateByPrimaryKeySelective(HomeNavbar record);
    int updateByPrimaryKey(HomeNavbar record);
    /**
     * 根据主键批量删除
     * @param list
     * @return
     */
    int deleteBatchByPrimaryKey(List<Long> list);
    /**
     * 获取最大的排序值
     * @param card
     * @return
     */
    int getMaxOrder();
    /**
     * 查询交换排序对象
     * @param type
     * @param order 排序值
     * @return
     */
    List<HomeNavbar> getChangeOrder(@Param("type") Integer type, @Param("order") Integer order);
    /**
     * 后端列表查询
     * @param start
     * @param count
     * @param key
     * @return
     */
    List<HomeNavbar> listQuery(@Param("start") long start, @Param("count") int count, @Param("key") String key);
    long countListQuery(@Param("key") String key);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/SpecialCardMapper.java
@@ -1,5 +1,9 @@
package com.yeshi.fanli.dao.mybatis.homemodule;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.entity.bus.homemodule.SpecialCard;
public interface SpecialCardMapper {
@@ -15,4 +19,15 @@
    int updateByPrimaryKeySelective(SpecialCard record);
    int updateByPrimaryKey(SpecialCard record);
    int deleteBatchByPrimaryKey(List<Long> list);
    List<SpecialCard> listQuery(@Param("start") long start, @Param("count") int count, @Param("key") String key,
             @Param("sort") Integer sort);
    long countlistQuery(@Param("key") String key);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/SpecialMapper.java
@@ -1,5 +1,9 @@
package com.yeshi.fanli.dao.mybatis.homemodule;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.entity.bus.homemodule.Special;
public interface SpecialMapper {
@@ -15,4 +19,53 @@
    int updateByPrimaryKeySelective(Special record);
    int updateByPrimaryKey(Special record);
    int deleteBatchByPrimaryKey(List<Long> list);
    int deleteBatchByCardID(List<Long> list);
    /**
     * 批量查询id
     * @param list
     * @return
     */
    List<Special> queryByListPrimaryKey(List<Long> list);
    /**
     * 批量查询CardID
     * @param list
     * @return
     */
    List<Special> queryByListCardID(List<Long> list);
    /**
     * 查询需替换顺序数据
     * @param cardId
     * @param type
     * @param order
     * @return
     */
    List<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,
            @Param("cardId") Long card, @Param("key") String key);
    long countlistQueryByCard(@Param("cardId") Long card, @Param("key") String key);
    /**
     * 获取最大的排序值
     * @param card
     * @return
     */
    int getMaxOrderByCard(@Param("cardId") Long card);
    /**
     * 根据标识、系统查询启用专题
     * @param card
     * @param systemId
     * @return
     */
    List<Special> listBySystemAndCard(@Param("card") String card, @Param("systemId") Long systemId);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/SuperHomeNavbarMapper.java
@@ -28,4 +28,33 @@
    List<SuperHomeNavbar> listBySystem(@Param("systemId") Long systemId);
    
    
    /**
     * 根据导航栏id 批量查询
     * @param list
     * @return
     */
    List<SuperHomeNavbar> listByNavbarIds(List<Long> list);
    /**
     * 根据导航栏id 批量删除
     * @param list
     * @return
     */
    int deleteBatchByNavbarIds(List<Long> list);
    /**
     * 根据系统id+导航id查询
     * @param systemId 系统id
     * @return
     */
    List<SuperHomeNavbar> querybyNavbarId(@Param("navbarId") Long navbarId,@Param("systemId") Long systemId);
    /**
     * 根据系统id+导航id 删除
     * @param systemId 系统id
     * @return
     */
    int deletebyNavbarId(@Param("navbarId") Long navbarId,@Param("systemId") Long systemId);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/homemodule/SuperSpecialCardMapper.java
New file
@@ -0,0 +1,30 @@
package com.yeshi.fanli.dao.mybatis.homemodule;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.entity.bus.homemodule.SuperSpecialCard;
public interface SuperSpecialCardMapper {
    int deleteByPrimaryKey(Long id);
    int insert(SuperSpecialCard record);
    int insertSelective(SuperSpecialCard record);
    SuperSpecialCard selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(SuperSpecialCard record);
    int updateByPrimaryKey(SuperSpecialCard record);
    List<SuperSpecialCard> listByCardIDs(List<Long> list);
    int deleteBatchByCardId(List<Long> list);
    void deletebyCardIdAndSystemId(@Param("cardId") Long cardId, @Param("systemId") Long systemId);
    List<SuperSpecialCard> querybyCardIdAndSystemId(@Param("cardId") Long cardId, @Param("systemId") Long systemId);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/lable/QualityFactoryMapper.java
@@ -337,8 +337,17 @@
    List<QualityFactory> listRecommendBykey(@Param("start") long start, @Param("count") int count, 
            @Param("key") String key,@Param("hasQuan") Integer hasQuan,  @Param("userType") Integer userType,
            @Param("startprice") Double startprice, @Param("endprice") Double endprice,
            @Param("startTkRate") Double startTkRate, @Param("endTkRate") Double endTkRate,
            @Param("sort") Integer sort);
    
    long countRecommendBykey(@Param("key") String key, @Param("hasQuan") Integer hasQuan,  
            @Param("userType") Integer userType,@Param("startprice") Double startprice, @Param("endprice") Double endprice);
            @Param("userType") Integer userType,@Param("startprice") Double startprice,
            @Param("endprice") Double endprice,@Param("startTkRate") Double startTkRate,
            @Param("endTkRate") Double endTkRate);
    List<QualityFactory> listQueryBylabIDs(@Param("start") long start, @Param("count") int count,
            @Param("list") List<Long> list, @Param("gid") Long gid,@Param("systemCid") Long systemCid);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/monitor/ClientAPIMonitorMapper.java
New file
@@ -0,0 +1,18 @@
package com.yeshi.fanli.dao.mybatis.monitor;
import com.yeshi.fanli.entity.monitor.ClientAPIMonitor;
public interface ClientAPIMonitorMapper {
    int deleteByPrimaryKey(Long id);
    int insert(ClientAPIMonitor record);
    int insertSelective(ClientAPIMonitor record);
    ClientAPIMonitor selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(ClientAPIMonitor record);
    int updateByPrimaryKey(ClientAPIMonitor record);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/order/LostOrderMapper.java
New file
@@ -0,0 +1,40 @@
package com.yeshi.fanli.dao.mybatis.order;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.entity.bus.user.LostOrder;
public interface LostOrderMapper {
    int updateByPrimaryKeySelective(LostOrder record);
    /**
     * 通过订单号查询丢失订单
     *
     * @param orderId
     * @return
     */
    List<LostOrder> selectByOrderId(String orderId);
    /**
     * 统计用户申诉次数
     * @param uid
     * @return
     */
    Map<String, Object> countByUid(@Param("uid") Long uid);
    /**
     * 后端列表查询
     * @param start
     * @param count
     * @param key
     * @return
     */
    List<LostOrder> listQuery(@Param("start") long start, @Param("count") int count, @Param("key") String key,
            @Param("state") Integer state, @Param("handleType") Integer handleType);
    long countQuery(@Param("key") String key, @Param("state") Integer state, @Param("handleType") Integer handleType);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/push/DeviceTokenIOSMapper.java
@@ -18,6 +18,8 @@
    DeviceTokenIOS selectByDevice(String device);
    
    DeviceTokenIOS selectByDeviceToken(String deviceToken);
    List<DeviceTokenIOS> selectByUid(Long uid);
    
    List<DeviceTokenIOS> selectList(@Param("start")Long start,@Param("count")int count);
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/ShamUserMapper.java
@@ -31,4 +31,7 @@
    
    List<ShamUser> listByDistinctPicUrl(@Param("start")long start, @Param("count")int count);
    
    // 随机取出数据
    List<ShamUser> listRand(@Param("count") int count);
}
fanli/src/main/java/com/yeshi/fanli/entity/AppVersionInfo.java
New file
@@ -0,0 +1,80 @@
package com.yeshi.fanli.entity;
import java.util.Date;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
/**
 * APP端版本号记录
 *
 * @author Administrator
 *
 */
@Table("yeshi_ec_app_version_code_map")
public class AppVersionInfo {
    public final static String PLATFORM_ANDROID = "android";
    public final static String PLATFORM_IOS = "ios";
    @Column(name = "avcm_id")
    private Long id;
    @Column(name = "avcm_platform")
    private String platform;
    @Column(name = "avcm_version")
    private String version;
    @Column(name = "avcm_version_code")
    private Integer versionCode;
    @Column(name = "avcm_createtime")
    private Date createTime;
    @Column(name = "avcm_updatetime")
    private Date updateTime;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getPlatform() {
        return platform;
    }
    public void setPlatform(String platform) {
        this.platform = platform;
    }
    public String getVersion() {
        return version;
    }
    public void setVersion(String version) {
        this.version = version;
    }
    public Integer getVersionCode() {
        return versionCode;
    }
    public void setVersionCode(Integer versionCode) {
        this.versionCode = versionCode;
    }
    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/GoodsSourceTypeEnum.java
New file
@@ -0,0 +1,14 @@
package com.yeshi.fanli.entity.bus;
public enum GoodsSourceTypeEnum {
    tb("淘宝"), jd("京东");
    private final String desc;
    private GoodsSourceTypeEnum(String desc) {
        this.desc = desc;
    }
    public String getDesc() {
        return desc;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/help/AppPageNotification.java
@@ -3,7 +3,10 @@
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Transient;
import com.google.gson.annotations.Expose;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
@@ -26,7 +29,7 @@
                "资金"), accountDetail("账户明细"), extract("提现"), orderFanli("返利订单"),orderTiCheng("提成订单"),orderTaoBao("淘宝订单"), coollect("收藏"), scanHistory("足迹"), team(
                        "队员"), kefu("联系客服"), taoBaoShoppingCart("淘宝购物车"), orderFind("订单申诉"), msgCenter("消息中心");
        private final String desc;
        private AppPageNotificationTypeEnum(String desc) {
            this.desc = desc;
        }
@@ -63,6 +66,9 @@
    @Column(name = "an_updatetime")
    private Date updateTime;// 更新时间
    @Transient // 页面名称
    private String pageName;
    public Long getId() {
        return id;
    }
@@ -135,4 +141,12 @@
        this.updateTime = updateTime;
    }
    public String getPageName() {
        return pageName;
    }
    public void setPageName(String pageName) {
        this.pageName = pageName;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/HomeNavbar.java
@@ -2,6 +2,7 @@
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
@@ -10,6 +11,7 @@
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Table;
import javax.persistence.Transient;
/**
 * 导航管理
@@ -86,6 +88,9 @@
    @JoinColumn(name = "br_updatetime")
    @org.yeshi.utils.mybatis.Column(name = "br_updatetime")
    private Date updatetime;
    @Transient // 系统关联列表
    private List<com.yeshi.fanli.entity.system.System> systemList;
    public Long getId() {
        return id;
@@ -159,4 +164,12 @@
        this.updatetime = updatetime;
    }
    public List<com.yeshi.fanli.entity.system.System> getSystemList() {
        return systemList;
    }
    public void setSystemList(List<com.yeshi.fanli.entity.system.System> systemList) {
        this.systemList = systemList;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/Special.java
@@ -45,12 +45,18 @@
    @org.yeshi.utils.mybatis.Column(name = "b_card")
    private String card;
    // Android链接
    // 标识管理id
    @JoinColumn(name = "b_card_id")
    @org.yeshi.utils.mybatis.Column(name = "b_card_id")
    private Long cardId;
    // 主图
    @JoinColumn(name = "b_main_picture")
    @org.yeshi.utils.mybatis.Column(name = "b_main_picture")
    private String picture;
    // IOS跳转链接
    // 附图
    @JoinColumn(name = "b_sub_picture")
    @org.yeshi.utils.mybatis.Column(name = "b_sub_picture")
    private String subPicture;
@@ -71,6 +77,21 @@
    @org.yeshi.utils.mybatis.Column(name = "b_orderby")
    private Integer orderby;
    // 状态
    @JoinColumn(name = "b_state")
    @org.yeshi.utils.mybatis.Column(name = "b_state")
    private Long state;
    // 显示类型
    @JoinColumn(name = "b_show_type")
    @org.yeshi.utils.mybatis.Column(name = "b_show_type")
    private String showType;
    // 备注
    @JoinColumn(name = "b_remark")
    @org.yeshi.utils.mybatis.Column(name = "b_remark")
    private String remark;
    // 创建时间
    @JoinColumn(name = "b_createtime")
    @org.yeshi.utils.mybatis.Column(name = "b_createtime")
@@ -163,4 +184,36 @@
        this.updatetime = updatetime;
    }
    public Long getCardId() {
        return cardId;
    }
    public void setCardId(Long cardId) {
        this.cardId = cardId;
    }
    public Long getState() {
        return state;
    }
    public void setState(Long state) {
        this.state = state;
    }
    public String getShowType() {
        return showType;
    }
    public void setShowType(String showType) {
        this.showType = showType;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/SpecialCard.java
@@ -2,6 +2,7 @@
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
@@ -10,6 +11,7 @@
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Table;
import javax.persistence.Transient;
/**
 * 专题标识管理
@@ -42,6 +44,11 @@
    @org.yeshi.utils.mybatis.Column(name = "cd_card")
    private String card; 
    
    // 匹配标识
    @JoinColumn(name = "cd_state")
    @org.yeshi.utils.mybatis.Column(name = "cd_state")
    private Integer state;
    // 创建时间
    @JoinColumn(name = "cd_createtime")
    @org.yeshi.utils.mybatis.Column(name = "cd_createtime")
@@ -51,6 +58,13 @@
    @JoinColumn(name = "cd_updatetime")
    @org.yeshi.utils.mybatis.Column(name = "cd_updatetime")
    private Date updatetime;
    @Transient
    private Long totalSpecial;
    @Transient // 系统关联列表
    private List<com.yeshi.fanli.entity.system.System> systemList;
    
    public Long getId() {
@@ -91,6 +105,30 @@
    public void setUpdatetime(Date updatetime) {
        this.updatetime = updatetime;
    }
    public List<com.yeshi.fanli.entity.system.System> getSystemList() {
        return systemList;
    }
    public void setSystemList(List<com.yeshi.fanli.entity.system.System> systemList) {
        this.systemList = systemList;
    }
    public Long getTotalSpecial() {
        return totalSpecial;
    }
    public void setTotalSpecial(Long totalSpecial) {
        this.totalSpecial = totalSpecial;
    }
    public Integer getState() {
        return state;
    }
    public void setState(Integer state) {
        this.state = state;
    } 
    
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/SuperSpecialCard.java
New file
@@ -0,0 +1,74 @@
package com.yeshi.fanli.entity.bus.homemodule;
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 com.yeshi.fanli.entity.system.System;
/**
 * 专题对应启用系统
 *
 * @author yj
 *
 * @date 2018年11月08日
 */
@Entity
@Table(name = "yeshi_ec_super_special_card")
@org.yeshi.utils.mybatis.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")
    private SpecialCard specialCard;
    // 系统
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "sp_system_id")
    @org.yeshi.utils.mybatis.Column(name = "sp_system_id")
    private System system;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public SpecialCard getSpecialCard() {
        return specialCard;
    }
    public void setSpecialCard(SpecialCard specialCard) {
        this.specialCard = specialCard;
    }
    public System getSystem() {
        return system;
    }
    public void setSystem(System system) {
        this.system = system;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/SwiperPicture.java
@@ -3,70 +3,69 @@
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;
/**
 *  轮播图
 *
 * @author yj
 *
 * @date 2018年10月15日
 */
import com.yeshi.fanli.entity.common.JumpDetailV2;
@Entity
@Table(name = "yeshi_ec_swiper_banner_picture")
@org.yeshi.utils.mybatis.Table("yeshi_ec_swiper_banner_picture")
public class SwiperPicture implements Serializable{
    private static final long serialVersionUID = 1L;
public class SwiperPicture implements Serializable {
    
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "pic_id")
    @javax.persistence.Column(name = "pic_id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    @org.yeshi.utils.mybatis.Column(name = "pic_id")
    private Long id;
    @JoinColumn(name = "pic_banner_id")
    @org.yeshi.utils.mybatis.Column(name = "pic_banner_id")
    private Long bannerId;// 管理id
    private Long bannerId;
    @JoinColumn(name = "pic_src")
    @org.yeshi.utils.mybatis.Column(name = "pic_src")
    private String src;// 图片地址
    private String src;
    @JoinColumn(name = "pic_link")
    @org.yeshi.utils.mybatis.Column(name = "pic_link")
    private String link; // 跳转地址
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "pic_jumpid")
    @org.yeshi.utils.mybatis.Column(name = "pic_jumpid")
    private JumpDetailV2 jumpDetail;
    @JoinColumn(name = "pic_params")
    @org.yeshi.utils.mybatis.Column(name = "pic_params")
    private String params;
    @JoinColumn(name = "pic_order")
    @org.yeshi.utils.mybatis.Column(name = "pic_order")
    private Integer order; // 排序
    private Integer order;
    @JoinColumn(name = "pic_remark")
    @org.yeshi.utils.mybatis.Column(name = "pic_remark")
    private String remark; // 备注
    private String remark;
    @JoinColumn(name = "pic_state")
    @org.yeshi.utils.mybatis.Column(name = "pic_state")
    private Integer state; // 状态: 1 停用  0启用
    private Integer state;
    @JoinColumn(name = "pic_createtime")
    @org.yeshi.utils.mybatis.Column(name = "pic_createtime")
    private Date createtime; // 创建时间
    private Date createtime;
    @JoinColumn(name = "pic_updatetime")
    @org.yeshi.utils.mybatis.Column(name = "pic_updatetime")
    private Date updatetime; // 更新时间(修改时间)
    private Date updatetime;
    public Long getId() {
        return id;
        return this.id;
    }
    public void setId(Long id) {
@@ -74,7 +73,7 @@
    }
    public Long getBannerId() {
        return bannerId;
        return this.bannerId;
    }
    public void setBannerId(Long bannerId) {
@@ -82,23 +81,15 @@
    }
    public String getSrc() {
        return src;
        return this.src;
    }
    public void setSrc(String src) {
        this.src = src;
    }
    public String getLink() {
        return link;
    }
    public void setLink(String link) {
        this.link = link;
    }
    public String getRemark() {
        return remark;
        return this.remark;
    }
    public void setRemark(String remark) {
@@ -106,7 +97,7 @@
    }
    public Integer getState() {
        return state;
        return this.state;
    }
    public void setState(Integer state) {
@@ -114,7 +105,7 @@
    }
    public Date getCreatetime() {
        return createtime;
        return this.createtime;
    }
    public void setCreatetime(Date createtime) {
@@ -122,7 +113,7 @@
    }
    public Date getUpdatetime() {
        return updatetime;
        return this.updatetime;
    }
    public void setUpdatetime(Date updatetime) {
@@ -130,11 +121,26 @@
    }
    public Integer getOrder() {
        return order;
        return this.order;
    }
    public void setOrder(Integer order) {
        this.order = order;
    }
}
    public JumpDetailV2 getJumpDetail() {
        return this.jumpDetail;
    }
    public void setJumpDetail(JumpDetailV2 jumpDetail) {
        this.jumpDetail = jumpDetail;
    }
    public String getParams() {
        return this.params;
    }
    public void setParams(String params) {
        this.params = params;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/content/MsgMoneyHongBaoMap.java
New file
@@ -0,0 +1,39 @@
package com.yeshi.fanli.entity.bus.msg.content;
import com.yeshi.fanli.entity.bus.user.HongBao;
/**
 * 奖金到账,返利到账消息和红包的映射
 *
 * @author Administrator
 *
 */
public class MsgMoneyHongBaoMap {
    private Long id;
    private HongBao hongBao;
    private MsgTypeMoney msgTypeMoney;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public HongBao getHongBao() {
        return hongBao;
    }
    public void setHongBao(HongBao hongBao) {
        this.hongBao = hongBao;
    }
    public MsgTypeMoney getMsgTypeMoney() {
        return msgTypeMoney;
    }
    public void setMsgTypeMoney(MsgTypeMoney msgTypeMoney) {
        this.msgTypeMoney = msgTypeMoney;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/content/MsgTypeInvite.java
New file
@@ -0,0 +1,120 @@
package com.yeshi.fanli.entity.bus.msg.content;
import java.util.Date;
import com.yeshi.fanli.entity.bus.user.ThreeSale;
import com.yeshi.fanli.entity.bus.user.UserInfo;
/***
 * 邀请消息
 *
 * @author Administrator
 *
 */
public class MsgTypeInvite {
    public enum MsgTypeInviteEnumType {
        invite("邀请消息"), welcome("新人欢迎");
        private final String desc;
        private MsgTypeInviteEnumType(String desc) {
            this.desc = desc;
        }
        public String getDesc() {
            return desc;
        }
    }
    private Long id;
    private UserInfo user;
    private MsgTypeInviteEnumType msgType;// 消息类型
    private String welcomeContent;// 欢迎用语
    private ThreeSale inviteUser;// 邀请信息
    private String desc;// 说明
    private String beiZhu;// 备注
    private Boolean read;// 是否已读
    private Date createTime;
    private Date updateTime;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public UserInfo getUser() {
        return user;
    }
    public void setUser(UserInfo user) {
        this.user = user;
    }
    public MsgTypeInviteEnumType getMsgType() {
        return msgType;
    }
    public void setMsgType(MsgTypeInviteEnumType msgType) {
        this.msgType = msgType;
    }
    public String getWelcomeContent() {
        return welcomeContent;
    }
    public void setWelcomeContent(String welcomeContent) {
        this.welcomeContent = welcomeContent;
    }
    public ThreeSale getInviteUser() {
        return inviteUser;
    }
    public void setInviteUser(ThreeSale inviteUser) {
        this.inviteUser = inviteUser;
    }
    public String getDesc() {
        return desc;
    }
    public void setDesc(String desc) {
        this.desc = desc;
    }
    public String getBeiZhu() {
        return beiZhu;
    }
    public void setBeiZhu(String beiZhu) {
        this.beiZhu = beiZhu;
    }
    public Boolean getRead() {
        return read;
    }
    public void setRead(Boolean read) {
        this.read = read;
    }
    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/msg/content/MsgTypeMoney.java
New file
@@ -0,0 +1,157 @@
package com.yeshi.fanli.entity.bus.msg.content;
import java.math.BigDecimal;
import java.util.Date;
import com.yeshi.fanli.entity.bus.GoodsSourceTypeEnum;
import com.yeshi.fanli.entity.bus.user.Extract;
import com.yeshi.fanli.entity.bus.user.UserInfo;
/**
 * 奖金到账记录
 *
 * @author Administrator
 *
 */
public class MsgTypeMoney {
    public enum MsgTypeMoneyEnumType {
        extract("提现"), shareMoney("奖金到账"), fanLiMoney("返利到账");
        private final String desc;
        private MsgTypeMoneyEnumType(String desc) {
            this.desc = desc;
        }
        public String getDesc() {
            return desc;
        }
    }
    private Long id;
    private UserInfo user;
    private MsgTypeMoneyEnumType msgType;// 消息类型
    private Integer orderCount;// 订单数(奖金适用)
    private Integer goodsCount;
    private String orderId;// 订单号(返利适用)
    private GoodsSourceTypeEnum sourceType;// 产生订单的商品来源类型
    private Extract extract;// 提现详情
    private BigDecimal money;// 到账资金
    private BigDecimal balance;// 账户余额
    private String beiZhu;// 备注
    private Date createTime;
    private Date updateTime;
    private Boolean read;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public UserInfo getUser() {
        return user;
    }
    public void setUser(UserInfo user) {
        this.user = user;
    }
    public MsgTypeMoneyEnumType getMsgType() {
        return msgType;
    }
    public void setMsgType(MsgTypeMoneyEnumType msgType) {
        this.msgType = msgType;
    }
    public Integer getOrderCount() {
        return orderCount;
    }
    public void setOrderCount(Integer orderCount) {
        this.orderCount = orderCount;
    }
    public Integer getGoodsCount() {
        return goodsCount;
    }
    public void setGoodsCount(Integer goodsCount) {
        this.goodsCount = goodsCount;
    }
    public String getOrderId() {
        return orderId;
    }
    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }
    public GoodsSourceTypeEnum getSourceType() {
        return sourceType;
    }
    public void setSourceType(GoodsSourceTypeEnum sourceType) {
        this.sourceType = sourceType;
    }
    public Extract getExtract() {
        return extract;
    }
    public void setExtract(Extract extract) {
        this.extract = extract;
    }
    public BigDecimal getMoney() {
        return money;
    }
    public void setMoney(BigDecimal money) {
        this.money = money;
    }
    public BigDecimal getBalance() {
        return balance;
    }
    public void setBalance(BigDecimal balance) {
        this.balance = balance;
    }
    public String getBeiZhu() {
        return beiZhu;
    }
    public void setBeiZhu(String beiZhu) {
        this.beiZhu = beiZhu;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    public Boolean getRead() {
        return read;
    }
    public void setRead(Boolean read) {
        this.read = read;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/search/HotSearch.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.entity.bus.search;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
@@ -8,39 +9,45 @@
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
@Entity
@Table(name = "yeshi_ec_hot_search")
public class HotSearch implements Serializable{
public class HotSearch implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id")
    private Long id;
    @Column(name="`orderby`")
    @Column(name = "`orderby`")
    private Integer orderby;
    @Column(name="`name`")
    @Column(name = "`name`")
    private String name;
    private Long createtime;
    @Transient
    // 系统关联列表
    private List<com.yeshi.fanli.entity.system.System> systemList;
    public HotSearch() {
    }
    public HotSearch(Long id) {
        super();
        this.id = id;
    }
    public HotSearch(Integer orderby, String name) {
        super();
        this.orderby = orderby;
        this.name = name;
    }
    public Long getCreatetime() {
        return createtime;
    }
    public void setCreatetime(Long createtime) {
        this.createtime = createtime;
    }
@@ -48,20 +55,33 @@
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public Integer getOrderby() {
        return orderby;
    }
    public void setOrderby(Integer orderby) {
        this.orderby = orderby;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public List<com.yeshi.fanli.entity.system.System> getSystemList() {
        return systemList;
    }
    public void setSystemList(List<com.yeshi.fanli.entity.system.System> systemList) {
        this.systemList = systemList;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/LostOrder.java
@@ -7,47 +7,88 @@
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.yeshi.utils.mybatis.Column;
import com.google.gson.annotations.Expose;
/**
 * 丢失订单
 *
 * @author cxx
 *
 * @date 2018年1月29日
 */
@Entity
@Table(name="yeshi_ec_lost_order")
@Table(name = "yeshi_ec_lost_order")
@org.yeshi.utils.mybatis.Table("yeshi_ec_lost_order")
public class LostOrder {
    public final static int RESULT_CODE_VERFING = 1;// 审核中
    public final static int RESULT_CODE_SUCCESS = 2;// 成功
    public final static int RESULT_CODE_FAIL = 3;// 失败(通过后3日未处理成功则判断为失败)
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Expose
    @Column(name="id")
    private Long id;
    @Expose
    private String orderId;//订单号
    @Column(name="orderId")
    private String orderId;// 订单号
    @Column(name="type")
    @Expose
    private Integer type;//订单类型
    private Integer type;// 订单类型 1-淘宝订单
    @Column(name="state")
    @Expose
    private Integer state;//订单状态 0:审核 1:通过 2:拒绝
    private Integer state;// 订单状态 0:审核 1:通过 2:拒绝
    @Column(name="createTime")
    @Expose
    private Long createTime;
    @Column(name="handleTime")
    @Expose
    private Long handleTime;
    @Column(name="uid")
    @ManyToOne
    @JoinColumn(name="uid")
    @JoinColumn(name = "uid")
    @Expose
    private UserInfo userInfo;
    @Column(name="oid")
    @ManyToOne
    @JoinColumn(name="oid")
    @JoinColumn(name = "oid")
    @Expose
    private Order order;
    @Column(name="remake")
    @Expose
    private String remake;
    @Column(name="judge")
    @Expose
    private String judge;//系统判定:如果用户在本系统购买并成功上传过订单,且上传的丢失订单后6为相同的话,那么系统判定为匹配
    private String judge;// 系统判定:如果用户在本系统购买并成功上传过订单,且上传的丢失订单后6位相同的话,那么系统判定为匹配
    @Column(name="result_code")
    @javax.persistence.Column(name="result_code")
    @Expose
    private Integer resultCode;// 第三方平台订单爬取结果
    @Transient
    private Integer total;
    @Transient
    private Integer totalPass;
    @Transient
    private Integer totalReject;
    
    public Integer getResultCode() {
        return resultCode;
    }
    public void setResultCode(Integer resultCode) {
        this.resultCode = resultCode;
    }
    public Long getId() {
        return id;
    }
@@ -55,7 +96,7 @@
    public void setId(Long id) {
        this.id = id;
    }
    public String getRemake() {
        return remake;
    }
@@ -63,7 +104,7 @@
    public void setRemake(String remake) {
        this.remake = remake;
    }
    public String getJudge() {
        return judge;
    }
@@ -127,6 +168,29 @@
    public void setOrder(Order order) {
        this.order = order;
    }
    public Integer getTotal() {
        return total;
    }
    public void setTotal(Integer total) {
        this.total = total;
    }
    public Integer getTotalPass() {
        return totalPass;
    }
    public void setTotalPass(Integer totalPass) {
        this.totalPass = totalPass;
    }
    public Integer getTotalReject() {
        return totalReject;
    }
    public void setTotalReject(Integer totalReject) {
        this.totalReject = totalReject;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/ShamUser.java
@@ -6,21 +6,36 @@
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
//假用户
@Entity
@Table(name="yeshi_ec_sham_user")//@com.yeshi.utils.mybatis.Table("yeshi_ec_demouser")
@Table(name = "yeshi_ec_sham_user")
@org.yeshi.utils.mybatis.Table("yeshi_ec_sham_user")
public class ShamUser {
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    @Column(name="`id`")
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "`id`")
    private long id;
    @Column(name="`name`")
    @Column(name = "`name`")
    private String name;
    @Column(name = "`picUrl`")
    private String picUrl;
    @Transient
    private String msg;
    @Transient
    private String showId;
    @Transient
    private String shareBonusPic;
    public ShamUser() {
    }
    public ShamUser(long id) {
        super();
        this.id = id;
@@ -29,20 +44,49 @@
    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 getPicUrl() {
        return picUrl;
    }
    public void setPicUrl(String picUrl) {
        this.picUrl = picUrl;
    }
    public String getMsg() {
        return msg;
    }
    public void setMsg(String msg) {
        this.msg = msg;
    }
    public String getShowId() {
        return showId;
    }
    public void setShowId(String showId) {
        this.showId = showId;
    }
    public String getShareBonusPic() {
        return shareBonusPic;
    }
    public void setShareBonusPic(String shareBonusPic) {
        this.shareBonusPic = shareBonusPic;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/monitor/ClientAPIMonitor.java
New file
@@ -0,0 +1,90 @@
package com.yeshi.fanli.entity.monitor;
import java.util.Date;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
@Table("yeshi_ec_monitor_client_api")
public class ClientAPIMonitor {
    @Column(name = "mca_id")
    private Long id;
    @Column(name = "mca_url")
    private String url;
    @Column(name = "mca_ip")
    private String ip;
    @Column(name = "mca_request_data")
    private String requestData;
    @Column(name = "mca_code")
    private Integer code;
    @Column(name = "mca_time")
    private Integer time;
    @Column(name = "mca_createtime")
    private Date createTime;
    @Column(name = "mca_beizhu")
    private String beiZhu;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    public String getIp() {
        return ip;
    }
    public void setIp(String ip) {
        this.ip = ip;
    }
    public String getRequestData() {
        return requestData;
    }
    public void setRequestData(String requestData) {
        this.requestData = requestData;
    }
    public Integer getCode() {
        return code;
    }
    public void setCode(Integer code) {
        this.code = code;
    }
    public Integer getTime() {
        return time;
    }
    public void setTime(Integer time) {
        this.time = time;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getBeiZhu() {
        return beiZhu;
    }
    public void setBeiZhu(String beiZhu) {
        this.beiZhu = beiZhu;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/push/DeviceTokenIOS.java
@@ -25,6 +25,9 @@
    @Column(name = "device_token")
    private String deviceToken;
    @Column(name = "device_token_md5")
    private String deviceTokenMd5;
    @Column(name = "device")
    private String device;
@@ -46,6 +49,14 @@
        this.id = id;
    }
    public String getDeviceTokenMd5() {
        return deviceTokenMd5;
    }
    public void setDeviceTokenMd5(String deviceTokenMd5) {
        this.deviceTokenMd5 = deviceTokenMd5;
    }
    public Long getUid() {
        return uid;
    }
fanli/src/main/java/com/yeshi/fanli/entity/taobao/SearchFilter.java
@@ -36,6 +36,13 @@
    private int endTkRate;
    // 淘客佣金比率下限,如:1234表示12.34%
    private int startTkRate;
    //     KA媒体淘客佣金比率上限,如:1234表示12.34%
    private int endKaTkRate;
    //     KA媒体淘客佣金比率下限,如:1234表示12.34%
    private int startKaTkRate;
    // 1-有券 0-无券
    private int quan;
    
@@ -320,4 +327,20 @@
        this.materialId = materialId;
    }
    public int getEndKaTkRate() {
        return endKaTkRate;
    }
    public void setEndKaTkRate(int endKaTkRate) {
        this.endKaTkRate = endKaTkRate;
    }
    public int getStartKaTkRate() {
        return startKaTkRate;
    }
    public void setStartKaTkRate(int startKaTkRate) {
        this.startKaTkRate = startKaTkRate;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/taobao/TaoBaoGoodsBriefExtra.java
@@ -21,8 +21,7 @@
    @Expose
    private String tbToken;
    @Expose
    private int collected; // 0-没有收藏    1-已收藏
    private int collected; // 0-没有收藏 1-已收藏
    public String getTbToken() {
        return tbToken;
@@ -88,5 +87,4 @@
        this.collected = collected;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/taobao/TaoBaoShopInfo.java
@@ -19,6 +19,9 @@
    private String sellerNick;// 卖家昵称
    private String pictureUrl;// 店铺图标
    private String shopUrl;// 店铺地址
    private String userType;// 店铺类型  1-天猫  0-淘宝()
    public TaoBaoShopInfo() {
@@ -83,4 +86,12 @@
        this.shopUrl = shopUrl;
    }
    public String getUserType() {
        return userType;
    }
    public void setUserType(String userType) {
        this.userType = userType;
    }
}
fanli/src/main/java/com/yeshi/fanli/job/UpdateOrderJob.java
@@ -19,6 +19,7 @@
import com.yeshi.fanli.service.inter.common.DataMonitorService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoService;
import com.yeshi.fanli.service.inter.hongbao.ThreeSaleGiftService;
import com.yeshi.fanli.service.inter.order.LostOrderService;
import com.yeshi.fanli.service.inter.order.OrderItemServcie;
import com.yeshi.fanli.service.inter.order.OrderProcessService;
import com.yeshi.fanli.service.inter.order.PidOrderService;
@@ -73,6 +74,9 @@
    @Resource
    private RedisManager redisManager;
    @Resource
    private LostOrderService lostOrderService;
    private void updateOrder(long startTime, long endTime) {
        List<TaoBaoUnionConfig> configList = taoBaoUnionConfigService.getConfigByTypeCache(PidUser.TYPE_FANLI_ANDROID);
@@ -258,4 +262,10 @@
        pidOrderService.doPidOrder();
    }
    // 每6个小时执行一次
    @Scheduled(cron = "0 0 0/6 * * ? ")
    public void doLostOrder() {
        lostOrderService.processFail();
    }
}
fanli/src/main/java/com/yeshi/fanli/mapping/AppVersionInfoMapper.xml
New file
@@ -0,0 +1,89 @@
<?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.AppVersionInfoMapper">
    <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.AppVersionInfo">
        <id column="avcm_id" property="id" jdbcType="BIGINT" />
        <result column="avcm_platform" property="platform" jdbcType="VARCHAR" />
        <result column="avcm_version" property="version" jdbcType="VARCHAR" />
        <result column="avcm_version_code" property="versionCode"
            jdbcType="INTEGER" />
        <result column="avcm_createtime" property="createTime"
            jdbcType="TIMESTAMP" />
        <result column="avcm_updatetime" property="updateTime"
            jdbcType="TIMESTAMP" />
    </resultMap>
    <sql id="Base_Column_List">avcm_id,avcm_platform,avcm_version,avcm_version_code,avcm_createtime,avcm_updatetime</sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_app_version_code_map where avcm_id =
        #{id,jdbcType=BIGINT}
    </select>
    <select id="selectByPlatform" resultMap="BaseResultMap"
        parameterType="java.lang.String">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_app_version_code_map where avcm_platform =
        #{0}
    </select>
    <select id="selectByPlatformAndVersionCode" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_app_version_code_map where avcm_platform =
        #{platform}
        and avcm_version_code=#{versionCode}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_app_version_code_map where avcm_id = #{id,jdbcType=BIGINT}</delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.AppVersionInfo"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_app_version_code_map
        (avcm_id,avcm_platform,avcm_version,avcm_version_code,avcm_createtime,avcm_updatetime)
        values
        (#{id,jdbcType=BIGINT},#{platform,jdbcType=VARCHAR},#{version,jdbcType=VARCHAR},#{versionCode,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.AppVersionInfo"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_app_version_code_map
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">avcm_id,</if>
            <if test="platform != null">avcm_platform,</if>
            <if test="version != null">avcm_version,</if>
            <if test="versionCode != null">avcm_version_code,</if>
            <if test="createTime != null">avcm_createtime,</if>
            <if test="updateTime != null">avcm_updatetime,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="platform != null">#{platform,jdbcType=VARCHAR},</if>
            <if test="version != null">#{version,jdbcType=VARCHAR},</if>
            <if test="versionCode != null">#{versionCode,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.AppVersionInfo">update
        yeshi_ec_app_version_code_map set avcm_platform =
        #{platform,jdbcType=VARCHAR},avcm_version =
        #{version,jdbcType=VARCHAR},avcm_version_code =
        #{versionCode,jdbcType=INTEGER},avcm_createtime =
        #{createTime,jdbcType=TIMESTAMP},avcm_updatetime =
        #{updateTime,jdbcType=TIMESTAMP} where avcm_id = #{id,jdbcType=BIGINT}</update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.AppVersionInfo">
        update yeshi_ec_app_version_code_map
        <set>
            <if test="platform != null">avcm_platform=#{platform,jdbcType=VARCHAR},</if>
            <if test="version != null">avcm_version=#{version,jdbcType=VARCHAR},</if>
            <if test="versionCode != null">avcm_version_code=#{versionCode,jdbcType=INTEGER},</if>
            <if test="createTime != null">avcm_createtime=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">avcm_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if>
        </set>
        where avcm_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/ThreeSaleMapper.xml
@@ -15,8 +15,21 @@
            javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
            <id column="worker_id" property="id" jdbcType="BIGINT" />
        </association>
    </resultMap>
    <resultMap id="AllResultMap" type="com.yeshi.fanli.entity.bus.user.ThreeSale">
        <id column="id" property="id" jdbcType="BIGINT" />
        <result column="state" property="state" jdbcType="BOOLEAN" />
        <result column="createTime" property="createTime" jdbcType="BIGINT" />
        <result column="expire" property="expire" jdbcType="INTEGER" />
        <association property="boss" column="boss_id"
            select="com.yeshi.fanli.dao.mybatis.UserInfoMapper.selectByPKey" />
        <association property="worker" column="worker_id"
            select="com.yeshi.fanli.dao.mybatis.UserInfoMapper.selectByPKey" />
    </resultMap>
    <sql id="Base_Column_List">id,boss_id,worker_id,state,expire,createTime</sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
@@ -171,4 +184,138 @@
            close=")">#{item}</foreach>
    </update>
    
    <select id="listFirstTeamQuery"  resultMap="AllResultMap">
         SELECT    *  FROM `yeshi_ec_threesale`
         WHERE 1=1
          <if test="uid != null">
                  AND `boss_id` = #{uid}
          </if>
         <if test="state == 0">
                  AND `state` = 0  AND (expire = 0  OR  expire IS NULL)
          </if>
          <if test="state == 1">
                  AND `state` = 1
          </if>
          <if test="state ==2">
                AND `expire` = 1  <!-- 失效 -->
          </if>
          <if test="startTime != null and startTime !='' ">
                <![CDATA[AND FROM_UNIXTIME(createTime/1000) >= #{startTime}]]>
          </if>
          <if test="endTime != null and  endTime !='' ">
                  <![CDATA[AND FROM_UNIXTIME(createTime/1000) <= #{endTime}]]>
          </if>
          ORDER BY createTime DESC
          LIMIT ${start},${count}
    </select>
    <select id="countFirstTeamQuery"  resultType="java.lang.Long">
         SELECT count(id) FROM `yeshi_ec_threesale`
         WHERE 1=1
          <if test="uid != null">
                  AND `boss_id` = #{uid}
          </if>
         <if test="state == 0">
                  AND `state` = 0  AND (expire = 0  OR  expire IS NULL)
        </if>
        <if test="state == 1">
                  AND `state` = 1
         </if>
          <if test="state ==2">
              AND `expire` = 1  <!-- 失效 -->
          </if>
          <if test="startTime != null and startTime !='' ">
                <![CDATA[AND FROM_UNIXTIME(createTime/1000) >= #{startTime}]]>
          </if>
          <if test="endTime != null and  endTime !=''">
                  <![CDATA[AND FROM_UNIXTIME(createTime/1000) <= #{endTime}]]>
          </if>
    </select>
    <select id="listSecondTeamQuery"  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  1=1
               <if test="uid != null">
                      AND tf.`boss_id` = #{uid}
              </if>
               <if test="state == 0">
                      AND ts.`state` = 0  AND (ts.expire = 0  OR  ts.expire IS NULL)
              </if>
              <if test="state == 1">
                      AND ts.`state` = 1
              </if>
               <if test="state ==2">
                      AND ts.`expire` = 1  <!-- 失效 -->
              </if>
             <if test="startTime != null and startTime !='' ">
                    <![CDATA[AND FROM_UNIXTIME(ts.createTime/1000) >= #{startTime}]]>
              </if>
              <if test="endTime != null and  endTime !=''">
                      <![CDATA[AND FROM_UNIXTIME(ts.createTime/1000) <= #{endTime}]]>
              </if>
              )A LEFT JOIN yeshi_ec_threesale yet ON yet.id = A.id
        ORDER BY yet.`createtime` DESC
        LIMIT ${start},${count}
    </select>
    <select id="countSecondTeamQuery" 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`
             WHERE  1=1
               <if test="uid != null">
                      AND tf.`boss_id` = #{uid}
              </if>
              <if test="state == 0">
                      AND ts.`state` = 0  AND (ts.expire = 0  OR  ts.expire IS NULL)
              </if>
              <if test="state == 1">
                      AND ts.`state` = 1
              </if>
              <if test="state ==2">
                      AND ts.`expire` = 1  <!-- 失效 -->
              </if>
              <if test="startTime != null and startTime !='' ">
                    <![CDATA[AND FROM_UNIXTIME(ts.createTime/1000) >= #{startTime}]]>
              </if>
               <if test="endTime != null and endTime !=''">
                      <![CDATA[AND FROM_UNIXTIME(ts.createTime/1000) <= #{endTime}]]>
              </if>
            )A
    </select>
    <select id="listSuperiorQuery"  resultMap="AllResultMap">
        SELECT * FROM `yeshi_ec_threesale` ts
        WHERE ts.`worker_id` = #{uid}
             <if test="state == 0">
                      AND ts.`state` = 0  AND (ts.expire = 0  OR  ts.expire IS NULL)
              </if>
              <if test="state == 1">
                      AND ts.`state` = 1
              </if>
            <if test="state ==2">
                  AND ts.`expire` = 1  <!-- 失效 -->
            </if>
        ORDER BY ts.`createtime` DESC
        LIMIT ${start},${count}
    </select>
    <select id="countSuperiorQuery" resultType="java.lang.Long" >
         SELECT COUNT(ts.id) FROM `yeshi_ec_threesale` ts
        WHERE ts.`worker_id` = #{uid}
             <if test="state == 0">
                      AND ts.`state` = 0  AND (ts.expire = 0  OR  ts.expire IS NULL)
              </if>
              <if test="state == 1">
                      AND ts.`state` = 1
              </if>
            <if test="state ==2">
                  AND ts.`expire` = 1  <!-- 失效 -->
            </if>
    </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml
@@ -233,7 +233,8 @@
               LEFT JOIN yeshi_ec_binding_account  b ON u.`id` = b.`uid`  
           where  1=1  
                <if test="key != null and key !='' ">
                   AND    (u.id LIKE '%${key}%' OR u.`phone` LIKE '%${key}%' OR b.`account` LIKE '%${key}%')
                   AND    (u.id LIKE '%${key}%' OR u.`phone` LIKE '%${key}%'  OR u.`wxName` LIKE '%${key}%'
                   OR u.`nick_name` LIKE '%${key}%'  OR u.`tbName` LIKE '%${key}%' OR b.`account` LIKE '%${key}%')
                </if>
                <if test="startTime != null and startTime !='' ">
                   <![CDATA[ AND FROM_UNIXTIME(createtime/1000) >= '${startTime}' ]]>  
@@ -277,8 +278,9 @@
           SELECT count(u.id) FROM yeshi_ec_user u 
               LEFT JOIN yeshi_ec_binding_account  b ON u.`id` = b.`uid`  
           where <![CDATA[ 1>0 ]]>  
                <if test="key != null and key !='' ">
                   AND    (u.id LIKE '%${key}%' OR u.`phone` LIKE '%${key}%' OR b.`account` LIKE '%${key}%')
                 <if test="key != null and key !='' ">
                   AND    (u.id LIKE '%${key}%' OR u.`phone` LIKE '%${key}%'  OR u.`wxName` LIKE '%${key}%'
                   OR u.`nick_name` LIKE '%${key}%'  OR u.`tbName` LIKE '%${key}%' OR b.`account` LIKE '%${key}%')
                </if>
                <if test="startTime != null and startTime !='' ">
                   <![CDATA[ AND FROM_UNIXTIME(createtime/1000) >= '${startTime}' ]]>  
@@ -301,7 +303,8 @@
               LEFT JOIN yeshi_ec_binding_account  b ON u.`id` = b.`uid`  
           where <![CDATA[ 1>0 ]]>  
                <if test="key != null and key !='' ">
                   AND    (u.id LIKE '%${key}%' OR u.`phone` LIKE '%${key}%' OR b.`account` LIKE '%${key}%')
                   AND    (u.id LIKE '%${key}%' OR u.`phone` LIKE '%${key}%'  OR u.`wxName` LIKE '%${key}%'
                   OR u.`nick_name` LIKE '%${key}%'  OR u.`tbName` LIKE '%${key}%' OR b.`account` LIKE '%${key}%')
                </if>
                <if test="startTime != null and startTime !='' ">
                   <![CDATA[ AND FROM_UNIXTIME(createtime/1000) >= '${startTime}' ]]>  
fanli/src/main/java/com/yeshi/fanli/mapping/common/JumpDetailV2Mapper.xml
@@ -54,4 +54,31 @@
       where jp_type = #{type,jdbcType=VARCHAR}
  </select>
  
   <select id="listJump" resultMap="BaseResultMap">
      select <include refid="Base_Column_List"/> from yeshi_ec_action_jumpdetail_v2
  </select>
   <select id="listQuery" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />  FROM yeshi_ec_action_jumpdetail_v2
        WHERE 1=1
           <if test='key != null and key != ""'>
                  AND (jp_name like '%${key}%')
           </if>
           ORDER BY jp_id
        LIMIT ${start},${count}
   </select>
   <select id="countListQuery" resultType="java.lang.Long">
        SELECT IFNULL(count(jp_id),0)  FROM yeshi_ec_action_jumpdetail_v2
        WHERE 1=1
           <if test='key != null and key != ""'>
                  AND (jp_name like '%${key}%')
           </if>
    </select>
      <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List">
        delete from yeshi_ec_action_jumpdetail_v2 WHERE jp_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
    </delete>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/help/AppPageNotificationMapper.xml
@@ -96,4 +96,42 @@
        </set>
        where an_id = #{id,jdbcType=BIGINT}
    </update>
    <select id="listQuery" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />  FROM yeshi_ec_apppage_notification
        WHERE 1=1
           <if test='key != null and key != ""'>
                  AND (an_type like '%${key}%' or an_content like '%${key}%')
           </if>
           <if test='show != null'>
                  AND an_show = #{show}
           </if>
           <if test='canClose != null'>
                  AND an_can_close = #{canClose}
           </if>
           ORDER BY an_createtime desc
        LIMIT ${start},${count}
   </select>
   <select id="countQuery" resultType="java.lang.Long">
        SELECT IFNULL(count(an_id),0)  FROM yeshi_ec_apppage_notification
        WHERE 1=1
            <if test='key != null and key != ""'>
                  AND (an_type like '%${key}%' or an_content like '%${key}%')
           </if>
           <if test='show != null'>
                  AND an_show = #{show}
           </if>
           <if test='canClose != null'>
                  AND an_can_close = #{canClose}
           </if>
    </select>
      <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List">
        delete from yeshi_ec_apppage_notification WHERE an_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
    </delete>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/HomeNavbarMapper.xml
@@ -66,4 +66,46 @@
    </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
   </select>
   <select id="getChangeOrder" resultMap="BaseResultMap">
        SELECT  <include refid="Base_Column_List" /> FROM yeshi_ec_home_navbar
        WHERE 1=1
        <if test="type == -1">
            <![CDATA[and br_orderby < #{order}]]>
            order by br_orderby desc
        </if>
        <if test="type == 1">
            <![CDATA[and br_orderby > #{order} ]]>
            order by br_orderby
        </if>
   </select>
    <select id="listQuery" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />  FROM yeshi_ec_home_navbar
        WHERE 1=1
           <if test='key != null and key != ""'>
                  AND (br_name like '%${key}%')
           </if>
           ORDER BY br_orderby
        LIMIT ${start},${count}
   </select>
   <select id="countListQuery" resultType="java.lang.Long">
        SELECT IFNULL(count(br_id),0)  FROM yeshi_ec_home_navbar
        WHERE 1=1
           <if test='key != null and key != ""'>
                  AND (br_name like '%${key}%')
           </if>
    </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>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SpecialCardMapper.xml
@@ -2,16 +2,16 @@
<!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.SpecialCardMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.homemodule.SpecialCard">
    <id column="cd_id" property="id" jdbcType="BIGINT"/>
    <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_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_createtime,cd_updatetime</sql>
  <sql id="Base_Column_List">cd_id,cd_name,cd_card,cd_state,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}
@@ -19,13 +19,14 @@
  
  <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_createtime,cd_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{card,jdbcType=VARCHAR},#{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_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="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="createtime != null">cd_createtime,</if>
      <if test="updatetime != null">cd_updatetime,</if>
    </trim>values
@@ -33,20 +34,46 @@
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <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="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_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_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="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}
  </update>
  
   <select id="listQuery" resultMap="BaseResultMap">
        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}%')
           </if>
           ORDER BY cd_createtime <if test='sort == 1'>DESC</if>
        LIMIT ${start},${count}
   </select>
   <select id="countlistQuery" resultType="java.lang.Long">
        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}%')
           </if>
    </select>
    <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List">
        delete from yeshi_ec_special_card WHERE cd_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
    </delete>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SpecialMapper.xml
@@ -2,44 +2,44 @@
<!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.SpecialMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.homemodule.Special">
    <id column="b_id" property="id" jdbcType="BIGINT"/>
    <result column="b_name" property="name" jdbcType="VARCHAR"/>
    <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_sub_picture" property="subPicture" jdbcType="VARCHAR"/>
    <result column="b_params" property="params" 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"/>
    <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_main_picture,b_sub_picture,b_jumpid,b_params,b_orderby,b_createtime,b_updatetime</sql>
  <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>
  <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_main_picture,b_sub_picture,b_jumpid,b_params,b_orderby,b_createtime,b_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{card,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{subPicture,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{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_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="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>
      <if test="name != null">b_name,</if>
      <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="subPicture != null">b_sub_picture,</if>
      <if test="jumpDetail != null">b_jumpid,</if>
      <if test="params != null">b_params,</if>
      <if test="orderby != null">b_orderby,</if>
      <if test="state != null">b_state,</if>
      <if test="showType != null">b_show_type,</if>
      <if test="remark != null">b_remark,</if>
      <if test="createtime != null">b_createtime,</if>
      <if test="updatetime != null">b_updatetime,</if>
    </trim>values
@@ -47,30 +47,107 @@
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="name != null">#{name,jdbcType=VARCHAR},</if>
      <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="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="orderby != null">#{orderby,jdbcType=INTEGER},</if>
      <if test="state != null">#{state,jdbcType=BIGINT},</if>
      <if test="showType != null">#{showType,jdbcType=VARCHAR},</if>
      <if test="remark != null">#{remark,jdbcType=VARCHAR},</if>
      <if test="createtime != null">#{createtime,jdbcType=TIMESTAMP},</if>
      <if test="updatetime != null">#{updatetime,jdbcType=TIMESTAMP},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.Special">update yeshi_ec_special set b_name = #{name,jdbcType=VARCHAR},b_card = #{card,jdbcType=VARCHAR},b_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_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_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="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="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="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>
      <if test="remark != null">b_remark=#{remark,jdbcType=VARCHAR},</if>
      <if test="createtime != null">b_createtime=#{createtime,jdbcType=TIMESTAMP},</if>
      <if test="updatetime != null">b_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if>
    </set> where b_id = #{id,jdbcType=BIGINT}
  </update>
  
    <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List">
        delete from yeshi_ec_special WHERE b_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
    </delete>
    <delete id="deleteBatchByCardID" parameterType="java.util.List">
        delete from yeshi_ec_special WHERE b_card_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
    </delete>
  <select id="queryByListPrimaryKey" parameterType="java.util.List" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />  FROM yeshi_ec_special
        WHERE b_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
   </select>
   <select id="queryByListCardID" parameterType="java.util.List" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />  FROM yeshi_ec_special
        WHERE b_card_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
   </select>
   <select id="listQueryByCard" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" /> FROM  `yeshi_ec_special` pp
        WHERE pp.`b_card_id` = #{cardId}
           <if test='key != null and key != ""'>
                  AND b_name like '%${key}%'
           </if>
        ORDER BY pp.b_orderby
        LIMIT ${start},${count}
   </select>
   <select id="countlistQueryByCard" resultType="java.lang.Long">
        SELECT IFNULL(count(b_id),0) FROM  `yeshi_ec_special` pp
        WHERE pp.`b_card_id` = #{cardId}
           <if test='key != null and key != ""'>
                  AND b_name like '%${key}%'
           </if>
   </select>
   <select id="getMaxOrderByCard" resultType="java.lang.Integer">
        SELECT IFNULL(MAX(pp.b_orderby),0) FROM yeshi_ec_special pp
        WHERE pp.`b_card_id` = #{cardId}
   </select>
   <select id="getOrderByCardID" resultMap="BaseResultMap">
        SELECT  <include refid="Base_Column_List" /> FROM yeshi_ec_special
        WHERE b_card_id = #{cardId}
        <if test="type == -1">
            <![CDATA[and b_orderby < #{order}]]>
            order by b_orderby desc
        </if>
        <if test="type == 1">
            <![CDATA[and b_orderby > #{order} ]]>
            order by b_orderby
        </if>
   </select>
   <select id="listBySystemAndCard" resultMap="BaseResultMap">
        SELECT p.* FROM `yeshi_ec_special` p LEFT JOIN `yeshi_ec_special_card` c ON  p.`b_card_id` = c.`cd_id`
        LEFT JOIN `yeshi_ec_super_special_card` s ON  s.`sp_special_cid` = c.`cd_id`
        WHERE p.`b_state` = 0 AND c.`cd_state` = 0
              AND c.`cd_card` = #{card} AND s.`sp_system_id` = #{systemId}
        ORDER BY p.`b_orderby`
   </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SuperHomeNavbarMapper.xml
@@ -58,4 +58,23 @@
  </select>
  
  
   <select id="listByNavbarIds"  parameterType="java.util.List" resultMap="BaseResultMap">
     SELECT <include refid="Base_Column_List"/> FROM `yeshi_ec_super_homenavbar`
     WHERE sp_navbar_id in  <foreach collection="list" item="item" open="(" separator="," close=")">#{item}</foreach>
  </select>
   <delete id="deleteBatchByNavbarIds" parameterType="java.util.List">
        delete from yeshi_ec_super_homenavbar WHERE sp_navbar_id in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
   </delete>
    <select id="querybyNavbarId"  resultMap="BaseResultMap">
        SELECT * FROM `yeshi_ec_super_homenavbar` WHERE sp_navbar_id = #{navbarId} and sp_system_id = #{systemId}
    </select>
    <delete id="deletebyNavbarId">
        delete from yeshi_ec_super_homenavbar WHERE sp_navbar_id = #{navbarId} and sp_system_id = #{systemId}
   </delete>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SuperSpecialCardMapper.xml
New file
@@ -0,0 +1,66 @@
<?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.SuperSpecialCardMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.homemodule.SuperSpecialCard">
    <id column="sp_id" property="id" jdbcType="BIGINT"/>
    <association property="specialCard" column="sp_special_cid"
        javaType="com.yeshi.fanli.entity.bus.homemodule.SpecialCard">
            <id column="sp_special_cid" property="id" jdbcType="BIGINT" />
    </association>
    <association property="system" column="sp_system_id"
        javaType="com.yeshi.fanli.entity.system.System">
            <id column="sp_system_id" property="id" jdbcType="BIGINT" />
    </association>
  </resultMap>
  <sql id="Base_Column_List">sp_id,sp_special_cid,sp_system_id</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_super_special_card where sp_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_super_special_card where sp_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.SuperSpecialCard" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_super_special_card (sp_id,sp_special_cid,sp_system_id) values (#{id,jdbcType=BIGINT},#{specialCard.id,jdbcType=BIGINT},#{system.id,jdbcType=BIGINT})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.SuperSpecialCard" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_super_special_card
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">sp_id,</if>
      <if test="specialCard != null">sp_special_cid,</if>
      <if test="system != null">sp_system_id,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="specialCard != null">#{specialCard.id,jdbcType=BIGINT},</if>
      <if test="system != null">#{system.id,jdbcType=BIGINT},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.SuperSpecialCard">update yeshi_ec_super_special_card set sp_special_cid = #{specialCard.id,jdbcType=BIGINT},sp_system_id = #{system.id,jdbcType=BIGINT} where sp_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.SuperSpecialCard">update yeshi_ec_super_special_card
    <set>
      <if test="specialCard != null">sp_special_cid=#{specialCard.id,jdbcType=BIGINT},</if>
      <if test="system != null">sp_system_id=#{system.id,jdbcType=BIGINT},</if>
    </set> where sp_id = #{id,jdbcType=BIGINT}
  </update>
   <select id="listByCardIDs"  parameterType="java.util.List" resultMap="BaseResultMap">
     SELECT sp.* FROM `yeshi_ec_super_special_card` sp
     LEFT JOIN `yeshi_ec_special_card` pp  ON sp.sp_special_cid = pp.`cd_id`
     WHERE  pp.`cd_id` in  <foreach collection="list" item="item" open="(" separator="," close=")">#{item}</foreach>
  </select>
   <delete id="deleteBatchByCardId" parameterType="java.util.List">
        delete from yeshi_ec_super_special_card WHERE sp_special_cid in
        <foreach collection="list" item="item" open="(" close=")"
            separator=",">#{item}</foreach>
   </delete>
    <select id="querybyCardIdAndSystemId"  resultMap="BaseResultMap">
        SELECT * FROM `yeshi_ec_super_special_card` WHERE sp_special_cid = #{cardId} and sp_system_id = #{systemId}
    </select>
    <delete id="deletebyCardIdAndSystemId">
        delete from yeshi_ec_super_special_card WHERE sp_special_cid = #{cardId} and sp_system_id = #{systemId}
   </delete>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SwiperPictureMapper.xml
@@ -6,25 +6,29 @@
    <id column="pic_id" property="id" jdbcType="BIGINT"/>
    <result column="pic_banner_id" property="bannerId" jdbcType="BIGINT"/>
    <result column="pic_src" property="src" jdbcType="VARCHAR"/>
    <result column="pic_link" property="link" jdbcType="VARCHAR"/>
    <result column="pic_params" property="params" jdbcType="VARCHAR"/>
    <result column="pic_order" property="order" jdbcType="INTEGER"/>
    <result column="pic_remark" property="remark" jdbcType="VARCHAR"/>
    <result column="pic_state" property="state" jdbcType="INTEGER"/>
    <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_link,pic_order,pic_remark,pic_state,pic_createtime,pic_updatetime</sql>
  <sql id="Base_Column_List">pic_id,pic_banner_id,pic_src,pic_jumpid,pic_params,pic_order,pic_remark,pic_state,pic_createtime,pic_updatetime</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_swiper_banner_picture where pic_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_swiper_banner_picture where pic_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.SwiperPicture" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_swiper_banner_picture (pic_id,pic_banner_id,pic_src,pic_link,pic_order,pic_remark,pic_state,pic_createtime,pic_updatetime) values (#{id,jdbcType=BIGINT},#{bannerId,jdbcType=BIGINT},#{src,jdbcType=VARCHAR},#{link,jdbcType=VARCHAR},#{order,jdbcType=INTEGER},#{remark,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.SwiperPicture" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_swiper_banner_picture (pic_id,pic_banner_id,pic_src,pic_jumpid,pic_params,pic_order,pic_remark,pic_state,pic_createtime,pic_updatetime) values (#{id,jdbcType=BIGINT},#{bannerId,jdbcType=BIGINT},#{src,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{order,jdbcType=INTEGER},#{remark,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.SwiperPicture" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_swiper_banner_picture
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">pic_id,</if>
      <if test="bannerId != null">pic_banner_id,</if>
      <if test="src != null">pic_src,</if>
      <if test="link != null">pic_link,</if>
      <if test="jumpDetail != null">pic_jumpid,</if>
      <if test="params != null">pic_params,</if>
      <if test="order != null">pic_order,</if>
      <if test="remark != null">pic_remark,</if>
      <if test="state != null">pic_state,</if>
@@ -35,7 +39,8 @@
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="bannerId != null">#{bannerId,jdbcType=BIGINT},</if>
      <if test="src != null">#{src,jdbcType=VARCHAR},</if>
      <if test="link != null">#{link,jdbcType=VARCHAR},</if>
      <if test="jumpDetail != null">#{jumpDetail.id,jdbcType=BIGINT},</if>
      <if test="params != null">#{params,jdbcType=VARCHAR},</if>
      <if test="order != null">#{order,jdbcType=INTEGER},</if>
      <if test="remark != null">#{remark,jdbcType=VARCHAR},</if>
      <if test="state != null">#{state,jdbcType=INTEGER},</if>
@@ -43,12 +48,13 @@
      <if test="updatetime != null">#{updatetime,jdbcType=TIMESTAMP},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.SwiperPicture">update yeshi_ec_swiper_banner_picture set pic_banner_id = #{bannerId,jdbcType=BIGINT},pic_src = #{src,jdbcType=VARCHAR},pic_link = #{link,jdbcType=VARCHAR},pic_order = #{order,jdbcType=INTEGER},pic_remark = #{remark,jdbcType=VARCHAR},pic_state = #{state,jdbcType=INTEGER},pic_createtime = #{createtime,jdbcType=TIMESTAMP},pic_updatetime = #{updatetime,jdbcType=TIMESTAMP} where pic_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.SwiperPicture">update yeshi_ec_swiper_banner_picture set pic_banner_id = #{bannerId,jdbcType=BIGINT},pic_src = #{src,jdbcType=VARCHAR},pic_jumpid = #{jumpDetail.id,jdbcType=BIGINT},pic_params = #{params,jdbcType=VARCHAR},pic_order = #{order,jdbcType=INTEGER},pic_remark = #{remark,jdbcType=VARCHAR},pic_state = #{state,jdbcType=INTEGER},pic_createtime = #{createtime,jdbcType=TIMESTAMP},pic_updatetime = #{updatetime,jdbcType=TIMESTAMP} where pic_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.SwiperPicture">update yeshi_ec_swiper_banner_picture
    <set>
      <if test="bannerId != null">pic_banner_id=#{bannerId,jdbcType=BIGINT},</if>
      <if test="src != null">pic_src=#{src,jdbcType=VARCHAR},</if>
      <if test="link != null">pic_link=#{link,jdbcType=VARCHAR},</if>
      <if test="jumpDetail != null">pic_jumpid=#{jumpDetail.id,jdbcType=BIGINT},</if>
      <if test="params != null">pic_params=#{params,jdbcType=VARCHAR},</if>
      <if test="order != null">pic_order=#{order,jdbcType=INTEGER},</if>
      <if test="remark != null">pic_remark=#{remark,jdbcType=VARCHAR},</if>
      <if test="state != null">pic_state=#{state,jdbcType=INTEGER},</if>
@@ -57,12 +63,12 @@
    </set> where pic_id = #{id,jdbcType=BIGINT}
  </update>
  
   <select id="queryByBannerID" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />  FROM yeshi_ec_swiper_banner_picture
        WHERE pic_banner_id = #{bannerId}
           ORDER BY pic_order
        LIMIT ${start},${count}
       SELECT *  FROM yeshi_ec_swiper_banner_picture p
       LEFT JOIN `yeshi_ec_action_jumpdetail_v2` j ON j.`jp_id` = p.`pic_jumpid`
       WHERE pic_banner_id = #{bannerId}
          ORDER BY pic_order
       LIMIT ${start},${count}
   </select>
   
   <select id="countQueryByBannerID" resultType="java.lang.Long">
@@ -117,8 +123,9 @@
   
   
    <select id="getByBannerCard" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" /> FROM `yeshi_ec_swiper_banner` w
        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_card` = #{card} AND w.`sp_state` = 0 AND p.`pic_state`= 0
        ORDER BY p.`pic_order`
   </select>
fanli/src/main/java/com/yeshi/fanli/mapping/lable/QualityFactoryMapper.xml
@@ -57,7 +57,34 @@
            javaType="com.yeshi.fanli.entity.common.AdminUser">
            <id column="sg_update_aid" property="id" jdbcType="BIGINT" />
    </association>
  </resultMap>
  <resultMap id="GoodsResultMap" type="com.yeshi.fanli.entity.bus.lable.QualityFactory">
    <id column="sg_id" property="id" jdbcType="BIGINT"/>
    <result column="sg_class_id" property="systemCid" jdbcType="BIGINT"/>
    <result column="sg_entry_mode" property="entryMode" jdbcType="INTEGER"/>
    <result column="sg_goods_source" property="goodsSource" jdbcType="INTEGER"/>
    <result column="sg_source_calss" property="sourceCalss" jdbcType="VARCHAR"/>
    <result column="sg_weight" property="weight" jdbcType="INTEGER"/>
    <result column="sg_createtime" property="createtime" jdbcType="TIMESTAMP"/>
    <result column="sg_updatetime" property="updatetime" jdbcType="TIMESTAMP"/>
      <association property="boutiqueAutoRule" column="sg_rule_id"
        javaType="com.yeshi.fanli.entity.bus.lable.BoutiqueAutoRule">
            <id column="sg_rule_id" property="id" jdbcType="BIGINT" />
    </association>
     <association property="taoBaoGoodsBrief" column="sg_goods_id"
      resultMap="com.yeshi.fanli.dao.mybatis.taobao.TaoBaoGoodsBriefMapper.BaseResultMap"/>
      <association property="createUser" column="sg_create_aid"
        javaType="com.yeshi.fanli.entity.common.AdminUser">
            <id column="sg_create_aid" property="id" jdbcType="BIGINT" />
    </association>
    <association property="updateUser" column="sg_update_aid"
            javaType="com.yeshi.fanli.entity.common.AdminUser">
            <id column="sg_update_aid" property="id" jdbcType="BIGINT" />
    </association>
  </resultMap>
  
  <sql id="Base_Column_List">sg_id,sg_class_id,sg_goods_id,sg_entry_mode,sg_goods_source,sg_source_calss,sg_rule_id,sg_weight,sg_create_aid,sg_createtime,sg_update_aid,sg_updatetime</sql>
@@ -1050,6 +1077,13 @@
          <if test='endprice != null'>
               AND <![CDATA[  tb.`zkPrice` <= #{endprice}]]>
        </if>
        <!-- 返利比范围  -->
         <if test='startTkRate != null'>
               AND <![CDATA[  tb.`tkRate` >= #{startTkRate}]]>
         </if>
          <if test='endTkRate != null'>
               AND <![CDATA[  tb.`tkRate` <= #{endTkRate}]]>
        </if>
        <!-- 有券  -->
        <if test='hasQuan != null'>
               AND <![CDATA[  tb.`couponLeftCount` > 1]]>
@@ -1103,6 +1137,13 @@
          <if test='endprice != null'>
               AND <![CDATA[  tb.`zkPrice` <= #{endprice}]]>
        </if>
        <!-- 返利比范围  -->
         <if test='startTkRate != null'>
               AND <![CDATA[  tb.`tkRate` >= #{startTkRate}]]>
         </if>
          <if test='endTkRate != null'>
               AND <![CDATA[  tb.`tkRate` <= #{endTkRate}]]>
        </if>
        <!-- 有券  -->
        <if test='hasQuan != null'>
               AND <![CDATA[  tb.`couponLeftCount` > 1]]>
@@ -1113,4 +1154,24 @@
        </if>
    </select>
    
    <select id="listQueryBylabIDs" resultMap="GoodsResultMap">
          SELECT * FROM (
            SELECT DISTINCT( tt.`sg_id`) AS tbid  FROM yeshi_ec_quality_factory tt
            LEFT JOIN yeshi_ec_taobao_goods tb ON tt.`sg_goods_id`= tb.`id`
            LEFT JOIN yeshi_ec_label_goods lg ON tt.`sg_goods_id` = lg.`lg_goods_id`
                WHERE tb.`id` != #{gid}
                    <if test='systemCid != null'>
                           AND  tt.`sg_class_id` = #{systemCid}
                    </if>
                     AND  lg.`lg_label_id` IN
                <foreach collection="list" item="item" open="(" close=")"
                    separator=",">#{item}</foreach>
              LIMIT ${start},${count}
         ) a LEFT JOIN yeshi_ec_quality_factory ts ON ts.`sg_id`=a.tbid
             LEFT JOIN yeshi_ec_taobao_goods tbb ON ts.`sg_goods_id`= tbb.`id`
   </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/monitor/ClientAPIMonitorMapper.xml
New file
@@ -0,0 +1,84 @@
<?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.monitor.ClientAPIMonitorMapper">
    <resultMap id="BaseResultMap"
        type="com.yeshi.fanli.entity.monitor.ClientAPIMonitor">
        <id column="mca_id" property="id" jdbcType="BIGINT" />
        <result column="mca_url" property="url" jdbcType="VARCHAR" />
        <result column="mca_ip" property="ip" jdbcType="VARCHAR" />
        <result column="mca_request_data" property="requestData"
            jdbcType="VARCHAR" />
        <result column="mca_code" property="code" jdbcType="INTEGER" />
        <result column="mca_time" property="time" jdbcType="INTEGER" />
        <result column="mca_createtime" property="createTime" jdbcType="TIMESTAMP" />
        <result column="mca_beizhu" property="beiZhu" jdbcType="VARCHAR" />
    </resultMap>
    <sql id="Base_Column_List">mca_id,mca_url,mca_ip,mca_request_data,mca_code,mca_time,mca_createtime,mca_beizhu
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_monitor_client_api where mca_id = #{id,jdbcType=BIGINT}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_monitor_client_api where mca_id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.monitor.ClientAPIMonitor"
        useGeneratedKeys="true" keyProperty="id">insert into
        yeshi_ec_monitor_client_api
        (mca_id,mca_url,mca_ip,mca_request_data,mca_code,mca_time,mca_createtime,mca_beizhu)
        values
        (#{id,jdbcType=BIGINT},#{url,jdbcType=VARCHAR},#{ip,jdbcType=VARCHAR},#{requestData,jdbcType=VARCHAR},#{code,jdbcType=INTEGER},#{time,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{beiZhu,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.monitor.ClientAPIMonitor"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_monitor_client_api
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">mca_id,</if>
            <if test="url != null">mca_url,</if>
            <if test="ip != null">mca_ip,</if>
            <if test="requestData != null">mca_request_data,</if>
            <if test="code != null">mca_code,</if>
            <if test="time != null">mca_time,</if>
            <if test="createTime != null">mca_createtime,</if>
            <if test="beiZhu != null">mca_beizhu,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="url != null">#{url,jdbcType=VARCHAR},</if>
            <if test="ip != null">#{ip,jdbcType=VARCHAR},</if>
            <if test="requestData != null">#{requestData,jdbcType=VARCHAR},</if>
            <if test="code != null">#{code,jdbcType=INTEGER},</if>
            <if test="time != null">#{time,jdbcType=INTEGER},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="beiZhu != null">#{beiZhu,jdbcType=VARCHAR},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.monitor.ClientAPIMonitor">update
        yeshi_ec_monitor_client_api set mca_url =
        #{url,jdbcType=VARCHAR},mca_ip =
        #{ip,jdbcType=VARCHAR},mca_request_data =
        #{requestData,jdbcType=VARCHAR},mca_code =
        #{code,jdbcType=INTEGER},mca_time =
        #{time,jdbcType=INTEGER},mca_createtime =
        #{createTime,jdbcType=TIMESTAMP},mca_beizhu =
        #{beiZhu,jdbcType=VARCHAR} where mca_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.monitor.ClientAPIMonitor">
        update yeshi_ec_monitor_client_api
        <set>
            <if test="url != null">mca_url=#{url,jdbcType=VARCHAR},</if>
            <if test="ip != null">mca_ip=#{ip,jdbcType=VARCHAR},</if>
            <if test="requestData != null">mca_request_data=#{requestData,jdbcType=VARCHAR},</if>
            <if test="code != null">mca_code=#{code,jdbcType=INTEGER},</if>
            <if test="time != null">mca_time=#{time,jdbcType=INTEGER},</if>
            <if test="createTime != null">mca_createtime=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="beiZhu != null">mca_beizhu=#{beiZhu,jdbcType=VARCHAR},</if>
        </set>
        where mca_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/order/LostOrderMapper.xml
New file
@@ -0,0 +1,112 @@
<?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.order.LostOrderMapper">
    <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.LostOrder">
        <id column="id" property="id" jdbcType="BIGINT" />
        <result column="orderId" property="orderId" jdbcType="VARCHAR" />
        <result column="type" property="type" jdbcType="INTEGER" />
        <result column="state" property="state" jdbcType="INTEGER" />
        <result column="createTime" property="createTime" jdbcType="BIGINT" />
        <result column="handleTime" property="handleTime" jdbcType="BIGINT" />
        <result column="remake" property="remake" jdbcType="VARCHAR" />
        <result column="judge" property="judge" jdbcType="VARCHAR" />
        <result column="result_code" property="resultCode" jdbcType="INTEGER" />
        <association property="userInfo" column="uid"
            javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
            <id column="uid" property="id" jdbcType="BIGINT" />
        </association>
        <association property="order" column="oid"
            javaType="com.yeshi.fanli.entity.bus.user.Order">
            <id column="oid" property="id" jdbcType="BIGINT" />
        </association>
    </resultMap>
    <resultMap id="AllResultMap" type="com.yeshi.fanli.entity.bus.user.LostOrder">
        <id column="id" property="id" jdbcType="BIGINT" />
        <result column="orderId" property="orderId" jdbcType="VARCHAR" />
        <result column="type" property="type" jdbcType="INTEGER" />
        <result column="state" property="state" jdbcType="INTEGER" />
        <result column="createTime" property="createTime" jdbcType="BIGINT" />
        <result column="handleTime" property="handleTime" jdbcType="BIGINT" />
        <result column="remake" property="remake" jdbcType="VARCHAR" />
        <result column="judge" property="judge" jdbcType="VARCHAR" />
        <result column="result_code" property="resultCode" jdbcType="INTEGER" />
        <association property="userInfo" column="uid"
              select="com.yeshi.fanli.dao.mybatis.UserInfoMapper.selectByPKey"/>
        <association property="order" column="oid"
                 select="com.yeshi.fanli.dao.mybatis.order.OrderMapper.selectByPrimaryKey">
        </association>
    </resultMap>
    <select id="selectByOrderId" resultMap="BaseResultMap"
        parameterType="java.lang.String">
        select * from yeshi_ec_lost_order where orderId=#{0}
    </select>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.LostOrder">
        update yeshi_ec_lost_order
        <set>
            <if test="orderId != null">orderId=#{orderId,jdbcType=VARCHAR},</if>
            <if test="type != null">type=#{type,jdbcType=INTEGER},</if>
            <if test="state != null">state=#{state,jdbcType=INTEGER},</if>
            <if test="createTime != null">createTime=#{createTime,jdbcType=BIGINT},</if>
            <if test="handleTime != null">handleTime=#{handleTime,jdbcType=BIGINT},</if>
            <if test="userInfo != null">uid=#{userInfo.id,jdbcType=BIGINT},</if>
            <if test="order != null">oid=#{order.id,jdbcType=BIGINT},</if>
            <if test="remake != null">remake=#{remake,jdbcType=VARCHAR},</if>
            <if test="judge != null">judge=#{judge,jdbcType=VARCHAR},</if>
            <if test="resultCode != null">result_code=#{resultCode,jdbcType=INTEGER},</if>
        </set>
        where id = #{id,jdbcType=BIGINT}
    </update>
    <select id="countByUid" resultType="java.util.HashMap">
       SELECT IFNULL(COUNT(id), 0) AS total,IFNULL(SUM(CASE WHEN state = 1 THEN 1 ELSE 0 END),0) AS totalPass,
               IFNULL(SUM(CASE WHEN state = 2 THEN 1 ELSE 0 END),0) AS totalReject
        FROM yeshi_ec_lost_order  WHERE  uid = #{uid};
    </select>
      <select id="listQuery" resultMap="AllResultMap">
        SELECT d.* FROM yeshi_ec_lost_order d
              left join  yeshi_ec_user u on d.uid = u.id
        WHERE 1=1
           <if test='key != null and key != ""'>
                  AND (d.orderId like '%${key}%' or d.uid like '%${key}%' or u.nick_name like '%${key}%')
           </if>
           <if test='state != null'>
                  AND d.state = #{state}
           </if>
           <if test='handleType != null and handleType == 0'>
                  AND d.state = 0
           </if>
            <if test='handleType != null and handleType != 0'>
                  AND (d.state = 1 or d.state = 2)
           </if>
           ORDER BY d.createTime desc
        LIMIT ${start},${count}
   </select>
   <select id="countQuery" resultType="java.lang.Long">
        SELECT  IFNULL(count(d.id),0) FROM yeshi_ec_lost_order d
          left join  yeshi_ec_user u on d.uid = u.id
        WHERE 1=1
           <if test='key != null and key != ""'>
                  AND (d.orderId like '%${key}%' or d.uid like '%${key}%' or u.nick_name like '%${key}%')
           </if>
           <if test='state != null'>
                  AND d.state = #{state}
           </if>
           <if test='handleType != null and handleType == 0'>
                  AND d.state = 0
           </if>
            <if test='handleType != null and handleType != 0'>
                  AND (d.state = 1 or d.state = 2)
           </if>
    </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/mapping/taobao/TaoBaoGoodsBriefMapper.xml
@@ -183,7 +183,7 @@
            <if test="tkMktStatus != null">tkMktStatus,</if>
            <if test="updatetime != null">updatetime,</if>
            <if test="state != null">state,</if>
            <if test="state != null">totalSales,</if>
            <if test="totalSales != null">totalSales,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
fanli/src/main/java/com/yeshi/fanli/mapping/user/ShamUserMapper.xml
@@ -61,5 +61,8 @@
        LEFT JOIN yeshi_ec_demouser B ON  A.id = B.id
    </select>
     <select id="listRand" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_sham_user ORDER BY  RAND() LIMIT #{count}
    </select>
</mapper>
fanli/src/main/java/com/yeshi/fanli/service/impl/activity/ActivityServiceImpl.java
@@ -44,6 +44,7 @@
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.activity.ActivityUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import org.yeshi.utils.HttpUtil;
import org.yeshi.utils.QRCodeUtil;
import org.yeshi.utils.entity.FileUploadResult;
@@ -119,7 +120,10 @@
        if (activity.getType() != RecommendActivity.TYPE_SHARE_GOODS)
            throw new ActivityException(3, "不属于分享商品动态");
        ActivityShareResult result = new ActivityShareResult();
        result.setTitle(activity.getTitle().replace("<br>", "/n").replace("<p>", "").replace("</p>", ""));
        String title = activity.getTitle().replace("<br>", "/n").replace("<p>", "").replace("</p>", "");
        if (title != null && title.trim().endsWith("/n"))
            title = title.trim().substring(0, title.trim().length() - 2);
        result.setTitle(title);
        List<FileUploadResult> imgList = new ArrayList<>();
        if (activity.getGoodsList() != null) {
            // 提前分配好PID
@@ -588,4 +592,29 @@
        return activity;
    }
    @Override
    public int insert(RecommendActivity record) {
        return recommendActivityMapper.insert(record);
    }
    @Override
    public int insertSelective(RecommendActivity record) {
        return recommendActivityMapper.insertSelective(record);
    }
    @Override
    public RecommendActivity selectByPrimaryKey(Long id) {
        return recommendActivityMapper.selectByPrimaryKey(id);
    }
    @Override
    public int updateByPrimaryKeySelective(RecommendActivity record) {
        return recommendActivityMapper.updateByPrimaryKeySelective(record);
    }
    @Override
    public int updateByPrimaryKey(RecommendActivity record) {
        return recommendActivityMapper.updateByPrimaryKey(record);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/common/JumpDetailV2ServiceImpl.java
@@ -72,4 +72,24 @@
        return jumpDetailV2;
    }
    
    @Override
    public List<JumpDetailV2> listJump() {
        return this.jumpDetailV2Mapper.listJump();
    }
    @Override
    public int deleteBatchByPrimaryKey(List<Long> list) {
        return jumpDetailV2Mapper.deleteBatchByPrimaryKey(list);
    }
    @Override
    public List<JumpDetailV2> listQuery(long start, int count, String key) {
        return jumpDetailV2Mapper.listQuery(start, count, key);
    }
    @Override
    public long countListQuery(String key) {
        return jumpDetailV2Mapper.countListQuery(key);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/config/AppVersionServiceImpl.java
New file
@@ -0,0 +1,50 @@
package com.yeshi.fanli.service.impl.config;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.AppVersionInfoMapper;
import com.yeshi.fanli.entity.AppVersionInfo;
import com.yeshi.fanli.service.inter.config.AppVersionService;
import com.yeshi.fanli.util.StringUtil;
@Service
public class AppVersionServiceImpl implements AppVersionService {
    @Resource
    private AppVersionInfoMapper appVersionInfoMapper;
    @Override
    public void addAppVersion(AppVersionInfo versionInfo) throws Exception {
        if (versionInfo == null)
            return;
        if (StringUtil.isNullOrEmpty(versionInfo.getPlatform()))
            throw new Exception("platform为空");
        if (StringUtil.isNullOrEmpty(versionInfo.getVersion()))
            throw new Exception("version为空");
        if (versionInfo.getVersionCode() == null)
            throw new Exception("versionCode为空");
        versionInfo.setCreateTime(new Date());
        versionInfo.setUpdateTime(new Date());
        appVersionInfoMapper.insertSelective(versionInfo);
    }
    @Override
    public List<AppVersionInfo> getAppVersionInfoListByPlatform(String platform) {
        return appVersionInfoMapper.selectByPlatform(platform);
    }
    @Override
    public AppVersionInfo getAppVersionInfoListByPlatformAndVersion(String platform, int versionCode) {
        return appVersionInfoMapper.selectByPlatformAndVersionCode(platform, versionCode);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/config/ConfigServiceImpl.java
@@ -6,6 +6,8 @@
import javax.annotation.Resource;
import net.sf.json.JSONArray;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
@@ -17,9 +19,8 @@
import com.yeshi.fanli.entity.config.AppHomeFloatImg;
import com.yeshi.fanli.entity.xcx.XCXSettingConfig;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import net.sf.json.JSONArray;
@Service
public class ConfigServiceImpl implements ConfigService {
@@ -32,6 +33,44 @@
        return configDao.list("from Config");
    }
    @Override
    public List<Config> listObjects(String key, int page) {
        int start = (page-1) * Constant.PAGE_SIZE;
        StringBuffer hqlBuf=new StringBuffer("from Config pr where 1=1 ");
        if(key !=null && !"".equals(key.trim())){
            hqlBuf.append(" and (pr.name like ? )");
        }
        hqlBuf.append(" order by pr.id desc ");
        String hql = hqlBuf.toString();
        if(hql.contains("pr.name")){
            return configDao.list(hqlBuf.toString(), start, Constant.PAGE_SIZE, new Serializable[]{"%"+key+"%"});
        } else {
            return configDao.list(hqlBuf.toString(), start, Constant.PAGE_SIZE, new Serializable[]{});
        }
    }
    @Override
    public int getCount(String key, int page) {
        StringBuffer hqlBuf=new StringBuffer("select count(*) from Config pr where 1=1 ");
        if(key !=null && !"".equals(key.trim())){
            hqlBuf.append(" and (pr.name like ? )");
        }
        String hql = hqlBuf.toString();
        if(hql.contains("pr.name")){
            return (int) configDao.getCount(hqlBuf.toString(),new Serializable[]{"%"+key+"%"});
        } else {
            return (int) configDao.getCount(hqlBuf.toString(), new Serializable[]{});
        }
    }
    @CacheEvict(value = "config", allEntries = true)
    @Transactional
    public void update(List<Config> list) {
@@ -146,5 +185,10 @@
        String value = get("home_weex_url");
        return value;
    }
    @Override
    public Config getConfig(long id) {
        return configDao.find(Config.class, id);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/config/HotSearchServiceImpl.java
@@ -8,6 +8,7 @@
import javax.annotation.Resource;
import org.apache.commons.beanutils.PropertyUtils;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
@@ -23,6 +24,7 @@
import com.yeshi.fanli.service.inter.config.SuperHotSearchService;
import com.yeshi.fanli.service.inter.config.SystemService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.Utils;
@Service
@@ -202,4 +204,130 @@
        });
    }
    @Override
    @SuppressWarnings("unchecked")
    public List<HotSearch> listQuery(int start, int count, String key, Long systemId) throws Exception {
        List<HotSearch> listObj = null;
        if (systemId == null) {
            String hql = "from HotSearch hs where 1=1 ";
            if (!StringUtil.isNullOrEmpty(key)) {
                hql += " hs.name like ?";
            }
            final String queryHQL = hql;
            listObj = (List<HotSearch>) hotSearchDao.excute(new HibernateCallback<List<HotSearch>>() {
                public List<HotSearch> doInHibernate(Session session) throws HibernateException {
                    Query query = session.createQuery(queryHQL);
                    query.setFirstResult(start);
                    query.setMaxResults(count);
                    if (!StringUtil.isNullOrEmpty(key)) {
                        query.setParameter(0, "%" + key + "%");
                    }
                    return query.list();
                }
            });
        } else {
            List<SuperHotSearch> superHotSearchList = null;
            if(StringUtil.isNullOrEmpty(key)){
                superHotSearchList = superHotSearchService.getSuperHotSearchBySystemId(systemId,start, count);
            }else{
                String likekey = "%"+key+"%";
                superHotSearchList = superHotSearchService.getSuperHotSearchBySystemId(systemId, start, count, likekey);
            }
            if (superHotSearchList != null && superHotSearchList.size() > 0) {
                listObj = new ArrayList<HotSearch>();
                for (SuperHotSearch superHotSearch: superHotSearchList) {
                    HotSearch hotSearch = superHotSearch.getHotSearch();
                    listObj.add(hotSearch);
                }
            }
        }
        if (listObj == null || listObj.size() == 0) {
            return null;
        }
        List<Long> listId = new ArrayList<>();
        for (HotSearch hotSearch : listObj) {
            listId.add(hotSearch.getId());
        }
        List<System> systemList = systemService.getSystems();
        List<SuperHotSearch> listSuper = superHotSearchService.listSuperHotSearch(listId);
        if (listSuper == null || listSuper.size() == 0) {
            for (HotSearch hotSearch : listObj) {
                hotSearch.setSystemList(systemList);
            }
        } else {
            for (HotSearch hotSearch : listObj) {
                Long id = hotSearch.getId();
                List<System> newList = new ArrayList<System>();
                // 是否有关联系统选项
                for (System dsystem : systemList) {
                    System newsystem = new System();
                    try {
                        PropertyUtils.copyProperties(newsystem, dsystem);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    if (listSuper != null && listSuper.size() > 0) {
                        Long superSystemId = newsystem.getId();
                        for (SuperHotSearch superHotSearch : listSuper) {
                            HotSearch search = superHotSearch.getHotSearch();
                            System system = superHotSearch.getSystem();
                            // 当前专题 、当前系统
                            if (search != null && system != null && id == search.getId() && superSystemId == system.getId()) {
                                newsystem.setCheck(1);
                                break;
                            }
                        }
                    }
                    if (newsystem.getCheck() != 1) {
                        newsystem.setCheck(0);
                    }
                    newList.add(newsystem);
                }
                hotSearch.setSystemList(newList);
            }
        }
        return listObj;
    }
    @Override
    public int countList(String key, Long systemId) {
        return (Integer) hotSearchDao.excute(new HibernateCallback<Integer>() {
            public Integer doInHibernate(Session session)
                    throws HibernateException {
                Query query = null;
                if (StringUtil.isNullOrEmpty(key)) {
                    query = session.createQuery("select count(hs.id) from HotSearch hs");
                } else {
                    query = session.createQuery("select count(hs.id) from HotSearch hs where hs.name like ?");
                    query.setParameter(0, "%"+key+"%");
                }
                Long result = (Long) query.uniqueResult();
                return result.intValue();
            }
        });
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/config/InviteGetMoneyServiceImpl.java
@@ -20,6 +20,7 @@
import com.yeshi.fanli.entity.bus.invite.SpreadImg;
import com.yeshi.fanli.service.inter.config.InviteGetMoneyService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
@Service
public class InviteGetMoneyServiceImpl implements InviteGetMoneyService {
@@ -171,5 +172,31 @@
    public void editActivityRules(String value, String key) {
        shareMapper.editActivityRules(value, key);
    }
    @Override
    public List<SpreadImg> listQuery(int start, int pageSize, String key) {
        if (StringUtil.isNullOrEmpty(key)) {
            return spreadImgDao.list("from SpreadImg si order by si.createtime desc", start,
                    pageSize, new Serializable[] {});
        } else {
            return spreadImgDao.list("from SpreadImg si where si.url like ? order by si.createtime desc", start,
                    pageSize, new Serializable[] { "%" + key + "%" });
        }
    }
    @Override
    public long countQuery(String key) {
        if (StringUtil.isNullOrEmpty(key)) {
            return spreadImgDao.getCount("SELECT COUNT(id) FROM SpreadImg");
        } else {
            return spreadImgDao.getCount("SELECT COUNT(id) FROM SpreadImg where url like ? ",
                    new Serializable[] { "%" + key + "%" });
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/config/SuperHotSearchSerivceImpl.java
@@ -20,6 +20,7 @@
import com.yeshi.fanli.entity.system.System;
import com.yeshi.fanli.service.inter.config.SuperHotSearchService;
import com.yeshi.fanli.service.inter.config.SystemService;
import com.yeshi.fanli.util.StringUtil;
@Service
public class SuperHotSearchSerivceImpl implements SuperHotSearchService {
@@ -67,7 +68,23 @@
                strat, count, new Serializable[] { id, key });
    }
    @Override
    @SuppressWarnings({ "unchecked", "rawtypes" })
    public List<SuperHotSearch> listSuperHotSearch(List<Long> list) {
        List<SuperHotSearch> listObj = (List<SuperHotSearch>) superHotSearchDao.excute(new HibernateCallback<List<SuperHotSearch>>() {
            public List<SuperHotSearch> doInHibernate(Session session) throws HibernateException {
                Query query = session.createQuery("from SuperHotSearch srs where srs.hotSearch.id in (:array)");
                 query.setParameterList("array",list);
                 return query.list();
            }
        });
        return listObj;
    }
    public Integer deleteSuperHotSearch(final long hsid, final String platform, final String packageName) {
        return (Integer) superHotSearchDao.excute(new HibernateCallback<Integer>() {
@@ -101,4 +118,48 @@
        return getSuperHotSearchBySystemId(id);
    }
    @SuppressWarnings({ "unchecked", "rawtypes" })
    @Override
    public List<SuperHotSearch> getHotSearchSystem(Long id, Long systemId) {
        List<SuperHotSearch> listObj = (List<SuperHotSearch>) superHotSearchDao.excute(new HibernateCallback<List<SuperHotSearch>>() {
            public List<SuperHotSearch> doInHibernate(Session session) throws HibernateException {
                Query query = session.createQuery("from SuperHotSearch shs " + " where shs.hotSearch.id=? and shs.system.id=?");
                query.setLong(0, id);
                query.setLong(1,systemId);
                return query.list();
            }
        });
        return listObj;
    }
    @Override
    public Integer deleteSuper(Long id, Long systemId) {
        return (Integer) superHotSearchDao.excute(new HibernateCallback<Integer>() {
            public Integer doInHibernate(Session session) throws HibernateException {
                Transaction transaction = session.beginTransaction();
                Query query = session
                        .createQuery("delete SuperHotSearch shs " + " where shs.hotSearch.id=? and shs.system.id=?");
                query.setLong(0, id);
                query.setLong(1, systemId);
                int i = query.executeUpdate();
                transaction.commit();
                return i;
            }
        });
    }
    @Override
    public void addSuper(Long id, System system) {
        SuperHotSearch superHotSearch = new SuperHotSearch();
        HotSearch hotSearch = new HotSearch();
        hotSearch.setId(id);
        superHotSearch.setHotSearch(hotSearch);
        superHotSearch.setSystem(system);
        superHotSearchDao.create(superHotSearch);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/config/SystemClientParamsServiceImpl.java
@@ -7,6 +7,7 @@
import javax.annotation.Resource;
import org.apache.commons.beanutils.PropertyUtils;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
@@ -25,7 +26,9 @@
import com.yeshi.fanli.entity.system.System;
import com.yeshi.fanli.entity.system.SystemClientParams;
import com.yeshi.fanli.service.inter.config.SystemClientParamsService;
import com.yeshi.fanli.service.inter.config.SystemService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
@Service
public class SystemClientParamsServiceImpl implements SystemClientParamsService {
@@ -38,6 +41,9 @@
    
    @Resource
    private SystemHelpListDao systemHelpListDao;
    @Resource
    private SystemService systemService;
    
    @Resource
    private SystemSecondProblemDao systemSecondProblemDao;
@@ -74,6 +80,7 @@
                list = systemClientParamsDao.list(hqlb.toString());
            }
        }
        SystemClientParamsAdmin scpa = null;
        for (SystemClientParams scp : list) {
            scpa = new SystemClientParamsAdmin(scp);
@@ -287,6 +294,108 @@
        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 = ? ",
                         new Serializable[] {systemId});
            } else {
                list = systemClientParamsDao.list(
                        "from SystemClientParams scp where scp.system.id = ? and (scp.name like ? or scp.key like ?)",
                        new Serializable[] {systemId, "%" + key + "%" ,"%" + key + "%"});
            }
        }
        return list;
    }
    @Override
    public long countQuery(String key, Long systemId) {
        if (systemId == null) {
            if (StringUtil.isNullOrEmpty(key)) {
                return systemClientParamsDao.getCount("from SystemClientParams scp");
            } else {
                return systemClientParamsDao.getCount("from SystemClientParams scp where (scp.name like ? or scp.key like ?) ",
                        new Serializable[] { "%" + key + "%" ,"%" + key + "%"});
            }
        } else {
            if (StringUtil.isNullOrEmpty(key)) {
                return systemClientParamsDao.getCount("from SystemClientParams scp where scp.system.id = ? ",
                         new Serializable[] {systemId});
            } else {
                return systemClientParamsDao.getCount(
                        "from SystemClientParams scp where scp.system.id = ? and (scp.name like ? or scp.key like ?)",
                        new Serializable[] {systemId, "%" + key + "%" ,"%" + key + "%"});
            }
        }
    }
    @Transactional
    public void saveAdd(SystemClientParams scp, List<Long> listId) throws Exception {
        if (listId == null || listId.size() == 0) {
            return;
        }
        SystemClientParams nscp = null;
        for (Long systemId : listId) {
            System system  = new System(systemId);
            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);
        }
    }
    @Override
    public void update(SystemClientParams systemClientParams) {
        systemClientParamsDao.update(systemClientParams);
    }
    @Override
    public List<SystemClientParams> getById(long id) {
        return systemClientParamsDao.list("from SystemClientParams scp where scp.id=?",
                new Serializable[] { 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();
                }
            });
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/config/SystemServiceImpl.java
@@ -56,4 +56,11 @@
    public System getSystemCache(String platform, String packages) {
        return getSystem(platform, packages);
    }
    @Override
    public System getById(long id) {
        return systemDao.find(System.class, id);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/CollectionGoodsServiceImpl.java
@@ -13,6 +13,7 @@
import com.yeshi.fanli.dao.goods.CollectionGoodsDao;
import com.yeshi.fanli.entity.bus.user.CollectionGoods;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.service.inter.goods.CollectionGoodsService;
import com.yeshi.fanli.util.Constant;
@@ -94,4 +95,45 @@
            return null;
    }
    @Override
    public void updateCollectionGoods(TaoBaoGoodsBrief goods) {
        if (goods != null && goods.getAuctionId() != null) {
            long count = dao.getCount("select count(*) from CollectionGoods cg where cg.auctionId=?",
                    new Serializable[] { goods.getAuctionId() });
            if (count > 0) {
                int pageSize = 50;
                int page = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
                for (int i = 0; i < page; i++) {
                    List<CollectionGoods> list = dao.list("from CollectionGoods cg where cg.auctionId=?", i * pageSize,
                            pageSize, new Serializable[] { goods.getAuctionId() });
                    if (list != null)
                        for (CollectionGoods cg : list) {
                            cg = getCollectionGoods(cg, goods);
                            if (cg != null)
                                dao.update(cg);
                        }
                }
            }
        }
    }
    private static CollectionGoods getCollectionGoods(CollectionGoods collectionGoods, TaoBaoGoodsBrief goods) {
        if (collectionGoods == null || goods == null)
            return null;
        // 更新商品信息(标题,销量,图片,佣金比例,价格,券信息)
        collectionGoods.setBiz30day(goods.getBiz30day());
        collectionGoods.setTitle(goods.getTitle());
        collectionGoods.setCouponAmount(goods.getCouponAmount());
        collectionGoods.setCouponEffectiveEndTime(goods.getCouponEffectiveEndTime());
        collectionGoods.setCouponLeftCount(goods.getCouponLeftCount());
        collectionGoods.setCouponEffectiveStartTime(goods.getCouponEffectiveStartTime());
        collectionGoods.setCouponStartFee(goods.getCouponStartFee());
        collectionGoods.setCouponTotalCount(goods.getCouponTotalCount());
        collectionGoods.setTkRate(goods.getTkRate());
        collectionGoods.setPictUrl(goods.getPictUrl());
        collectionGoods.setZkPrice(goods.getZkPrice());
        collectionGoods.setReservePrice(goods.getReservePrice());
        return collectionGoods;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/help/AppPageNotificationServiceImpl.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.service.impl.help;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
@@ -48,4 +49,35 @@
        appPageNotificationMapper.insertSelective(apn);
    }
    @Override
    public void insertSelective(AppPageNotification record) {
        appPageNotificationMapper.insertSelective(record);
    }
    @Override
    public void updateByPrimaryKeySelective(AppPageNotification record) {
        appPageNotificationMapper.updateByPrimaryKeySelective(record);
    }
    @Override
    public AppPageNotification selectByPrimaryKey(Long id) {
        return appPageNotificationMapper.selectByPrimaryKey(id);
    }
    @Override
    public int deleteBatchByPrimaryKey(List<Long> list) {
        return appPageNotificationMapper.deleteBatchByPrimaryKey(list);
    }
    @Override
    public List<AppPageNotification> listQuery(long start, int count, String key, Integer show, Integer canClose) {
        return appPageNotificationMapper.listQuery(start, count, key, show, canClose);
    }
    @Override
    public long countQuery(String key, Integer show, Integer canClose) {
        return appPageNotificationMapper.countQuery(key, show, canClose);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/HomeNavbarServiceImpl.java
@@ -1,19 +1,38 @@
package com.yeshi.fanli.service.impl.homemodule;
import javax.annotation.Resource;
import java.io.InputStream;
import java.util.ArrayList;
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.HomeNavbarMapper;
import com.yeshi.fanli.dao.mybatis.homemodule.SuperHomeNavbarMapper;
import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar;
import com.yeshi.fanli.entity.bus.homemodule.SuperHomeNavbar;
import com.yeshi.fanli.entity.system.System;
import com.yeshi.fanli.service.inter.config.SystemService;
import com.yeshi.fanli.service.inter.homemodule.HomeNavbarService;
import com.yeshi.fanli.util.StringUtil;
@Service
public class HomeNavbarServiceImpl implements HomeNavbarService {
    
    @Resource
    private SystemService systemService;
    @Resource
    private HomeNavbarMapper homeNavbarMapper;
    @Resource
    private SuperHomeNavbarMapper superHomeNavbarMapper;
    
    @Override
@@ -46,4 +65,132 @@
        return homeNavbarMapper.updateByPrimaryKey(record);
    }
    @Override
    @Transactional
    public int deleteBatchByPrimaryKey(List<Long> list) {
        superHomeNavbarMapper.deleteBatchByNavbarIds(list);
        for (Long id: list) {
            HomeNavbar homeNavbar = homeNavbarMapper.selectByPrimaryKey(id);
            if (homeNavbar !=null) {
                // 删除已存在图片 /
                String picture = homeNavbar.getPicture();
                if (!StringUtil.isNullOrEmpty(picture)) {
                    COSManager.getInstance().deleteFile(picture);
                }
            }
        }
        return homeNavbarMapper.deleteBatchByPrimaryKey(list);
    }
    @Override
    public int getMaxOrder() {
        return homeNavbarMapper.getMaxOrder();
    }
    @Override
    public List<HomeNavbar> getChangeOrder(Integer type, Integer order) {
        return homeNavbarMapper.getChangeOrder(type, order);
    }
    @Override
    public List<HomeNavbar> listQuery(long start, int count, String key) {
        List<HomeNavbar> listObj = homeNavbarMapper.listQuery(start, count, key);
        if (listObj == null || listObj.size() == 0) {
            return null;
        }
        List<System> systemList = systemService.getSystems();
        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) {
            for (HomeNavbar homeNavbar: listObj) {
                homeNavbar.setSystemList(systemList);
            }
        } else {
            for (HomeNavbar homeNavbar: listObj) {
                Long id = homeNavbar.getId();
                List<System> newList = new ArrayList<System>();
                // 是否有关联系统选项
                for (System dsystem : systemList) {
                    System newsystem = new System();
                    try {
                        PropertyUtils.copyProperties(newsystem, dsystem);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    if (listSuper != null && listSuper.size() > 0) {
                        Long systemId = newsystem.getId();
                        for (SuperHomeNavbar superHomeNavbar : listSuper) {
                            HomeNavbar navbar = superHomeNavbar.getHomeNavbar();
                            System system = superHomeNavbar.getSystem();
                            // 当前专题 、当前系统
                            if (navbar != null && system != null && id == navbar.getId()
                                    && systemId == system.getId()) {
                                newsystem.setCheck(1);
                                break;
                            }
                        }
                    }
                    if (newsystem.getCheck() != 1) {
                        newsystem.setCheck(0);
                    }
                    newList.add(newsystem);
                }
                homeNavbar.setSystemList(newList);
            }
        }
        return listObj;
    }
    @Override
    public long countlistQuery(String key) {
        return homeNavbarMapper.countListQuery(key);
    }
    @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);
        }
        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,12 +1,25 @@
package com.yeshi.fanli.service.impl.homemodule;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import javax.transaction.Transactional;
import org.apache.commons.beanutils.PropertyUtils;
import org.springframework.stereotype.Service;
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.Special;
import com.yeshi.fanli.entity.bus.homemodule.SpecialCard;
import com.yeshi.fanli.entity.bus.homemodule.SuperSpecialCard;
import com.yeshi.fanli.entity.system.System;
import com.yeshi.fanli.service.inter.config.SystemService;
import com.yeshi.fanli.service.inter.homemodule.SpecialCardService;
import com.yeshi.fanli.service.inter.homemodule.SpecialService;
import com.yeshi.fanli.util.StringUtil;
@Service
@@ -15,6 +28,14 @@
    @Resource
    private SpecialCardMapper specialCardMapper;
    @Resource
    private SystemService systemService;
    @Resource
    private SpecialService specialService;
    @Resource
    private SuperSpecialCardMapper superSpecialCardMapper;
    
    @Override
    public int deleteByPrimaryKey(Long id) {
@@ -46,4 +67,93 @@
        return specialCardMapper.updateByPrimaryKey(record);
    }
    @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);
        if (listObj == null || listObj.size() == 0) {
            return null;
        }
        List<System> systemList = systemService.getSystems();
        List<Long> listCardId = new ArrayList<Long>();
        for (SpecialCard specialCard: listObj) {
            listCardId.add(specialCard.getId());
        }
        List<SuperSpecialCard> listSuper = superSpecialCardMapper.listByCardIDs(listCardId);
        if (listSuper == null || listSuper.size() == 0) {
            for (SpecialCard specialCard: listObj) {
                specialCard.setSystemList(systemList);
            }
        } else {
            for (SpecialCard specialCard: listObj) {
                Long id = specialCard.getId();
                List<System> newList = new ArrayList<System>();
                // 是否有关联系统选项
                for (System dsystem : systemList) {
                    System newsystem = new System();
                    try {
                        PropertyUtils.copyProperties(newsystem, dsystem);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    if (listSuper != null && listSuper.size() > 0) {
                        Long systemId = newsystem.getId();
                        for (SuperSpecialCard superSpecialCard : listSuper) {
                            SpecialCard special = superSpecialCard.getSpecialCard();
                            System system = superSpecialCard.getSystem();
                            // 当前专题 、当前系统
                            if (special != null && system != null && id == special.getId()
                                    && systemId == system.getId()) {
                                newsystem.setCheck(1);
                                break;
                            }
                        }
                    }
                    if (newsystem.getCheck() != 1) {
                        newsystem.setCheck(0);
                    }
                    newList.add(newsystem);
                }
                specialCard.setSystemList(newList);
            }
        }
        return listObj;
    }
    @Override
    public long countlistQuery(String key) {
        return specialCardMapper.countlistQuery(key);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java
@@ -1,12 +1,22 @@
package com.yeshi.fanli.service.impl.homemodule;
import javax.annotation.Resource;
import java.io.InputStream;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import javax.annotation.Resource;
import javax.transaction.Transactional;
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.SpecialMapper;
import com.yeshi.fanli.entity.bus.homemodule.Special;
import com.yeshi.fanli.service.inter.homemodule.SpecialService;
import com.yeshi.fanli.util.StringUtil;
@Service
@@ -45,5 +55,105 @@
    public int updateByPrimaryKey(Special record) {
        return specialMapper.updateByPrimaryKey(record);
    }
    @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);
            }
        }
        return specialMapper.deleteBatchByPrimaryKey(list);
    }
    @Override
    public int deleteBatchByCardID(List<Long> list) throws Exception{
        List<Special> listSpecial = specialMapper.queryByListCardID(list);
        for (Special special: listSpecial) {
            String src = special.getPicture();
            if (!StringUtil.isNullOrEmpty(src)) {
                COSManager.getInstance().deleteFile(src);
            }
        }
        return specialMapper.deleteBatchByCardID(list);
    }
    @Override
    public List<Special> listQueryByCard(long start, int count, Long card, String key){
        return specialMapper.listQueryByCard(start, count, card, key);
    }
    @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")
    public List<Special> listBySystemAndCard( String card, Long systemId) {
        return specialMapper.listBySystemAndCard(card, systemId);
    }
    @Override
    public void uploadPicture(MultipartFile file, Special record, Long cardId) 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);
            }
        }
        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);
            }
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SuperHomeNavbarServiceImpl.java
@@ -62,5 +62,26 @@
    }
    
    
    @Override
    public List<SuperHomeNavbar> listByNavbarIds(List<Long> list) {
        return superHomeNavbarMapper.listByNavbarIds(list);
    }
    @Override
    public void deleteBatchByNavbarIds(List<Long> list) {
         superHomeNavbarMapper.deleteBatchByNavbarIds(list);
    }
    @Override
    public List<SuperHomeNavbar> querybyNavbarId(Long navbarId, Long systemId) {
        return superHomeNavbarMapper.querybyNavbarId(navbarId, systemId);
    }
    @Override
    public int deletebyNavbarId(Long navbarId, Long systemId) {
        return superHomeNavbarMapper.deletebyNavbarId(navbarId, systemId);
    }
    
}
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SuperSpecialCardServiceImpl.java
New file
@@ -0,0 +1,70 @@
package com.yeshi.fanli.service.impl.homemodule;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.homemodule.SuperSpecialCardMapper;
import com.yeshi.fanli.entity.bus.homemodule.SuperSpecialCard;
import com.yeshi.fanli.service.inter.config.SystemService;
import com.yeshi.fanli.service.inter.homemodule.SuperSpecialCardService;
@Service
public class SuperSpecialCardServiceImpl implements SuperSpecialCardService {
    @Resource
    private SystemService systemService;
    @Resource
    private SuperSpecialCardMapper superSpecialCardMapper;
    @Override
    public int deleteByPrimaryKey(Long id) {
        return superSpecialCardMapper.deleteByPrimaryKey(id);
    }
    @Override
    public int insert(SuperSpecialCard record) {
        return superSpecialCardMapper.insert(record);
    }
    @Override
    public int insertSelective(SuperSpecialCard record) {
        return superSpecialCardMapper.insertSelective(record);
    }
    @Override
    public SuperSpecialCard selectByPrimaryKey(Long id) {
        return superSpecialCardMapper.selectByPrimaryKey(id);
    }
    @Override
    public int updateByPrimaryKeySelective(SuperSpecialCard record) {
        return superSpecialCardMapper.updateByPrimaryKeySelective(record);
    }
    @Override
    public int updateByPrimaryKey(SuperSpecialCard record) {
        return superSpecialCardMapper.updateByPrimaryKey(record);
    }
    @Override
    public int deleteBatchByCardId(List<Long> list) {
        return superSpecialCardMapper.deleteBatchByCardId(list);
    }
    @Override
    public void deletebyCardIdAndSystemId(Long cardId, Long systemId) throws Exception {
        superSpecialCardMapper.deletebyCardIdAndSystemId(cardId, systemId);
    }
    @Override
    public List<SuperSpecialCard> querybyCardIdAndSystemId(Long cardId, Long systemId) throws Exception {
        return superSpecialCardMapper.querybyCardIdAndSystemId(cardId, systemId);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SwiperPictureServiceImpl.java
@@ -8,6 +8,7 @@
import javax.annotation.Resource;
import javax.transaction.Transactional;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
@@ -126,6 +127,7 @@
    }
    
    @Override
    @Cacheable(value = "bannerCache", key = "'getByBannerCard-'+#card")
    public List<SwiperPicture> getByBannerCard(String card) throws SwiperPictureException {
        return swiperPictureMapper.getByBannerCard(card);
    }
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/HongBaoServiceImpl.java
@@ -910,7 +910,7 @@
                });
            }
        } else if ("订单结算".equals(taoBaoOrder.getOrderState())) {// 更新预估获取时间
            BigDecimal money = MoneyBigDecimalUtil.mul(taoBaoOrder.getEstimate(), rate);
            BigDecimal money = MoneyBigDecimalUtil.mul(taoBaoOrder.geteIncome(), rate);
            // 设置预计领取时间
            long settlementTime = TimeUtil.convertDateToTemp2(taoBaoOrder.getSettlementTime().trim());
            // 预计领取时间
@@ -940,7 +940,8 @@
                    hongBaoMapper.updateByPrimaryKeySelective(updateChildHongBao);
                });
            BigDecimal estimate = taoBaoOrder.getEstimate();
            BigDecimal estimate = taoBaoOrder.geteIncome();
            updateHongBao.setPayMoney(taoBaoOrder.getSettlement());
            updateHongBao.setMoney(MoneyBigDecimalUtil.mul(estimate, rate));
        }
@@ -985,9 +986,17 @@
        // 创建红包
        JSONObject data = new JSONObject();
        HongBao hongBao = HongBaoFactory.createHongBao(MoneyBigDecimalUtil.mul(baseRate, taoBaoOrder.getEstimate()),
                data.toString(), order.getId(), null, order.getUserInfo(), 1, taoBaoOrder.getPayment(),
                taoBaoOrder.getAuctionId());
        HongBao hongBao = null;
        if (taoBaoOrder.getOrderState().equalsIgnoreCase("订单结算"))
            // 订单结算应该取结算金额与预估收入
            hongBao = HongBaoFactory.createHongBao(MoneyBigDecimalUtil.mul(baseRate, taoBaoOrder.geteIncome()),
                    data.toString(), order.getId(), null, order.getUserInfo(), 1, taoBaoOrder.getSettlement(),
                    taoBaoOrder.getAuctionId());
        else
            hongBao = HongBaoFactory.createHongBao(MoneyBigDecimalUtil.mul(baseRate, taoBaoOrder.getEstimate()),
                    data.toString(), order.getId(), null, order.getUserInfo(), 1, taoBaoOrder.getPayment(),
                    taoBaoOrder.getAuctionId());
        hongBao.setOrderId(taoBaoOrder.getOrderId());
        hongBao.setOrderItemId(orderItem.getId());
        hongBao.setPreGettime(0L);
@@ -1024,7 +1033,19 @@
            else
                rate = new BigDecimal(hbm.getValue()).divide(new BigDecimal(100));
            if (rate.compareTo(new BigDecimal(0)) > 0) {
                HongBao hongBao2 = HongBaoFactory.createHongBao(
                HongBao hongBao2 = null;
                if (taoBaoOrder.getOrderState().equalsIgnoreCase("订单结算")) {
                    // 订单结算应该取结算金额与预估收入
                    hongBao2 = HongBaoFactory.createHongBao(
                            MoneyBigDecimalUtil.mul(rate, MoneyBigDecimalUtil.mul(taoBaoOrder.geteIncome(), baseRate)),
                            null, hongBao, boss, Constant.ONESALE);
                } else {
                    hongBao2 = HongBaoFactory.createHongBao(
                            MoneyBigDecimalUtil.mul(rate, MoneyBigDecimalUtil.mul(taoBaoOrder.getEstimate(), baseRate)),
                            null, hongBao, boss, Constant.ONESALE);
                }
                HongBaoFactory.createHongBao(
                        MoneyBigDecimalUtil.mul(rate, MoneyBigDecimalUtil.mul(taoBaoOrder.getEstimate(), baseRate)),
                        null, hongBao, boss, Constant.ONESALE);
                // 设置订单号
@@ -1050,10 +1071,18 @@
                else
                    rate = new BigDecimal(hbm.getValue()).divide(new BigDecimal(100));
                if (rate.compareTo(new BigDecimal(0)) > 0) {
                    HongBao hongBao3 = HongBaoFactory.createHongBao(
                            MoneyBigDecimalUtil.mul(rate, MoneyBigDecimalUtil.mul(taoBaoOrder.getEstimate(), baseRate)),
                            null, hongBao, boss2, Constant.TWOSALE);
                    // 订单结算应该取结算金额与预估收入
                    HongBao hongBao3 = null;
                    if (taoBaoOrder.getOrderState().equalsIgnoreCase("订单结算"))
                        hongBao3 = HongBaoFactory.createHongBao(
                                MoneyBigDecimalUtil.mul(rate,
                                        MoneyBigDecimalUtil.mul(taoBaoOrder.geteIncome(), baseRate)),
                                null, hongBao, boss2, Constant.TWOSALE);
                    else
                        hongBao3 = HongBaoFactory.createHongBao(
                                MoneyBigDecimalUtil.mul(rate,
                                        MoneyBigDecimalUtil.mul(taoBaoOrder.getEstimate(), baseRate)),
                                null, hongBao, boss2, Constant.TWOSALE);
                    // 设置返利订单号
                    hongBao3.setOrderId(taoBaoOrder.getOrderId());
                    hongBaoMapper.insertSelective(hongBao3);
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/ThreeSaleSerivceImpl.java
@@ -13,6 +13,7 @@
import org.springframework.orm.hibernate4.HibernateCallback;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.yeshi.utils.NumberUtil;
import com.yeshi.fanli.dao.mybatis.ThreeSaleMapper;
import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
@@ -24,7 +25,6 @@
import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.util.Constant;
import org.yeshi.utils.NumberUtil;
@Service
public class ThreeSaleSerivceImpl implements ThreeSaleSerivce {
@@ -310,6 +310,39 @@
    public int updateExpire(List<Long> list){
        return threeSaleMapper.updateExpire(list);
    }
    @Override
    public List<ThreeSale> listFirstTeamQuery(long start, int count, Long uid, Integer state, String startTime,
            String endTime) {
        return threeSaleMapper.listFirstTeamQuery(start, count, uid, state, startTime, endTime);
    }
    @Override
    public long countFirstTeamQuery(Long uid, Integer state, String startTime, String endTime) {
        return threeSaleMapper.countFirstTeamQuery(uid, state, startTime, endTime);
    }
    @Override
    public List<ThreeSale> listSecondTeamQuery(long start, int count, Long uid, Integer state, String startTime,
            String endTime) {
        return threeSaleMapper.listSecondTeamQuery(start, count, uid, state, startTime, endTime);
    }
    @Override
    public long countSecondTeamQuery(Long uid, Integer state, String startTime, String endTime) {
        return threeSaleMapper.countSecondTeamQuery(uid, state, startTime, endTime);
    }
    @Override
    public List<ThreeSale> listSuperiorQuery(long start, int count, Integer state, Long uid) {
        return threeSaleMapper.listSuperiorQuery(start, count, state, uid);
    }
    @Override
    public long countSuperiorQuery(Integer state, Long uid) {
        return threeSaleMapper.countSuperiorQuery(state, uid);
    }
    
    
}
fanli/src/main/java/com/yeshi/fanli/service/impl/lable/QualityGoodsServiceImpl.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.service.impl.lable;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
@@ -16,6 +17,8 @@
import com.yeshi.fanli.dao.mybatis.lable.QualityFactoryMapper;
import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoGoodsBriefMapper;
import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoGoodsBriefRecordMapper;
import com.yeshi.fanli.entity.bus.lable.Label;
import com.yeshi.fanli.entity.bus.lable.LabelGoods;
import com.yeshi.fanli.entity.bus.lable.QualityFactory;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
@@ -25,6 +28,7 @@
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.taobao.TbImgUtil;
@@ -240,15 +244,15 @@
    
    @Override
    public List<QualityFactory> listRecommendBykey(long start, int count, String key, Integer hasQuan,
            Integer userType, Double startprice, Double endprice, Integer sort) {
            Integer userType, Double startprice, Double endprice, Double startTkRate, Double endTkRate, Integer sort) {
        return qualityFactoryMapper.listRecommendBykey(start, count, key, hasQuan, userType,
                startprice, endprice, sort);
                startprice, endprice, startTkRate, endTkRate, sort);
    }
    @Override
    public long countRecommendBykey(String key, Integer hasQuan, Integer userType,
            Double startprice, Double endprice) {
        return qualityFactoryMapper.countRecommendBykey(key, hasQuan, userType, startprice, endprice);
            Double startprice, Double endprice, Double startTkRate, Double endTkRate) {
        return qualityFactoryMapper.countRecommendBykey(key, hasQuan, userType, startprice, endprice, startTkRate, endTkRate);
    }
    
    
@@ -334,5 +338,42 @@
        return countRecommend(pop, commision, couponAmount, tkRate, couponRatio);
    }
    
    @Override
    public List<QualityFactory> recommendByAuctionId(Long auctionId){
        List<Long> list = new ArrayList<Long>();
        list.add(auctionId);
        List<QualityFactory> listTaoBaoGoods = qualityFactoryMapper.listQueryByAuctionId(list);
        if (listTaoBaoGoods == null || listTaoBaoGoods.size() == 0) {
            return null;
        }
        QualityFactory qualityFactory = listTaoBaoGoods.get(0);
        TaoBaoGoodsBrief goodsBrief = qualityFactory.getTaoBaoGoodsBrief();
        if (goodsBrief == null) {
            return null;
        }
        List<LabelGoods> listLab = labelGoodsMapper.queryByGoodsId(0, 200, goodsBrief.getId());
        if (listLab == null || listLab.size() == 0) {
            return null;
        }
        // 标签id
        List<Long> listId = new ArrayList<Long>();
        for (LabelGoods labelGoods: listLab) {
            Label label = labelGoods.getLabel();
            if (label != null) {
                listId.add(label.getId());
            }
        }
        if (listId.size() == 0) {
            return null;
        }
        return qualityFactoryMapper.listQueryBylabIDs(0, 10, listId, goodsBrief.getId(),qualityFactory.getSystemCid());
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/monitor/MonitorServiceImpl.java
New file
@@ -0,0 +1,24 @@
package com.yeshi.fanli.service.impl.monitor;
import javax.annotation.Resource;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.mybatis.monitor.ClientAPIMonitorMapper;
import com.yeshi.fanli.entity.monitor.ClientAPIMonitor;
import com.yeshi.fanli.service.inter.monitor.MonitorService;
@Service
public class MonitorServiceImpl implements MonitorService {
    @Resource
    private ClientAPIMonitorMapper clientAPIMonitorMapper;
    @Async
    @Override
    public void addClientAPIMonitor(ClientAPIMonitor monitor) {
        clientAPIMonitorMapper.insertSelective(monitor);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/order/LostOrderServiceImpl.java
@@ -2,13 +2,17 @@
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.yeshi.utils.NumberUtil;
import com.yeshi.fanli.dao.mybatis.order.LostOrderMapper;
import com.yeshi.fanli.dao.order.LostOrderDao;
import com.yeshi.fanli.dao.order.PidOrderDao;
import com.yeshi.fanli.entity.bus.user.LostOrder;
@@ -17,7 +21,6 @@
import com.yeshi.fanli.service.inter.order.OrderService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.Utils;
import org.yeshi.utils.NumberUtil;
@Service
public class LostOrderServiceImpl implements LostOrderService {
@@ -31,6 +34,9 @@
    @Resource
    private PidOrderDao pidOrderDao;
    @Resource
    private LostOrderMapper lostOrderMapper;
    @Override
    public int addLostOrder(LostOrder lostOrder) {
        String orderId = lostOrder.getOrderId();
@@ -38,6 +44,20 @@
        if (type == null) { // 默认为淘宝订单
            lostOrder.setType(1);
            type = 1;
        }
        // 查询是否提交
        List<LostOrder> orderList = lostOrderMapper.selectByOrderId(orderId);
        if (orderList != null && orderList.size() > 0) {
            if (orderList.get(0).getState() == 0 || orderList.get(0).getResultCode() == LostOrder.RESULT_CODE_VERFING) {
                return -2;
            } else if (orderList.get(0).getState() == 1
                    && orderList.get(0).getResultCode() == LostOrder.RESULT_CODE_SUCCESS) {
                return -1;
            } else if (orderList.get(0).getState() == 1
                    && orderList.get(0).getResultCode() == LostOrder.RESULT_CODE_FAIL) {
                return -6;
            }
        }
        Order order = orderService.findOrderByOrderIdAndType(orderId, type);
@@ -120,6 +140,7 @@
            lostOrder.setState(2);
        }
        lostOrder.setHandleTime(System.currentTimeMillis());
        lostOrder.setResultCode(LostOrder.RESULT_CODE_VERFING);
        lostOrderDao.update(lostOrder);
    }
@@ -177,4 +198,84 @@
        return lostOrderDao.find(LostOrder.class, id);
    }
    @Override
    public List<LostOrder> getLostOrderListByUid(Long uid, int page, int pageSize) {
        return lostOrderDao.list("from LostOrder lo where lo.userInfo.id=? order by lo.createTime desc",
                (page - 1) * pageSize, pageSize, new Serializable[] { uid });
    }
    @Override
    public long getLostOrderCountByUid(Long uid) {
        return lostOrderDao.getCount("select count(*)  from LostOrder lo where lo.userInfo.id=?",
                new Serializable[] { uid });
    }
    @Transactional
    @Override
    public void processSuceess(String orderId) {
        // 查询订单号是否在申诉列表中
        List<LostOrder> list = lostOrderMapper.selectByOrderId(orderId);
        if (list == null || list.size() == 0)
            return;
        for (LostOrder lo : list) {
            if (lo.getState() == 1 && lo.getResultCode() != null
                    && lo.getResultCode() == LostOrder.RESULT_CODE_VERFING) {
                LostOrder update = new LostOrder();
                update.setId(lo.getId());
                update.setResultCode(LostOrder.RESULT_CODE_SUCCESS);
                lostOrderMapper.updateByPrimaryKeySelective(update);
            }
        }
    }
    @Override
    public void processFail(String orderId) {
        lostOrderDao.update("update LostOrder lo set lo.resultCode=? where lo.orderId=?",
                new Serializable[] { LostOrder.RESULT_CODE_FAIL, orderId });
    }
    @Override
    public void processFail() {
        // 订单申诉人工通过后,但是隔了3天还未处理成功就视为该订单申诉失败
        lostOrderDao.update(
                "update LostOrder lo set lo.resultCode=? where lo.state=1 and lo.resultCode=? and lo.handleTime<?",
                new Serializable[] { LostOrder.RESULT_CODE_FAIL, LostOrder.RESULT_CODE_VERFING,
                        System.currentTimeMillis() - 1000 * 60 * 60 * 24 * 3L });
    }
    @Override
    public void deleteLostOrder(long id) {
        LostOrder lostOrder = new LostOrder();
        lostOrder.setId(id);
        lostOrderDao.delete(lostOrder);
    }
    @Override
    public void deleteLostOrderByUid(long uid) {
        lostOrderDao.update("delete from LostOrder lo where lo.userInfo.id=?", new Serializable[] { uid });
    }
    @Override
    public Map<String, Object> countByUid(long uid) {
        return lostOrderMapper.countByUid(uid);
    }
    /**
     * 后端列表查询
     *
     * @param start
     * @param count
     * @param key
     * @return
     */
    @Override
    public List<LostOrder> listQuery(long start, int count, String key, Integer state, Integer handleType) {
        return lostOrderMapper.listQuery(start, count, key, state, handleType);
    }
    @Override
    public long countQuery(String key, Integer state, Integer handleType) {
        return lostOrderMapper.countQuery(key, state, handleType);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderItemServcieImpl.java
@@ -471,6 +471,18 @@
            updateOrderItem.setSettlementTime(newOrderItem.getSettlementTime());
            updateOrderItem.setState(newOrderItem.getState());
            updateOrderItem.setPrePayMoney(taoBaoOrder.getPrice().multiply(new BigDecimal(taoBaoOrder.getCount())));
            updateOrderItem.setPayMoney(newOrderItem.getPayMoney());
            updateOrderItem.setFanMoney(newOrderItem.getFanMoney());
            orderItemMapper.updateByPrimaryKeySelective(updateOrderItem);
        } else if (newOrderItem.getState() == OrderItem.STATE_JIESUAN) {
            OrderItem updateOrderItem = new OrderItem();
            // 处理正常状态
            updateOrderItem.setId(oldOrderItem.getId());
            updateOrderItem.setSettlementTime(newOrderItem.getSettlementTime());
            updateOrderItem.setState(newOrderItem.getState());
            updateOrderItem.setPrePayMoney(taoBaoOrder.getPrice().multiply(new BigDecimal(taoBaoOrder.getCount())));
            updateOrderItem.setPayMoney(newOrderItem.getPayMoney());
            updateOrderItem.setFanMoney(newOrderItem.getFanMoney());
            orderItemMapper.updateByPrimaryKeySelective(updateOrderItem);
        }
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java
@@ -45,6 +45,7 @@
import com.yeshi.fanli.exception.TaoBaoWeiQuanException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.hongbao.HongBaoService;
import com.yeshi.fanli.service.inter.order.LostOrderService;
import com.yeshi.fanli.service.inter.order.OrderItemServcie;
import com.yeshi.fanli.service.inter.order.OrderProcessService;
import com.yeshi.fanli.service.inter.order.OrderService;
@@ -128,6 +129,9 @@
    @Resource
    private RedisManager redisManager;
    @Resource
    private LostOrderService lostOrderService;
    @Override
    public void processOrder(Map<String, List<TaoBaoOrder>> orders) {
        List<TaoBaoUnionConfig> configList = taoBaoUnionConfigService.getConfigByTypeCache(PidUser.TYPE_FANLI_ANDROID);
@@ -163,6 +167,7 @@
    /**
     * 利用redis的原子性将订单号锁住,不让其他处理
     *
     * @param orderId
     */
    private void redisLockOrder(String orderId) {
@@ -172,6 +177,7 @@
    /**
     * 订单解锁
     *
     * @param orderId
     */
    private void redisUnlockOrder(String orderId) {
@@ -181,6 +187,7 @@
    /**
     * 订单是否被锁住了
     *
     * @param orderId
     * @return
     */
@@ -202,12 +209,16 @@
            try {
                String orderId = its.next();
                // 处理红包与子红包
//                if (isRedisLockOrder(orderId))
//                    continue;
//                redisLockOrder(orderId);
                // if (isRedisLockOrder(orderId))
                // continue;
                // redisLockOrder(orderId);
                processShopingFanliOrder(orderId, orders.get(orderId));
//                redisUnlockOrder(orderId);
                // redisUnlockOrder(orderId);
                // 出错了就不处理该订单了,需要定期检查
                // 更改丢失订单的状态
                lostOrderService.processSuceess(orderId);
            } catch (HongBaoException e1) {
                e1.printStackTrace();
            } catch (OrderItemException e2) {
@@ -383,8 +394,13 @@
            } else// 计算订单的总金额
            {
                BigDecimal money = new BigDecimal(0);
                for (TaoBaoOrder o : orderList)
                    money = money.add(o.getPayment());
                for (TaoBaoOrder o : orderList) {
                    if (o.getOrderState().equalsIgnoreCase("订单结算"))
                        money = money.add(o.getSettlement());
                    else {
                        money = money.add(o.getPayment());
                    }
                }
                updateOrder.setMoney(money);
                String thirdState = null;
                for (TaoBaoOrder o : orderList)
fanli/src/main/java/com/yeshi/fanli/service/impl/order/PidOrderServiceImpl.java
@@ -89,6 +89,9 @@
    @Resource
    private RedisManager redisManager;
    // @Resource
    // private LostOrderService lostOrderService;
    @Override
    @Transactional
    public void addPidOrderFromTaoBao(Map<String, List<PidOrder>> map) {
@@ -201,11 +204,13 @@
        while (its.hasNext()) {
            String orderId = its.next();
            // 订单锁定
//            if (isRedisLockOrder(orderId))
//                continue;
//            redisLockOrder(orderId);
            // if (isRedisLockOrder(orderId))
            // continue;
            // redisLockOrder(orderId);
            doPidOrder(orderId);
//            redisUnlockOrder(orderId);
            // 处理订单找回
            // lostOrderService.processSuceess(orderId);
            // redisUnlockOrder(orderId);
        }
    }
@@ -267,7 +272,10 @@
                                HongBao.TYPE_SHARE_GOODS, HongBao.STATE_BUKELINGQU, new Date().getTime(),
                                new Date().getTime(), 0, "192.168.1.1", "系统添加");
                        hongBao.setOrderId(order.getOrderId());
                        hongBao.setPayMoney(order.getPayMoney());
                        if ("订单结算".equalsIgnoreCase(order.getState()))
                            hongBao.setPayMoney(order.getFinalMoney());
                        else
                            hongBao.setPayMoney(order.getPayMoney());
                        if (order.getBalanceTime() != null)
                            hongBao.setBalanceTime(order.getBalanceTime());
fanli/src/main/java/com/yeshi/fanli/service/impl/push/IOSPushServiceImpl.java
@@ -21,6 +21,7 @@
import com.yeshi.fanli.entity.xinge.MessageInfo;
import com.yeshi.fanli.entity.xinge.PushRecord;
import com.yeshi.fanli.exception.PushException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.log.PushLogHelper;
import com.yeshi.fanli.service.inter.push.IOSPushService;
import com.yeshi.fanli.util.CMQManager;
@@ -34,10 +35,9 @@
    @Resource
    private DeviceTokenIOSMapper deviceTokenIOSMapper;
    @Resource
    private PushQueueRecordMapper pushQueueRecordMapper;
    @Override
    public void pushGoods(Long uid, Long auctionId, String title, String content) throws PushException {
@@ -65,26 +65,21 @@
        pushRecord.setAppName(Constant.systemCommonConfig.getProjectChineseName());
        if (uid == null || uid == 0) {
            addPushIOSQueue(info, url, PushController.GOODS);
        /*    // 查询IOS所有设备号
            // TODO 需要全推
            List<String> deviceTokenList = getDeviceTokenList(1, 20000);
            // IOS 全推
            ThreadUtil.run(new Runnable() {
                @Override
                public void run() {
                    try {
                        IOSPushUtil.allPushIOS(deviceTokenList, info, url, PushController.GOODS);
                    } catch (Exception e) {
                        PushLogHelper.iosError(e);
                    }
                }
            });*/
            addPushIOSQueue(info, url, PushController.GOODS);
            /*
             * // 查询IOS所有设备号 // TODO 需要全推 List<String> deviceTokenList =
             * getDeviceTokenList(1, 20000); // IOS 全推 ThreadUtil.run(new
             * Runnable() {
             *
             * @Override public void run() { try {
             * IOSPushUtil.allPushIOS(deviceTokenList, info, url,
             * PushController.GOODS); } catch (Exception e) {
             * PushLogHelper.iosError(e);
             *
             * } } });
             */
        } else {
            // IOS 单推
            List<DeviceTokenIOS> deviceTokenIosList = getDeviceTokenListByUid(uid);
@@ -125,23 +120,20 @@
        // IOS 全推
        if (uid == null || uid == 0) {
            // TODO 需要全推
            addPushIOSQueue(info, url, PushController.URL);
            /*List<String> deviceTokenList = getDeviceTokenList(1, 1000);
            ThreadUtil.run(new Runnable() {
                @Override
                public void run() {
                    try {
                        IOSPushUtil.allPushIOS(deviceTokenList, info, url, PushController.URL);
                    } catch (Exception e) {
                        PushLogHelper.iosError(e);
                    }
                }
            });*/
            /*
             * List<String> deviceTokenList = getDeviceTokenList(1, 1000);
             * ThreadUtil.run(new Runnable() {
             *
             * @Override public void run() { try {
             *
             * IOSPushUtil.allPushIOS(deviceTokenList, info, url,
             * PushController.URL);
             *
             * } catch (Exception e) { PushLogHelper.iosError(e); } } });
             */
        } else {
            List<DeviceTokenIOS> deviceTokenIosList = getDeviceTokenListByUid(uid);
            List<String> deviceTokenList = new ArrayList<>();
@@ -192,22 +184,21 @@
            PushRecord pushRecord = new PushRecord();
            // TODO 需要全推
            addPushIOSQueue(info, id + "", PushController.ZNX);
            /*List<String> deviceTokenList = getDeviceTokenList(1, 1000);
            ThreadUtil.run(new Runnable() {
                @Override
                public void run() {
                    try {
                        IOSPushUtil.allPushIOS(deviceTokenList, info, id + "", PushController.ZNX);
                    } catch (Exception e) {
                        PushLogHelper.iosError(e);
                    }
                }
            });*/
            /*
             * List<String> deviceTokenList = getDeviceTokenList(1, 1000);
             *
             * ThreadUtil.run(new Runnable() {
             *
             * @Override public void run() { try {
             * IOSPushUtil.allPushIOS(deviceTokenList, info, id + "",
             * PushController.ZNX); } catch (Exception e) {
             * PushLogHelper.iosError(e); }
             *
             * } });
             */
        } else if (msg != null) {
            // 插入推送记录
            PushRecord pushRecord = new PushRecord();
@@ -248,9 +239,9 @@
    @Transactional
    @Override
    public void addDeviceToken(Long uid,int version, String deviceToken, String device) {
    public void addDeviceToken(Long uid, int version, String deviceToken, String device) {
        // 如果device为空就返回
        if (StringUtil.isNullOrEmpty(device))
        if (StringUtil.isNullOrEmpty(device) || StringUtil.isNullOrEmpty(deviceToken))
            return;
        // 判断device是否存在
@@ -261,6 +252,7 @@
            deviceTokenIos.setUpdateTime(new Date());
            deviceTokenIos.setDevice(device);
            deviceTokenIos.setDeviceToken(deviceToken);
            deviceTokenIos.setDeviceTokenMd5(StringUtil.Md5(deviceToken));
            deviceTokenIos.setUid(uid);
            deviceTokenIos.setVersion(version);
            deviceTokenIOSMapper.insertSelective(deviceTokenIos);
@@ -297,20 +289,20 @@
    }
    @Override
    public DeviceTokenIOS getDeviceTokenByDevice(String device) {
        return deviceTokenIOSMapper.selectByDevice(device);
    public DeviceTokenIOS getDeviceTokenByDeviceToken(String deviceToken) {
        return deviceTokenIOSMapper.selectByDeviceToken(deviceToken);
    }
    /**
     * 保存推送内容只队列中
     *
     * @param json
     */
    @Transactional
    public void addPushIOSQueue(MessageInfo info, String url, int type) {
        try {
            JSONObject json = IOSPushUtil.getJSONObject(info, url, type);
            // 总条目
@@ -333,7 +325,7 @@
                pushQueueRecord.setCreatetime(new Date());
                // 每次推送数量
                pushQueueRecord.setPushNum(pushNum);
                // 推送端 IOS
                // 推送端 IOS
                pushQueueRecord.setType(1);
                if (tokenCount - i < totalCount) {
@@ -375,94 +367,95 @@
        }
    }
    /**
     * 队列执行推送操作
     */
    @Override
    public void readyPushIOS(PushQueueRecord pushQueueRecord) throws Exception {
        // 起始位置
        Long startCursor = pushQueueRecord.getStartCursor();
        // 结束位置
        Long endCursor = pushQueueRecord.getEndCursor();
        if (startCursor == null && endCursor == null) {
            return;
        }
        int total = (int) (endCursor - startCursor);
        // 每次推送总条数
        int moveNum = pushQueueRecord.getPushNum();
        int count =  total/ moveNum;
        int count = total / moveNum;
        if (total % moveNum > 0) {
            count +=1;
            count += 1;
        }
        long recordCursor = startCursor;
        for (int i = 0; i < count; i++) {
            // 不足50个数据
            if (moveNum > total) {
                moveNum = (int) (endCursor- startCursor);
                moveNum = (int) (endCursor - startCursor);
                List<DeviceTokenIOS> list = deviceTokenIOSMapper.selectList(startCursor, moveNum);
                recordCursor = endCursor;
                if (list != null) {
                    executePushIOS(list, pushQueueRecord, recordCursor);
                    PushLogHelper.iosInfo("推送游标:" + startCursor + "," + moveNum);
                }
            } else {
                if (recordCursor + moveNum > endCursor) {
                    //System.out.println("recordCursorend:" +recordCursor);
                    moveNum =  (int) (endCursor- recordCursor);
                    //System.out.println(moveNum);
                    // System.out.println("recordCursorend:" +recordCursor);
                    moveNum = (int) (endCursor - recordCursor);
                    // System.out.println(moveNum);
                    List<DeviceTokenIOS> list = deviceTokenIOSMapper.selectList(recordCursor, moveNum);
                    if (list != null) {
                        executePushIOS(list, pushQueueRecord, endCursor);
                        PushLogHelper.iosInfo("推送游标:" + recordCursor + "," + moveNum);
                    }
                    recordCursor = endCursor;
                } else {
                    List<DeviceTokenIOS> list = deviceTokenIOSMapper.selectList(recordCursor, moveNum);
                    recordCursor = recordCursor + 50;
                    if (list != null) {
                        executePushIOS(list, pushQueueRecord, recordCursor-1);
                        executePushIOS(list, pushQueueRecord, recordCursor - 1);
                        PushLogHelper.iosInfo("推送游标:" + recordCursor + "," + moveNum);
                    }
                }
                //System.out.println("recordCursor:" +recordCursor);
                // System.out.println("recordCursor:" +recordCursor);
            }
        }
    }
    public void executePushIOS(List<DeviceTokenIOS> list ,PushQueueRecord pushQueueRecord, long recordCursor) {
    public void executePushIOS(List<DeviceTokenIOS> list, PushQueueRecord pushQueueRecord, long recordCursor) {
        String jsonContent = pushQueueRecord.getJsonContent();
        JSONObject json = JSONObject.fromObject(jsonContent);
        List<String> tokenList = new ArrayList<>();
        for (DeviceTokenIOS ios : list){
            if (!StringUtil.isNullOrEmpty(ios.getDeviceToken())){
        for (DeviceTokenIOS ios : list) {
            if (!StringUtil.isNullOrEmpty(ios.getDeviceToken())) {
                tokenList.add(ios.getDeviceToken());
                //System.out.println(ios.getDeviceToken());
                // System.out.println(ios.getDeviceToken());
            }
        }
        if (tokenList.size() > 0) {
            //System.out.println(tokenList.size());
            // System.out.println(tokenList.size());
            // 执行推送
            try {
                IOSPushUtil.executePushIOS(tokenList,json);
                IOSPushUtil.executePushIOS(tokenList, json);
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
@@ -471,10 +464,9 @@
        pushQueueRecord.setState(1);
        pushQueueRecord.setEndtime(new Date());
        pushQueueRecord.setRecordCursor(recordCursor);
        //TODO 更新数据库
        // TODO 更新数据库
        pushQueueRecordMapper.updateByPrimaryKeySelective(pushQueueRecord);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/push/PushServiceImpl.java
@@ -22,6 +22,7 @@
import com.yeshi.fanli.service.inter.user.AccountMessageService;
import com.yeshi.fanli.service.inter.user.SystemZnxService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
@Service
public class PushServiceImpl implements PushService {
@@ -54,20 +55,24 @@
    @Resource
    private XMPushService xmPushService;
    @Resource
    private PushRecordMapper pushRecordMapper;
    @Resource
    private AccountMessageMapper accountMessageMapper;
    @Async("pushExecutor")
    @Override
    public void pushGoods(Long uid, String url, String title, String content) throws PushException {
        String gids = url.split("id=")[1];
        String gid = gids.split("&")[0];
        if (StringUtil.isNullOrEmpty(gid))
            throw new PushException(1, "商品解析失败");
        if (StringUtil.isNullOrEmpty(title))
            throw new PushException(1, "请填写推送标题");
        if (StringUtil.isNullOrEmpty(content))
            throw new PushException(1, "请填写推送内容");
        PushRecord pushRecord = new PushRecord();
        pushRecord.setState(1);
@@ -79,7 +84,7 @@
        xmPushService.pushGoods(uid, Long.parseLong(gid), title, content);
        iosPushService.pushGoods(uid, Long.parseLong(gid), title, content);
        //hwPushService.pushGoods(uid, Long.parseLong(gid), title, content);
        // hwPushService.pushGoods(uid, Long.parseLong(gid), title, content);
        pushRecordMapper.insertSelective(pushRecord);
    }
@@ -87,6 +92,14 @@
    @Async("pushExecutor")
    @Override
    public void pushUrl(Long uid, String url, String title, String content) throws PushException {
        if (StringUtil.isNullOrEmpty(url))
            throw new PushException(1, "无推送链接");
        if (StringUtil.isNullOrEmpty(title))
            throw new PushException(1, "无推送标题");
        if (StringUtil.isNullOrEmpty(content))
            throw new PushException(1, "无推送内容");
        PushRecord pushRecord = new PushRecord();
        pushRecord.setState(1);
        pushRecord.setType(PushController.URL);
@@ -103,9 +116,13 @@
    @Async("pushExecutor")
    @Override
    public void pushZNX(Long uId, String title, String content) throws PushException {
        if (StringUtil.isNullOrEmpty(title))
            throw new PushException(1, "无推送标题");
        if (StringUtil.isNullOrEmpty(content))
            throw new PushException(1, "无推送内容");
        /* 无uid , 广播 数据插入系统表 */
        if (uId == null||uId==0) {
        if (uId == null || uId == 0) {
            // 插入数据库(系统站内信数据)
            SystemZnx systemZnx = new SystemZnx();
            systemZnx.setTitle(title);
@@ -146,6 +163,5 @@
            pushRecordMapper.insertSelective(pushRecord);
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoGoodsUpdateServiceImpl.java
@@ -16,6 +16,7 @@
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsUpdateException;
import com.yeshi.fanli.service.inter.activity.ActivityService;
import com.yeshi.fanli.service.inter.goods.CollectionGoodsService;
import com.yeshi.fanli.service.inter.goods.RecommendSectionGoodsService;
import com.yeshi.fanli.service.inter.lable.QualityFactoryService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
@@ -36,6 +37,9 @@
    @Resource
    private TaoBaoGoodsBriefMapper taoBaoGoodsBriefMapper;
    @Resource
    private CollectionGoodsService collectionGoodsService;
    @Override
    public void startUpdate() {
@@ -107,6 +111,8 @@
            TaoBaoGoodsBrief updateGoods = getUpdateTaoBaoGoodsBrief(goods);
            System.out.println("更细信息:" + new Gson().toJson(updateGoods));
            taoBaoGoodsBriefMapper.updateByPrimaryKeySelective(updateGoods);
            // 更新收藏信息
            collectionGoodsService.updateCollectionGoods(goods);
        }
    }
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoOrderServiceImpl.java
@@ -14,6 +14,7 @@
import com.yeshi.fanli.entity.admin.ReslutOrder;
import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
import com.yeshi.fanli.service.inter.taobao.TaoBaoOrderService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
@@ -38,8 +39,10 @@
            String key = "addorder-" + orderId;
            // redis做频率限制
            try {
                if (!StringUtil.isNullOrEmpty(redisManager.getCommonString(key))) {
                    continue;
                if (Constant.IS_OUTNET) {
                    if (!StringUtil.isNullOrEmpty(redisManager.getCommonString(key))) {
                        continue;
                    }
                }
            } catch (Exception e) {
@@ -48,7 +51,8 @@
            addTaoBaoOrder(orderId, map.get(orderId));
            try {
                // 6小时内不再处理
                redisManager.cacheCommonString(key, "1", 60 * 60 * 6);
                if (Constant.IS_OUTNET)
                    redisManager.cacheCommonString(key, "1", 60 * 60 * 6);
            } catch (Exception e) {
            }
fanli/src/main/java/com/yeshi/fanli/service/impl/user/ShamUserServiceImpl.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.service.impl.user;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Collections;
@@ -8,7 +9,8 @@
import javax.annotation.Resource;
import org.apache.ibatis.annotations.Param;
import net.sf.json.JSONArray;
import org.hibernate.HibernateException;
import org.hibernate.SQLQuery;
import org.hibernate.Session;
@@ -20,8 +22,10 @@
import com.yeshi.fanli.dao.user.ShamUserDao;
import com.yeshi.fanli.entity.bus.user.HongBaoMessage;
import com.yeshi.fanli.entity.bus.user.ShamUser;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.user.ShamUserService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.Utils;
@Service
@@ -32,6 +36,9 @@
    
    @Resource
    private ShamUserMapper shamUserMapper;
    @Resource
    private ConfigService configService;
    
    
    @Transactional
@@ -182,6 +189,85 @@
    public List<ShamUser> listDistinctPicUrl(long start, int count) {
        return shamUserMapper.listByDistinctPicUrl(start, count);
    }
    @Override
    public List<ShamUser> listRandCouponUser(int count, int smallTime, int largeTime) {
        List<Integer> listTime = new ArrayList<Integer>();
        while (listTime.size() < count) {
            int time = smallTime + (int) (Math.random() * (largeTime - smallTime + 1));
            if (!listTime.contains(Integer.valueOf(time))) {
                listTime.add(Integer.valueOf(time));
            }
        }
        Collections.sort(listTime);
        List<ShamUser> listRand = shamUserMapper.listRand(count);
        for (int i = 1; i <= count; i++) {
            ShamUser shamUser = (ShamUser) listRand.get(i - 1);
            transformId(shamUser);
            shamUser.setMsg(listTime.get(listTime.size() - i) + "秒前领券购买了这个商品");
        }
        return listRand;
    }
    @Override
    public List<ShamUser> listRandShareUser(int count, BigDecimal shareMoney, int small, int large) {
        List<Integer> listMultiple = new ArrayList<Integer>();
        while (listMultiple.size() < count) {
            int Multiple = small + (int) (Math.random() * (large - small + 1));
            listMultiple.add(Integer.valueOf(Multiple));
        }
        List<String> imgList = new ArrayList<String>();
        String value = configService.get("shareBonusPicture");
        if (!StringUtil.isNullOrEmpty(value)) {
            JSONArray array = JSONArray.fromObject(value);
            if (array != null) {
                for (int n = 0; n < array.size(); n++) {
                    imgList.add(array.optString(n));
                }
            }
        }
        List<ShamUser> listRand = shamUserMapper.listRand(count);
        for (int i = 0; i < count; i++) {
            ShamUser shamUser = (ShamUser) listRand.get(i);
            transformId(shamUser);
            if (imgList.size() > 0) {
                int randBonusPic = (int) (Math.random() * imgList.size());
                shamUser.setShareBonusPic((String) imgList.get(randBonusPic));
            }
            BigDecimal money = shareMoney.multiply(new BigDecimal(((Integer) listMultiple.get(i)).intValue())).setScale(2, 1);
            // 必须包含 【奖金¥】  这3个符号,  用于前端颜色区分
            shamUser.setMsg("分享了这个商品,累计获得奖金¥" + money);
        }
        return listRand;
    }
    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));
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/inter/activity/ActivityService.java
@@ -2,11 +2,10 @@
import java.util.List;
import org.springframework.cache.annotation.Cacheable;
import com.yeshi.fanli.entity.bus.activity.ActivityShareResult;
import com.yeshi.fanli.entity.bus.activity.ActivityUser;
import com.yeshi.fanli.entity.bus.activity.RecommendActivity;
import com.yeshi.fanli.entity.bus.activity.RecommendActivityImg;
import com.yeshi.fanli.entity.bus.activity.RecommendActivityInviteInfo;
import com.yeshi.fanli.exception.ActivityException;
@@ -17,6 +16,16 @@
 *
 */
public interface ActivityService {
    public int insert(RecommendActivity record);
    public int insertSelective(RecommendActivity record);
    public RecommendActivity selectByPrimaryKey(Long id);
    public int updateByPrimaryKeySelective(RecommendActivity record);
    public int updateByPrimaryKey(RecommendActivity record);
    /**
     * 获取活动用户列表
fanli/src/main/java/com/yeshi/fanli/service/inter/common/JumpDetailV2Service.java
@@ -38,4 +38,26 @@
     */
    public JumpDetailV2 getByTypeCache(String type);
    public List<JumpDetailV2> listJump();
    /**
     * 根据主键批量删除
     * @param list
     * @return
     */
    int deleteBatchByPrimaryKey(List<Long> list);
    /**
     * 后端列表查询
     * @param start
     * @param count
     * @param key
     * @return
     */
    List<JumpDetailV2> listQuery(long start, int count, String key);
    long countListQuery(String key);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/config/AppVersionService.java
New file
@@ -0,0 +1,40 @@
package com.yeshi.fanli.service.inter.config;
import java.util.List;
import com.yeshi.fanli.entity.AppVersionInfo;
/**
 * 应用版本号服务
 *
 * @author Administrator
 *
 */
public interface AppVersionService {
    /**
     * 添加版本
     *
     * @param versionInfo
     * @throws Exception
     */
    public void addAppVersion(AppVersionInfo versionInfo) throws Exception;
    /**
     * 通过平台获取版本列表
     *
     * @param platform
     * @return
     */
    public List<AppVersionInfo> getAppVersionInfoListByPlatform(String platform);
    /**
     * 通过版本号与平台获取详细信息
     *
     * @param platform
     * @param versionCode
     * @return
     */
    public AppVersionInfo getAppVersionInfoListByPlatformAndVersion(String platform, int versionCode);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/config/ConfigService.java
@@ -67,4 +67,22 @@
     */
    public String getHomeWEEXUrl();
    /**
     * 后端查询分页
     * @param key
     * @param page
     * @return
     */
    public List<Config> listObjects(String key, int page);
    /**
     * 后端查询统计
     * @param key
     * @param page
     * @return
     */
    public int getCount(String key, int page);
    public Config getConfig(long id);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/config/HotSearchService.java
@@ -7,8 +7,7 @@
public interface HotSearchService {
    List<HotSearchAdmin> getHotSearchs(int index, String platform, String packages,
            String key);
    List<HotSearchAdmin> getHotSearchs(int index, String platform, String packages,    String key);
    HotSearch getHotSearch(long id);
@@ -20,4 +19,8 @@
    int getCount(String platform, String packages, String key);
    public List<HotSearch> listQuery(int start, int count, String key, Long systemId) throws Exception;
    int countList(String key, Long systemId);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/config/InviteGetMoneyService.java
@@ -75,4 +75,8 @@
     * @param key
     */
    void editActivityRules(String value, String key);
    List<SpreadImg> listQuery(int start, int pageSize, String key);
    long countQuery(String key);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/config/SuperHotSearchService.java
@@ -2,9 +2,8 @@
import java.util.List;
import org.springframework.cache.annotation.Cacheable;
import com.yeshi.fanli.entity.bus.su.search.SuperHotSearch;
import com.yeshi.fanli.entity.system.System;
public interface SuperHotSearchService {
@@ -23,4 +22,31 @@
    public void addSuperHotSearch(long hsid, String platform, String packageName);
    public List<SuperHotSearch> listSuperHotSearch(List<Long> list);
    /**
     * 查询系统
     * @param id
     * @param systemId
     * @return
     */
    public List<SuperHotSearch> getHotSearchSystem(Long id, Long systemId);
    /**
     * 删除系统
     * @param id
     * @param systemId
     * @return
     */
    public Integer deleteSuper(Long id, Long systemId);
    /**
     * 新增系统
     * @param id
     * @param system
     */
    public void addSuper(Long id, System system);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/config/SystemClientParamsService.java
@@ -2,8 +2,6 @@
import java.util.List;
import org.springframework.cache.annotation.Cacheable;
import com.yeshi.fanli.entity.admin.SystemClientParamsAdmin;
import com.yeshi.fanli.entity.system.CustomerContent;
import com.yeshi.fanli.entity.system.CustomerName;
@@ -61,4 +59,35 @@
    public List<CustomerContent> contactCustomerService(String title);
    /**
     * 新版后台查询
     * @param start
     * @param count
     * @param key
     * @param systemId
     * @return
     */
    public List<SystemClientParams> listQuery(int start, int count, String key, Long systemId);
    public long countQuery(String key, Long systemId);
    /**
     * 更新
     * @param systemClientParams
     */
    public void update(SystemClientParams systemClientParams);
    /**
     * 根据id获取
     * @param id
     * @return
     */
    public List<SystemClientParams> getById(long id);
    /**
     * 根据id批量删除
     * @param ids
     */
    public void deleteBatchByPrimaryKey(List<Long> ids);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/config/SystemService.java
@@ -13,4 +13,11 @@
    public List<System> getSystems();
    /**
     * 通过id查询
     * @param id
     * @return
     */
    public System getById(long id);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/CollectionGoodsService.java
@@ -3,6 +3,7 @@
import java.util.List;
import com.yeshi.fanli.entity.bus.user.CollectionGoods;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
public interface CollectionGoodsService {
    /**
@@ -29,5 +30,11 @@
    void delete(long auctionId, long uid);
    void clear(long uid);
    /**
     * 更新收藏的商品信息
     * @param goods
     */
    void updateCollectionGoods(TaoBaoGoodsBrief goods);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/help/AppPageNotificationService.java
@@ -1,5 +1,7 @@
package com.yeshi.fanli.service.inter.help;
import java.util.List;
import com.yeshi.fanli.entity.bus.help.AppPageNotification;
/**
@@ -32,5 +34,39 @@
     * @param apn
     */
    public void addAppPageNotification(AppPageNotification apn) throws Exception;
    /**
     * 选择性插入
     * @param record
     */
    public void insertSelective(AppPageNotification record);
    /**
     * 选择性更新
     * @param record
     */
    public void updateByPrimaryKeySelective(AppPageNotification record);
    /**
     * 根据主键查询
     * @param id
     * @return
     */
    public AppPageNotification selectByPrimaryKey(Long id);
    /**
     * 根据主键批量删除
     * @param list
     * @return
     */
    public int deleteBatchByPrimaryKey(List<Long> list);
    /**
     * 后端列表查询
     * @return
     */
    public List<AppPageNotification> listQuery(long start, int count,String key, Integer show, Integer canClose);
    public long countQuery(String key, Integer show, Integer canClose);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/HomeNavbarService.java
@@ -1,5 +1,9 @@
package com.yeshi.fanli.service.inter.homemodule;
import java.util.List;
import org.springframework.web.multipart.MultipartFile;
import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar;
/**
@@ -21,5 +25,46 @@
    public int updateByPrimaryKeySelective(HomeNavbar record);
    public int updateByPrimaryKey(HomeNavbar record);
    /**
     * 根据主键批量删除
     * @param list
     * @return
     */
    public int deleteBatchByPrimaryKey(List<Long> list);
    /**
     * 获取最大的排序值
     * @param card
     * @return
     */
    public int getMaxOrder();
    /**
     * 查询交换排序对象
     * @param type
     * @param order 排序值
     * @return
     */
    public List<HomeNavbar> getChangeOrder(Integer type, Integer order);
    /**
     * 后端列表查询
     * @param start
     * @param count
     * @param key
     * @return
     */
    public List<HomeNavbar> listQuery(long start, int count, String key);
    public long countlistQuery(String key);
    /**
     * 图片上传
     * @param file
     * @param homeNavbar
     * @throws Exception
     */
    public void uploadPicture(MultipartFile file, HomeNavbar homeNavbar) throws Exception;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SpecialCardService.java
@@ -1,5 +1,7 @@
package com.yeshi.fanli.service.inter.homemodule;
import java.util.List;
import com.yeshi.fanli.entity.bus.homemodule.SpecialCard;
/**
@@ -22,4 +24,16 @@
    public int updateByPrimaryKey(SpecialCard record);
    public List<SpecialCard> listQuery(long start, int count, String key, Integer sort);
    public long countlistQuery(String key);
    /**
     * 根据id批量删除
     * @param list
     * @return
     * @throws Exception
     */
    public int deleteBatchByPrimaryKey(List<Long> list) throws Exception;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SpecialService.java
@@ -1,5 +1,9 @@
package com.yeshi.fanli.service.inter.homemodule;
import java.util.List;
import org.springframework.web.multipart.MultipartFile;
import com.yeshi.fanli.entity.bus.homemodule.Special;
/**
@@ -22,4 +26,57 @@
    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批量删除
     * @param list
     * @return
     * @throws Exception
     */
    public int deleteBatchByPrimaryKey(List<Long> list) throws Exception;
    /**
     * CardID批量删除
     * @param list
     * @return
     * @throws Exception
     */
    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
     * @return
     */
    public List<Special> listBySystemAndCard(String card, Long systemId);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SuperHomeNavbarService.java
@@ -38,5 +38,36 @@
     * @return
     */
    List<SuperHomeNavbar> listBySystemCache(Long systemId);
    /**
     * 根据导航栏id 批量查询
     * @param list
     * @return
     */
    List<SuperHomeNavbar> listByNavbarIds(List<Long> list);
    /**
     * 根据导航栏id 批量删除
     * @param list
     * @return
     */
    void deleteBatchByNavbarIds(List<Long> list);
    /**
     * 根据系统id+导航id查询
     * @param systemId 系统id
     * @return
     */
    List<SuperHomeNavbar> querybyNavbarId(Long navbarId, Long systemId);
    /**
     * 根据系统id+导航id 删除
     * @param systemId 系统id
     * @return
     */
    int deletebyNavbarId(Long navbarId, Long systemId);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SuperSpecialCardService.java
New file
@@ -0,0 +1,43 @@
package com.yeshi.fanli.service.inter.homemodule;
import java.util.List;
import com.yeshi.fanli.entity.bus.homemodule.SuperSpecialCard;
/**
 *  专题-系统
 *
 * @author Administrator
 *
 */
public interface SuperSpecialCardService {
    public int deleteByPrimaryKey(Long id);
    public int insert(SuperSpecialCard record);
    public int insertSelective(SuperSpecialCard record);
    public SuperSpecialCard selectByPrimaryKey(Long id);
    public int updateByPrimaryKeySelective(SuperSpecialCard record);
    public int updateByPrimaryKey(SuperSpecialCard record);
    public int deleteBatchByCardId(List<Long> list);
    /**
     * 删除系统
     * @param cardId
     * @param systemId
     */
    public void deletebyCardIdAndSystemId(Long cardId, Long systemId) throws Exception ;
    /**
     * 查询系统
     * @param cardId
     * @param systemId
     */
    public List<SuperSpecialCard> querybyCardIdAndSystemId(Long cardId, Long systemId) throws Exception ;
}
fanli/src/main/java/com/yeshi/fanli/service/inter/hongbao/ThreeSaleSerivce.java
@@ -2,6 +2,8 @@
import java.util.List;
import net.sf.json.JSONObject;
import com.yeshi.fanli.entity.bus.user.ThreeSale;
import com.yeshi.fanli.entity.bus.user.UserInfo;
@@ -108,4 +110,106 @@
     */
    public int updateExpire(List<Long> list);
     /**
     * 一级查询
     * @param start
     * @param count
     * @param uid
     * @param startTime
     * @param endTime
     * @return
     */
    public List<ThreeSale> listFirstTeamQuery(long start, int count, Long uid, Integer state,
             String startTime, String endTime);
    public long countFirstTeamQuery(Long uid, Integer state, String startTime, String endTime);
      /**
     * 二级查询
     * @param start
     * @param count
     * @param uid
     * @param startTime
     * @param endTime
     * @return
     */
    public List<ThreeSale> listSecondTeamQuery(long start, int count, Long uid, Integer state,
            String startTime,String endTime);
    public long countSecondTeamQuery(Long uid, Integer state, String startTime, String endTime);
      /**
     * 上级查询
     * @param start
     * @param count
     * @param uid
     * @return
     */
    public List<ThreeSale> listSuperiorQuery(long start, int count, Integer state, Long uid);
    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);
    /**
     * 统计所有一级队员
     * @param uid
     * @param state  状态,值 为空时则统计所有
     * @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);
    /**
        * 统计二级队员
        * @param uid
        * @param state  状态,值 为空时则统计所有
        * @return
        */
    public long countSecondTeam(Long uid, Integer state);
    /**
     * 前端查询一级队员
     * @param start
     * @param count
     * @param uid
     * @return
     */
    public JSONObject getMyFirstTeam(long start, int count, Long uid);
    /**
     * 前端查询二级队员
     * @param start
     * @param count
     * @param uid
     * @return
     */
    public JSONObject getMySecondTeam(long start, int count, Long uid);
    /**
     * 获取上级
     * @param uid
     * @return
     */
    public ThreeSale getMyBoss(Long uid);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/lable/QualityGoodsService.java
@@ -156,10 +156,10 @@
     * @return
     */
    public List<QualityFactory> listRecommendBykey(long start, int count, String key, Integer hasQuan,
            Integer userType, Double startprice, Double endprice, Integer sort);
            Integer userType, Double startprice, Double endprice, Double startTkRate, Double endTkRate, Integer sort);
    
    public long countRecommendBykey(String key, Integer hasQuan, Integer userType, 
            Double startprice, Double endprice);
            Double startprice, Double endprice, Double startTkRate, Double endTkRate);
    
    
    /**
@@ -173,5 +173,12 @@
    
    public long countRecommendToIndex(String proportion);
    
    /**
     * 单个商品根据标签推荐商品
     * @param paramLong
     * @param paramString1
     * @param paramString2
     * @return
     */
    public  List<QualityFactory> recommendByAuctionId(Long paramLong);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/monitor/MonitorService.java
New file
@@ -0,0 +1,20 @@
package com.yeshi.fanli.service.inter.monitor;
import com.yeshi.fanli.entity.monitor.ClientAPIMonitor;
/**
 * 监控服务
 *
 * @author Administrator
 *
 */
public interface MonitorService {
    /**
     * 添加客户端API的监控
     *
     * @param monitor
     */
    public void addClientAPIMonitor(ClientAPIMonitor monitor);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/order/LostOrderService.java
@@ -1,18 +1,96 @@
package com.yeshi.fanli.service.inter.order;
import java.util.List;
import java.util.Map;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import com.yeshi.fanli.entity.bus.user.LostOrder;
public interface LostOrderService {
    static final ReentrantReadWriteLock lostOrderLock = new ReentrantReadWriteLock(true);
    static final ReentrantReadWriteLock lostOrderLock = new ReentrantReadWriteLock(true);
    int addLostOrder(LostOrder lostOrder);
    void pass(LostOrder lostOrder);
    void reject(LostOrder lostOrder);
    List<LostOrder> findLostOrderList(String key, int page);
    int getCount(String key);
    LostOrder getOne(long id);
    /**
     * 按用户查找丢失订单
     *
     * @param uid
     * @param page
     * @param pageSize
     * @return
     */
    List<LostOrder> getLostOrderListByUid(Long uid, int page, int pageSize);
    /**
     * 获取丢失订单数量
     *
     * @param uid
     * @return
     */
    long getLostOrderCountByUid(Long uid);
    /**
     * 订单处理成功
     *
     * @param orderId
     */
    void processSuceess(String orderId);
    /**
     * 订单处理失败
     *
     * @param orderId
     */
    void processFail(String orderId);
    /**
     * 订单处理失败批量处理
     */
    void processFail();
    /**
     * 删除记录
     *
     * @param id
     */
    void deleteLostOrder(long id);
    /**
     * 删除用户的所有记录
     *
     * @param uid
     */
    void deleteLostOrderByUid(long uid);
    /**
     * 统计用户申诉次数
     * @param uid
     * @return
     */
    public Map<String, Object>  countByUid(long uid);
    /**
     * 后端查询
     * @param start
     * @param count
     * @param key
     * @param state
     * @param handleType
     * @return
     */
    public List<LostOrder> listQuery(long start, int count, String key, Integer state, Integer handleType);
    public long countQuery(String key, Integer state, Integer handleType);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/ShamUserService.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.service.inter.user;
import java.math.BigDecimal;
import java.util.List;
import com.yeshi.fanli.entity.bus.user.HongBaoMessage;
@@ -39,4 +40,24 @@
    public int updateByPrimaryKey(ShamUser record);
    public List<ShamUser> listDistinctPicUrl(long start, int count);
    /**
     * 领券提示
     * @param count
     * @param smallTime
     * @param largeTime
     * @return
     */
    public List<ShamUser> listRandCouponUser(int count, int smallTime, int largeTime);
    /**
     * 分享奖金
     * @param count
     *
     * @param shareMoney
     * @param small
     * @param large
     * @return
     */
    public List<ShamUser> listRandShareUser(int count, BigDecimal shareMoney, int small, int large);
}
fanli/src/main/java/com/yeshi/fanli/util/HongBaoUtil.java
@@ -156,11 +156,24 @@
            TaoBaoOrder taoBaoOrder = validTaoBaoOrderList.get(i);
            for (int n = 0; n < hongBaoList.size(); n++) {
                HongBao hongBao = hongBaoList.get(n);
                if (taoBaoOrder.getAuctionId().longValue() == hongBao.getAuctionId()
                        && taoBaoOrder.getPayment().compareTo(hongBao.getPayMoney()) == 0) {
                    validHongBaoList.add(hongBao);
                    hongBaoList.remove(n);
                    break;
                if (taoBaoOrder.getOrderState().equalsIgnoreCase("订单结算")) {
                    if (taoBaoOrder.getAuctionId().longValue() == hongBao.getAuctionId()
                            &&( taoBaoOrder.getSettlement().compareTo(hongBao.getPayMoney()) == 0||taoBaoOrder.getPayment().compareTo(hongBao.getPayMoney()) == 0)) {
                        validHongBaoList.add(hongBao);
                        hongBaoList.remove(n);
                        break;
                    }
                }
                else {
                    if (taoBaoOrder.getAuctionId().longValue() == hongBao.getAuctionId()
                            && taoBaoOrder.getPayment().compareTo(hongBao.getPayMoney()) == 0) {
                        validHongBaoList.add(hongBao);
                        hongBaoList.remove(n);
                        break;
                    }
                }
            }
        }
fanli/src/main/java/com/yeshi/fanli/util/ImageUtil.java
@@ -92,7 +92,7 @@
            int length = 0;
            // 画第一排
            length = getTextLengthByWidth(g2d, font, title, 500, 10);
            g2d.drawString(title.substring(0, length), 50 + 60, 112 + row * 40);
            g2d.drawString(title.substring(0, length), 50 + 65, 112 + row * 40);
            title = title.substring(length);
            row++;
@@ -120,10 +120,10 @@
                }
                g2d.setColor(new Color(229, 0, 93));
                g2d.drawString("¥", 60, 875);
                g2d.drawString("券后价  ¥", 57, 875);
                g2d.setColor(new Color(229, 0, 93));
                g2d.setFont(boldFont);
                g2d.drawString(finalPrice.toString(), 85, 875);
                g2d.drawString(finalPrice.toString(), 85 + 110, 875);
                // 画券右侧
                BufferedImage quanRight = ImageIO
@@ -195,7 +195,7 @@
            font = font.deriveFont(30.0f);
            g2d.setFont(font);
            g2d.setColor(new Color(229, 0, 93));
            g2d.drawString("返利券提醒您", 250 + 17, 1080 + 17);
            // g2d.drawString("返利券提醒您", 250 + 17, 1080 + 17);
            g2d.setColor(new Color(102, 102, 102));
            g2d.drawString("长按识别二维码领取优惠券", 250 + 17, 1130 + 17);
@@ -286,7 +286,8 @@
                    int topX = 50;
                    int topY = 50;
                    // 画大图 起始点坐标为(50,50)
                    InputStream goodsPicture = TaoBaoHttpUtil.getAsInputStream(goods.getPictUrl().replace("_.webp", "").replace("_220x220", ""));
                    InputStream goodsPicture = TaoBaoHttpUtil
                            .getAsInputStream(goods.getPictUrl().replace("_.webp", "").replace("_220x220", ""));
                    BufferedImage picImage = ImageIO.read(goodsPicture);
                    picImage = zoomInImage(picImage, 650, 650);
                    g2d.drawImage(picImage, topX, topX, null);
@@ -374,17 +375,16 @@
                        topY = 50 + (315 + 20) * 2;
                    // 画大图
                    InputStream goodsPicture = TaoBaoHttpUtil.getAsInputStream(goods.getPictUrl().replace("_.webp", ""));
                    InputStream goodsPicture = TaoBaoHttpUtil
                            .getAsInputStream(goods.getPictUrl().replace("_.webp", ""));
                    BufferedImage picImage = ImageIO.read(goodsPicture);
                    picImage = zoomInImage(picImage, 315, 315);
                    g2d.drawImage(picImage, topX, topY, null);
                    g2d.setColor(new Color(224, 224, 224));
                    // 画边框
                    g2d.setStroke(new BasicStroke(1.0f));
                    g2d.drawRect(topX - 1, topY - 1, 316,316);
                    g2d.drawRect(topX - 1, topY - 1, 316, 316);
                    // 画券
@@ -445,10 +445,10 @@
            font = font.deriveFont(50.0f);
            g2d.setFont(font);
            g2d.setColor(new Color(229, 0, 93));
            g2d.drawString("返利券提醒您", 312, 1118 + 40);
//            g2d.drawString("返利券提醒您", 312, 1118 + 40);
            g2d.setColor(new Color(102, 102, 102));
            g2d.drawString("长按识别二维码领取优惠券", 312, 1118 + 105);
            g2d.drawString("长按识别二维码领取优惠券", 312, 1118 + 77);
            g2d.dispose();
fanli/src/main/java/com/yeshi/fanli/util/MoneyBigDecimalUtil.java
@@ -21,7 +21,7 @@
    }
    public static BigDecimal div(BigDecimal d1, BigDecimal d2) {// 进行除法运算
        return d1.divide(d2).setScale(2, BigDecimal.ROUND_DOWN);
        return d1.divide(d2,2, BigDecimal.ROUND_DOWN);
    }
    public static BigDecimal getWithNoZera(BigDecimal num) {// 进行除法运算
fanli/src/main/java/com/yeshi/fanli/util/RedisManager.java
@@ -169,10 +169,13 @@
        if (StringUtil.isNullOrEmpty(value)) {
            List<ImageInfo> list = null;
            try {
                list = TaoBaoUtil.getTBDetailImageWithSize(auctionId);
                list = TaoBaoUtil.getTBDetailImageWithSizev2(auctionId);
            } catch (Exception e) {
                e.printStackTrace();
            }
            if (list == null || list.size() == 0) {
                list = TaoBaoUtil.getTBDetailImageWithSize(auctionId);
            }
            if (list != null && list.size() > 0)
                // 缓存1天
                if (Constant.IS_OUTNET)
fanli/src/main/java/com/yeshi/fanli/util/SpringContext.java
@@ -91,7 +91,7 @@
            doPushIOS();// 处理发送IOS消息
        } else if (!Constant.IS_TEST) {
            initScheduler();// 启动定时任务
//            doUpdateGoodsJob();
            // doUpdateGoodsJob();
        }
    }
@@ -376,7 +376,7 @@
                                }
                            }
                        } catch (Exception e) {
                            LogHelper.error("更新商品出错:"+e.getMessage());
                            LogHelper.error("更新商品出错:" + e.getMessage());
                        }
                    }
fanli/src/main/java/com/yeshi/fanli/util/factory/MonitorFactory.java
New file
@@ -0,0 +1,47 @@
package com.yeshi.fanli.util.factory;
import java.util.Date;
import java.util.Iterator;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.yeshi.fanli.entity.monitor.ClientAPIMonitor;
import net.sf.json.JSONObject;
public class MonitorFactory {
    @SuppressWarnings("unchecked")
    public static ClientAPIMonitor createClientAPI(HttpServletRequest request, int code, int time, String beiZhu)
            throws Exception {
        if (request == null)
            throw new Exception("request 为空");
        ClientAPIMonitor monitor = new ClientAPIMonitor();
        Map<String, Object> params = (Map<String, Object>) request.getParameterMap();
        if (params != null) {
            Iterator<String> its = params.keySet().iterator();
            JSONObject json = new JSONObject();
            while (its.hasNext()) {
                String key = its.next();
                if ("packages".equalsIgnoreCase(key) || "appkey".equalsIgnoreCase(key)
                        || "platform".equalsIgnoreCase(key) || "apiversion".equalsIgnoreCase(key)
                        || "channel".equalsIgnoreCase(key) || "imei".equalsIgnoreCase(key)
                        || "osVersion".equalsIgnoreCase(key) || "network".equalsIgnoreCase(key)
                        || "deviceType".equalsIgnoreCase(key) || "time".equalsIgnoreCase(key)
                        || "sign".equalsIgnoreCase(key))
                    continue;
                json.put(key, ((Object[]) params.get(key))[0]);
            }
            monitor.setRequestData(json.toString());
        }
        monitor.setBeiZhu(beiZhu);
        monitor.setCode(code);
        monitor.setCreateTime(new Date());
        monitor.setIp(request.getRemoteHost());
        monitor.setTime(time);
        monitor.setUrl(request.getRequestURI());
        return monitor;
    }
}
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoOrderUtil.java
@@ -674,8 +674,15 @@
        orderItem.setSettlementTime(0L);
        String createTime = tbo.getCreateTime();
        orderItem.setCreateTime(TimeUtil.convertDateToTemp2(createTime));
        orderItem.setFanMoney(MoneyBigDecimalUtil.mul(rate.divide(BigDecimal.valueOf(100)), tbo.getEstimate()));
        orderItem.setPayMoney(tbo.getPayment());
        if ("订单结算".equalsIgnoreCase(tbo.getOrderState()))
            orderItem.setFanMoney(MoneyBigDecimalUtil.mul(rate.divide(BigDecimal.valueOf(100)), tbo.geteIncome()));
        else
            orderItem.setFanMoney(MoneyBigDecimalUtil.mul(rate.divide(BigDecimal.valueOf(100)), tbo.getEstimate()));
        if ("订单结算".equalsIgnoreCase(tbo.getOrderState()))
            orderItem.setPayMoney(tbo.getSettlement());
        else
            orderItem.setPayMoney(tbo.getPayment());
        orderItem.setOrder(order);
        orderItem.setOrderId(tbo.getOrderId());
@@ -809,7 +816,10 @@
        pidOrder.setOrderType(taoBaoOrder.getOrderType());
        pidOrder.setRate(taoBaoOrder.getiRatio());
        pidOrder.setPayMoney(taoBaoOrder.getPayment());
        pidOrder.setPreMoney(taoBaoOrder.getEstimate());
        if ("订单结算".equalsIgnoreCase(taoBaoOrder.getOrderState()))
            pidOrder.setPreMoney(taoBaoOrder.geteIncome());
        else
            pidOrder.setPreMoney(taoBaoOrder.getEstimate());
        pidOrder.setFinalMoney(taoBaoOrder.getSettlement());
        if (!StringUtil.isNullOrEmpty(taoBaoOrder.getSettlementTime()))
            pidOrder.setBalanceTime(new Date(TimeUtil.convertDateToTemp2(taoBaoOrder.getSettlementTime())));
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java
@@ -1664,6 +1664,56 @@
    }
    /**
     *
     * @param auctionId
     * @return
     */
    public static List<ImageInfo> getTBDetailImageWithSizev2(Long auctionId) {
        List<ImageInfo> imgList = new ArrayList<>();
        try {
            String url = String.format("https://hws.m.taobao.com/cache/desc/5.0?id=" + auctionId);
            String result = HttpUtil.get(url);
            JSONObject data = JSONObject.fromObject(result);
            JSONArray array = data.optJSONObject("wdescContent").optJSONArray("pages");
            if (array != null) {
                String html = "";
                for (int i = 0; i < array.size(); i++) {
                    String itemStr = array.optString(i).replace("<img", "<a").replace("</img>", "<a>");
                    html += itemStr;
                }
                Document doc = Jsoup.parse(html);
                Elements items = doc.getElementsByTag("a");
                for (int i = 0; i < items.size(); i++) {
                    ImageInfo img = new ImageInfo();
                    Element item = items.get(i);
                    if (StringUtil.isNullOrEmpty(item.ownText()))
                        continue;
                    if (!StringUtil.isNullOrEmpty(item.attr("size"))) {
                        img.setWidth(Integer.parseInt(item.attr("size").split("x")[0]));
                        img.setHeight(Integer.parseInt(item.attr("size").split("x")[1]));
                    }
                    if (item.ownText().startsWith("http"))
                        img.setPicture(item.ownText().trim());
                    else
                        img.setPicture("http:" + item.ownText().trim());
                    imgList.add(img);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
            try {
                LogHelper.errorDetailInfo(e);
            } catch (Exception e1) {
                e1.printStackTrace();
            }
        }
        return imgList;
    }
    /**
     * 阿里百川转链接口(暂时无法使用)
     * 
     * @param auctionId
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java
@@ -626,6 +626,13 @@
        if (filter.getEndTkRate() > 0)
            map.put("end_tk_rate", filter.getEndTkRate() + "");
        if (filter.getStartKaTkRate() > 0)
            map.put("start_ka_tk_rate", filter.getStartKaTkRate() + "");
        if (filter.getEndKaTkRate() > 0)
            map.put("end_ka_tk_rate", filter.getEndKaTkRate() + "");
        if (filter.isTmall())
            map.put("is_tmall", filter.isTmall() + "");
@@ -729,7 +736,7 @@
        // 设置发货地址
        TaoBaoSearchNav nav = new TaoBaoSearchNav();
        nav.setName("发货地");
        nav.setName("发货地选择");
        nav.setFlag("address");
        nav.setId(11110);
        nav.setType("fahuodi");
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeBaseUtil.java
@@ -52,12 +52,14 @@
            if (data.optJSONObject("error_response") != null
                    && data.optJSONObject("error_response").optInt("code") == 7) {
                reportAppInvalid(app.getAppKey());
                TaoKeLogHelper.error(params, result);
                throw new TaoKeApiException(TaoKeApiException.CODE_APPKEY_LIMIT, "淘宝请求限制:" + result, params);
            } else if (data.optJSONObject("error_response") != null) {
                throw new TaoKeApiException(TaoKeApiException.CODE_API_ERROR, result, params);
            }
        } else
            throw new TaoKeApiException(TaoKeApiException.CODE_OTHER, ":" + result, params);
        reValid(app.getAppKey());
        return data;
    }
@@ -95,6 +97,7 @@
            }
        } else
            throw new TaoKeApiException(TaoKeApiException.CODE_OTHER, ":" + result, params);
        reValid(app.getAppKey());
        return data;
    }
@@ -125,7 +128,7 @@
                data = JSONObject.fromObject(result);
            } catch (Exception e) {
            }
        }
        if (data != null)
@@ -192,13 +195,13 @@
            } catch (Exception e) {
            }
            // 接口请求失败,默认设置成返利券Android的媒体信息
            // 接口请求失败,默认设置成影视大全IOS的媒体信息
            if (StringUtil.isNullOrEmpty(result)) {
                taoKeAppInfo = new TaoKeAppInfo();
                taoKeAppInfo.setAdzoneId("10647300249");
                taoKeAppInfo.setAppKey("24980167");
                taoKeAppInfo.setAppSecret("e0a2e05deabf5ce039b52e5b492d5382");
                taoKeAppInfo.setPid("mm_124933865_56750082_10647300249");
                taoKeAppInfo.setAdzoneId("381938426");
                taoKeAppInfo.setAppKey("24838852");
                taoKeAppInfo.setAppSecret("bc8265e2bf8d8115329d652f9d3d4cd8");
                taoKeAppInfo.setPid("mm_124933865_43788020_381938426");
                lastTime = System.currentTimeMillis();
                return taoKeAppInfo;
            }
@@ -213,6 +216,13 @@
                info.setAdzoneId(sts[sts.length - 1]);
                taoKeAppInfo = info;
                lastTime = System.currentTimeMillis();
            } else {// 防止所有的失效
                taoKeAppInfo = new TaoKeAppInfo();
                taoKeAppInfo.setAdzoneId("381938426");
                taoKeAppInfo.setAppKey("24838852");
                taoKeAppInfo.setAppSecret("bc8265e2bf8d8115329d652f9d3d4cd8");
                taoKeAppInfo.setPid("mm_124933865_43788020_381938426");
                return taoKeAppInfo;
            }
        }
        return taoKeAppInfo;
@@ -239,16 +249,42 @@
        }
    }
    static Map<String, Integer> invalidMap = new HashMap<>();
    /**
     * 报告该APPKey不能用
     * 
     * @param appkey
     */
    static void reportAppInvalid(String appkey) {
        if (invalidMap == null)
            return;
        // 错误三次后再真正上报
        if (invalidMap.get(appkey) == null)
            invalidMap.put(appkey, 1);
        else
            invalidMap.put(appkey, invalidMap.get(appkey) + 1);
        if (invalidMap.get(appkey) < 4)
            return;
        invalidMap.put(appkey, 0);
        HttpUtil.get("http://193.112.35.168:8091/tb/taoke/reportappcannotuse?appkey=" + appkey);
        lastTime = 0;
    }
    /**
     * APPKey恢复可用
     *
     * @param appKey
     */
    static void reValid(String appKey) {
        if (invalidMap == null)
            return;
        Integer count = invalidMap.get(appKey);
        if (count != null && count > 0)
            invalidMap.put(appKey, count - 1);
    }
    public static void setAppValid() {
        HttpUtil.get("http://193.112.35.168:8091/tb/taoke/setappcanuse");
    }
fanli/src/main/resource/druid.properties
@@ -4,6 +4,23 @@
#druid.username=root
#druid.password=hexiaohui
#druid.url=jdbc:mysql://192.168.1.253:3306/ec_quan
#druid.username=root
#druid.password=123456
#druid.url=jdbc:mysql://172.16.16.17:3306/ec_quan_test
#druid.username=root
#druid.password=Yeshi2016@
#druid.url=jdbc:mysql://172.16.16.17:3306/ec_quan_test_online
#druid.username=root
#druid.password=Yeshi2016@
#外网正式
druid.url=jdbc:mysql://172.16.16.17:3306/ec_quan
druid.username=root
fanli/src/test/java/org/fanli/AppTest.java
@@ -1,5 +1,7 @@
package org.fanli;
import org.junit.Ignore;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
@@ -7,6 +9,7 @@
/**
 * Unit test for simple App.
 */
@Ignore
public class AppTest extends TestCase {
    /**
     * Create the test case
fanli/src/test/java/org/fanli/AppVersionTest.java
New file
@@ -0,0 +1,35 @@
package org.fanli;
import java.util.List;
import org.junit.Ignore;
import org.junit.Test;
import com.yeshi.fanli.entity.AppVersionInfo;
import com.yeshi.fanli.service.inter.config.AppVersionService;
@Ignore
public class AppVersionTest {
    @Test
    public void test1() {
        AppVersionService appVersionService = com.yeshi.fanli.util.BeanUtil.getBean(AppVersionService.class);
        AppVersionInfo info = new AppVersionInfo();
        info.setPlatform(AppVersionInfo.PLATFORM_IOS);
        info.setVersion("1.4.4");
        info.setVersionCode(34);
        try {
            appVersionService.addAppVersion(info);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    @Test
    public void test2() {
        AppVersionService appVersionService = com.yeshi.fanli.util.BeanUtil.getBean(AppVersionService.class);
        List<AppVersionInfo> list = appVersionService.getAppVersionInfoListByPlatform(AppVersionInfo.PLATFORM_ANDROID);
        appVersionService.getAppVersionInfoListByPlatformAndVersion(AppVersionInfo.PLATFORM_ANDROID, 26);
    }
}
fanli/src/test/java/org/fanli/DeviceTokenTest.java
New file
@@ -0,0 +1,19 @@
package org.fanli;
import org.junit.Ignore;
import org.junit.Test;
import com.yeshi.fanli.dao.mybatis.push.DeviceTokenIOSMapper;
import com.yeshi.fanli.entity.push.DeviceTokenIOS;
@Ignore
public class DeviceTokenTest {
    @Test
    public void test1() {
        DeviceTokenIOSMapper deviceTokenIOSMapper = com.yeshi.fanli.util.BeanUtil.getBean(DeviceTokenIOSMapper.class);
        DeviceTokenIOS ios = deviceTokenIOSMapper.selectByDevice("test213ste");
        System.out.println(ios);
    }
}
fanli/src/test/java/org/fanli/TBImgTest.java
New file
@@ -0,0 +1,43 @@
package org.fanli;
import java.io.IOException;
import java.io.InputStream;
import org.junit.Ignore;
import org.junit.Test;
import org.yeshi.utils.HttpUtil;
import org.yeshi.utils.exception.HttpException;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
import com.yeshi.fanli.util.FileUtil;
import com.yeshi.fanli.util.ImageUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
//@Ignore
public class TBImgTest {
    @Test
    public void test1() {
        try {
            InputStream img = ImageUtil.drawGoodsShareImg(
                    HttpUtil.downLoadImg(
                            "https://wwc.alicdn.com/avatar/getAvatar.do?userId=1889722423&width=160&height=160&type=sns"),
                    HttpUtil.downLoadImg(
                            "https://wwc.alicdn.com/avatar/getAvatar.do?userId=1889722423&width=160&height=160&type=sns"),
                    TaoKeApiUtil.searchGoodsDetail(559888327092L));
            try {
                FileUtil.saveAsFile(img, "D:/test.png");
            } catch (IOException e) {
                e.printStackTrace();
            }
        } catch (HttpException e) {
            e.printStackTrace();
        } catch (TaobaoGoodsDownException e) {
            e.printStackTrace();
        }
    }
}
fanli/src/test/java/org/fanli/TaoKeTest.java
@@ -1,10 +1,15 @@
package org.fanli;
import org.junit.Ignore;
import org.junit.Test;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
@Ignore
public class TaoKeTest {
    @Test
@@ -15,7 +20,17 @@
    @Test
    public void test2() {
        System.out.println("测试合并");
        TaoKeAppInfo app = new TaoKeAppInfo();
        app.setAdzoneId("44841750025");
        app.setAppKey("25070111");
        app.setAppSecret("c7809ad9cd926fc45199d1d3ab7fe2eb");
        app.setPid("mm_124933865_113050446_44841750025");
        try {
            TaoBaoGoodsBrief goods = TaoKeApiUtil.searchGoodsDetail(527893773636L, app);
            System.out.println(goods.getId());
        } catch (TaobaoGoodsDownException e) {
            e.printStackTrace();
        }
    }
    @Test