├── document ├── sh.zip ├── mind │ ├── app.emmx │ ├── cms.emmx │ ├── home.emmx │ ├── oms.emmx │ ├── pms.emmx │ ├── sms.emmx │ └── ums.emmx ├── resource │ ├── mind_sale.jpg │ ├── mind_content.jpg │ ├── mind_member.jpg │ ├── mind_order.jpg │ ├── mind_portal.jpg │ ├── mind_product.jpg │ ├── mall_dev_flow.png │ ├── eclipse_import_1.png │ ├── eclipse_import_2.png │ ├── mall_system_arch.png │ ├── mall_business_arch.png │ ├── mall_dev_flow_note.png │ ├── mall_swarm_linux_02.png │ ├── mall_swarm_linux_04.png │ ├── mall_swarm_linux_07.png │ ├── mall_swarm_linux_08.png │ ├── mall_swarm_linux_09.png │ ├── rabbitmq_install_1.png │ ├── rabbitmq_install_2.png │ ├── rabbitmq_install_3.png │ ├── rabbitmq_install_4.png │ ├── mall_swarm_windows_01.png │ ├── mall_swarm_windows_02.png │ ├── mall_swarm_windows_03.png │ ├── mall_swarm_windows_04.png │ ├── mall_swarm_windows_05.png │ ├── mall_swarm_windows_06.png │ ├── mall_swarm_windows_07.png │ ├── mall_swarm_windows_08.png │ ├── mall_swarm_windows_09.png │ ├── mall_swarm_windows_10.png │ ├── mall_micro_service_arch.jpg │ └── mall_micro_service_arch.png ├── elk │ ├── logstash-springboot.conf │ └── logback-spring.xml ├── sh │ ├── mall-registry.sh │ ├── mall-config.sh │ ├── mall-gateway.sh │ ├── mall-monitor.sh │ ├── mall-admin.sh │ ├── mall-demo.sh │ ├── mall-search.sh │ └── mall-portal.sh ├── reference │ └── function.md └── docker │ ├── docker-compose-app.yml │ └── nginx.conf ├── mall-mbg ├── .gitignore └── src │ └── main │ ├── resources │ └── generator.properties │ └── java │ └── com │ └── macro │ └── mall │ └── mapper │ ├── CmsMemberReportMapper.java │ ├── UmsRoleMapper.java │ ├── OmsOrderMapper.java │ ├── PmsAlbumMapper.java │ ├── UmsAdminMapper.java │ ├── SmsCouponMapper.java │ ├── UmsMemberMapper.java │ ├── OmsCartItemMapper.java │ ├── PmsAlbumPicMapper.java │ ├── PmsSkuStockMapper.java │ ├── OmsOrderItemMapper.java │ ├── SmsHomeBrandMapper.java │ ├── UmsMemberTagMapper.java │ ├── UmsMemberTaskMapper.java │ ├── UmsPermissionMapper.java │ ├── PmsMemberPriceMapper.java │ ├── UmsMemberLevelMapper.java │ ├── CmsHelpCategoryMapper.java │ ├── CmsTopicCommentMapper.java │ ├── OmsOrderSettingMapper.java │ ├── CmsTopicCategoryMapper.java │ ├── PmsCommentReplayMapper.java │ ├── PmsProductLadderMapper.java │ ├── SmsCouponHistoryMapper.java │ ├── SmsHomeAdvertiseMapper.java │ ├── UmsAdminLoginLogMapper.java │ ├── CmsSubjectCommentMapper.java │ ├── OmsCompanyAddressMapper.java │ ├── PmsFeightTemplateMapper.java │ ├── SmsFlashPromotionMapper.java │ ├── SmsHomeNewProductMapper.java │ ├── UmsMemberLoginLogMapper.java │ ├── CmsSubjectCategoryMapper.java │ ├── OmsOrderReturnApplyMapper.java │ ├── PmsProductAttributeMapper.java │ ├── OmsOrderReturnReasonMapper.java │ ├── PmsProductOperateLogMapper.java │ ├── UmsAdminRoleRelationMapper.java │ ├── UmsMemberRuleSettingMapper.java │ └── SmsFlashPromotionLogMapper.java ├── mall-demo ├── src │ ├── main │ │ ├── resources │ │ │ ├── bootstrap.yml │ │ │ ├── bootstrap-dev.yml │ │ │ ├── bootstrap-prod.yml │ │ │ └── application.yml │ │ └── java │ │ │ └── com │ │ │ └── macro │ │ │ └── mall │ │ │ ├── demo │ │ │ ├── config │ │ │ │ ├── MyBatisConfig.java │ │ │ │ └── FeignConfig.java │ │ │ ├── dto │ │ │ │ └── UmsAdminLoginParam.java │ │ │ ├── service │ │ │ │ ├── DemoService.java │ │ │ │ ├── FeignPortalService.java │ │ │ │ ├── FeignAdminService.java │ │ │ │ └── FeignSearchService.java │ │ │ ├── validator │ │ │ │ ├── FlagValidator.java │ │ │ │ └── FlagValidatorClass.java │ │ │ └── controller │ │ │ │ ├── FeignPortalController.java │ │ │ │ └── FeignAdminController.java │ │ │ └── MallDemoApplication.java │ └── test │ │ └── java │ │ └── com │ │ └── macro │ │ └── mall │ │ └── MallDemoApplicationTests.java └── .gitignore ├── mall-admin └── src │ └── main │ ├── resources │ ├── META-INF │ │ └── MANIFEST.MF │ ├── bootstrap.yml │ ├── bootstrap-dev.yml │ ├── bootstrap-prod.yml │ └── dao │ │ ├── CmsSubjectProductRelationDao.xml │ │ ├── CmsPrefrenceAreaProductRelationDao.xml │ │ ├── PmsProductFullReductionDao.xml │ │ ├── PmsProductAttributeValueDao.xml │ │ ├── PmsProductLadderDao.xml │ │ ├── UmsAdminPermissionRelationDao.xml │ │ ├── PmsProductCategoryAttributeRelationDao.xml │ │ ├── OmsOrderOperateHistoryDao.xml │ │ ├── SmsCouponProductRelationDao.xml │ │ ├── PmsMemberPriceDao.xml │ │ ├── PmsProductAttributeDao.xml │ │ ├── SmsCouponProductCategoryRelationDao.xml │ │ ├── PmsProductVertifyRecordDao.xml │ │ ├── UmsRolePermissionRelationDao.xml │ │ ├── PmsProductCategoryDao.xml │ │ └── PmsProductAttributeCategoryDao.xml │ └── java │ └── com │ └── macro │ └── mall │ ├── dao │ ├── SmsCouponDao.java │ ├── PmsProductCategoryDao.java │ ├── PmsProductAttributeCategoryDao.java │ ├── PmsProductDao.java │ ├── PmsMemberPriceDao.java │ ├── PmsProductLadderDao.java │ ├── PmsProductAttributeDao.java │ ├── PmsProductVertifyRecordDao.java │ ├── UmsAdminPermissionRelationDao.java │ ├── OmsOrderOperateHistoryDao.java │ ├── PmsProductFullReductionDao.java │ ├── SmsCouponProductRelationDao.java │ ├── PmsProductAttributeValueDao.java │ ├── CmsSubjectProductRelationDao.java │ ├── CmsPrefrenceAreaProductRelationDao.java │ ├── SmsCouponProductCategoryRelationDao.java │ ├── PmsProductCategoryAttributeRelationDao.java │ ├── PmsSkuStockDao.java │ ├── SmsFlashPromotionProductRelationDao.java │ ├── UmsRolePermissionRelationDao.java │ ├── OmsOrderReturnApplyDao.java │ ├── OmsOrderDao.java │ └── UmsAdminRoleRelationDao.java │ ├── service │ ├── CmsPrefrenceAreaService.java │ ├── OmsCompanyAddressService.java │ ├── UmsMemberLevelService.java │ ├── OmsOrderSettingService.java │ ├── CmsSubjectService.java │ ├── PmsSkuStockService.java │ ├── OssService.java │ ├── SmsCouponHistoryService.java │ ├── PmsProductAttributeCategoryService.java │ ├── UmsPermissionService.java │ ├── impl │ │ ├── CmsPrefrenceAreaServiceImpl.java │ │ ├── OmsCompanyAddressServiceImpl.java │ │ ├── OmsOrderSettingServiceImpl.java │ │ └── UmsMemberLevelServiceImpl.java │ ├── SmsFlashPromotionService.java │ ├── PmsBrandService.java │ ├── OmsOrderReturnApplyService.java │ ├── SmsHomeAdvertiseService.java │ ├── SmsHomeBrandService.java │ ├── OmsOrderReturnReasonService.java │ ├── SmsHomeNewProductService.java │ ├── UmsRoleService.java │ ├── SmsHomeRecommendSubjectService.java │ ├── SmsHomeRecommendProductService.java │ ├── SmsCouponService.java │ ├── SmsFlashPromotionSessionService.java │ └── PmsProductCategoryService.java │ ├── dto │ ├── MinioUploadDto.java │ ├── UmsPermissionNode.java │ ├── SmsFlashPromotionSessionDetail.java │ ├── OmsMoneyInfoParam.java │ ├── OmsOrderReturnApplyResult.java │ ├── PmsProductResult.java │ ├── SmsFlashPromotionProduct.java │ ├── OmsOrderDeliveryParam.java │ ├── PmsProductCategoryWithChildrenItem.java │ ├── OmsOrderDetail.java │ ├── OmsReceiverInfoParam.java │ ├── ProductAttrInfo.java │ ├── PmsProductAttributeCategoryItem.java │ ├── OmsReturnApplyQueryParam.java │ ├── OmsOrderQueryParam.java │ ├── UmsAdminLoginParam.java │ ├── OmsUpdateStatusParam.java │ ├── UmsAdminParam.java │ └── OssCallbackParam.java │ ├── config │ ├── MyBatisConfig.java │ ├── OssConfig.java │ ├── MallSecurityConfig.java │ └── GlobalCorsConfig.java │ ├── MallAdminApplication.java │ └── validator │ ├── FlagValidator.java │ └── FlagValidatorClass.java ├── mall-portal ├── src │ ├── main │ │ ├── resources │ │ │ ├── bootstrap.yml │ │ │ ├── bootstrap-dev.yml │ │ │ └── bootstrap-prod.yml │ │ └── java │ │ │ └── com │ │ │ └── macro │ │ │ └── mall │ │ │ └── portal │ │ │ ├── config │ │ │ ├── SpringTaskConfig.java │ │ │ ├── MyBatisConfig.java │ │ │ └── MallSecurityConfig.java │ │ │ ├── dao │ │ │ ├── PortalOrderItemDao.java │ │ │ ├── SmsCouponHistoryDao.java │ │ │ ├── PortalProductDao.java │ │ │ └── PortalOrderDao.java │ │ │ ├── service │ │ │ ├── OmsPortalOrderReturnApplyService.java │ │ │ ├── MemberCollectionService.java │ │ │ ├── OmsPromotionService.java │ │ │ ├── MemberReadHistoryService.java │ │ │ ├── MemberAttentionService.java │ │ │ ├── RedisService.java │ │ │ ├── UmsMemberReceiveAddressService.java │ │ │ ├── UmsMemberCouponService.java │ │ │ ├── HomeService.java │ │ │ ├── OmsPortalOrderService.java │ │ │ └── impl │ │ │ │ └── OmsPortalOrderReturnApplyServiceImpl.java │ │ │ ├── MallPortalApplication.java │ │ │ ├── domain │ │ │ ├── FlashPromotionProduct.java │ │ │ ├── HomeFlashPromotion.java │ │ │ ├── OmsOrderDetail.java │ │ │ ├── HomeContentResult.java │ │ │ ├── QueueEnum.java │ │ │ └── CartProduct.java │ │ │ ├── repository │ │ │ ├── MemberReadHistoryRepository.java │ │ │ ├── MemberBrandAttentionRepository.java │ │ │ └── MemberProductCollectionRepository.java │ │ │ ├── component │ │ │ ├── CancelOrderReceiver.java │ │ │ └── OrderTimeOutCancelTask.java │ │ │ └── util │ │ │ └── DateUtil.java │ └── test │ │ └── java │ │ └── com │ │ └── macro │ │ └── mall │ │ └── portal │ │ ├── MallPortalApplicationTests.java │ │ └── PortalProductDaoTests.java └── .gitignore ├── mall-search ├── src │ └── main │ │ ├── resources │ │ ├── bootstrap.yml │ │ ├── bootstrap-dev.yml │ │ ├── bootstrap-prod.yml │ │ └── application.yml │ │ └── java │ │ └── com │ │ └── macro │ │ └── mall │ │ └── search │ │ ├── dao │ │ └── EsProductDao.java │ │ ├── config │ │ └── MyBatisConfig.java │ │ ├── MallSearchApplication.java │ │ └── repository │ │ └── EsProductRepository.java └── .gitignore ├── .gitignore ├── mall-config ├── src │ ├── main │ │ ├── resources │ │ │ ├── application-dev.yml │ │ │ ├── application-native.yml │ │ │ ├── application-prod.yml │ │ │ ├── config │ │ │ │ ├── demo │ │ │ │ │ ├── demo-prod.yml │ │ │ │ │ └── demo-dev.yml │ │ │ │ ├── search │ │ │ │ │ ├── search-dev.yml │ │ │ │ │ └── search-prod.yml │ │ │ │ ├── portal │ │ │ │ │ ├── portal-prod.yml │ │ │ │ │ └── portal-dev.yml │ │ │ │ └── admin │ │ │ │ │ ├── admin-prod.yml │ │ │ │ │ └── admin-dev.yml │ │ │ └── application.yml │ │ └── java │ │ │ └── com │ │ │ └── macro │ │ │ └── mall │ │ │ └── MallConfigApplication.java │ └── test │ │ └── java │ │ └── com │ │ └── macro │ │ └── mall │ │ └── MallConfigApplicationTests.java └── .gitignore ├── mall-monitor ├── src │ ├── main │ │ ├── resources │ │ │ ├── application-dev.yml │ │ │ ├── application-prod.yml │ │ │ └── application.yml │ │ └── java │ │ │ └── com │ │ │ └── macro │ │ │ └── mall │ │ │ └── MallMonitorApplication.java │ └── test │ │ └── java │ │ └── com │ │ └── macro │ │ └── mall │ │ └── MallMonitorApplicationTests.java └── .gitignore ├── mall-gateway ├── src │ ├── main │ │ ├── resources │ │ │ ├── application-dev.yml │ │ │ ├── application-prod.yml │ │ │ └── application.yml │ │ └── java │ │ │ └── com │ │ │ └── macro │ │ │ └── mall │ │ │ ├── MallGatewayApplication.java │ │ │ └── config │ │ │ └── GlobalCorsConfig.java │ └── test │ │ └── java │ │ └── com │ │ └── macro │ │ └── mall │ │ └── MallGatewayApplicationTests.java └── .gitignore ├── mall-common └── src │ └── main │ └── java │ └── com │ └── macro │ └── mall │ └── common │ └── api │ ├── IErrorCode.java │ └── ResultCode.java ├── mall-registry ├── src │ ├── main │ │ ├── resources │ │ │ └── application.yml │ │ └── java │ │ │ └── com │ │ │ └── macro │ │ │ └── mall │ │ │ └── MallRegistryApplication.java │ └── test │ │ └── java │ │ └── com │ │ └── macro │ │ └── mall │ │ └── MallRegistryApplicationTests.java └── .gitignore └── mall-security ├── .gitignore └── src └── main └── java └── com └── macro └── mall └── security ├── config └── IgnoreUrlsConfig.java └── component ├── RestAuthenticationEntryPoint.java └── RestfulAccessDeniedHandler.java /document/sh.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/sh.zip -------------------------------------------------------------------------------- /mall-mbg/.gitignore: -------------------------------------------------------------------------------- 1 | # MyBatis generate files # 2 | src\main\resources\com\macro\mall\mapper -------------------------------------------------------------------------------- /document/mind/app.emmx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/mind/app.emmx -------------------------------------------------------------------------------- /document/mind/cms.emmx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/mind/cms.emmx -------------------------------------------------------------------------------- /document/mind/home.emmx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/mind/home.emmx -------------------------------------------------------------------------------- /document/mind/oms.emmx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/mind/oms.emmx -------------------------------------------------------------------------------- /document/mind/pms.emmx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/mind/pms.emmx -------------------------------------------------------------------------------- /document/mind/sms.emmx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/mind/sms.emmx -------------------------------------------------------------------------------- /document/mind/ums.emmx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/mind/ums.emmx -------------------------------------------------------------------------------- /document/resource/mind_sale.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mind_sale.jpg -------------------------------------------------------------------------------- /document/resource/mind_content.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mind_content.jpg -------------------------------------------------------------------------------- /document/resource/mind_member.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mind_member.jpg -------------------------------------------------------------------------------- /document/resource/mind_order.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mind_order.jpg -------------------------------------------------------------------------------- /document/resource/mind_portal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mind_portal.jpg -------------------------------------------------------------------------------- /document/resource/mind_product.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mind_product.jpg -------------------------------------------------------------------------------- /document/resource/mall_dev_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mall_dev_flow.png -------------------------------------------------------------------------------- /mall-demo/src/main/resources/bootstrap.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | profiles: 3 | active: dev 4 | application: 5 | name: mall-demo -------------------------------------------------------------------------------- /document/resource/eclipse_import_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/eclipse_import_1.png -------------------------------------------------------------------------------- /document/resource/eclipse_import_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/eclipse_import_2.png -------------------------------------------------------------------------------- /document/resource/mall_system_arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mall_system_arch.png -------------------------------------------------------------------------------- /mall-admin/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Main-Class: com.macro.mall.MallAdminApplication 3 | 4 | -------------------------------------------------------------------------------- /mall-admin/src/main/resources/bootstrap.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | profiles: 3 | active: dev 4 | application: 5 | name: mall-admin -------------------------------------------------------------------------------- /mall-portal/src/main/resources/bootstrap.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | profiles: 3 | active: dev 4 | application: 5 | name: mall-portal -------------------------------------------------------------------------------- /mall-search/src/main/resources/bootstrap.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | profiles: 3 | active: dev 4 | application: 5 | name: mall-search -------------------------------------------------------------------------------- /document/resource/mall_business_arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mall_business_arch.png -------------------------------------------------------------------------------- /document/resource/mall_dev_flow_note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mall_dev_flow_note.png -------------------------------------------------------------------------------- /document/resource/mall_swarm_linux_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mall_swarm_linux_02.png -------------------------------------------------------------------------------- /document/resource/mall_swarm_linux_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mall_swarm_linux_04.png -------------------------------------------------------------------------------- /document/resource/mall_swarm_linux_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mall_swarm_linux_07.png -------------------------------------------------------------------------------- /document/resource/mall_swarm_linux_08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mall_swarm_linux_08.png -------------------------------------------------------------------------------- /document/resource/mall_swarm_linux_09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mall_swarm_linux_09.png -------------------------------------------------------------------------------- /document/resource/rabbitmq_install_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/rabbitmq_install_1.png -------------------------------------------------------------------------------- /document/resource/rabbitmq_install_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/rabbitmq_install_2.png -------------------------------------------------------------------------------- /document/resource/rabbitmq_install_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/rabbitmq_install_3.png -------------------------------------------------------------------------------- /document/resource/rabbitmq_install_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/rabbitmq_install_4.png -------------------------------------------------------------------------------- /document/resource/mall_swarm_windows_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mall_swarm_windows_01.png -------------------------------------------------------------------------------- /document/resource/mall_swarm_windows_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mall_swarm_windows_02.png -------------------------------------------------------------------------------- /document/resource/mall_swarm_windows_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mall_swarm_windows_03.png -------------------------------------------------------------------------------- /document/resource/mall_swarm_windows_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mall_swarm_windows_04.png -------------------------------------------------------------------------------- /document/resource/mall_swarm_windows_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mall_swarm_windows_05.png -------------------------------------------------------------------------------- /document/resource/mall_swarm_windows_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mall_swarm_windows_06.png -------------------------------------------------------------------------------- /document/resource/mall_swarm_windows_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mall_swarm_windows_07.png -------------------------------------------------------------------------------- /document/resource/mall_swarm_windows_08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mall_swarm_windows_08.png -------------------------------------------------------------------------------- /document/resource/mall_swarm_windows_09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mall_swarm_windows_09.png -------------------------------------------------------------------------------- /document/resource/mall_swarm_windows_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mall_swarm_windows_10.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Maven # 2 | target/ 3 | 4 | # IDEA # 5 | .idea/ 6 | *.iml 7 | 8 | # Eclipse # 9 | .settings/ 10 | .classpath 11 | .project -------------------------------------------------------------------------------- /document/resource/mall_micro_service_arch.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mall_micro_service_arch.jpg -------------------------------------------------------------------------------- /document/resource/mall_micro_service_arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluswait/mall-swarm/HEAD/document/resource/mall_micro_service_arch.png -------------------------------------------------------------------------------- /mall-config/src/main/resources/application-dev.yml: -------------------------------------------------------------------------------- 1 | eureka: 2 | client: 3 | service-url: 4 | defaultZone: http://localhost:8001/eureka/ -------------------------------------------------------------------------------- /mall-config/src/main/resources/application-native.yml: -------------------------------------------------------------------------------- 1 | eureka: 2 | client: 3 | service-url: 4 | defaultZone: http://localhost:8001/eureka/ -------------------------------------------------------------------------------- /mall-monitor/src/main/resources/application-dev.yml: -------------------------------------------------------------------------------- 1 | eureka: 2 | client: 3 | service-url: 4 | defaultZone: http://localhost:8001/eureka/ 5 | -------------------------------------------------------------------------------- /mall-gateway/src/main/resources/application-dev.yml: -------------------------------------------------------------------------------- 1 | eureka: 2 | client: 3 | service-url: 4 | defaultZone: http://localhost:8001/eureka/ 5 | registry-fetch-interval-seconds: 10 6 | -------------------------------------------------------------------------------- /mall-config/src/main/resources/application-prod.yml: -------------------------------------------------------------------------------- 1 | eureka: 2 | client: 3 | service-url: 4 | defaultZone: http://mall-registry:8001/eureka/ 5 | instance: 6 | prefer-ip-address: true 7 | -------------------------------------------------------------------------------- /mall-monitor/src/main/resources/application-prod.yml: -------------------------------------------------------------------------------- 1 | eureka: 2 | client: 3 | service-url: 4 | defaultZone: http://mall-registry:8001/eureka/ 5 | instance: 6 | prefer-ip-address: true 7 | -------------------------------------------------------------------------------- /mall-gateway/src/main/resources/application-prod.yml: -------------------------------------------------------------------------------- 1 | eureka: 2 | client: 3 | service-url: 4 | defaultZone: http://mall-registry:8001/eureka/ 5 | registry-fetch-interval-seconds: 10 6 | instance: 7 | prefer-ip-address: true 8 | -------------------------------------------------------------------------------- /mall-mbg/src/main/resources/generator.properties: -------------------------------------------------------------------------------- 1 | jdbc.driverClass=com.mysql.cj.jdbc.Driver 2 | jdbc.connectionURL=jdbc:mysql://localhost:3306/mall?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai 3 | jdbc.userId=root 4 | jdbc.password=root -------------------------------------------------------------------------------- /mall-config/src/main/resources/config/demo/demo-prod.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:mysql://db:3306/mall?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai 4 | username: root 5 | password: 123456 6 | logging: 7 | path: /var/logs #配置日志生成路径 -------------------------------------------------------------------------------- /mall-common/src/main/java/com/macro/mall/common/api/IErrorCode.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.common.api; 2 | 3 | /** 4 | * 封装API的错误码 5 | * Created by macro on 2019/4/19. 6 | */ 7 | public interface IErrorCode { 8 | long getCode(); 9 | 10 | String getMessage(); 11 | } 12 | -------------------------------------------------------------------------------- /document/elk/logstash-springboot.conf: -------------------------------------------------------------------------------- 1 | input { 2 | tcp { 3 | mode => "server" 4 | host => "0.0.0.0" 5 | port => 4560 6 | codec => json_lines 7 | } 8 | } 9 | output { 10 | elasticsearch { 11 | hosts => "es:9200" 12 | index => "springboot-logstash-%{+YYYY.MM.dd}" 13 | } 14 | } -------------------------------------------------------------------------------- /mall-registry/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8001 3 | spring: 4 | application: 5 | name: mall-registry 6 | eureka: 7 | instance: 8 | hostname: localhost 9 | client: 10 | fetch-registry: false 11 | register-with-eureka: false 12 | server: 13 | enable-self-preservation: false 14 | -------------------------------------------------------------------------------- /mall-demo/src/main/resources/bootstrap-dev.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | cloud: 3 | config: 4 | profile: dev #启用环境名称 5 | label: master #分支名称 6 | name: demo #配置文件名称 7 | discovery: 8 | enabled: true 9 | service-id: mall-config 10 | eureka: 11 | client: 12 | service-url: 13 | defaultZone: http://localhost:8001/eureka/ -------------------------------------------------------------------------------- /mall-admin/src/main/resources/bootstrap-dev.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | cloud: 3 | config: 4 | profile: dev #启用环境名称 5 | label: master #分支名称 6 | name: admin #配置文件名称 7 | discovery: 8 | enabled: true 9 | service-id: mall-config 10 | eureka: 11 | client: 12 | service-url: 13 | defaultZone: http://localhost:8001/eureka/ -------------------------------------------------------------------------------- /mall-portal/src/main/resources/bootstrap-dev.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | cloud: 3 | config: 4 | profile: dev #启用环境名称 5 | label: master #分支名称 6 | name: portal #配置文件名称 7 | discovery: 8 | enabled: true 9 | service-id: mall-config 10 | eureka: 11 | client: 12 | service-url: 13 | defaultZone: http://localhost:8001/eureka/ -------------------------------------------------------------------------------- /mall-search/src/main/resources/bootstrap-dev.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | cloud: 3 | config: 4 | profile: dev #启用环境名称 5 | label: master #分支名称 6 | name: search #配置文件名称 7 | discovery: 8 | enabled: true 9 | service-id: mall-config 10 | eureka: 11 | client: 12 | service-url: 13 | defaultZone: http://localhost:8001/eureka/ -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dao/SmsCouponDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dao; 2 | 3 | import com.macro.mall.dto.SmsCouponParam; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | /** 7 | * 优惠券管理自定义查询Dao 8 | * Created by macro on 2018/8/29. 9 | */ 10 | public interface SmsCouponDao { 11 | SmsCouponParam getItem(@Param("id") Long id); 12 | } 13 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/service/CmsPrefrenceAreaService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.service; 2 | 3 | import com.macro.mall.model.CmsPrefrenceArea; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 优选专区Service 9 | * Created by macro on 2018/6/1. 10 | */ 11 | public interface CmsPrefrenceAreaService { 12 | List listAll(); 13 | } 14 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dto/MinioUploadDto.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dto; 2 | 3 | import lombok.Data; 4 | import lombok.EqualsAndHashCode; 5 | 6 | /** 7 | * 文件上传返回结果 8 | * Created by macro on 2019/12/25. 9 | */ 10 | @Data 11 | @EqualsAndHashCode(callSuper = false) 12 | public class MinioUploadDto { 13 | private String url; 14 | private String name; 15 | } 16 | -------------------------------------------------------------------------------- /mall-demo/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /mall-portal/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /mall-search/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dao/PmsProductCategoryDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dao; 2 | 3 | import com.macro.mall.dto.PmsProductCategoryWithChildrenItem; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 商品分类自定义Dao 9 | * Created by macro on 2018/5/25. 10 | */ 11 | public interface PmsProductCategoryDao { 12 | List listWithChildren(); 13 | } 14 | -------------------------------------------------------------------------------- /mall-config/src/main/resources/config/demo/demo-dev.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:mysql://192.168.1.122:3306/mall?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai 4 | username: root 5 | password: 123456 6 | logging: 7 | level: 8 | root: info #日志配置DEBUG,INFO,WARN,ERROR 9 | com.macro.mall: debug 10 | com.macro.mall.demo.service.FeignAdminService: debug -------------------------------------------------------------------------------- /mall-demo/src/main/java/com/macro/mall/demo/config/MyBatisConfig.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.demo.config; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | /** 7 | * MyBatis配置类 8 | * Created by macro on 2019/4/8. 9 | */ 10 | @Configuration 11 | @MapperScan("com.macro.mall.mapper") 12 | public class MyBatisConfig { 13 | } 14 | -------------------------------------------------------------------------------- /mall-admin/src/main/resources/bootstrap-prod.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | cloud: 3 | config: 4 | profile: prod #启用环境名称 5 | label: master #分支名称 6 | name: admin #配置文件名称 7 | discovery: 8 | enabled: true 9 | service-id: mall-config 10 | eureka: 11 | client: 12 | service-url: 13 | defaultZone: http://mall-registry:8001/eureka/ 14 | instance: 15 | prefer-ip-address: true -------------------------------------------------------------------------------- /mall-demo/src/main/resources/bootstrap-prod.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | cloud: 3 | config: 4 | profile: prod #启用环境名称 5 | label: master #分支名称 6 | name: demo #配置文件名称 7 | discovery: 8 | enabled: true 9 | service-id: mall-config 10 | eureka: 11 | client: 12 | service-url: 13 | defaultZone: http://mall-registry:8001/eureka/ 14 | instance: 15 | prefer-ip-address: true -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/config/SpringTaskConfig.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.scheduling.annotation.EnableScheduling; 5 | 6 | /** 7 | * 定时任务配置 8 | * Created by macro on 2019/4/8. 9 | */ 10 | @Configuration 11 | @EnableScheduling 12 | public class SpringTaskConfig { 13 | } 14 | -------------------------------------------------------------------------------- /mall-portal/src/main/resources/bootstrap-prod.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | cloud: 3 | config: 4 | profile: prod #启用环境名称 5 | label: master #分支名称 6 | name: portal #配置文件名称 7 | discovery: 8 | enabled: true 9 | service-id: mall-config 10 | eureka: 11 | client: 12 | service-url: 13 | defaultZone: http://mall-registry:8001/eureka/ 14 | instance: 15 | prefer-ip-address: true -------------------------------------------------------------------------------- /mall-search/src/main/resources/bootstrap-prod.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | cloud: 3 | config: 4 | profile: prod #启用环境名称 5 | label: master #分支名称 6 | name: search #配置文件名称 7 | discovery: 8 | enabled: true 9 | service-id: mall-config 10 | eureka: 11 | client: 12 | service-url: 13 | defaultZone: http://mall-registry:8001/eureka/ 14 | instance: 15 | prefer-ip-address: true -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dao/PmsProductAttributeCategoryDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dao; 2 | 3 | import com.macro.mall.dto.PmsProductAttributeCategoryItem; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 自定义商品属性分类Dao 9 | * Created by macro on 2018/5/24. 10 | */ 11 | public interface PmsProductAttributeCategoryDao { 12 | List getListWithAttr(); 13 | } 14 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/service/OmsCompanyAddressService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.service; 2 | 3 | import com.macro.mall.model.OmsCompanyAddress; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 收货地址管Service 9 | * Created by macro on 2018/10/18. 10 | */ 11 | public interface OmsCompanyAddressService { 12 | /** 13 | * 获取全部收货地址 14 | */ 15 | List list(); 16 | } 17 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dao/PmsProductDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dao; 2 | 3 | import com.macro.mall.dto.PmsProductResult; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | 7 | /** 8 | * 商品自定义Dao 9 | * Created by macro on 2018/4/26. 10 | */ 11 | public interface PmsProductDao { 12 | /** 13 | * 获取商品编辑信息 14 | */ 15 | PmsProductResult getUpdateInfo(@Param("id") Long id); 16 | } 17 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dao/PmsMemberPriceDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dao; 2 | 3 | import com.macro.mall.model.PmsMemberPrice; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 自定义会员价格Dao 10 | * Created by macro on 2018/4/26. 11 | */ 12 | public interface PmsMemberPriceDao { 13 | int insertList(@Param("list") List memberPriceList); 14 | } 15 | -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/dao/PortalOrderItemDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.dao; 2 | 3 | import com.macro.mall.model.OmsOrderItem; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 订单商品信息自定义Dao 10 | * Created by macro on 2018/9/3. 11 | */ 12 | public interface PortalOrderItemDao { 13 | int insertList(@Param("list") List list); 14 | } 15 | -------------------------------------------------------------------------------- /mall-search/src/main/java/com/macro/mall/search/dao/EsProductDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.search.dao; 2 | 3 | import com.macro.mall.search.domain.EsProduct; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 搜索系统中的商品管理自定义Dao 10 | * Created by macro on 2018/6/19. 11 | */ 12 | public interface EsProductDao { 13 | List getAllEsProductList(@Param("id") Long id); 14 | } 15 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dto/UmsPermissionNode.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dto; 2 | 3 | import com.macro.mall.model.UmsPermission; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Created by macro on 2018/9/30. 11 | */ 12 | public class UmsPermissionNode extends UmsPermission { 13 | @Getter 14 | @Setter 15 | private List children; 16 | } 17 | -------------------------------------------------------------------------------- /mall-search/src/main/java/com/macro/mall/search/config/MyBatisConfig.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.search.config; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | /** 7 | * MyBatis配置类 8 | * Created by macro on 2019/4/8. 9 | */ 10 | @Configuration 11 | @MapperScan({"com.macro.mall.mapper","com.macro.mall.search.dao"}) 12 | public class MyBatisConfig { 13 | } 14 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dao/PmsProductLadderDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dao; 2 | 3 | import com.macro.mall.model.PmsProductLadder; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 自定义会员阶梯价格Dao 10 | * Created by macro on 2018/4/26. 11 | */ 12 | public interface PmsProductLadderDao { 13 | int insertList(@Param("list") List productLadderList); 14 | } 15 | -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/service/OmsPortalOrderReturnApplyService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.service; 2 | 3 | import com.macro.mall.portal.domain.OmsOrderReturnApplyParam; 4 | 5 | /** 6 | * 订单退货管理Service 7 | * Created by macro on 2018/10/17. 8 | */ 9 | public interface OmsPortalOrderReturnApplyService { 10 | /** 11 | * 提交申请 12 | */ 13 | int create(OmsOrderReturnApplyParam returnApply); 14 | } 15 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dao/PmsProductAttributeDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dao; 2 | 3 | import com.macro.mall.dto.ProductAttrInfo; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 自定义商品属性Dao 10 | * Created by macro on 2018/5/23. 11 | */ 12 | public interface PmsProductAttributeDao { 13 | List getProductAttrInfo(@Param("id") Long productCategoryId); 14 | } 15 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dao/PmsProductVertifyRecordDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dao; 2 | 3 | import com.macro.mall.model.PmsProductVertifyRecord; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 商品审核日志自定义dao 10 | * Created by macro on 2018/4/27. 11 | */ 12 | public interface PmsProductVertifyRecordDao { 13 | int insertList(@Param("list") List list); 14 | } 15 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dto/SmsFlashPromotionSessionDetail.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dto; 2 | 3 | import com.macro.mall.model.SmsFlashPromotionSession; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | /** 8 | * 包含商品数量的场次信息 9 | * Created by macro on 2018/11/19. 10 | */ 11 | public class SmsFlashPromotionSessionDetail extends SmsFlashPromotionSession { 12 | @Setter 13 | @Getter 14 | private Long productCount; 15 | } 16 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dao/UmsAdminPermissionRelationDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dao; 2 | 3 | import com.macro.mall.model.UmsAdminPermissionRelation; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 用户权限自定义Dao 10 | * Created by macro on 2018/10/8. 11 | */ 12 | public interface UmsAdminPermissionRelationDao { 13 | int insertList(@Param("list") List list); 14 | } 15 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/service/UmsMemberLevelService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.service; 2 | 3 | import com.macro.mall.model.UmsMemberLevel; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 会员等级管理Service 9 | * Created by macro on 2018/4/26. 10 | */ 11 | public interface UmsMemberLevelService { 12 | /** 13 | * 获取所有会员登录 14 | * @param defaultStatus 是否为默认会员 15 | */ 16 | List list(Integer defaultStatus); 17 | } 18 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dao/OmsOrderOperateHistoryDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dao; 2 | 3 | import com.macro.mall.model.OmsOrderOperateHistory; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 订单操作记录自定义Dao 10 | * Created by macro on 2018/10/12. 11 | */ 12 | public interface OmsOrderOperateHistoryDao { 13 | int insertList(@Param("list") List orderOperateHistoryList); 14 | } 15 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dao/PmsProductFullReductionDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dao; 2 | 3 | import com.macro.mall.model.PmsProductFullReduction; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 自定义商品满减Dao 10 | * Created by macro on 2018/4/26. 11 | */ 12 | public interface PmsProductFullReductionDao { 13 | int insertList(@Param("list") List productFullReductionList); 14 | } 15 | -------------------------------------------------------------------------------- /mall-registry/src/test/java/com/macro/mall/MallRegistryApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | class MallRegistryApplicationTests { 11 | 12 | @Test 13 | void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dao/SmsCouponProductRelationDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dao; 2 | 3 | import com.macro.mall.model.SmsCouponProductRelation; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 优惠券和产品关系自定义Dao 10 | * Created by macro on 2018/8/28. 11 | */ 12 | public interface SmsCouponProductRelationDao { 13 | int insertList(@Param("list")List productRelationList); 14 | } 15 | -------------------------------------------------------------------------------- /mall-config/src/test/java/com/macro/mall/MallConfigApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class MallConfigApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/dao/SmsCouponHistoryDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.dao; 2 | 3 | import com.macro.mall.portal.domain.SmsCouponHistoryDetail; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 会员优惠券领取历史自定义Dao 10 | * Created by macro on 2018/8/29. 11 | */ 12 | public interface SmsCouponHistoryDao { 13 | List getDetailList(@Param("memberId") Long memberId); 14 | } 15 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dao/PmsProductAttributeValueDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dao; 2 | 3 | import com.macro.mall.model.PmsProductAttributeValue; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 商品参数,商品自定义规格属性Dao 10 | * Created by macro on 2018/4/26. 11 | */ 12 | public interface PmsProductAttributeValueDao { 13 | int insertList(@Param("list")List productAttributeValueList); 14 | } 15 | -------------------------------------------------------------------------------- /mall-gateway/src/test/java/com/macro/mall/MallGatewayApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class MallGatewayApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /mall-monitor/src/test/java/com/macro/mall/MallMonitorApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class MallMonitorApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dao/CmsSubjectProductRelationDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dao; 2 | 3 | import com.macro.mall.model.CmsSubjectProductRelation; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 自定义商品和专题关系操作 10 | * Created by macro on 2018/4/26. 11 | */ 12 | public interface CmsSubjectProductRelationDao { 13 | int insertList(@Param("list") List subjectProductRelationList); 14 | } 15 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dto/OmsMoneyInfoParam.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dto; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | import java.math.BigDecimal; 7 | 8 | /** 9 | * 修改订单费用信息参数 10 | * Created by macro on 2018/10/29. 11 | */ 12 | @Getter 13 | @Setter 14 | public class OmsMoneyInfoParam { 15 | private Long orderId; 16 | private BigDecimal freightAmount; 17 | private BigDecimal discountAmount; 18 | private Integer status; 19 | } 20 | -------------------------------------------------------------------------------- /document/sh/mall-registry.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | app_name='mall-registry' 3 | docker stop ${app_name} 4 | echo '----stop container----' 5 | docker rm ${app_name} 6 | echo '----rm container----' 7 | docker rmi `docker images | grep none | awk '{print $3}'` 8 | echo '----rm none images----' 9 | docker run -p 8001:8001 --name ${app_name} \ 10 | -v /etc/localtime:/etc/localtime \ 11 | -v /mydata/app/${app_name}/logs:/var/logs \ 12 | -d mall/${app_name}:1.0-SNAPSHOT 13 | echo '----start container----' -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/service/OmsOrderSettingService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.service; 2 | 3 | import com.macro.mall.model.OmsOrderSetting; 4 | 5 | /** 6 | * 订单设置Service 7 | * Created by macro on 2018/10/16. 8 | */ 9 | public interface OmsOrderSettingService { 10 | /** 11 | * 获取指定订单设置 12 | */ 13 | OmsOrderSetting getItem(Long id); 14 | 15 | /** 16 | * 修改指定订单设置 17 | */ 18 | int update(Long id, OmsOrderSetting orderSetting); 19 | } 20 | -------------------------------------------------------------------------------- /mall-config/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /mall-gateway/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /mall-monitor/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /mall-portal/src/test/java/com/macro/mall/portal/MallPortalApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class MallPortalApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /mall-registry/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /mall-security/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dto/OmsOrderReturnApplyResult.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dto; 2 | 3 | import com.macro.mall.model.OmsCompanyAddress; 4 | import com.macro.mall.model.OmsOrderReturnApply; 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | 8 | /** 9 | * 申请信息封装 10 | * Created by macro on 2018/10/18. 11 | */ 12 | public class OmsOrderReturnApplyResult extends OmsOrderReturnApply { 13 | @Getter 14 | @Setter 15 | private OmsCompanyAddress companyAddress; 16 | } 17 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dto/PmsProductResult.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dto; 2 | 3 | /** 4 | * 查询单个产品进行修改时返回的结果 5 | * Created by macro on 2018/4/26. 6 | */ 7 | public class PmsProductResult extends PmsProductParam { 8 | //商品所选分类的父id 9 | private Long cateParentId; 10 | 11 | public Long getCateParentId() { 12 | return cateParentId; 13 | } 14 | 15 | public void setCateParentId(Long cateParentId) { 16 | this.cateParentId = cateParentId; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dto/SmsFlashPromotionProduct.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dto; 2 | 3 | import com.macro.mall.model.PmsProduct; 4 | import com.macro.mall.model.SmsFlashPromotionProductRelation; 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | 8 | /** 9 | * 限时购及商品信息封装 10 | * Created by macro on 2018/11/16. 11 | */ 12 | public class SmsFlashPromotionProduct extends SmsFlashPromotionProductRelation{ 13 | @Getter 14 | @Setter 15 | private PmsProduct product; 16 | } 17 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dao/CmsPrefrenceAreaProductRelationDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dao; 2 | 3 | import com.macro.mall.model.CmsPrefrenceAreaProductRelation; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 自定义优选和商品关系操作 10 | * Created by macro on 2018/4/26. 11 | */ 12 | public interface CmsPrefrenceAreaProductRelationDao { 13 | int insertList(@Param("list") List prefrenceAreaProductRelationList); 14 | } 15 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dao/SmsCouponProductCategoryRelationDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dao; 2 | 3 | import com.macro.mall.model.SmsCouponProductCategoryRelation; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 优惠券和商品分类关系自定义Dao 10 | * Created by macro on 2018/8/28. 11 | */ 12 | public interface SmsCouponProductCategoryRelationDao { 13 | int insertList(@Param("list")List productCategoryRelationList); 14 | } 15 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/service/CmsSubjectService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.service; 2 | 3 | import com.macro.mall.model.CmsSubject; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 商品专题Service 9 | * Created by macro on 2018/6/1. 10 | */ 11 | public interface CmsSubjectService { 12 | /** 13 | * 查询所有专题 14 | */ 15 | List listAll(); 16 | 17 | /** 18 | * 分页查询专题 19 | */ 20 | List list(String keyword, Integer pageNum, Integer pageSize); 21 | } 22 | -------------------------------------------------------------------------------- /mall-monitor/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: mall-monitor 4 | security: # 配置登录用户名和密码 5 | user: 6 | name: macro 7 | password: 123456 8 | boot: # 不显示admin-server的监控信息 9 | admin: 10 | discovery: 11 | ignored-services: ${spring.application.name} 12 | server: 13 | port: 8101 14 | eureka: 15 | client: 16 | register-with-eureka: true 17 | fetch-registry: true 18 | service-url: 19 | defaultZone: http://localhost:8001/eureka/ 20 | -------------------------------------------------------------------------------- /document/sh/mall-config.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | app_name='mall-config' 3 | docker stop ${app_name} 4 | echo '----stop container----' 5 | docker rm ${app_name} 6 | echo '----rm container----' 7 | docker rmi `docker images | grep none | awk '{print $3}'` 8 | echo '----rm none images----' 9 | docker run -p 8301:8301 --name ${app_name} \ 10 | --link mall-registry:mall-registry \ 11 | -v /etc/localtime:/etc/localtime \ 12 | -v /mydata/app/${app_name}/logs:/var/logs \ 13 | -d mall/${app_name}:1.0-SNAPSHOT 14 | echo '----start container----' -------------------------------------------------------------------------------- /document/sh/mall-gateway.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | app_name='mall-gateway' 3 | docker stop ${app_name} 4 | echo '----stop container----' 5 | docker rm ${app_name} 6 | echo '----rm container----' 7 | docker rmi `docker images | grep none | awk '{print $3}'` 8 | echo '----rm none images----' 9 | docker run -p 8201:8201 --name ${app_name} \ 10 | --link mall-registry:mall-registry \ 11 | -v /etc/localtime:/etc/localtime \ 12 | -v /mydata/app/${app_name}/logs:/var/logs \ 13 | -d mall/${app_name}:1.0-SNAPSHOT 14 | echo '----start container----' -------------------------------------------------------------------------------- /document/sh/mall-monitor.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | app_name='mall-monitor' 3 | docker stop ${app_name} 4 | echo '----stop container----' 5 | docker rm ${app_name} 6 | echo '----rm container----' 7 | docker rmi `docker images | grep none | awk '{print $3}'` 8 | echo '----rm none images----' 9 | docker run -p 8101:8101 --name ${app_name} \ 10 | --link mall-registry:mall-registry \ 11 | -v /etc/localtime:/etc/localtime \ 12 | -v /mydata/app/${app_name}/logs:/var/logs \ 13 | -d mall/${app_name}:1.0-SNAPSHOT 14 | echo '----start container----' -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/config/MyBatisConfig.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.config; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.transaction.annotation.EnableTransactionManagement; 6 | 7 | /** 8 | * MyBatis配置类 9 | * Created by macro on 2019/4/8. 10 | */ 11 | @Configuration 12 | @EnableTransactionManagement 13 | @MapperScan({"com.macro.mall.mapper","com.macro.mall.dao"}) 14 | public class MyBatisConfig { 15 | } 16 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dao/PmsProductCategoryAttributeRelationDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dao; 2 | 3 | import com.macro.mall.model.PmsProductCategoryAttributeRelation; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 自定义商品分类和属性关系Dao 10 | * Created by macro on 2018/5/23. 11 | */ 12 | public interface PmsProductCategoryAttributeRelationDao { 13 | int insertList(@Param("list") List productCategoryAttributeRelationList); 14 | } 15 | -------------------------------------------------------------------------------- /mall-config/src/main/resources/config/search/search-dev.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:mysql://192.168.1.122:3306/mall?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai 4 | username: root 5 | password: 123456 6 | data: 7 | elasticsearch: 8 | cluster-nodes: 127.0.0.1:9300 9 | cluster-name: elasticsearch 10 | elasticsearch: 11 | rest: 12 | uris: http://192.168.1.122:9200 13 | logging: 14 | level: 15 | root: info #日志配置DEBUG,INFO,WARN,ERROR 16 | com.macro.mall: debug -------------------------------------------------------------------------------- /document/sh/mall-admin.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | app_name='mall-admin' 3 | docker stop ${app_name} 4 | echo '----stop container----' 5 | docker rm ${app_name} 6 | echo '----rm container----' 7 | docker rmi `docker images | grep none | awk '{print $3}'` 8 | echo '----rm none images----' 9 | docker run -p 8180:8180 --name ${app_name} \ 10 | --link mysql:db \ 11 | --link mall-registry:mall-registry \ 12 | -v /etc/localtime:/etc/localtime \ 13 | -v /mydata/app/${app_name}/logs:/var/logs \ 14 | -d mall/${app_name}:1.0-SNAPSHOT 15 | echo '----start container----' -------------------------------------------------------------------------------- /document/sh/mall-demo.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | app_name='mall-demo' 3 | docker stop ${app_name} 4 | echo '----stop container----' 5 | docker rm ${app_name} 6 | echo '----rm container----' 7 | docker rmi `docker images | grep none | awk '{print $3}'` 8 | echo '----rm none images----' 9 | docker run -p 8082:8082 --name ${app_name} \ 10 | --link mysql:db \ 11 | --link mall-registry:mall-registry \ 12 | -v /etc/localtime:/etc/localtime \ 13 | -v /mydata/app/${app_name}/logs:/var/logs \ 14 | -d mall/${app_name}:1.0-SNAPSHOT 15 | echo '----start container----' -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/service/PmsSkuStockService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.service; 2 | 3 | import com.macro.mall.model.PmsSkuStock; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * sku商品库存管理Service 9 | * Created by macro on 2018/4/27. 10 | */ 11 | public interface PmsSkuStockService { 12 | /** 13 | * 根据产品id和skuCode模糊搜索 14 | */ 15 | List getList(Long pid, String keyword); 16 | 17 | /** 18 | * 批量更新商品库存信息 19 | */ 20 | int update(Long pid, List skuStockList); 21 | } 22 | -------------------------------------------------------------------------------- /mall-gateway/src/main/java/com/macro/mall/MallGatewayApplication.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | 7 | @EnableDiscoveryClient 8 | @SpringBootApplication 9 | public class MallGatewayApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(MallGatewayApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /mall-registry/src/main/java/com/macro/mall/MallRegistryApplication.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; 6 | 7 | @EnableEurekaServer 8 | @SpringBootApplication 9 | public class MallRegistryApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(MallRegistryApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /mall-config/src/main/resources/config/search/search-prod.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:mysql://db:3306/mall?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai 4 | username: root 5 | password: 123456 6 | data: 7 | elasticsearch: 8 | cluster-nodes: es:9300 9 | cluster-name: elasticsearch 10 | elasticsearch: 11 | rest: 12 | uris: http://es:9200 13 | logging: 14 | path: /var/logs #配置日志生成路径 15 | management: 16 | health: 17 | elasticsearch: 18 | response-timeout: 1000ms #加大健康检查超时时间 -------------------------------------------------------------------------------- /mall-demo/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8082 3 | spring: 4 | datasource: 5 | url: jdbc:mysql://192.168.1.122:3306/mall?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai 6 | username: root 7 | password: 123456 8 | mybatis: 9 | mapper-locations: 10 | - classpath:mapper/*.xml 11 | - classpath*:com/**/mapper/*.xml 12 | management: #开启SpringBoot Admin的监控 13 | endpoints: 14 | web: 15 | exposure: 16 | include: '*' 17 | endpoint: 18 | health: 19 | show-details: always 20 | -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/config/MyBatisConfig.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.config; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.transaction.annotation.EnableTransactionManagement; 6 | 7 | /** 8 | * MyBatis配置类 9 | * Created by macro on 2019/4/8. 10 | */ 11 | @Configuration 12 | @EnableTransactionManagement 13 | @MapperScan({"com.macro.mall.mapper","com.macro.mall.portal.dao"}) 14 | public class MyBatisConfig { 15 | } 16 | -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/service/MemberCollectionService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.service; 2 | 3 | import com.macro.mall.portal.domain.MemberProductCollection; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 会员收藏Service 9 | * Created by macro on 2018/8/2. 10 | */ 11 | public interface MemberCollectionService { 12 | int addProduct(MemberProductCollection productCollection); 13 | 14 | int deleteProduct(Long memberId, Long productId); 15 | 16 | List listProduct(Long memberId); 17 | } 18 | -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/service/OmsPromotionService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.service; 2 | 3 | import com.macro.mall.model.OmsCartItem; 4 | import com.macro.mall.portal.domain.CartPromotionItem; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * Created by macro on 2018/8/27. 10 | * 促销管理Service 11 | */ 12 | public interface OmsPromotionService { 13 | /** 14 | * 计算购物车中的促销活动信息 15 | * @param cartItemList 购物车 16 | */ 17 | List calcCartPromotion(List cartItemList); 18 | } 19 | -------------------------------------------------------------------------------- /mall-search/src/main/java/com/macro/mall/search/MallSearchApplication.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.search; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | 7 | @EnableDiscoveryClient 8 | @SpringBootApplication 9 | public class MallSearchApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(MallSearchApplication.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/MallPortalApplication.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | 7 | @EnableDiscoveryClient 8 | @SpringBootApplication 9 | public class MallPortalApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(MallPortalApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dto/OmsOrderDeliveryParam.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dto; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | /** 8 | * 订单发货参数 9 | * Created by macro on 2018/10/12. 10 | */ 11 | @Getter 12 | @Setter 13 | public class OmsOrderDeliveryParam { 14 | @ApiModelProperty("订单id") 15 | private Long orderId; 16 | @ApiModelProperty("物流公司") 17 | private String deliveryCompany; 18 | @ApiModelProperty("物流单号") 19 | private String deliverySn; 20 | } 21 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/service/OssService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.service; 2 | 3 | import com.macro.mall.dto.OssCallbackResult; 4 | import com.macro.mall.dto.OssPolicyResult; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | 8 | /** 9 | * oss上传管理Service 10 | * Created by macro on 2018/5/17. 11 | */ 12 | public interface OssService { 13 | /** 14 | * oss上传策略生成 15 | */ 16 | OssPolicyResult policy(); 17 | /** 18 | * oss上传成功回调 19 | */ 20 | OssCallbackResult callback(HttpServletRequest request); 21 | } 22 | -------------------------------------------------------------------------------- /mall-config/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8301 3 | spring: 4 | application: 5 | name: mall-config 6 | profiles: 7 | active: git #使用本地配置,要使用git存储改为git即可 8 | cloud: 9 | config: 10 | server: 11 | native: #本地仓库存储 12 | search-locations: classpath:/config/{application} 13 | git: #Git仓库存储 14 | uri: https://github.com/pluswait/mall-swarm.git 15 | username: pluswait 16 | password: GIThub1024. 17 | clone-on-start: true 18 | search-paths: '{application}' 19 | -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/domain/FlashPromotionProduct.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.domain; 2 | 3 | import com.macro.mall.model.PmsProduct; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | import java.math.BigDecimal; 8 | 9 | /** 10 | * 秒杀信息和商品对象封装 11 | * Created by macro on 2019/1/28. 12 | */ 13 | @Getter 14 | @Setter 15 | public class FlashPromotionProduct extends PmsProduct{ 16 | private BigDecimal flashPromotionPrice; 17 | private Integer flashPromotionCount; 18 | private Integer flashPromotionLimit; 19 | } 20 | -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/dao/PortalProductDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.dao; 2 | 3 | import com.macro.mall.portal.domain.CartProduct; 4 | import com.macro.mall.portal.domain.PromotionProduct; 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * 前台系统自定义商品Dao 11 | * Created by macro on 2018/8/2. 12 | */ 13 | public interface PortalProductDao { 14 | CartProduct getCartProduct(@Param("id") Long id); 15 | List getPromotionProductList(@Param("ids") List ids); 16 | } 17 | -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/repository/MemberReadHistoryRepository.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.repository; 2 | 3 | import com.macro.mall.portal.domain.MemberReadHistory; 4 | import org.springframework.data.mongodb.repository.MongoRepository; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 会员商品浏览历史Repository 10 | * Created by macro on 2018/8/3. 11 | */ 12 | public interface MemberReadHistoryRepository extends MongoRepository { 13 | List findByMemberIdOrderByCreateTimeDesc(Long memberId); 14 | } 15 | -------------------------------------------------------------------------------- /document/sh/mall-search.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | app_name='mall-search' 3 | docker stop ${app_name} 4 | echo '----stop container----' 5 | docker rm ${app_name} 6 | echo '----rm container----' 7 | docker rmi `docker images | grep none | awk '{print $3}'` 8 | echo '----rm none images----' 9 | docker run -p 8081:8081 --name ${app_name} \ 10 | --link mysql:db \ 11 | --link elasticsearch:es \ 12 | --link mall-registry:mall-registry \ 13 | -v /etc/localtime:/etc/localtime \ 14 | -v /mydata/app/${app_name}/logs:/var/logs \ 15 | -d mall/${app_name}:1.0-SNAPSHOT 16 | echo '----start container----' -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dao/PmsSkuStockDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dao; 2 | 3 | import com.macro.mall.model.PmsSkuStock; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 自定义商品sku库存Dao 10 | * Created by macro on 2018/4/26. 11 | */ 12 | public interface PmsSkuStockDao { 13 | /** 14 | * 批量插入操作 15 | */ 16 | int insertList(@Param("list")List skuStockList); 17 | 18 | /** 19 | * 批量插入或替换操作 20 | */ 21 | int replaceList(@Param("list")List skuStockList); 22 | } 23 | -------------------------------------------------------------------------------- /mall-gateway/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8201 3 | spring: 4 | application: 5 | name: mall-gateway 6 | profiles: 7 | active: dev 8 | cloud: 9 | gateway: 10 | discovery: 11 | locator: 12 | enabled: true 13 | lower-case-service-id: true #使用小写service-id 14 | management: #开启SpringBoot Admin的监控 15 | endpoints: 16 | web: 17 | exposure: 18 | include: '*' 19 | endpoint: 20 | health: 21 | show-details: always 22 | logging: 23 | level: 24 | org.springframework.cloud.gateway: debug 25 | -------------------------------------------------------------------------------- /mall-demo/src/main/java/com/macro/mall/demo/dto/UmsAdminLoginParam.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.demo.dto; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | import org.hibernate.validator.constraints.NotEmpty; 7 | 8 | /** 9 | * 用户登录参数 10 | * Created by macro on 2018/4/26. 11 | */ 12 | @Getter 13 | @Setter 14 | public class UmsAdminLoginParam { 15 | @ApiModelProperty(value = "用户名", required = true) 16 | private String username; 17 | @ApiModelProperty(value = "密码", required = true) 18 | private String password; 19 | } 20 | -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/domain/HomeFlashPromotion.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.domain; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | import java.util.Date; 7 | import java.util.List; 8 | 9 | /** 10 | * 首页当前秒杀场次信息 11 | * Created by macro on 2019/1/28. 12 | */ 13 | @Getter 14 | @Setter 15 | public class HomeFlashPromotion { 16 | private Date startTime; 17 | private Date endTime; 18 | private Date nextStartTime; 19 | private Date nextEndTime; 20 | //属于该秒杀活动的商品 21 | private List productList; 22 | } 23 | -------------------------------------------------------------------------------- /mall-security/src/main/java/com/macro/mall/security/config/IgnoreUrlsConfig.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.security.config; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | import org.springframework.boot.context.properties.ConfigurationProperties; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | /** 11 | * 用于配置不需要保护的资源路径 12 | * Created by macro on 2018/11/5. 13 | */ 14 | @Getter 15 | @Setter 16 | @ConfigurationProperties(prefix = "secure.ignored") 17 | public class IgnoreUrlsConfig { 18 | 19 | private List urls = new ArrayList<>(); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/MallAdminApplication.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | 7 | /** 8 | * 应用启动入口 9 | * Created by macro on 2018/4/26. 10 | */ 11 | @EnableDiscoveryClient 12 | @SpringBootApplication 13 | public class MallAdminApplication { 14 | public static void main(String[] args) { 15 | SpringApplication.run(MallAdminApplication.class, args); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/service/SmsCouponHistoryService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.service; 2 | 3 | import com.macro.mall.model.SmsCouponHistory; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 优惠券领取记录管理Service 9 | * Created by macro on 2018/11/6. 10 | */ 11 | public interface SmsCouponHistoryService { 12 | /** 13 | * 分页查询优惠券领取记录 14 | * @param couponId 优惠券id 15 | * @param useStatus 使用状态 16 | * @param orderSn 使用订单号码 17 | */ 18 | List list(Long couponId, Integer useStatus, String orderSn, Integer pageSize, Integer pageNum); 19 | } 20 | -------------------------------------------------------------------------------- /mall-demo/src/main/java/com/macro/mall/MallDemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | import org.springframework.cloud.openfeign.EnableFeignClients; 7 | 8 | @EnableFeignClients 9 | @EnableDiscoveryClient 10 | @SpringBootApplication 11 | public class MallDemoApplication{ 12 | public static void main(String[] args) { 13 | SpringApplication.run(MallDemoApplication.class, args); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dao/SmsFlashPromotionProductRelationDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dao; 2 | 3 | import com.macro.mall.dto.SmsFlashPromotionProduct; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 限时购商品关联自定义Dao 10 | * Created by macro on 2018/11/16. 11 | */ 12 | public interface SmsFlashPromotionProductRelationDao { 13 | /** 14 | * 获取限时购及相关商品信息 15 | */ 16 | List getList(@Param("flashPromotionId") Long flashPromotionId, @Param("flashPromotionSessionId") Long flashPromotionSessionId); 17 | } 18 | -------------------------------------------------------------------------------- /document/elk/logback-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | localhost:4560 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dto/PmsProductCategoryWithChildrenItem.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dto; 2 | 3 | import com.macro.mall.model.PmsProductCategory; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * Created by macro on 2018/5/25. 9 | */ 10 | public class PmsProductCategoryWithChildrenItem extends PmsProductCategory { 11 | private List children; 12 | 13 | public List getChildren() { 14 | return children; 15 | } 16 | 17 | public void setChildren(List children) { 18 | this.children = children; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /mall-demo/src/main/java/com/macro/mall/demo/service/DemoService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.demo.service; 2 | 3 | import com.macro.mall.demo.dto.PmsBrandDto; 4 | import com.macro.mall.model.PmsBrand; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * DemoService接口 10 | */ 11 | public interface DemoService { 12 | List listAllBrand(); 13 | 14 | int createBrand(PmsBrandDto pmsBrandDto); 15 | 16 | int updateBrand(Long id, PmsBrandDto pmsBrandDto); 17 | 18 | int deleteBrand(Long id); 19 | 20 | List listBrand(int pageNum, int pageSize); 21 | 22 | PmsBrand getBrand(Long id); 23 | } 24 | -------------------------------------------------------------------------------- /document/sh/mall-portal.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | app_name='mall-portal' 3 | docker stop ${app_name} 4 | echo '----stop container----' 5 | docker rm ${app_name} 6 | echo '----rm container----' 7 | docker rmi `docker images | grep none | awk '{print $3}'` 8 | echo '----rm none images----' 9 | docker run -p 8085:8085 --name ${app_name} \ 10 | --link mysql:db \ 11 | --link redis:redis \ 12 | --link mongo:mongo \ 13 | --link rabbitmq:rabbit \ 14 | --link mall-registry:mall-registry \ 15 | -v /etc/localtime:/etc/localtime \ 16 | -v /mydata/app/${app_name}/logs:/var/logs \ 17 | -d mall/${app_name}:1.0-SNAPSHOT 18 | echo '----start container----' -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dto/OmsOrderDetail.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dto; 2 | 3 | import com.macro.mall.model.OmsOrder; 4 | import com.macro.mall.model.OmsOrderItem; 5 | import com.macro.mall.model.OmsOrderOperateHistory; 6 | import lombok.Getter; 7 | import lombok.Setter; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * 订单详情信息 13 | * Created by macro on 2018/10/11. 14 | */ 15 | public class OmsOrderDetail extends OmsOrder { 16 | @Getter 17 | @Setter 18 | private List orderItemList; 19 | @Getter 20 | @Setter 21 | private List historyList; 22 | } 23 | -------------------------------------------------------------------------------- /mall-admin/src/main/resources/dao/CmsSubjectProductRelationDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | insert into cms_subject_product_relation (subject_id, product_id) values 6 | 7 | (#{item.subjectId,jdbcType=BIGINT}, 8 | #{item.productId,jdbcType=BIGINT}) 9 | 10 | 11 | -------------------------------------------------------------------------------- /mall-config/src/main/java/com/macro/mall/MallConfigApplication.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | import org.springframework.cloud.config.server.EnableConfigServer; 7 | 8 | @EnableConfigServer 9 | @EnableDiscoveryClient 10 | @SpringBootApplication 11 | public class MallConfigApplication { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(MallConfigApplication.class, args); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /mall-monitor/src/main/java/com/macro/mall/MallMonitorApplication.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall; 2 | 3 | import de.codecentric.boot.admin.server.config.EnableAdminServer; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 7 | 8 | @EnableDiscoveryClient 9 | @EnableAdminServer 10 | @SpringBootApplication 11 | public class MallMonitorApplication { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(MallMonitorApplication.class, args); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dto/OmsReceiverInfoParam.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dto; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | /** 7 | * 订单修改收货人信息参数 8 | * Created by macro on 2018/10/29. 9 | */ 10 | @Getter 11 | @Setter 12 | public class OmsReceiverInfoParam { 13 | private Long orderId; 14 | private String receiverName; 15 | private String receiverPhone; 16 | private String receiverPostCode; 17 | private String receiverDetailAddress; 18 | private String receiverProvince; 19 | private String receiverCity; 20 | private String receiverRegion; 21 | private Integer status; 22 | } 23 | -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/service/MemberReadHistoryService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.service; 2 | 3 | import com.macro.mall.portal.domain.MemberReadHistory; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 会员浏览记录管理Service 9 | * Created by macro on 2018/8/3. 10 | */ 11 | public interface MemberReadHistoryService { 12 | /** 13 | * 生成浏览记录 14 | */ 15 | int create(MemberReadHistory memberReadHistory); 16 | 17 | /** 18 | * 批量删除浏览记录 19 | */ 20 | int delete(List ids); 21 | 22 | /** 23 | * 获取用户浏览历史记录 24 | */ 25 | List list(Long memberId); 26 | } 27 | -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/service/MemberAttentionService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.service; 2 | 3 | import com.macro.mall.portal.domain.MemberBrandAttention; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 会员关注Service 9 | * Created by macro on 2018/8/2. 10 | */ 11 | public interface MemberAttentionService { 12 | /** 13 | * 添加关注 14 | */ 15 | int add(MemberBrandAttention memberBrandAttention); 16 | 17 | /** 18 | * 取消关注 19 | */ 20 | int delete(Long memberId, Long brandId); 21 | 22 | /** 23 | * 获取用户关注列表 24 | */ 25 | List list(Long memberId); 26 | } 27 | -------------------------------------------------------------------------------- /mall-admin/src/main/resources/dao/CmsPrefrenceAreaProductRelationDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | insert into cms_prefrence_area_product_relation (prefrence_area_id, product_id) values 6 | 7 | (#{item.prefrenceAreaId,jdbcType=BIGINT}, 8 | #{item.productId,jdbcType=BIGINT}) 9 | 10 | 11 | -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/domain/OmsOrderDetail.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.domain; 2 | 3 | import com.macro.mall.model.OmsOrder; 4 | import com.macro.mall.model.OmsOrderItem; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 包含订单商品信息的订单详情 10 | * Created by macro on 2018/9/4. 11 | */ 12 | public class OmsOrderDetail extends OmsOrder { 13 | private List orderItemList; 14 | 15 | public List getOrderItemList() { 16 | return orderItemList; 17 | } 18 | 19 | public void setOrderItemList(List orderItemList) { 20 | this.orderItemList = orderItemList; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /mall-config/src/main/resources/config/portal/portal-prod.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:mysql://db:3306/mall?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai 4 | username: root 5 | password: 123456 6 | data: 7 | mongodb: 8 | host: mongo 9 | port: 27017 10 | database: mall-port 11 | redis: 12 | host: redis # Redis服务器地址 13 | database: 0 # Redis数据库索引(默认为0) 14 | port: 6379 # Redis服务器连接端口 15 | password: #不设置密码 16 | rabbitmq: 17 | host: rabbit 18 | port: 5672 19 | virtual-host: /mall 20 | username: mall 21 | password: mall 22 | publisher-confirms: true #如果对异步消息需要回调必须设置为true 23 | 24 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dao/UmsRolePermissionRelationDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dao; 2 | 3 | import com.macro.mall.model.UmsPermission; 4 | import com.macro.mall.model.UmsRolePermissionRelation; 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * 后台用户角色管理自定义Dao 11 | * Created by macro on 2018/9/30. 12 | */ 13 | public interface UmsRolePermissionRelationDao { 14 | /** 15 | * 批量插入角色和权限关系 16 | */ 17 | int insertList(@Param("list")List list); 18 | 19 | /** 20 | * 根据角色获取权限 21 | */ 22 | List getPermissionList(@Param("roleId") Long roleId); 23 | } 24 | -------------------------------------------------------------------------------- /mall-demo/src/main/java/com/macro/mall/demo/validator/FlagValidator.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.demo.validator; 2 | 3 | import javax.validation.Constraint; 4 | import javax.validation.Payload; 5 | import java.lang.annotation.*; 6 | 7 | /** 8 | * 用户验证状态是否在指定范围内的注解 9 | */ 10 | @Documented 11 | @Retention(RetentionPolicy.RUNTIME) 12 | @Target({ElementType.FIELD,ElementType.PARAMETER}) 13 | @Constraint(validatedBy = FlagValidatorClass.class) 14 | public @interface FlagValidator { 15 | String[] value() default {}; 16 | 17 | String message() default "flag is not found"; 18 | 19 | Class[] groups() default {}; 20 | 21 | Class[] payload() default {}; 22 | } 23 | -------------------------------------------------------------------------------- /mall-admin/src/main/resources/dao/PmsProductFullReductionDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | INSERT INTO pms_product_full_reduction (product_id, full_price, reduce_price) VALUES 6 | 7 | (#{item.productId,jdbcType=BIGINT}, 8 | #{item.fullPrice,jdbcType=DECIMAL}, 9 | #{item.reducePrice,jdbcType=DECIMAL}) 10 | 11 | 12 | -------------------------------------------------------------------------------- /mall-admin/src/main/resources/dao/PmsProductAttributeValueDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | insert into pms_product_attribute_value (product_id,product_attribute_id,value) values 6 | 7 | (#{item.productId,jdbcType=BIGINT}, 8 | #{item.productAttributeId,jdbcType=BIGINT}, 9 | #{item.value,jdbcType=VARCHAR}) 10 | 11 | 12 | -------------------------------------------------------------------------------- /mall-demo/src/main/java/com/macro/mall/demo/config/FeignConfig.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.demo.config; 2 | 3 | import com.macro.mall.demo.component.FeignRequestInterceptor; 4 | import feign.Logger; 5 | import feign.RequestInterceptor; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | 9 | /** 10 | * Created by macro on 2019/9/5. 11 | */ 12 | @Configuration 13 | public class FeignConfig { 14 | @Bean 15 | Logger.Level feignLoggerLevel() { 16 | return Logger.Level.FULL; 17 | } 18 | 19 | @Bean 20 | RequestInterceptor requestInterceptor() { 21 | return new FeignRequestInterceptor(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /mall-admin/src/main/resources/dao/PmsProductLadderDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | INSERT INTO pms_product_ladder (product_id, count, discount, price) VALUES 6 | 7 | (#{item.productId,jdbcType=BIGINT}, 8 | #{item.count,jdbcType=INTEGER}, 9 | #{item.discount,jdbcType=DECIMAL}, 10 | #{item.price,jdbcType=DECIMAL}) 11 | 12 | 13 | -------------------------------------------------------------------------------- /mall-admin/src/main/resources/dao/UmsAdminPermissionRelationDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | INSERT INTO ums_admin_permission_relation (admin_id, permission_id, type) VALUES 7 | 8 | (#{item.adminId,jdbcType=BIGINT}, 9 | #{item.permissionId,jdbcType=BIGINT}, 10 | #{item.type,jdbcType=INTEGER}) 11 | 12 | 13 | -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/repository/MemberBrandAttentionRepository.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.repository; 2 | 3 | import com.macro.mall.portal.domain.MemberBrandAttention; 4 | import org.springframework.data.mongodb.repository.MongoRepository; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 会员关注Repository 10 | * Created by macro on 2018/8/2. 11 | */ 12 | public interface MemberBrandAttentionRepository extends MongoRepository { 13 | MemberBrandAttention findByMemberIdAndBrandId(Long memberId, Long brandId); 14 | int deleteByMemberIdAndBrandId(Long memberId,Long brandId); 15 | List findByMemberId(Long memberId); 16 | } 17 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/validator/FlagValidator.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.validator; 2 | 3 | import javax.validation.Constraint; 4 | import javax.validation.Payload; 5 | import java.lang.annotation.*; 6 | 7 | /** 8 | * 用户验证状态是否在指定范围内的注解 9 | * Created by macro on 2018/4/26. 10 | */ 11 | @Documented 12 | @Retention(RetentionPolicy.RUNTIME) 13 | @Target({ElementType.FIELD,ElementType.PARAMETER}) 14 | @Constraint(validatedBy = FlagValidatorClass.class) 15 | public @interface FlagValidator { 16 | String[] value() default {}; 17 | 18 | String message() default "flag is not found"; 19 | 20 | Class[] groups() default {}; 21 | 22 | Class[] payload() default {}; 23 | } 24 | -------------------------------------------------------------------------------- /mall-admin/src/main/resources/dao/PmsProductCategoryAttributeRelationDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | INSERT INTO pms_product_category_attribute_relation (product_category_id, product_attribute_id) VALUES 7 | 8 | (#{item.productCategoryId,jdbcType=BIGINT}, 9 | #{item.productAttributeId,jdbcType=BIGINT}) 10 | 11 | 12 | -------------------------------------------------------------------------------- /mall-config/src/main/resources/config/admin/admin-prod.yml: -------------------------------------------------------------------------------- 1 | aliyun: 2 | oss: 3 | endpoint: oss-cn-shenzhen.aliyuncs.com # oss对外服务的访问域名 4 | accessKeyId: test # 访问身份验证中用到用户标识 5 | accessKeySecret: test # 用户用于加密签名字符串和oss用来验证签名字符串的密钥 6 | bucketName: macro-oss # oss的存储空间 7 | policy: 8 | expire: 300 # 签名有效期(S) 9 | maxSize: 10 # 上传文件大小(M) 10 | callback: http://192.168.137.182:8080/aliyun/oss/callback # 文件上传成功后的回调地址 11 | dir: 12 | prefix: mall/images/ # 上传文件夹路径前缀 13 | spring: 14 | datasource: 15 | url: jdbc:mysql://db:3306/mall?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai 16 | username: root 17 | password: 123456 18 | logging: 19 | path: /var/logs #配置日志生成路径 -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/service/RedisService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.service; 2 | 3 | /** 4 | * redis操作Service, 5 | * 对象和数组都以json形式进行存储 6 | * Created by macro on 2018/8/7. 7 | */ 8 | public interface RedisService { 9 | /** 10 | * 存储数据 11 | */ 12 | void set(String key, String value); 13 | 14 | /** 15 | * 获取数据 16 | */ 17 | String get(String key); 18 | 19 | /** 20 | * 设置超期时间 21 | */ 22 | boolean expire(String key, long expire); 23 | 24 | /** 25 | * 删除数据 26 | */ 27 | void remove(String key); 28 | 29 | /** 30 | * 自增操作 31 | * @param delta 自增步长 32 | */ 33 | Long increment(String key, long delta); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dao/OmsOrderReturnApplyDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dao; 2 | 3 | import com.macro.mall.dto.OmsOrderReturnApplyResult; 4 | import com.macro.mall.dto.OmsReturnApplyQueryParam; 5 | import com.macro.mall.model.OmsOrderReturnApply; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 订单退货申请自定义Dao 12 | * Created by macro on 2018/10/18. 13 | */ 14 | public interface OmsOrderReturnApplyDao { 15 | /** 16 | * 查询申请列表 17 | */ 18 | List getList(@Param("queryParam") OmsReturnApplyQueryParam queryParam); 19 | 20 | /** 21 | * 获取申请详情 22 | */ 23 | OmsOrderReturnApplyResult getDetail(@Param("id")Long id); 24 | } 25 | -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/repository/MemberProductCollectionRepository.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.repository; 2 | 3 | import com.macro.mall.portal.domain.MemberProductCollection; 4 | import org.springframework.data.mongodb.repository.MongoRepository; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 商品收藏Repository 10 | * Created by macro on 2018/8/2. 11 | */ 12 | public interface MemberProductCollectionRepository extends MongoRepository { 13 | MemberProductCollection findByMemberIdAndProductId(Long memberId, Long productId); 14 | int deleteByMemberIdAndProductId(Long memberId,Long productId); 15 | List findByMemberId(Long memberId); 16 | } 17 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dto/ProductAttrInfo.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dto; 2 | 3 | 4 | /** 5 | * 商品分类对应属性信息 6 | * Created by macro on 2018/5/23. 7 | */ 8 | public class ProductAttrInfo { 9 | private Long attributeId; 10 | private Long attributeCategoryId; 11 | 12 | public Long getAttributeId() { 13 | return attributeId; 14 | } 15 | 16 | public void setAttributeId(Long attributeId) { 17 | this.attributeId = attributeId; 18 | } 19 | 20 | public Long getAttributeCategoryId() { 21 | return attributeCategoryId; 22 | } 23 | 24 | public void setAttributeCategoryId(Long attributeCategoryId) { 25 | this.attributeCategoryId = attributeCategoryId; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /mall-admin/src/main/resources/dao/OmsOrderOperateHistoryDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | INSERT INTO oms_order_operate_history (order_id, operate_man, create_time, order_status, note) VALUES 6 | 7 | (#{item.orderId}, 8 | #{item.operateMan}, 9 | #{item.createTime,jdbcType=TIMESTAMP}, 10 | #{item.orderStatus}, 11 | #{item.note}) 12 | 13 | 14 | -------------------------------------------------------------------------------- /mall-admin/src/main/resources/dao/SmsCouponProductRelationDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | INSERT INTO sms_coupon_product_relation (product_id,product_name,product_sn,coupon_id) VALUES 6 | 7 | (#{item.productId,jdbcType=BIGINT}, 8 | #{item.productName,jdbcType=VARCHAR}, 9 | #{item.productSn,jdbcType=VARCHAR}, 10 | #{item.couponId,jdbcType=INTEGER}) 11 | 12 | 13 | -------------------------------------------------------------------------------- /mall-demo/src/main/java/com/macro/mall/demo/service/FeignPortalService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.demo.service; 2 | 3 | import com.macro.mall.common.api.CommonResult; 4 | import org.springframework.cloud.openfeign.FeignClient; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.PostMapping; 7 | import org.springframework.web.bind.annotation.RequestParam; 8 | 9 | /** 10 | * Created by macro on 2019/10/18. 11 | */ 12 | @FeignClient("mall-portal") 13 | public interface FeignPortalService { 14 | 15 | @PostMapping("/sso/login") 16 | CommonResult login(@RequestParam String username, @RequestParam String password); 17 | 18 | @GetMapping("/cart/list") 19 | CommonResult list(); 20 | } 21 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/service/PmsProductAttributeCategoryService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.service; 2 | 3 | import com.macro.mall.dto.PmsProductAttributeCategoryItem; 4 | import com.macro.mall.model.PmsProductAttributeCategory; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 商品属性分类Service 10 | * Created by macro on 2018/4/26. 11 | */ 12 | public interface PmsProductAttributeCategoryService { 13 | int create(String name); 14 | 15 | int update(Long id, String name); 16 | 17 | int delete(Long id); 18 | 19 | PmsProductAttributeCategory getItem(Long id); 20 | 21 | List getList(Integer pageSize, Integer pageNum); 22 | 23 | List getListWithAttr(); 24 | } 25 | -------------------------------------------------------------------------------- /mall-common/src/main/java/com/macro/mall/common/api/ResultCode.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.common.api; 2 | 3 | /** 4 | * 枚举了一些常用API操作码 5 | * Created by macro on 2019/4/19. 6 | */ 7 | public enum ResultCode implements IErrorCode { 8 | SUCCESS(200, "操作成功"), 9 | FAILED(500, "操作失败"), 10 | VALIDATE_FAILED(404, "参数检验失败"), 11 | UNAUTHORIZED(401, "暂未登录或token已经过期"), 12 | FORBIDDEN(403, "没有相关权限"); 13 | private long code; 14 | private String message; 15 | 16 | private ResultCode(long code, String message) { 17 | this.code = code; 18 | this.message = message; 19 | } 20 | 21 | public long getCode() { 22 | return code; 23 | } 24 | 25 | public String getMessage() { 26 | return message; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /mall-admin/src/main/resources/dao/PmsMemberPriceDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | INSERT INTO pms_member_price (product_id, member_level_id, member_price,member_level_name) VALUES 7 | 8 | (#{item.productId,jdbcType=BIGINT}, 9 | #{item.memberLevelId,jdbcType=BIGINT}, 10 | #{item.memberPrice,jdbcType=DECIMAL}, 11 | #{item.memberLevelName,jdbcType=VARCHAR}) 12 | 13 | 14 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dto/PmsProductAttributeCategoryItem.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dto; 2 | 3 | import com.macro.mall.model.PmsProductAttribute; 4 | import com.macro.mall.model.PmsProductAttributeCategory; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 包含有分类下属性的dto 10 | * Created by macro on 2018/5/24. 11 | */ 12 | public class PmsProductAttributeCategoryItem extends PmsProductAttributeCategory { 13 | private List productAttributeList; 14 | 15 | public List getProductAttributeList() { 16 | return productAttributeList; 17 | } 18 | 19 | public void setProductAttributeList(List productAttributeList) { 20 | this.productAttributeList = productAttributeList; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /mall-config/src/main/resources/config/admin/admin-dev.yml: -------------------------------------------------------------------------------- 1 | aliyun: 2 | oss: 3 | endpoint: oss-cn-shenzhen.aliyuncs.com # oss对外服务的访问域名 4 | accessKeyId: test # 访问身份验证中用到用户标识 5 | accessKeySecret: test # 用户用于加密签名字符串和oss用来验证签名字符串的密钥 6 | bucketName: macro-oss # oss的存储空间 7 | policy: 8 | expire: 300 # 签名有效期(S) 9 | maxSize: 10 # 上传文件大小(M) 10 | callback: http://192.168.137.182:8080/aliyun/oss/callback # 文件上传成功后的回调地址 11 | dir: 12 | prefix: mall/images/ # 上传文件夹路径前缀 13 | spring: 14 | datasource: 15 | url: jdbc:mysql://192.168.1.122:3306/mall?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai 16 | username: root 17 | password: 123456 18 | logging: 19 | level: 20 | root: info #日志配置DEBUG,INFO,WARN,ERROR 21 | com.macro.mall: debug -------------------------------------------------------------------------------- /mall-demo/src/main/java/com/macro/mall/demo/service/FeignAdminService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.demo.service; 2 | 3 | import com.macro.mall.common.api.CommonResult; 4 | import com.macro.mall.demo.dto.UmsAdminLoginParam; 5 | import org.springframework.cloud.openfeign.FeignClient; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestBody; 9 | 10 | /** 11 | * Created by macro on 2019/10/18. 12 | */ 13 | @FeignClient("mall-admin") 14 | public interface FeignAdminService { 15 | 16 | @PostMapping("/admin/login") 17 | CommonResult login(@RequestBody UmsAdminLoginParam loginParam); 18 | 19 | @GetMapping("/brand/listAll") 20 | CommonResult getList(); 21 | } 22 | -------------------------------------------------------------------------------- /document/reference/function.md: -------------------------------------------------------------------------------- 1 | # mall功能结构说明 2 | 3 | ## 后台管理系统 4 | 5 | ### 商品管理 6 | 7 | ![功能结构图-商品.jpg](https://github.com/macrozheng/mall/blob/master/document/resource/mind_product.jpg) 8 | 9 | ### 订单管理 10 | 11 | ![功能结构图-订单.jpg](https://github.com/macrozheng/mall/blob/master/document/resource/mind_order.jpg) 12 | 13 | ### 促销管理 14 | 15 | ![功能结构图-促销.jpg](https://github.com/macrozheng/mall/blob/master/document/resource/mind_sale.jpg) 16 | 17 | ### 内容管理 18 | 19 | ![功能结构图-内容.jpg](https://github.com/macrozheng/mall/blob/master/document/resource/mind_content.jpg) 20 | 21 | ### 用户管理 22 | 23 | ![功能结构图-用户.jpg](https://github.com/macrozheng/mall/blob/master/document/resource/mind_member.jpg) 24 | 25 | ## 前台商城系统 26 | 27 | ![功能结构图-前台.jpg](https://github.com/macrozheng/mall/blob/master/document/resource/mind_portal.jpg) -------------------------------------------------------------------------------- /mall-demo/src/main/java/com/macro/mall/demo/service/FeignSearchService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.demo.service; 2 | 3 | import com.macro.mall.common.api.CommonResult; 4 | import org.springframework.cloud.openfeign.FeignClient; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestParam; 7 | 8 | /** 9 | * Created by macro on 2019/10/22. 10 | */ 11 | @FeignClient("mall-search") 12 | public interface FeignSearchService { 13 | 14 | @GetMapping("/esProduct/search/simple") 15 | CommonResult search(@RequestParam(required = false) String keyword, 16 | @RequestParam(required = false, defaultValue = "0") Integer pageNum, 17 | @RequestParam(required = false, defaultValue = "5") Integer pageSize); 18 | } 19 | -------------------------------------------------------------------------------- /mall-admin/src/main/resources/dao/PmsProductAttributeDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/service/UmsPermissionService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.service; 2 | 3 | import com.macro.mall.dto.UmsPermissionNode; 4 | import com.macro.mall.model.UmsPermission; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 后台用户权限管理Service 10 | * Created by macro on 2018/9/29. 11 | */ 12 | public interface UmsPermissionService { 13 | /** 14 | * 添加权限 15 | */ 16 | int create(UmsPermission permission); 17 | 18 | /** 19 | * 修改权限 20 | */ 21 | int update(Long id,UmsPermission permission); 22 | 23 | /** 24 | * 批量删除权限 25 | */ 26 | int delete(List ids); 27 | 28 | /** 29 | * 以层级结构返回所有权限 30 | */ 31 | List treeList(); 32 | 33 | /** 34 | * 获取所有权限 35 | */ 36 | List list(); 37 | } 38 | -------------------------------------------------------------------------------- /mall-admin/src/main/resources/dao/SmsCouponProductCategoryRelationDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | INSERT INTO sms_coupon_product_category_relation (product_category_id,product_category_name,parent_category_name,coupon_id) VALUES 6 | 7 | (#{item.productCategoryId,jdbcType=BIGINT}, 8 | #{item.productCategoryName,jdbcType=VARCHAR}, 9 | #{item.parentCategoryName,jdbcType=VARCHAR}, 10 | #{item.couponId,jdbcType=BIGINT}) 11 | 12 | 13 | -------------------------------------------------------------------------------- /mall-admin/src/main/resources/dao/PmsProductVertifyRecordDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | insert into pms_product_vertify_record (product_id, create_time, vertify_man,status, detail) values 7 | 8 | (#{item.productId,jdbcType=BIGINT}, 9 | #{item.createTime,jdbcType=TIMESTAMP}, 10 | #{item.vertifyMan,jdbcType=VARCHAR}, 11 | #{item.status,jdbcType=INTEGER}, 12 | #{item.detail,jdbcType=VARCHAR}) 13 | 14 | 15 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dto/OmsReturnApplyQueryParam.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dto; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | /** 8 | * 订单退货申请查询参数 9 | * Created by macro on 2018/10/18. 10 | */ 11 | @Getter 12 | @Setter 13 | public class OmsReturnApplyQueryParam { 14 | @ApiModelProperty("服务单号") 15 | private Long id; 16 | @ApiModelProperty(value = "收货人姓名/号码") 17 | private String receiverKeyword; 18 | @ApiModelProperty(value = "申请状态:0->待处理;1->退货中;2->已完成;3->已拒绝") 19 | private Integer status; 20 | @ApiModelProperty(value = "申请时间") 21 | private String createTime; 22 | @ApiModelProperty(value = "处理人员") 23 | private String handleMan; 24 | @ApiModelProperty(value = "处理时间") 25 | private String handleTime; 26 | } 27 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dao/OmsOrderDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dao; 2 | 3 | import com.macro.mall.dto.OmsOrderDeliveryParam; 4 | import com.macro.mall.dto.OmsOrderDetail; 5 | import com.macro.mall.dto.OmsOrderQueryParam; 6 | import com.macro.mall.model.OmsOrder; 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * 订单自定义查询Dao 13 | * Created by macro on 2018/10/12. 14 | */ 15 | public interface OmsOrderDao { 16 | /** 17 | * 条件查询订单 18 | */ 19 | List getList(@Param("queryParam") OmsOrderQueryParam queryParam); 20 | 21 | /** 22 | * 批量发货 23 | */ 24 | int delivery(@Param("list") List deliveryParamList); 25 | 26 | /** 27 | * 获取订单详情 28 | */ 29 | OmsOrderDetail getDetail(@Param("id") Long id); 30 | } 31 | -------------------------------------------------------------------------------- /document/docker/docker-compose-app.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | mall-admin: 4 | image: mall/mall-admin:1.0-SNAPSHOT 5 | container_name: mall-admin 6 | ports: 7 | - 8080:8080 8 | external_links: 9 | - mysql:db #可以用db这个域名访问mysql服务 10 | mall-search: 11 | image: mall/mall-search:1.0-SNAPSHOT 12 | container_name: mall-search 13 | ports: 14 | - 8081:8081 15 | external_links: 16 | - elasticsearch:es #可以用es这个域名访问elasticsearch服务 17 | - mysql:db #可以用db这个域名访问mysql服务 18 | mall-portal: 19 | image: mall/mall-portal:1.0-SNAPSHOT 20 | container_name: mall-portal 21 | ports: 22 | - 8085:8085 23 | external_links: 24 | - redis:redis #可以用redis这个域名访问redis服务 25 | - mongo:mongo #可以用mongo这个域名访问mongo服务 26 | - mysql:db #可以用db这个域名访问mysql服务 27 | - rabbitmq:rabbit #可以用rabbit这个域名访问rabbitmq服务 -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/config/OssConfig.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.config; 2 | 3 | import com.aliyun.oss.OSSClient; 4 | import org.springframework.beans.factory.annotation.Value; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | /** 9 | * Created by macro on 2018/5/17. 10 | */ 11 | @Configuration 12 | public class OssConfig { 13 | @Value("${aliyun.oss.endpoint}") 14 | private String ALIYUN_OSS_ENDPOINT; 15 | @Value("${aliyun.oss.accessKeyId}") 16 | private String ALIYUN_OSS_ACCESSKEYID; 17 | @Value("${aliyun.oss.accessKeySecret}") 18 | private String ALIYUN_OSS_ACCESSKEYSECRET; 19 | @Bean 20 | public OSSClient ossClient(){ 21 | return new OSSClient(ALIYUN_OSS_ENDPOINT,ALIYUN_OSS_ACCESSKEYID,ALIYUN_OSS_ACCESSKEYSECRET); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dto/OmsOrderQueryParam.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dto; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | /** 8 | * 订单查询参数 9 | * Created by macro on 2018/10/11. 10 | */ 11 | @Getter 12 | @Setter 13 | public class OmsOrderQueryParam { 14 | @ApiModelProperty(value = "订单编号") 15 | private String orderSn; 16 | @ApiModelProperty(value = "收货人姓名/号码") 17 | private String receiverKeyword; 18 | @ApiModelProperty(value = "订单状态:0->待付款;1->待发货;2->已发货;3->已完成;4->已关闭;5->无效订单") 19 | private Integer status; 20 | @ApiModelProperty(value = "订单类型:0->正常订单;1->秒杀订单") 21 | private Integer orderType; 22 | @ApiModelProperty(value = "订单来源:0->PC订单;1->app订单") 23 | private Integer sourceType; 24 | @ApiModelProperty(value = "订单提交时间") 25 | private String createTime; 26 | } 27 | -------------------------------------------------------------------------------- /mall-config/src/main/resources/config/portal/portal-dev.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:mysql://192.168.1.122:3306/mall?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai 4 | username: root 5 | password: 123456 6 | data: 7 | mongodb: 8 | host: 192.168.1.122 9 | port: 27017 10 | database: mall-port 11 | redis: 12 | host: 192.168.1.122 # Redis服务器地址 13 | database: 0 # Redis数据库索引(默认为0) 14 | port: 6379 # Redis服务器连接端口 15 | password: # Redis服务器连接密码(默认为空) 16 | rabbitmq: 17 | host: 192.168.1.122 18 | port: 5672 19 | virtual-host: /mall 20 | username: mall 21 | password: mall 22 | publisher-confirms: true #如果对异步消息需要回调必须设置为true 23 | # 日志配置 24 | logging: 25 | level: 26 | org.springframework.data.mongodb.core: debug 27 | com.macro.mall.mapper: debug 28 | com.macro.mall.portal.dao: debug 29 | -------------------------------------------------------------------------------- /mall-search/src/main/java/com/macro/mall/search/repository/EsProductRepository.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.search.repository; 2 | 3 | import com.macro.mall.search.domain.EsProduct; 4 | import org.springframework.data.domain.Page; 5 | import org.springframework.data.domain.Pageable; 6 | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; 7 | 8 | /** 9 | * 商品ES操作类 10 | * Created by macro on 2018/6/19. 11 | */ 12 | public interface EsProductRepository extends ElasticsearchRepository { 13 | /** 14 | * 搜索查询 15 | * 16 | * @param name 商品名称 17 | * @param subTitle 商品标题 18 | * @param keywords 商品关键字 19 | * @param page 分页信息 20 | * @return 21 | */ 22 | Page findByNameOrSubTitleOrKeywords(String name, String subTitle, String keywords,Pageable page); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/CmsMemberReportMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.CmsMemberReport; 4 | import com.macro.mall.model.CmsMemberReportExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface CmsMemberReportMapper { 9 | long countByExample(CmsMemberReportExample example); 10 | 11 | int deleteByExample(CmsMemberReportExample example); 12 | 13 | int insert(CmsMemberReport record); 14 | 15 | int insertSelective(CmsMemberReport record); 16 | 17 | List selectByExample(CmsMemberReportExample example); 18 | 19 | int updateByExampleSelective(@Param("record") CmsMemberReport record, @Param("example") CmsMemberReportExample example); 20 | 21 | int updateByExample(@Param("record") CmsMemberReport record, @Param("example") CmsMemberReportExample example); 22 | } -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/domain/HomeContentResult.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.domain; 2 | 3 | import com.macro.mall.model.CmsSubject; 4 | import com.macro.mall.model.PmsBrand; 5 | import com.macro.mall.model.PmsProduct; 6 | import com.macro.mall.model.SmsHomeAdvertise; 7 | import lombok.Getter; 8 | import lombok.Setter; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * 首页内容返回信息封装 14 | * Created by macro on 2019/1/28. 15 | */ 16 | @Getter 17 | @Setter 18 | public class HomeContentResult { 19 | //轮播广告 20 | private List advertiseList; 21 | //推荐品牌 22 | private List brandList; 23 | //当前秒杀场次 24 | private HomeFlashPromotion homeFlashPromotion; 25 | //新品推荐 26 | private List newProductList; 27 | //人气推荐 28 | private List hotProductList; 29 | //推荐专题 30 | private List subjectList; 31 | } 32 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/service/impl/CmsPrefrenceAreaServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.service.impl; 2 | 3 | import com.macro.mall.mapper.CmsPrefrenceAreaMapper; 4 | import com.macro.mall.model.CmsPrefrenceArea; 5 | import com.macro.mall.model.CmsPrefrenceAreaExample; 6 | import com.macro.mall.service.CmsPrefrenceAreaService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * 商品优选Service实现类 14 | * Created by macro on 2018/6/1. 15 | */ 16 | @Service 17 | public class CmsPrefrenceAreaServiceImpl implements CmsPrefrenceAreaService { 18 | @Autowired 19 | private CmsPrefrenceAreaMapper prefrenceAreaMapper; 20 | 21 | @Override 22 | public List listAll() { 23 | return prefrenceAreaMapper.selectByExample(new CmsPrefrenceAreaExample()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/service/impl/OmsCompanyAddressServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.service.impl; 2 | 3 | import com.macro.mall.mapper.OmsCompanyAddressMapper; 4 | import com.macro.mall.model.OmsCompanyAddress; 5 | import com.macro.mall.model.OmsCompanyAddressExample; 6 | import com.macro.mall.service.OmsCompanyAddressService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * 收货地址管理Service实现类 14 | * Created by macro on 2018/10/18. 15 | */ 16 | @Service 17 | public class OmsCompanyAddressServiceImpl implements OmsCompanyAddressService { 18 | @Autowired 19 | private OmsCompanyAddressMapper companyAddressMapper; 20 | @Override 21 | public List list() { 22 | return companyAddressMapper.selectByExample(new OmsCompanyAddressExample()); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /mall-demo/src/main/java/com/macro/mall/demo/validator/FlagValidatorClass.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.demo.validator; 2 | 3 | import javax.validation.ConstraintValidator; 4 | import javax.validation.ConstraintValidatorContext; 5 | 6 | /** 7 | * 状态标记校验器 8 | */ 9 | public class FlagValidatorClass implements ConstraintValidator { 10 | private String[] values; 11 | @Override 12 | public void initialize(FlagValidator flagValidator) { 13 | this.values = flagValidator.value(); 14 | } 15 | 16 | @Override 17 | public boolean isValid(Integer value, ConstraintValidatorContext constraintValidatorContext) { 18 | boolean isValid = false; 19 | for(int i=0;i list(String keyword, Integer pageSize, Integer pageNum); 41 | } 42 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dto/UmsAdminLoginParam.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dto; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | 5 | import javax.validation.constraints.NotEmpty; 6 | 7 | /** 8 | * 用户登录参数 9 | * Created by macro on 2018/4/26. 10 | */ 11 | public class UmsAdminLoginParam { 12 | @ApiModelProperty(value = "用户名", required = true) 13 | @NotEmpty(message = "用户名不能为空") 14 | private String username; 15 | @ApiModelProperty(value = "密码", required = true) 16 | @NotEmpty(message = "密码不能为空") 17 | private String password; 18 | 19 | public String getUsername() { 20 | return username; 21 | } 22 | 23 | public void setUsername(String username) { 24 | this.username = username; 25 | } 26 | 27 | public String getPassword() { 28 | return password; 29 | } 30 | 31 | public void setPassword(String password) { 32 | this.password = password; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/service/PmsBrandService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.service; 2 | 3 | import com.macro.mall.dto.PmsBrandParam; 4 | import com.macro.mall.model.PmsBrand; 5 | import org.springframework.transaction.annotation.Transactional; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * 商品品牌Service 11 | * Created by macro on 2018/4/26. 12 | */ 13 | public interface PmsBrandService { 14 | List listAllBrand(); 15 | 16 | int createBrand(PmsBrandParam pmsBrandParam); 17 | @Transactional 18 | int updateBrand(Long id, PmsBrandParam pmsBrandParam); 19 | 20 | int deleteBrand(Long id); 21 | 22 | int deleteBrand(List ids); 23 | 24 | List listBrand(String keyword, int pageNum, int pageSize); 25 | 26 | PmsBrand getBrand(Long id); 27 | 28 | int updateShowStatus(List ids, Integer showStatus); 29 | 30 | int updateFactoryStatus(List ids, Integer factoryStatus); 31 | } 32 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/service/OmsOrderReturnApplyService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.service; 2 | 3 | import com.macro.mall.dto.OmsOrderReturnApplyResult; 4 | import com.macro.mall.dto.OmsReturnApplyQueryParam; 5 | import com.macro.mall.dto.OmsUpdateStatusParam; 6 | import com.macro.mall.model.OmsOrderReturnApply; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 退货申请管理Service 12 | * Created by macro on 2018/10/18. 13 | */ 14 | public interface OmsOrderReturnApplyService { 15 | /** 16 | * 分页查询申请 17 | */ 18 | List list(OmsReturnApplyQueryParam queryParam, Integer pageSize, Integer pageNum); 19 | 20 | /** 21 | * 批量删除申请 22 | */ 23 | int delete(List ids); 24 | 25 | /** 26 | * 修改申请状态 27 | */ 28 | int updateStatus(Long id, OmsUpdateStatusParam statusParam); 29 | 30 | /** 31 | * 获取指定申请详情 32 | */ 33 | OmsOrderReturnApplyResult getItem(Long id); 34 | } 35 | -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/domain/QueueEnum.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.domain; 2 | 3 | import lombok.Getter; 4 | 5 | /** 6 | * 消息队列枚举配置 7 | * Created by macro on 2018/9/14. 8 | */ 9 | @Getter 10 | public enum QueueEnum { 11 | /** 12 | * 消息通知队列 13 | */ 14 | QUEUE_ORDER_CANCEL("mall.order.direct", "mall.order.cancel", "mall.order.cancel"), 15 | /** 16 | * 消息通知ttl队列 17 | */ 18 | QUEUE_TTL_ORDER_CANCEL("mall.order.direct.ttl", "mall.order.cancel.ttl", "mall.order.cancel.ttl"); 19 | 20 | /** 21 | * 交换名称 22 | */ 23 | private String exchange; 24 | /** 25 | * 队列名称 26 | */ 27 | private String name; 28 | /** 29 | * 路由键 30 | */ 31 | private String routeKey; 32 | 33 | QueueEnum(String exchange, String name, String routeKey) { 34 | this.exchange = exchange; 35 | this.name = name; 36 | this.routeKey = routeKey; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dto/OmsUpdateStatusParam.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dto; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | import java.math.BigDecimal; 8 | 9 | /** 10 | * 确认收货提交参数 11 | * Created by macro on 2018/10/18. 12 | */ 13 | @Getter 14 | @Setter 15 | public class OmsUpdateStatusParam { 16 | @ApiModelProperty("服务单号") 17 | private Long id; 18 | @ApiModelProperty("收货地址关联id") 19 | private Long companyAddressId; 20 | @ApiModelProperty("确认退款金额") 21 | private BigDecimal returnAmount; 22 | @ApiModelProperty("处理备注") 23 | private String handleNote; 24 | @ApiModelProperty("处理人") 25 | private String handleMan; 26 | @ApiModelProperty("收货备注") 27 | private String receiveNote; 28 | @ApiModelProperty("收货人") 29 | private String receiveMan; 30 | @ApiModelProperty("申请状态:1->退货中;2->已完成;3->已拒绝") 31 | private Integer status; 32 | } 33 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/service/SmsHomeAdvertiseService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.service; 2 | 3 | import com.macro.mall.model.SmsHomeAdvertise; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 首页广告管理Service 9 | * Created by macro on 2018/11/7. 10 | */ 11 | public interface SmsHomeAdvertiseService { 12 | /** 13 | * 添加广告 14 | */ 15 | int create(SmsHomeAdvertise advertise); 16 | 17 | /** 18 | * 批量删除广告 19 | */ 20 | int delete(List ids); 21 | 22 | /** 23 | * 修改上、下线状态 24 | */ 25 | int updateStatus(Long id, Integer status); 26 | 27 | /** 28 | * 获取广告详情 29 | */ 30 | SmsHomeAdvertise getItem(Long id); 31 | 32 | /** 33 | * 更新广告 34 | */ 35 | int update(Long id, SmsHomeAdvertise advertise); 36 | 37 | /** 38 | * 分页查询广告 39 | */ 40 | List list(String name, Integer type, String endTime, Integer pageSize, Integer pageNum); 41 | } 42 | -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/service/UmsMemberReceiveAddressService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.service; 2 | 3 | import com.macro.mall.model.UmsMemberReceiveAddress; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 用户地址管理Service 9 | * Created by macro on 2018/8/28. 10 | */ 11 | public interface UmsMemberReceiveAddressService { 12 | /** 13 | * 添加收货地址 14 | */ 15 | int add(UmsMemberReceiveAddress address); 16 | 17 | /** 18 | * 删除收货地址 19 | * @param id 地址表的id 20 | */ 21 | int delete(Long id); 22 | 23 | /** 24 | * 修改收货地址 25 | * @param id 地址表的id 26 | * @param address 修改的收货地址信息 27 | */ 28 | int update(Long id, UmsMemberReceiveAddress address); 29 | 30 | /** 31 | * 返回当前用户的收货地址 32 | */ 33 | List list(); 34 | 35 | /** 36 | * 获取地址详情 37 | * @param id 地址id 38 | */ 39 | UmsMemberReceiveAddress getItem(Long id); 40 | } 41 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/service/SmsHomeBrandService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.service; 2 | 3 | import com.macro.mall.model.SmsHomeBrand; 4 | import org.springframework.transaction.annotation.Transactional; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 首页品牌管理Service 10 | * Created by macro on 2018/11/6. 11 | */ 12 | public interface SmsHomeBrandService { 13 | /** 14 | * 添加首页品牌推荐 15 | */ 16 | @Transactional 17 | int create(List homeBrandList); 18 | 19 | /** 20 | * 修改品牌推荐排序 21 | */ 22 | int updateSort(Long id, Integer sort); 23 | 24 | /** 25 | * 批量删除品牌推荐 26 | */ 27 | int delete(List ids); 28 | 29 | /** 30 | * 更新推荐状态 31 | */ 32 | int updateRecommendStatus(List ids, Integer recommendStatus); 33 | 34 | /** 35 | * 分页查询品牌推荐 36 | */ 37 | List list(String brandName, Integer recommendStatus, Integer pageSize, Integer pageNum); 38 | } 39 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/service/OmsOrderReturnReasonService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.service; 2 | 3 | import com.macro.mall.model.OmsOrderReturnReason; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 订单原因管理Service 9 | * Created by macro on 2018/10/17. 10 | */ 11 | public interface OmsOrderReturnReasonService { 12 | /** 13 | * 添加订单原因 14 | */ 15 | int create(OmsOrderReturnReason returnReason); 16 | 17 | /** 18 | * 修改退货原因 19 | */ 20 | int update(Long id, OmsOrderReturnReason returnReason); 21 | 22 | /** 23 | * 批量删除退货原因 24 | */ 25 | int delete(List ids); 26 | 27 | /** 28 | * 分页获取退货原因 29 | */ 30 | List list(Integer pageSize, Integer pageNum); 31 | 32 | /** 33 | * 批量修改退货原因状态 34 | */ 35 | int updateStatus(List ids, Integer status); 36 | 37 | /** 38 | * 获取单个退货原因详情信息 39 | */ 40 | OmsOrderReturnReason getItem(Long id); 41 | } 42 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dao/UmsAdminRoleRelationDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dao; 2 | 3 | import com.macro.mall.model.UmsAdminRoleRelation; 4 | import com.macro.mall.model.UmsPermission; 5 | import com.macro.mall.model.UmsRole; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 后台用户与角色管理自定义Dao 12 | * Created by macro on 2018/10/8. 13 | */ 14 | public interface UmsAdminRoleRelationDao { 15 | /** 16 | * 批量插入用户角色关系 17 | */ 18 | int insertList(@Param("list") List adminRoleRelationList); 19 | 20 | /** 21 | * 获取用于所有角色 22 | */ 23 | List getRoleList(@Param("adminId") Long adminId); 24 | 25 | /** 26 | * 获取用户所有角色权限 27 | */ 28 | List getRolePermissionList(@Param("adminId") Long adminId); 29 | 30 | /** 31 | * 获取用户所有权限(包括+-权限) 32 | */ 33 | List getPermissionList(@Param("adminId") Long adminId); 34 | } 35 | -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/service/UmsMemberCouponService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.service; 2 | 3 | import com.macro.mall.common.api.CommonResult; 4 | import com.macro.mall.model.SmsCouponHistory; 5 | import com.macro.mall.portal.domain.CartPromotionItem; 6 | import com.macro.mall.portal.domain.SmsCouponHistoryDetail; 7 | import org.springframework.transaction.annotation.Transactional; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * 用户优惠券管理Service 13 | * Created by macro on 2018/8/29. 14 | */ 15 | public interface UmsMemberCouponService { 16 | /** 17 | * 会员添加优惠券 18 | */ 19 | @Transactional 20 | CommonResult add(Long couponId); 21 | 22 | /** 23 | * 获取优惠券列表 24 | * @param useStatus 优惠券的使用状态 25 | */ 26 | List list(Integer useStatus); 27 | 28 | /** 29 | * 根据购物车信息获取可用优惠券 30 | */ 31 | List listCart(List cartItemList, Integer type); 32 | } 33 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/service/SmsHomeNewProductService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.service; 2 | 3 | import com.macro.mall.model.SmsHomeNewProduct; 4 | import org.springframework.transaction.annotation.Transactional; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 首页新品管理Service 10 | * Created by macro on 2018/11/6. 11 | */ 12 | public interface SmsHomeNewProductService { 13 | /** 14 | * 添加首页推荐 15 | */ 16 | @Transactional 17 | int create(List homeNewProductList); 18 | 19 | /** 20 | * 修改推荐排序 21 | */ 22 | int updateSort(Long id, Integer sort); 23 | 24 | /** 25 | * 批量删除推荐 26 | */ 27 | int delete(List ids); 28 | 29 | /** 30 | * 更新推荐状态 31 | */ 32 | int updateRecommendStatus(List ids, Integer recommendStatus); 33 | 34 | /** 35 | * 分页查询推荐 36 | */ 37 | List list(String productName, Integer recommendStatus, Integer pageSize, Integer pageNum); 38 | } 39 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/service/UmsRoleService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.service; 2 | 3 | import com.macro.mall.model.UmsPermission; 4 | import com.macro.mall.model.UmsRole; 5 | import org.springframework.transaction.annotation.Transactional; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * 后台角色管理Service 11 | * Created by macro on 2018/9/30. 12 | */ 13 | public interface UmsRoleService { 14 | /** 15 | * 添加角色 16 | */ 17 | int create(UmsRole role); 18 | 19 | /** 20 | * 修改角色信息 21 | */ 22 | int update(Long id, UmsRole role); 23 | 24 | /** 25 | * 批量删除角色 26 | */ 27 | int delete(List ids); 28 | 29 | /** 30 | * 获取指定角色权限 31 | */ 32 | List getPermissionList(Long roleId); 33 | 34 | /** 35 | * 修改指定角色的权限 36 | */ 37 | @Transactional 38 | int updatePermission(Long roleId, List permissionIds); 39 | 40 | /** 41 | * 获取角色列表 42 | */ 43 | List list(); 44 | } 45 | -------------------------------------------------------------------------------- /mall-admin/src/main/resources/dao/UmsRolePermissionRelationDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | INSERT INTO ums_role_permission_relation (role_id, permission_id) VALUES 7 | 8 | (#{item.roleId,jdbcType=BIGINT}, 9 | #{item.permissionId,jdbcType=BIGINT}) 10 | 11 | 12 | 21 | -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/UmsRoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.UmsRole; 4 | import com.macro.mall.model.UmsRoleExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface UmsRoleMapper { 9 | long countByExample(UmsRoleExample example); 10 | 11 | int deleteByExample(UmsRoleExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(UmsRole record); 16 | 17 | int insertSelective(UmsRole record); 18 | 19 | List selectByExample(UmsRoleExample example); 20 | 21 | UmsRole selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") UmsRole record, @Param("example") UmsRoleExample example); 24 | 25 | int updateByExample(@Param("record") UmsRole record, @Param("example") UmsRoleExample example); 26 | 27 | int updateByPrimaryKeySelective(UmsRole record); 28 | 29 | int updateByPrimaryKey(UmsRole record); 30 | } -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dto/UmsAdminParam.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dto; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | import javax.validation.constraints.Email; 8 | import javax.validation.constraints.NotEmpty; 9 | 10 | /** 11 | * 用户登录参数 12 | * Created by macro on 2018/4/26. 13 | */ 14 | @Getter 15 | @Setter 16 | public class UmsAdminParam { 17 | @ApiModelProperty(value = "用户名", required = true) 18 | @NotEmpty(message = "用户名不能为空") 19 | private String username; 20 | @ApiModelProperty(value = "密码", required = true) 21 | @NotEmpty(message = "密码不能为空") 22 | private String password; 23 | @ApiModelProperty(value = "用户头像") 24 | private String icon; 25 | @ApiModelProperty(value = "邮箱") 26 | @Email(message = "邮箱格式不合法") 27 | private String email; 28 | @ApiModelProperty(value = "用户昵称") 29 | private String nickName; 30 | @ApiModelProperty(value = "备注") 31 | private String note; 32 | } 33 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/service/impl/OmsOrderSettingServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.service.impl; 2 | 3 | import com.macro.mall.mapper.OmsOrderSettingMapper; 4 | import com.macro.mall.model.OmsOrderSetting; 5 | import com.macro.mall.service.OmsOrderSettingService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | * 订单设置管理Service实现类 11 | * Created by macro on 2018/10/16. 12 | */ 13 | @Service 14 | public class OmsOrderSettingServiceImpl implements OmsOrderSettingService { 15 | @Autowired 16 | private OmsOrderSettingMapper orderSettingMapper; 17 | 18 | @Override 19 | public OmsOrderSetting getItem(Long id) { 20 | return orderSettingMapper.selectByPrimaryKey(id); 21 | } 22 | 23 | @Override 24 | public int update(Long id, OmsOrderSetting orderSetting) { 25 | orderSetting.setId(id); 26 | return orderSettingMapper.updateByPrimaryKey(orderSetting); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /mall-admin/src/main/resources/dao/PmsProductCategoryDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 8 | 9 | 18 | -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/service/HomeService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.service; 2 | 3 | import com.macro.mall.model.CmsSubject; 4 | import com.macro.mall.model.PmsProduct; 5 | import com.macro.mall.model.PmsProductCategory; 6 | import com.macro.mall.portal.domain.HomeContentResult; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 首页内容管理Service 12 | * Created by macro on 2019/1/28. 13 | */ 14 | public interface HomeService { 15 | 16 | /** 17 | * 获取首页内容 18 | */ 19 | HomeContentResult content(); 20 | 21 | /** 22 | * 首页商品推荐 23 | */ 24 | List recommendProductList(Integer pageSize, Integer pageNum); 25 | 26 | /** 27 | * 获取商品分类 28 | * @param parentId 0:获取一级分类;其他:获取指定二级分类 29 | */ 30 | List getProductCateList(Long parentId); 31 | 32 | /** 33 | * 根据专题分类分页获取专题 34 | * @param cateId 专题分类id 35 | */ 36 | List getSubjectList(Long cateId, Integer pageSize, Integer pageNum); 37 | } 38 | -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/OmsOrderMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.OmsOrder; 4 | import com.macro.mall.model.OmsOrderExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface OmsOrderMapper { 9 | long countByExample(OmsOrderExample example); 10 | 11 | int deleteByExample(OmsOrderExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(OmsOrder record); 16 | 17 | int insertSelective(OmsOrder record); 18 | 19 | List selectByExample(OmsOrderExample example); 20 | 21 | OmsOrder selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") OmsOrder record, @Param("example") OmsOrderExample example); 24 | 25 | int updateByExample(@Param("record") OmsOrder record, @Param("example") OmsOrderExample example); 26 | 27 | int updateByPrimaryKeySelective(OmsOrder record); 28 | 29 | int updateByPrimaryKey(OmsOrder record); 30 | } -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/PmsAlbumMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.PmsAlbum; 4 | import com.macro.mall.model.PmsAlbumExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface PmsAlbumMapper { 9 | long countByExample(PmsAlbumExample example); 10 | 11 | int deleteByExample(PmsAlbumExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(PmsAlbum record); 16 | 17 | int insertSelective(PmsAlbum record); 18 | 19 | List selectByExample(PmsAlbumExample example); 20 | 21 | PmsAlbum selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") PmsAlbum record, @Param("example") PmsAlbumExample example); 24 | 25 | int updateByExample(@Param("record") PmsAlbum record, @Param("example") PmsAlbumExample example); 26 | 27 | int updateByPrimaryKeySelective(PmsAlbum record); 28 | 29 | int updateByPrimaryKey(PmsAlbum record); 30 | } -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/UmsAdminMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.UmsAdmin; 4 | import com.macro.mall.model.UmsAdminExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface UmsAdminMapper { 9 | long countByExample(UmsAdminExample example); 10 | 11 | int deleteByExample(UmsAdminExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(UmsAdmin record); 16 | 17 | int insertSelective(UmsAdmin record); 18 | 19 | List selectByExample(UmsAdminExample example); 20 | 21 | UmsAdmin selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") UmsAdmin record, @Param("example") UmsAdminExample example); 24 | 25 | int updateByExample(@Param("record") UmsAdmin record, @Param("example") UmsAdminExample example); 26 | 27 | int updateByPrimaryKeySelective(UmsAdmin record); 28 | 29 | int updateByPrimaryKey(UmsAdmin record); 30 | } -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/service/SmsHomeRecommendSubjectService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.service; 2 | 3 | import com.macro.mall.model.SmsHomeRecommendSubject; 4 | import org.springframework.transaction.annotation.Transactional; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 首页专题推荐管理Service 10 | * Created by macro on 2018/11/7. 11 | */ 12 | public interface SmsHomeRecommendSubjectService { 13 | /** 14 | * 添加首页推荐 15 | */ 16 | @Transactional 17 | int create(List recommendSubjectList); 18 | 19 | /** 20 | * 修改推荐排序 21 | */ 22 | int updateSort(Long id, Integer sort); 23 | 24 | /** 25 | * 批量删除推荐 26 | */ 27 | int delete(List ids); 28 | 29 | /** 30 | * 更新推荐状态 31 | */ 32 | int updateRecommendStatus(List ids, Integer recommendStatus); 33 | 34 | /** 35 | * 分页查询推荐 36 | */ 37 | List list(String subjectName, Integer recommendStatus, Integer pageSize, Integer pageNum); 38 | } 39 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/service/SmsHomeRecommendProductService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.service; 2 | 3 | import com.macro.mall.model.SmsHomeRecommendProduct; 4 | import org.springframework.transaction.annotation.Transactional; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 首页人气推荐管理Service 10 | * Created by macro on 2018/11/7. 11 | */ 12 | public interface SmsHomeRecommendProductService { 13 | /** 14 | * 添加首页推荐 15 | */ 16 | @Transactional 17 | int create(List homeRecommendProductList); 18 | 19 | /** 20 | * 修改推荐排序 21 | */ 22 | int updateSort(Long id, Integer sort); 23 | 24 | /** 25 | * 批量删除推荐 26 | */ 27 | int delete(List ids); 28 | 29 | /** 30 | * 更新推荐状态 31 | */ 32 | int updateRecommendStatus(List ids, Integer recommendStatus); 33 | 34 | /** 35 | * 分页查询推荐 36 | */ 37 | List list(String productName, Integer recommendStatus, Integer pageSize, Integer pageNum); 38 | } 39 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/service/SmsCouponService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.service; 2 | 3 | import com.macro.mall.dto.SmsCouponParam; 4 | import com.macro.mall.model.SmsCoupon; 5 | import org.springframework.transaction.annotation.Transactional; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * 优惠券管理Service 11 | * Created by macro on 2018/8/28. 12 | */ 13 | public interface SmsCouponService { 14 | /** 15 | * 添加优惠券 16 | */ 17 | @Transactional 18 | int create(SmsCouponParam couponParam); 19 | 20 | /** 21 | * 根据优惠券id删除优惠券 22 | */ 23 | @Transactional 24 | int delete(Long id); 25 | 26 | /** 27 | * 根据优惠券id更新优惠券信息 28 | */ 29 | @Transactional 30 | int update(Long id, SmsCouponParam couponParam); 31 | 32 | /** 33 | * 分页获取优惠券列表 34 | */ 35 | List list(String name, Integer type, Integer pageSize, Integer pageNum); 36 | 37 | /** 38 | * 获取优惠券详情 39 | * @param id 优惠券表id 40 | */ 41 | SmsCouponParam getItem(Long id); 42 | } 43 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/service/impl/UmsMemberLevelServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.service.impl; 2 | 3 | import com.macro.mall.mapper.UmsMemberLevelMapper; 4 | import com.macro.mall.model.UmsMemberLevel; 5 | import com.macro.mall.model.UmsMemberLevelExample; 6 | import com.macro.mall.service.UmsMemberLevelService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * 会员等级管理Service实现类 14 | * Created by macro on 2018/4/26. 15 | */ 16 | @Service 17 | public class UmsMemberLevelServiceImpl implements UmsMemberLevelService{ 18 | @Autowired 19 | private UmsMemberLevelMapper memberLevelMapper; 20 | @Override 21 | public List list(Integer defaultStatus) { 22 | UmsMemberLevelExample example = new UmsMemberLevelExample(); 23 | example.createCriteria().andDefaultStatusEqualTo(defaultStatus); 24 | return memberLevelMapper.selectByExample(example); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/SmsCouponMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.SmsCoupon; 4 | import com.macro.mall.model.SmsCouponExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface SmsCouponMapper { 9 | long countByExample(SmsCouponExample example); 10 | 11 | int deleteByExample(SmsCouponExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(SmsCoupon record); 16 | 17 | int insertSelective(SmsCoupon record); 18 | 19 | List selectByExample(SmsCouponExample example); 20 | 21 | SmsCoupon selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") SmsCoupon record, @Param("example") SmsCouponExample example); 24 | 25 | int updateByExample(@Param("record") SmsCoupon record, @Param("example") SmsCouponExample example); 26 | 27 | int updateByPrimaryKeySelective(SmsCoupon record); 28 | 29 | int updateByPrimaryKey(SmsCoupon record); 30 | } -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/UmsMemberMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.UmsMember; 4 | import com.macro.mall.model.UmsMemberExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface UmsMemberMapper { 9 | long countByExample(UmsMemberExample example); 10 | 11 | int deleteByExample(UmsMemberExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(UmsMember record); 16 | 17 | int insertSelective(UmsMember record); 18 | 19 | List selectByExample(UmsMemberExample example); 20 | 21 | UmsMember selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") UmsMember record, @Param("example") UmsMemberExample example); 24 | 25 | int updateByExample(@Param("record") UmsMember record, @Param("example") UmsMemberExample example); 26 | 27 | int updateByPrimaryKeySelective(UmsMember record); 28 | 29 | int updateByPrimaryKey(UmsMember record); 30 | } -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/component/CancelOrderReceiver.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.component; 2 | 3 | import com.macro.mall.portal.service.OmsPortalOrderService; 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | import org.springframework.amqp.rabbit.annotation.RabbitHandler; 7 | import org.springframework.amqp.rabbit.annotation.RabbitListener; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Component; 10 | 11 | /** 12 | * 取消订单消息的处理者 13 | * Created by macro on 2018/9/14. 14 | */ 15 | @Component 16 | @RabbitListener(queues = "mall.order.cancel") 17 | public class CancelOrderReceiver { 18 | private static Logger LOGGER =LoggerFactory.getLogger(CancelOrderReceiver.class); 19 | @Autowired 20 | private OmsPortalOrderService portalOrderService; 21 | @RabbitHandler 22 | public void handle(Long orderId){ 23 | portalOrderService.cancelOrder(orderId); 24 | LOGGER.info("process orderId:{}",orderId); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/util/DateUtil.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.util; 2 | 3 | import java.util.Calendar; 4 | import java.util.Date; 5 | 6 | /** 7 | * 日期工具类 8 | * Created by macro on 2019/1/29. 9 | */ 10 | public class DateUtil { 11 | 12 | /** 13 | * 从Date类型的时间中提取日期部分 14 | */ 15 | public static Date getDate(Date date) { 16 | Calendar calendar = Calendar.getInstance(); 17 | calendar.setTime(date); 18 | calendar.set(Calendar.HOUR_OF_DAY, 0); 19 | calendar.set(Calendar.MINUTE, 0); 20 | calendar.set(Calendar.SECOND, 0); 21 | return calendar.getTime(); 22 | } 23 | 24 | /** 25 | * 从Date类型的时间中提取时间部分 26 | */ 27 | public static Date getTime(Date date) { 28 | Calendar calendar = Calendar.getInstance(); 29 | calendar.setTime(date); 30 | calendar.set(Calendar.YEAR, 1970); 31 | calendar.set(Calendar.MONTH, 0); 32 | calendar.set(Calendar.DAY_OF_MONTH, 1); 33 | return calendar.getTime(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/validator/FlagValidatorClass.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.validator; 2 | 3 | import javax.validation.ConstraintValidator; 4 | import javax.validation.ConstraintValidatorContext; 5 | 6 | /** 7 | * 状态标记校验器 8 | * Created by macro on 2018/4/26. 9 | */ 10 | public class FlagValidatorClass implements ConstraintValidator { 11 | private String[] values; 12 | @Override 13 | public void initialize(FlagValidator flagValidator) { 14 | this.values = flagValidator.value(); 15 | } 16 | 17 | @Override 18 | public boolean isValid(Integer value, ConstraintValidatorContext constraintValidatorContext) { 19 | boolean isValid = false; 20 | if(value==null){ 21 | //当状态为空时使用默认值 22 | return true; 23 | } 24 | for(int i=0;i productAttributeList; 15 | private List skuStockList; 16 | 17 | public List getProductAttributeList() { 18 | return productAttributeList; 19 | } 20 | 21 | public void setProductAttributeList(List productAttributeList) { 22 | this.productAttributeList = productAttributeList; 23 | } 24 | 25 | public List getSkuStockList() { 26 | return skuStockList; 27 | } 28 | 29 | public void setSkuStockList(List skuStockList) { 30 | this.skuStockList = skuStockList; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /mall-search/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8081 3 | spring: 4 | datasource: 5 | url: jdbc:mysql://localhost:3306/mall?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai 6 | username: root 7 | password: root 8 | druid: 9 | initial-size: 5 #连接池初始化大小 10 | min-idle: 10 #最小空闲连接数 11 | max-active: 20 #最大连接数 12 | web-stat-filter: 13 | exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*" #不统计这些请求数据 14 | stat-view-servlet: #访问监控网页的登录用户名和密码 15 | login-username: druid 16 | login-password: druid 17 | data: 18 | elasticsearch: 19 | repositories: 20 | enabled: true 21 | cluster-nodes: 127.0.0.1:9300 22 | cluster-name: elasticsearch 23 | mybatis: 24 | mapper-locations: 25 | - classpath:dao/*.xml 26 | - classpath*:com/**/mapper/*.xml 27 | management: #开启SpringBoot Admin的监控 28 | endpoints: 29 | web: 30 | exposure: 31 | include: '*' 32 | endpoint: 33 | health: 34 | show-details: always 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /mall-demo/src/main/java/com/macro/mall/demo/controller/FeignPortalController.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.demo.controller; 2 | 3 | import com.macro.mall.common.api.CommonResult; 4 | import com.macro.mall.demo.service.FeignPortalService; 5 | import io.swagger.annotations.Api; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.web.bind.annotation.*; 8 | 9 | /** 10 | * Feign调用mall-portal接口示例 11 | * Created by macro on 2019/10/18. 12 | */ 13 | @Api(tags = "FeignPortalController", description = "Feign调用mall-portal接口示例") 14 | @RestController 15 | @RequestMapping("/feign/portal") 16 | public class FeignPortalController { 17 | 18 | @Autowired 19 | private FeignPortalService portalService; 20 | 21 | @PostMapping("/login") 22 | public CommonResult login(@RequestParam String username, @RequestParam String password) { 23 | return portalService.login(username,password); 24 | } 25 | 26 | @GetMapping("/cartList") 27 | public CommonResult cartList() { 28 | return portalService.list(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /mall-demo/src/test/java/com/macro/mall/MallDemoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall; 2 | 3 | import com.fasterxml.jackson.databind.ObjectMapper; 4 | import com.macro.mall.model.PmsProduct; 5 | import org.junit.Test; 6 | import org.junit.runner.RunWith; 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | import org.springframework.boot.test.context.SpringBootTest; 10 | import org.springframework.test.context.junit4.SpringRunner; 11 | 12 | @RunWith(SpringRunner.class) 13 | @SpringBootTest 14 | public class MallDemoApplicationTests { 15 | private Logger logger = LoggerFactory.getLogger(MallDemoApplicationTests.class); 16 | @Test 17 | public void contextLoads() { 18 | } 19 | 20 | @Test 21 | public void testLogStash() throws Exception { 22 | ObjectMapper mapper = new ObjectMapper(); 23 | PmsProduct product = new PmsProduct(); 24 | product.setId(1L); 25 | product.setName("小米手机"); 26 | product.setBrandName("小米"); 27 | logger.info(mapper.writeValueAsString(product)); 28 | logger.error(mapper.writeValueAsString(product)); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/OmsCartItemMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.OmsCartItem; 4 | import com.macro.mall.model.OmsCartItemExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface OmsCartItemMapper { 9 | long countByExample(OmsCartItemExample example); 10 | 11 | int deleteByExample(OmsCartItemExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(OmsCartItem record); 16 | 17 | int insertSelective(OmsCartItem record); 18 | 19 | List selectByExample(OmsCartItemExample example); 20 | 21 | OmsCartItem selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") OmsCartItem record, @Param("example") OmsCartItemExample example); 24 | 25 | int updateByExample(@Param("record") OmsCartItem record, @Param("example") OmsCartItemExample example); 26 | 27 | int updateByPrimaryKeySelective(OmsCartItem record); 28 | 29 | int updateByPrimaryKey(OmsCartItem record); 30 | } -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/PmsAlbumPicMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.PmsAlbumPic; 4 | import com.macro.mall.model.PmsAlbumPicExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface PmsAlbumPicMapper { 9 | long countByExample(PmsAlbumPicExample example); 10 | 11 | int deleteByExample(PmsAlbumPicExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(PmsAlbumPic record); 16 | 17 | int insertSelective(PmsAlbumPic record); 18 | 19 | List selectByExample(PmsAlbumPicExample example); 20 | 21 | PmsAlbumPic selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") PmsAlbumPic record, @Param("example") PmsAlbumPicExample example); 24 | 25 | int updateByExample(@Param("record") PmsAlbumPic record, @Param("example") PmsAlbumPicExample example); 26 | 27 | int updateByPrimaryKeySelective(PmsAlbumPic record); 28 | 29 | int updateByPrimaryKey(PmsAlbumPic record); 30 | } -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/PmsSkuStockMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.PmsSkuStock; 4 | import com.macro.mall.model.PmsSkuStockExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface PmsSkuStockMapper { 9 | long countByExample(PmsSkuStockExample example); 10 | 11 | int deleteByExample(PmsSkuStockExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(PmsSkuStock record); 16 | 17 | int insertSelective(PmsSkuStock record); 18 | 19 | List selectByExample(PmsSkuStockExample example); 20 | 21 | PmsSkuStock selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") PmsSkuStock record, @Param("example") PmsSkuStockExample example); 24 | 25 | int updateByExample(@Param("record") PmsSkuStock record, @Param("example") PmsSkuStockExample example); 26 | 27 | int updateByPrimaryKeySelective(PmsSkuStock record); 28 | 29 | int updateByPrimaryKey(PmsSkuStock record); 30 | } -------------------------------------------------------------------------------- /mall-admin/src/main/resources/dao/PmsProductAttributeCategoryDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 19 | -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/OmsOrderItemMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.OmsOrderItem; 4 | import com.macro.mall.model.OmsOrderItemExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface OmsOrderItemMapper { 9 | long countByExample(OmsOrderItemExample example); 10 | 11 | int deleteByExample(OmsOrderItemExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(OmsOrderItem record); 16 | 17 | int insertSelective(OmsOrderItem record); 18 | 19 | List selectByExample(OmsOrderItemExample example); 20 | 21 | OmsOrderItem selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") OmsOrderItem record, @Param("example") OmsOrderItemExample example); 24 | 25 | int updateByExample(@Param("record") OmsOrderItem record, @Param("example") OmsOrderItemExample example); 26 | 27 | int updateByPrimaryKeySelective(OmsOrderItem record); 28 | 29 | int updateByPrimaryKey(OmsOrderItem record); 30 | } -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/SmsHomeBrandMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.SmsHomeBrand; 4 | import com.macro.mall.model.SmsHomeBrandExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface SmsHomeBrandMapper { 9 | long countByExample(SmsHomeBrandExample example); 10 | 11 | int deleteByExample(SmsHomeBrandExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(SmsHomeBrand record); 16 | 17 | int insertSelective(SmsHomeBrand record); 18 | 19 | List selectByExample(SmsHomeBrandExample example); 20 | 21 | SmsHomeBrand selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") SmsHomeBrand record, @Param("example") SmsHomeBrandExample example); 24 | 25 | int updateByExample(@Param("record") SmsHomeBrand record, @Param("example") SmsHomeBrandExample example); 26 | 27 | int updateByPrimaryKeySelective(SmsHomeBrand record); 28 | 29 | int updateByPrimaryKey(SmsHomeBrand record); 30 | } -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/UmsMemberTagMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.UmsMemberTag; 4 | import com.macro.mall.model.UmsMemberTagExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface UmsMemberTagMapper { 9 | long countByExample(UmsMemberTagExample example); 10 | 11 | int deleteByExample(UmsMemberTagExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(UmsMemberTag record); 16 | 17 | int insertSelective(UmsMemberTag record); 18 | 19 | List selectByExample(UmsMemberTagExample example); 20 | 21 | UmsMemberTag selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") UmsMemberTag record, @Param("example") UmsMemberTagExample example); 24 | 25 | int updateByExample(@Param("record") UmsMemberTag record, @Param("example") UmsMemberTagExample example); 26 | 27 | int updateByPrimaryKeySelective(UmsMemberTag record); 28 | 29 | int updateByPrimaryKey(UmsMemberTag record); 30 | } -------------------------------------------------------------------------------- /document/docker/nginx.conf: -------------------------------------------------------------------------------- 1 | 2 | user nginx; 3 | worker_processes 1; 4 | 5 | error_log /var/log/nginx/error.log warn; 6 | pid /var/run/nginx.pid; 7 | 8 | 9 | events { 10 | worker_connections 1024; 11 | } 12 | 13 | 14 | http { 15 | include /etc/nginx/mime.types; 16 | default_type application/octet-stream; 17 | 18 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 19 | '$status $body_bytes_sent "$http_referer" ' 20 | '"$http_user_agent" "$http_x_forwarded_for"'; 21 | 22 | access_log /var/log/nginx/access.log main; 23 | 24 | sendfile on; 25 | #tcp_nopush on; 26 | 27 | keepalive_timeout 65; 28 | 29 | #gzip on; 30 | 31 | server { 32 | listen 80; 33 | server_name localhost; 34 | 35 | location / { 36 | root /usr/share/nginx/html; 37 | index index.html index.htm; 38 | } 39 | 40 | error_page 500 502 503 504 /50x.html; 41 | location = /50x.html { 42 | root /usr/share/nginx/html; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/UmsMemberTaskMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.UmsMemberTask; 4 | import com.macro.mall.model.UmsMemberTaskExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface UmsMemberTaskMapper { 9 | long countByExample(UmsMemberTaskExample example); 10 | 11 | int deleteByExample(UmsMemberTaskExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(UmsMemberTask record); 16 | 17 | int insertSelective(UmsMemberTask record); 18 | 19 | List selectByExample(UmsMemberTaskExample example); 20 | 21 | UmsMemberTask selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") UmsMemberTask record, @Param("example") UmsMemberTaskExample example); 24 | 25 | int updateByExample(@Param("record") UmsMemberTask record, @Param("example") UmsMemberTaskExample example); 26 | 27 | int updateByPrimaryKeySelective(UmsMemberTask record); 28 | 29 | int updateByPrimaryKey(UmsMemberTask record); 30 | } -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/UmsPermissionMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.UmsPermission; 4 | import com.macro.mall.model.UmsPermissionExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface UmsPermissionMapper { 9 | long countByExample(UmsPermissionExample example); 10 | 11 | int deleteByExample(UmsPermissionExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(UmsPermission record); 16 | 17 | int insertSelective(UmsPermission record); 18 | 19 | List selectByExample(UmsPermissionExample example); 20 | 21 | UmsPermission selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") UmsPermission record, @Param("example") UmsPermissionExample example); 24 | 25 | int updateByExample(@Param("record") UmsPermission record, @Param("example") UmsPermissionExample example); 26 | 27 | int updateByPrimaryKeySelective(UmsPermission record); 28 | 29 | int updateByPrimaryKey(UmsPermission record); 30 | } -------------------------------------------------------------------------------- /mall-demo/src/main/java/com/macro/mall/demo/controller/FeignAdminController.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.demo.controller; 2 | 3 | /** 4 | * Created by macro on 2019/10/18. 5 | */ 6 | 7 | import com.macro.mall.common.api.CommonResult; 8 | import com.macro.mall.demo.dto.UmsAdminLoginParam; 9 | import com.macro.mall.demo.service.FeignAdminService; 10 | import io.swagger.annotations.Api; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.web.bind.annotation.*; 13 | 14 | /** 15 | * Feign调用mall-admin接口示例 16 | */ 17 | @Api(tags = "FeignAdminController", description = "Feign调用mall-admin接口示例") 18 | @RestController 19 | @RequestMapping("/feign/admin") 20 | public class FeignAdminController { 21 | @Autowired 22 | private FeignAdminService adminService; 23 | 24 | @PostMapping("/login") 25 | public CommonResult login(@RequestBody UmsAdminLoginParam loginParam) { 26 | return adminService.login(loginParam); 27 | } 28 | 29 | @GetMapping("/getBrandList") 30 | public CommonResult getBrandList(){ 31 | return adminService.getList(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/PmsMemberPriceMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.PmsMemberPrice; 4 | import com.macro.mall.model.PmsMemberPriceExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface PmsMemberPriceMapper { 9 | long countByExample(PmsMemberPriceExample example); 10 | 11 | int deleteByExample(PmsMemberPriceExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(PmsMemberPrice record); 16 | 17 | int insertSelective(PmsMemberPrice record); 18 | 19 | List selectByExample(PmsMemberPriceExample example); 20 | 21 | PmsMemberPrice selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") PmsMemberPrice record, @Param("example") PmsMemberPriceExample example); 24 | 25 | int updateByExample(@Param("record") PmsMemberPrice record, @Param("example") PmsMemberPriceExample example); 26 | 27 | int updateByPrimaryKeySelective(PmsMemberPrice record); 28 | 29 | int updateByPrimaryKey(PmsMemberPrice record); 30 | } -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/UmsMemberLevelMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.UmsMemberLevel; 4 | import com.macro.mall.model.UmsMemberLevelExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface UmsMemberLevelMapper { 9 | long countByExample(UmsMemberLevelExample example); 10 | 11 | int deleteByExample(UmsMemberLevelExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(UmsMemberLevel record); 16 | 17 | int insertSelective(UmsMemberLevel record); 18 | 19 | List selectByExample(UmsMemberLevelExample example); 20 | 21 | UmsMemberLevel selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") UmsMemberLevel record, @Param("example") UmsMemberLevelExample example); 24 | 25 | int updateByExample(@Param("record") UmsMemberLevel record, @Param("example") UmsMemberLevelExample example); 26 | 27 | int updateByPrimaryKeySelective(UmsMemberLevel record); 28 | 29 | int updateByPrimaryKey(UmsMemberLevel record); 30 | } -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/dao/PortalOrderDao.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.dao; 2 | 3 | import com.macro.mall.model.OmsOrderItem; 4 | import com.macro.mall.portal.domain.OmsOrderDetail; 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * 前台订单自定义Dao 11 | * Created by macro on 2018/9/4. 12 | */ 13 | public interface PortalOrderDao { 14 | /** 15 | * 获取订单及下单商品详情 16 | */ 17 | OmsOrderDetail getDetail(@Param("orderId") Long orderId); 18 | 19 | /** 20 | * 修改 pms_sku_stock表的锁定库存及真实库存 21 | */ 22 | int updateSkuStock(@Param("itemList") List orderItemList); 23 | 24 | /** 25 | * 获取超时订单 26 | * @param minute 超时时间(分) 27 | */ 28 | List getTimeOutOrders(@Param("minute") Integer minute); 29 | 30 | /** 31 | * 批量修改订单状态 32 | */ 33 | int updateOrderStatus(@Param("ids") List ids,@Param("status") Integer status); 34 | 35 | /** 36 | * 解除取消订单的库存锁定 37 | */ 38 | int releaseSkuStockLock(@Param("itemList") List orderItemList); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/CmsHelpCategoryMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.CmsHelpCategory; 4 | import com.macro.mall.model.CmsHelpCategoryExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface CmsHelpCategoryMapper { 9 | long countByExample(CmsHelpCategoryExample example); 10 | 11 | int deleteByExample(CmsHelpCategoryExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(CmsHelpCategory record); 16 | 17 | int insertSelective(CmsHelpCategory record); 18 | 19 | List selectByExample(CmsHelpCategoryExample example); 20 | 21 | CmsHelpCategory selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") CmsHelpCategory record, @Param("example") CmsHelpCategoryExample example); 24 | 25 | int updateByExample(@Param("record") CmsHelpCategory record, @Param("example") CmsHelpCategoryExample example); 26 | 27 | int updateByPrimaryKeySelective(CmsHelpCategory record); 28 | 29 | int updateByPrimaryKey(CmsHelpCategory record); 30 | } -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/CmsTopicCommentMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.CmsTopicComment; 4 | import com.macro.mall.model.CmsTopicCommentExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface CmsTopicCommentMapper { 9 | long countByExample(CmsTopicCommentExample example); 10 | 11 | int deleteByExample(CmsTopicCommentExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(CmsTopicComment record); 16 | 17 | int insertSelective(CmsTopicComment record); 18 | 19 | List selectByExample(CmsTopicCommentExample example); 20 | 21 | CmsTopicComment selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") CmsTopicComment record, @Param("example") CmsTopicCommentExample example); 24 | 25 | int updateByExample(@Param("record") CmsTopicComment record, @Param("example") CmsTopicCommentExample example); 26 | 27 | int updateByPrimaryKeySelective(CmsTopicComment record); 28 | 29 | int updateByPrimaryKey(CmsTopicComment record); 30 | } -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/OmsOrderSettingMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.OmsOrderSetting; 4 | import com.macro.mall.model.OmsOrderSettingExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface OmsOrderSettingMapper { 9 | long countByExample(OmsOrderSettingExample example); 10 | 11 | int deleteByExample(OmsOrderSettingExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(OmsOrderSetting record); 16 | 17 | int insertSelective(OmsOrderSetting record); 18 | 19 | List selectByExample(OmsOrderSettingExample example); 20 | 21 | OmsOrderSetting selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") OmsOrderSetting record, @Param("example") OmsOrderSettingExample example); 24 | 25 | int updateByExample(@Param("record") OmsOrderSetting record, @Param("example") OmsOrderSettingExample example); 26 | 27 | int updateByPrimaryKeySelective(OmsOrderSetting record); 28 | 29 | int updateByPrimaryKey(OmsOrderSetting record); 30 | } -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/service/SmsFlashPromotionSessionService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.service; 2 | 3 | import com.macro.mall.dto.SmsFlashPromotionSessionDetail; 4 | import com.macro.mall.model.SmsFlashPromotionSession; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * 限时购场次管理Service 10 | * Created by macro on 2018/11/16. 11 | */ 12 | public interface SmsFlashPromotionSessionService { 13 | /** 14 | * 添加场次 15 | */ 16 | int create(SmsFlashPromotionSession promotionSession); 17 | 18 | /** 19 | * 修改场次 20 | */ 21 | int update(Long id, SmsFlashPromotionSession promotionSession); 22 | 23 | /** 24 | * 修改场次启用状态 25 | */ 26 | int updateStatus(Long id, Integer status); 27 | 28 | /** 29 | * 删除场次 30 | */ 31 | int delete(Long id); 32 | 33 | /** 34 | * 获取详情 35 | */ 36 | SmsFlashPromotionSession getItem(Long id); 37 | 38 | /** 39 | * 根据启用状态获取场次列表 40 | */ 41 | List list(); 42 | 43 | /** 44 | * 获取全部可选场次及其数量 45 | */ 46 | List selectList(Long flashPromotionId); 47 | } 48 | -------------------------------------------------------------------------------- /mall-gateway/src/main/java/com/macro/mall/config/GlobalCorsConfig.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.cors.CorsConfiguration; 6 | import org.springframework.web.cors.reactive.CorsWebFilter; 7 | import org.springframework.web.cors.reactive.UrlBasedCorsConfigurationSource; 8 | import org.springframework.web.util.pattern.PathPatternParser; 9 | 10 | /** 11 | * 全局跨域配置 12 | * 注意:前端从网关进行调用时需要配置 13 | * Created by macro on 2019/7/27. 14 | */ 15 | @Configuration 16 | public class GlobalCorsConfig { 17 | 18 | @Bean 19 | public CorsWebFilter corsFilter() { 20 | CorsConfiguration config = new CorsConfiguration(); 21 | config.addAllowedMethod("*"); 22 | config.addAllowedOrigin("*"); 23 | config.addAllowedHeader("*"); 24 | 25 | UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(new PathPatternParser()); 26 | source.registerCorsConfiguration("/**", config); 27 | 28 | return new CorsWebFilter(source); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/CmsTopicCategoryMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.CmsTopicCategory; 4 | import com.macro.mall.model.CmsTopicCategoryExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface CmsTopicCategoryMapper { 9 | long countByExample(CmsTopicCategoryExample example); 10 | 11 | int deleteByExample(CmsTopicCategoryExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(CmsTopicCategory record); 16 | 17 | int insertSelective(CmsTopicCategory record); 18 | 19 | List selectByExample(CmsTopicCategoryExample example); 20 | 21 | CmsTopicCategory selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") CmsTopicCategory record, @Param("example") CmsTopicCategoryExample example); 24 | 25 | int updateByExample(@Param("record") CmsTopicCategory record, @Param("example") CmsTopicCategoryExample example); 26 | 27 | int updateByPrimaryKeySelective(CmsTopicCategory record); 28 | 29 | int updateByPrimaryKey(CmsTopicCategory record); 30 | } -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/PmsCommentReplayMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.PmsCommentReplay; 4 | import com.macro.mall.model.PmsCommentReplayExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface PmsCommentReplayMapper { 9 | long countByExample(PmsCommentReplayExample example); 10 | 11 | int deleteByExample(PmsCommentReplayExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(PmsCommentReplay record); 16 | 17 | int insertSelective(PmsCommentReplay record); 18 | 19 | List selectByExample(PmsCommentReplayExample example); 20 | 21 | PmsCommentReplay selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") PmsCommentReplay record, @Param("example") PmsCommentReplayExample example); 24 | 25 | int updateByExample(@Param("record") PmsCommentReplay record, @Param("example") PmsCommentReplayExample example); 26 | 27 | int updateByPrimaryKeySelective(PmsCommentReplay record); 28 | 29 | int updateByPrimaryKey(PmsCommentReplay record); 30 | } -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/PmsProductLadderMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.PmsProductLadder; 4 | import com.macro.mall.model.PmsProductLadderExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface PmsProductLadderMapper { 9 | long countByExample(PmsProductLadderExample example); 10 | 11 | int deleteByExample(PmsProductLadderExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(PmsProductLadder record); 16 | 17 | int insertSelective(PmsProductLadder record); 18 | 19 | List selectByExample(PmsProductLadderExample example); 20 | 21 | PmsProductLadder selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") PmsProductLadder record, @Param("example") PmsProductLadderExample example); 24 | 25 | int updateByExample(@Param("record") PmsProductLadder record, @Param("example") PmsProductLadderExample example); 26 | 27 | int updateByPrimaryKeySelective(PmsProductLadder record); 28 | 29 | int updateByPrimaryKey(PmsProductLadder record); 30 | } -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/SmsCouponHistoryMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.SmsCouponHistory; 4 | import com.macro.mall.model.SmsCouponHistoryExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface SmsCouponHistoryMapper { 9 | long countByExample(SmsCouponHistoryExample example); 10 | 11 | int deleteByExample(SmsCouponHistoryExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(SmsCouponHistory record); 16 | 17 | int insertSelective(SmsCouponHistory record); 18 | 19 | List selectByExample(SmsCouponHistoryExample example); 20 | 21 | SmsCouponHistory selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") SmsCouponHistory record, @Param("example") SmsCouponHistoryExample example); 24 | 25 | int updateByExample(@Param("record") SmsCouponHistory record, @Param("example") SmsCouponHistoryExample example); 26 | 27 | int updateByPrimaryKeySelective(SmsCouponHistory record); 28 | 29 | int updateByPrimaryKey(SmsCouponHistory record); 30 | } -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/SmsHomeAdvertiseMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.SmsHomeAdvertise; 4 | import com.macro.mall.model.SmsHomeAdvertiseExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface SmsHomeAdvertiseMapper { 9 | long countByExample(SmsHomeAdvertiseExample example); 10 | 11 | int deleteByExample(SmsHomeAdvertiseExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(SmsHomeAdvertise record); 16 | 17 | int insertSelective(SmsHomeAdvertise record); 18 | 19 | List selectByExample(SmsHomeAdvertiseExample example); 20 | 21 | SmsHomeAdvertise selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") SmsHomeAdvertise record, @Param("example") SmsHomeAdvertiseExample example); 24 | 25 | int updateByExample(@Param("record") SmsHomeAdvertise record, @Param("example") SmsHomeAdvertiseExample example); 26 | 27 | int updateByPrimaryKeySelective(SmsHomeAdvertise record); 28 | 29 | int updateByPrimaryKey(SmsHomeAdvertise record); 30 | } -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/UmsAdminLoginLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.UmsAdminLoginLog; 4 | import com.macro.mall.model.UmsAdminLoginLogExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface UmsAdminLoginLogMapper { 9 | long countByExample(UmsAdminLoginLogExample example); 10 | 11 | int deleteByExample(UmsAdminLoginLogExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(UmsAdminLoginLog record); 16 | 17 | int insertSelective(UmsAdminLoginLog record); 18 | 19 | List selectByExample(UmsAdminLoginLogExample example); 20 | 21 | UmsAdminLoginLog selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") UmsAdminLoginLog record, @Param("example") UmsAdminLoginLogExample example); 24 | 25 | int updateByExample(@Param("record") UmsAdminLoginLog record, @Param("example") UmsAdminLoginLogExample example); 26 | 27 | int updateByPrimaryKeySelective(UmsAdminLoginLog record); 28 | 29 | int updateByPrimaryKey(UmsAdminLoginLog record); 30 | } -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/dto/OssCallbackParam.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.dto; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | 5 | /** 6 | * oss上传成功后的回调参数 7 | * Created by macro on 2018/5/17. 8 | */ 9 | public class OssCallbackParam { 10 | @ApiModelProperty("请求的回调地址") 11 | private String callbackUrl; 12 | @ApiModelProperty("回调是传入request中的参数") 13 | private String callbackBody; 14 | @ApiModelProperty("回调时传入参数的格式,比如表单提交形式") 15 | private String callbackBodyType; 16 | 17 | public String getCallbackUrl() { 18 | return callbackUrl; 19 | } 20 | 21 | public void setCallbackUrl(String callbackUrl) { 22 | this.callbackUrl = callbackUrl; 23 | } 24 | 25 | public String getCallbackBody() { 26 | return callbackBody; 27 | } 28 | 29 | public void setCallbackBody(String callbackBody) { 30 | this.callbackBody = callbackBody; 31 | } 32 | 33 | public String getCallbackBodyType() { 34 | return callbackBodyType; 35 | } 36 | 37 | public void setCallbackBodyType(String callbackBodyType) { 38 | this.callbackBodyType = callbackBodyType; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/config/MallSecurityConfig.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.config; 2 | 3 | import com.macro.mall.security.config.SecurityConfig; 4 | import com.macro.mall.service.UmsAdminService; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; 9 | import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; 10 | import org.springframework.security.core.userdetails.UserDetailsService; 11 | 12 | /** 13 | * mall-security模块相关配置 14 | * Created by macro on 2019/11/5. 15 | */ 16 | @Configuration 17 | @EnableWebSecurity 18 | @EnableGlobalMethodSecurity(prePostEnabled=true) 19 | public class MallSecurityConfig extends SecurityConfig { 20 | 21 | @Autowired 22 | private UmsAdminService adminService; 23 | 24 | @Bean 25 | public UserDetailsService userDetailsService() { 26 | //获取登录用户信息 27 | return username -> adminService.loadUserByUsername(username); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/CmsSubjectCommentMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.CmsSubjectComment; 4 | import com.macro.mall.model.CmsSubjectCommentExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface CmsSubjectCommentMapper { 9 | long countByExample(CmsSubjectCommentExample example); 10 | 11 | int deleteByExample(CmsSubjectCommentExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(CmsSubjectComment record); 16 | 17 | int insertSelective(CmsSubjectComment record); 18 | 19 | List selectByExample(CmsSubjectCommentExample example); 20 | 21 | CmsSubjectComment selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") CmsSubjectComment record, @Param("example") CmsSubjectCommentExample example); 24 | 25 | int updateByExample(@Param("record") CmsSubjectComment record, @Param("example") CmsSubjectCommentExample example); 26 | 27 | int updateByPrimaryKeySelective(CmsSubjectComment record); 28 | 29 | int updateByPrimaryKey(CmsSubjectComment record); 30 | } -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/OmsCompanyAddressMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.OmsCompanyAddress; 4 | import com.macro.mall.model.OmsCompanyAddressExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface OmsCompanyAddressMapper { 9 | long countByExample(OmsCompanyAddressExample example); 10 | 11 | int deleteByExample(OmsCompanyAddressExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(OmsCompanyAddress record); 16 | 17 | int insertSelective(OmsCompanyAddress record); 18 | 19 | List selectByExample(OmsCompanyAddressExample example); 20 | 21 | OmsCompanyAddress selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") OmsCompanyAddress record, @Param("example") OmsCompanyAddressExample example); 24 | 25 | int updateByExample(@Param("record") OmsCompanyAddress record, @Param("example") OmsCompanyAddressExample example); 26 | 27 | int updateByPrimaryKeySelective(OmsCompanyAddress record); 28 | 29 | int updateByPrimaryKey(OmsCompanyAddress record); 30 | } -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/PmsFeightTemplateMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.PmsFeightTemplate; 4 | import com.macro.mall.model.PmsFeightTemplateExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface PmsFeightTemplateMapper { 9 | long countByExample(PmsFeightTemplateExample example); 10 | 11 | int deleteByExample(PmsFeightTemplateExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(PmsFeightTemplate record); 16 | 17 | int insertSelective(PmsFeightTemplate record); 18 | 19 | List selectByExample(PmsFeightTemplateExample example); 20 | 21 | PmsFeightTemplate selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") PmsFeightTemplate record, @Param("example") PmsFeightTemplateExample example); 24 | 25 | int updateByExample(@Param("record") PmsFeightTemplate record, @Param("example") PmsFeightTemplateExample example); 26 | 27 | int updateByPrimaryKeySelective(PmsFeightTemplate record); 28 | 29 | int updateByPrimaryKey(PmsFeightTemplate record); 30 | } -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/SmsFlashPromotionMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.SmsFlashPromotion; 4 | import com.macro.mall.model.SmsFlashPromotionExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface SmsFlashPromotionMapper { 9 | long countByExample(SmsFlashPromotionExample example); 10 | 11 | int deleteByExample(SmsFlashPromotionExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(SmsFlashPromotion record); 16 | 17 | int insertSelective(SmsFlashPromotion record); 18 | 19 | List selectByExample(SmsFlashPromotionExample example); 20 | 21 | SmsFlashPromotion selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") SmsFlashPromotion record, @Param("example") SmsFlashPromotionExample example); 24 | 25 | int updateByExample(@Param("record") SmsFlashPromotion record, @Param("example") SmsFlashPromotionExample example); 26 | 27 | int updateByPrimaryKeySelective(SmsFlashPromotion record); 28 | 29 | int updateByPrimaryKey(SmsFlashPromotion record); 30 | } -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/SmsHomeNewProductMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.SmsHomeNewProduct; 4 | import com.macro.mall.model.SmsHomeNewProductExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface SmsHomeNewProductMapper { 9 | long countByExample(SmsHomeNewProductExample example); 10 | 11 | int deleteByExample(SmsHomeNewProductExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(SmsHomeNewProduct record); 16 | 17 | int insertSelective(SmsHomeNewProduct record); 18 | 19 | List selectByExample(SmsHomeNewProductExample example); 20 | 21 | SmsHomeNewProduct selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") SmsHomeNewProduct record, @Param("example") SmsHomeNewProductExample example); 24 | 25 | int updateByExample(@Param("record") SmsHomeNewProduct record, @Param("example") SmsHomeNewProductExample example); 26 | 27 | int updateByPrimaryKeySelective(SmsHomeNewProduct record); 28 | 29 | int updateByPrimaryKey(SmsHomeNewProduct record); 30 | } -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/UmsMemberLoginLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.UmsMemberLoginLog; 4 | import com.macro.mall.model.UmsMemberLoginLogExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface UmsMemberLoginLogMapper { 9 | long countByExample(UmsMemberLoginLogExample example); 10 | 11 | int deleteByExample(UmsMemberLoginLogExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(UmsMemberLoginLog record); 16 | 17 | int insertSelective(UmsMemberLoginLog record); 18 | 19 | List selectByExample(UmsMemberLoginLogExample example); 20 | 21 | UmsMemberLoginLog selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") UmsMemberLoginLog record, @Param("example") UmsMemberLoginLogExample example); 24 | 25 | int updateByExample(@Param("record") UmsMemberLoginLog record, @Param("example") UmsMemberLoginLogExample example); 26 | 27 | int updateByPrimaryKeySelective(UmsMemberLoginLog record); 28 | 29 | int updateByPrimaryKey(UmsMemberLoginLog record); 30 | } -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/component/OrderTimeOutCancelTask.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.component; 2 | 3 | import com.macro.mall.common.api.CommonResult; 4 | import com.macro.mall.portal.service.OmsPortalOrderService; 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.scheduling.annotation.Scheduled; 9 | import org.springframework.stereotype.Component; 10 | 11 | /** 12 | * Created by macro on 2018/8/24. 13 | * 订单超时取消并解锁库存的定时器 14 | */ 15 | //@Component 16 | public class OrderTimeOutCancelTask { 17 | private Logger LOGGER =LoggerFactory.getLogger(OrderTimeOutCancelTask.class); 18 | @Autowired 19 | private OmsPortalOrderService portalOrderService; 20 | 21 | /** 22 | * cron表达式:Seconds Minutes Hours DayofMonth Month DayofWeek [Year] 23 | * 每10分钟扫描一次,扫描设定超时时间之前下的订单,如果没支付则取消该订单 24 | */ 25 | @Scheduled(cron = "0 0/10 * ? * ?") 26 | private void cancelTimeOutOrder(){ 27 | CommonResult result = portalOrderService.cancelTimeOutOrder(); 28 | LOGGER.info("取消订单,并根据sku编号释放锁定库存:{}",result); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/service/OmsPortalOrderService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.service; 2 | 3 | import com.macro.mall.common.api.CommonResult; 4 | import com.macro.mall.portal.domain.ConfirmOrderResult; 5 | import com.macro.mall.portal.domain.OrderParam; 6 | import org.springframework.transaction.annotation.Transactional; 7 | 8 | /** 9 | * 前台订单管理Service 10 | * Created by macro on 2018/8/30. 11 | */ 12 | public interface OmsPortalOrderService { 13 | /** 14 | * 根据用户购物车信息生成确认单信息 15 | */ 16 | ConfirmOrderResult generateConfirmOrder(); 17 | 18 | /** 19 | * 根据提交信息生成订单 20 | */ 21 | @Transactional 22 | CommonResult generateOrder(OrderParam orderParam); 23 | 24 | /** 25 | * 支付成功后的回调 26 | */ 27 | @Transactional 28 | CommonResult paySuccess(Long orderId); 29 | 30 | /** 31 | * 自动取消超时订单 32 | */ 33 | @Transactional 34 | CommonResult cancelTimeOutOrder(); 35 | 36 | /** 37 | * 取消单个超时订单 38 | */ 39 | @Transactional 40 | void cancelOrder(Long orderId); 41 | 42 | /** 43 | * 发送延迟消息取消订单 44 | */ 45 | void sendDelayMessageCancelOrder(Long orderId); 46 | } 47 | -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/CmsSubjectCategoryMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.CmsSubjectCategory; 4 | import com.macro.mall.model.CmsSubjectCategoryExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface CmsSubjectCategoryMapper { 9 | long countByExample(CmsSubjectCategoryExample example); 10 | 11 | int deleteByExample(CmsSubjectCategoryExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(CmsSubjectCategory record); 16 | 17 | int insertSelective(CmsSubjectCategory record); 18 | 19 | List selectByExample(CmsSubjectCategoryExample example); 20 | 21 | CmsSubjectCategory selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") CmsSubjectCategory record, @Param("example") CmsSubjectCategoryExample example); 24 | 25 | int updateByExample(@Param("record") CmsSubjectCategory record, @Param("example") CmsSubjectCategoryExample example); 26 | 27 | int updateByPrimaryKeySelective(CmsSubjectCategory record); 28 | 29 | int updateByPrimaryKey(CmsSubjectCategory record); 30 | } -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/config/MallSecurityConfig.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.config; 2 | 3 | import com.macro.mall.portal.service.UmsMemberService; 4 | import com.macro.mall.security.config.SecurityConfig; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; 9 | import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; 10 | import org.springframework.security.core.userdetails.UserDetailsService; 11 | 12 | /** 13 | * mall-security模块相关配置 14 | * Created by macro on 2019/11/5. 15 | */ 16 | @Configuration 17 | @EnableWebSecurity 18 | @EnableGlobalMethodSecurity(prePostEnabled=true) 19 | public class MallSecurityConfig extends SecurityConfig { 20 | 21 | @Autowired 22 | private UmsMemberService memberService; 23 | 24 | @Bean 25 | public UserDetailsService userDetailsService() { 26 | //获取登录用户信息 27 | return username -> memberService.loadUserByUsername(username); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/OmsOrderReturnApplyMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.OmsOrderReturnApply; 4 | import com.macro.mall.model.OmsOrderReturnApplyExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface OmsOrderReturnApplyMapper { 9 | long countByExample(OmsOrderReturnApplyExample example); 10 | 11 | int deleteByExample(OmsOrderReturnApplyExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(OmsOrderReturnApply record); 16 | 17 | int insertSelective(OmsOrderReturnApply record); 18 | 19 | List selectByExample(OmsOrderReturnApplyExample example); 20 | 21 | OmsOrderReturnApply selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") OmsOrderReturnApply record, @Param("example") OmsOrderReturnApplyExample example); 24 | 25 | int updateByExample(@Param("record") OmsOrderReturnApply record, @Param("example") OmsOrderReturnApplyExample example); 26 | 27 | int updateByPrimaryKeySelective(OmsOrderReturnApply record); 28 | 29 | int updateByPrimaryKey(OmsOrderReturnApply record); 30 | } -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/PmsProductAttributeMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.PmsProductAttribute; 4 | import com.macro.mall.model.PmsProductAttributeExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface PmsProductAttributeMapper { 9 | long countByExample(PmsProductAttributeExample example); 10 | 11 | int deleteByExample(PmsProductAttributeExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(PmsProductAttribute record); 16 | 17 | int insertSelective(PmsProductAttribute record); 18 | 19 | List selectByExample(PmsProductAttributeExample example); 20 | 21 | PmsProductAttribute selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") PmsProductAttribute record, @Param("example") PmsProductAttributeExample example); 24 | 25 | int updateByExample(@Param("record") PmsProductAttribute record, @Param("example") PmsProductAttributeExample example); 26 | 27 | int updateByPrimaryKeySelective(PmsProductAttribute record); 28 | 29 | int updateByPrimaryKey(PmsProductAttribute record); 30 | } -------------------------------------------------------------------------------- /mall-portal/src/test/java/com/macro/mall/portal/PortalProductDaoTests.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal; 2 | 3 | import com.macro.mall.portal.dao.PortalProductDao; 4 | import com.macro.mall.portal.domain.PromotionProduct; 5 | import org.junit.Assert; 6 | import org.junit.Test; 7 | import org.junit.runner.RunWith; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.boot.test.context.SpringBootTest; 10 | import org.springframework.test.context.junit4.SpringRunner; 11 | 12 | import java.util.ArrayList; 13 | import java.util.List; 14 | 15 | /** 16 | * Created by macro on 2018/8/27. 17 | * 前台商品查询逻辑单元测试 18 | */ 19 | @RunWith(SpringRunner.class) 20 | @SpringBootTest 21 | public class PortalProductDaoTests { 22 | @Autowired 23 | private PortalProductDao portalProductDao; 24 | @Test 25 | public void testGetPromotionProductList(){ 26 | List ids = new ArrayList<>(); 27 | ids.add(26L); 28 | ids.add(27L); 29 | ids.add(28L); 30 | ids.add(29L); 31 | List promotionProductList = portalProductDao.getPromotionProductList(ids); 32 | Assert.assertEquals(4,promotionProductList.size()); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/config/GlobalCorsConfig.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.cors.CorsConfiguration; 6 | import org.springframework.web.cors.UrlBasedCorsConfigurationSource; 7 | import org.springframework.web.filter.CorsFilter; 8 | 9 | /** 10 | * 全局跨域配置 11 | * 注意:前端从网关进行调用时不需要配置 12 | * Created by macro on 2019/7/27. 13 | */ 14 | //@Configuration 15 | public class GlobalCorsConfig { 16 | 17 | /** 18 | * 允许跨域调用的过滤器 19 | */ 20 | @Bean 21 | public CorsFilter corsFilter() { 22 | CorsConfiguration config = new CorsConfiguration(); 23 | //允许所有域名进行跨域调用 24 | config.addAllowedOrigin("*"); 25 | //允许跨越发送cookie 26 | config.setAllowCredentials(true); 27 | //放行全部原始头信息 28 | config.addAllowedHeader("*"); 29 | //允许所有请求方法跨域调用 30 | config.addAllowedMethod("*"); 31 | UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); 32 | source.registerCorsConfiguration("/**", config); 33 | return new CorsFilter(source); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /mall-security/src/main/java/com/macro/mall/security/component/RestAuthenticationEntryPoint.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.security.component; 2 | 3 | import cn.hutool.json.JSONUtil; 4 | import com.macro.mall.common.api.CommonResult; 5 | import org.springframework.security.core.AuthenticationException; 6 | import org.springframework.security.web.AuthenticationEntryPoint; 7 | import org.springframework.stereotype.Component; 8 | 9 | import javax.servlet.ServletException; 10 | import javax.servlet.http.HttpServletRequest; 11 | import javax.servlet.http.HttpServletResponse; 12 | import java.io.IOException; 13 | 14 | /** 15 | * 自定义返回结果:未登录或登录过期 16 | * Created by macro on 2018/5/14. 17 | */ 18 | public class RestAuthenticationEntryPoint implements AuthenticationEntryPoint { 19 | @Override 20 | public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException { 21 | response.setCharacterEncoding("UTF-8"); 22 | response.setContentType("application/json"); 23 | response.getWriter().println(JSONUtil.parse(CommonResult.unauthorized(authException.getMessage()))); 24 | response.getWriter().flush(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/OmsOrderReturnReasonMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.OmsOrderReturnReason; 4 | import com.macro.mall.model.OmsOrderReturnReasonExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface OmsOrderReturnReasonMapper { 9 | long countByExample(OmsOrderReturnReasonExample example); 10 | 11 | int deleteByExample(OmsOrderReturnReasonExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(OmsOrderReturnReason record); 16 | 17 | int insertSelective(OmsOrderReturnReason record); 18 | 19 | List selectByExample(OmsOrderReturnReasonExample example); 20 | 21 | OmsOrderReturnReason selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") OmsOrderReturnReason record, @Param("example") OmsOrderReturnReasonExample example); 24 | 25 | int updateByExample(@Param("record") OmsOrderReturnReason record, @Param("example") OmsOrderReturnReasonExample example); 26 | 27 | int updateByPrimaryKeySelective(OmsOrderReturnReason record); 28 | 29 | int updateByPrimaryKey(OmsOrderReturnReason record); 30 | } -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/PmsProductOperateLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.PmsProductOperateLog; 4 | import com.macro.mall.model.PmsProductOperateLogExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface PmsProductOperateLogMapper { 9 | long countByExample(PmsProductOperateLogExample example); 10 | 11 | int deleteByExample(PmsProductOperateLogExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(PmsProductOperateLog record); 16 | 17 | int insertSelective(PmsProductOperateLog record); 18 | 19 | List selectByExample(PmsProductOperateLogExample example); 20 | 21 | PmsProductOperateLog selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") PmsProductOperateLog record, @Param("example") PmsProductOperateLogExample example); 24 | 25 | int updateByExample(@Param("record") PmsProductOperateLog record, @Param("example") PmsProductOperateLogExample example); 26 | 27 | int updateByPrimaryKeySelective(PmsProductOperateLog record); 28 | 29 | int updateByPrimaryKey(PmsProductOperateLog record); 30 | } -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/UmsAdminRoleRelationMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.UmsAdminRoleRelation; 4 | import com.macro.mall.model.UmsAdminRoleRelationExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface UmsAdminRoleRelationMapper { 9 | long countByExample(UmsAdminRoleRelationExample example); 10 | 11 | int deleteByExample(UmsAdminRoleRelationExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(UmsAdminRoleRelation record); 16 | 17 | int insertSelective(UmsAdminRoleRelation record); 18 | 19 | List selectByExample(UmsAdminRoleRelationExample example); 20 | 21 | UmsAdminRoleRelation selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") UmsAdminRoleRelation record, @Param("example") UmsAdminRoleRelationExample example); 24 | 25 | int updateByExample(@Param("record") UmsAdminRoleRelation record, @Param("example") UmsAdminRoleRelationExample example); 26 | 27 | int updateByPrimaryKeySelective(UmsAdminRoleRelation record); 28 | 29 | int updateByPrimaryKey(UmsAdminRoleRelation record); 30 | } -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/UmsMemberRuleSettingMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.UmsMemberRuleSetting; 4 | import com.macro.mall.model.UmsMemberRuleSettingExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface UmsMemberRuleSettingMapper { 9 | long countByExample(UmsMemberRuleSettingExample example); 10 | 11 | int deleteByExample(UmsMemberRuleSettingExample example); 12 | 13 | int deleteByPrimaryKey(Long id); 14 | 15 | int insert(UmsMemberRuleSetting record); 16 | 17 | int insertSelective(UmsMemberRuleSetting record); 18 | 19 | List selectByExample(UmsMemberRuleSettingExample example); 20 | 21 | UmsMemberRuleSetting selectByPrimaryKey(Long id); 22 | 23 | int updateByExampleSelective(@Param("record") UmsMemberRuleSetting record, @Param("example") UmsMemberRuleSettingExample example); 24 | 25 | int updateByExample(@Param("record") UmsMemberRuleSetting record, @Param("example") UmsMemberRuleSettingExample example); 26 | 27 | int updateByPrimaryKeySelective(UmsMemberRuleSetting record); 28 | 29 | int updateByPrimaryKey(UmsMemberRuleSetting record); 30 | } -------------------------------------------------------------------------------- /mall-mbg/src/main/java/com/macro/mall/mapper/SmsFlashPromotionLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.mapper; 2 | 3 | import com.macro.mall.model.SmsFlashPromotionLog; 4 | import com.macro.mall.model.SmsFlashPromotionLogExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface SmsFlashPromotionLogMapper { 9 | long countByExample(SmsFlashPromotionLogExample example); 10 | 11 | int deleteByExample(SmsFlashPromotionLogExample example); 12 | 13 | int deleteByPrimaryKey(Integer id); 14 | 15 | int insert(SmsFlashPromotionLog record); 16 | 17 | int insertSelective(SmsFlashPromotionLog record); 18 | 19 | List selectByExample(SmsFlashPromotionLogExample example); 20 | 21 | SmsFlashPromotionLog selectByPrimaryKey(Integer id); 22 | 23 | int updateByExampleSelective(@Param("record") SmsFlashPromotionLog record, @Param("example") SmsFlashPromotionLogExample example); 24 | 25 | int updateByExample(@Param("record") SmsFlashPromotionLog record, @Param("example") SmsFlashPromotionLogExample example); 26 | 27 | int updateByPrimaryKeySelective(SmsFlashPromotionLog record); 28 | 29 | int updateByPrimaryKey(SmsFlashPromotionLog record); 30 | } -------------------------------------------------------------------------------- /mall-security/src/main/java/com/macro/mall/security/component/RestfulAccessDeniedHandler.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.security.component; 2 | 3 | import cn.hutool.json.JSONUtil; 4 | import com.macro.mall.common.api.CommonResult; 5 | import org.springframework.security.access.AccessDeniedException; 6 | import org.springframework.security.web.access.AccessDeniedHandler; 7 | import org.springframework.stereotype.Component; 8 | 9 | import javax.servlet.ServletException; 10 | import javax.servlet.http.HttpServletRequest; 11 | import javax.servlet.http.HttpServletResponse; 12 | import java.io.IOException; 13 | 14 | /** 15 | * 自定义返回结果:没有权限访问时 16 | * Created by macro on 2018/4/26. 17 | */ 18 | public class RestfulAccessDeniedHandler implements AccessDeniedHandler{ 19 | @Override 20 | public void handle(HttpServletRequest request, 21 | HttpServletResponse response, 22 | AccessDeniedException e) throws IOException, ServletException { 23 | response.setCharacterEncoding("UTF-8"); 24 | response.setContentType("application/json"); 25 | response.getWriter().println(JSONUtil.parse(CommonResult.forbidden(e.getMessage()))); 26 | response.getWriter().flush(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /mall-admin/src/main/java/com/macro/mall/service/PmsProductCategoryService.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.service; 2 | 3 | import com.macro.mall.dto.PmsProductCategoryParam; 4 | import com.macro.mall.dto.PmsProductCategoryWithChildrenItem; 5 | import com.macro.mall.model.PmsProductCategory; 6 | import org.springframework.transaction.annotation.Isolation; 7 | import org.springframework.transaction.annotation.Propagation; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * 产品分类Service 14 | * Created by macro on 2018/4/26. 15 | */ 16 | public interface PmsProductCategoryService { 17 | @Transactional 18 | int create(PmsProductCategoryParam pmsProductCategoryParam); 19 | 20 | @Transactional 21 | int update(Long id, PmsProductCategoryParam pmsProductCategoryParam); 22 | 23 | List getList(Long parentId, Integer pageSize, Integer pageNum); 24 | 25 | int delete(Long id); 26 | 27 | PmsProductCategory getItem(Long id); 28 | 29 | int updateNavStatus(List ids, Integer navStatus); 30 | 31 | int updateShowStatus(List ids, Integer showStatus); 32 | 33 | List listWithChildren(); 34 | } 35 | -------------------------------------------------------------------------------- /mall-portal/src/main/java/com/macro/mall/portal/service/impl/OmsPortalOrderReturnApplyServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.macro.mall.portal.service.impl; 2 | 3 | import com.macro.mall.mapper.OmsOrderReturnApplyMapper; 4 | import com.macro.mall.model.OmsOrderReturnApply; 5 | import com.macro.mall.portal.domain.OmsOrderReturnApplyParam; 6 | import com.macro.mall.portal.service.OmsPortalOrderReturnApplyService; 7 | import org.springframework.beans.BeanUtils; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.Date; 12 | 13 | /** 14 | * 订单退货管理Service实现类 15 | * Created by macro on 2018/10/17. 16 | */ 17 | @Service 18 | public class OmsPortalOrderReturnApplyServiceImpl implements OmsPortalOrderReturnApplyService { 19 | @Autowired 20 | private OmsOrderReturnApplyMapper returnApplyMapper; 21 | @Override 22 | public int create(OmsOrderReturnApplyParam returnApply) { 23 | OmsOrderReturnApply realApply = new OmsOrderReturnApply(); 24 | BeanUtils.copyProperties(returnApply,realApply); 25 | realApply.setCreateTime(new Date()); 26 | realApply.setStatus(0); 27 | return returnApplyMapper.insert(realApply); 28 | } 29 | } 30 | --------------------------------------------------------------------------------