├── logistics
├── src
│ ├── main
│ │ ├── resources
│ │ │ └── logistics_views
│ │ │ │ ├── h22.sql
│ │ │ │ ├── mysql2.sql
│ │ │ │ ├── h20.sql
│ │ │ │ ├── mysql1.sql
│ │ │ │ └── mysql0.sql
│ │ └── java
│ │ │ └── me
│ │ │ └── jiangcai
│ │ │ └── logistics
│ │ │ ├── LogisticsDestination.java
│ │ │ ├── LogisticsSource.java
│ │ │ ├── exception
│ │ │ ├── StockOverrideException.java
│ │ │ ├── SupplierException.java
│ │ │ └── UnnecessaryShipException.java
│ │ │ ├── entity
│ │ │ ├── support
│ │ │ │ ├── PropertyType.java
│ │ │ │ ├── ProductStatus.java
│ │ │ │ ├── ShiftType.java
│ │ │ │ ├── ProductBatch.java
│ │ │ │ ├── StockInfo.java
│ │ │ │ └── ShiftStatus.java
│ │ │ ├── package-info.java
│ │ │ ├── ManuallyOrder.java
│ │ │ ├── UsageStock.java
│ │ │ └── UnSettlementUsageStock.java
│ │ │ ├── option
│ │ │ └── LogisticsOptions.java
│ │ │ ├── ProductTypeService.java
│ │ │ ├── supplier
│ │ │ └── ManuallySupplier.java
│ │ │ ├── repository
│ │ │ ├── DepotRepository.java
│ │ │ ├── ProductRepository.java
│ │ │ ├── StockShiftUnitRepository.java
│ │ │ ├── StockSettlementRepository.java
│ │ │ ├── UsageStockRepository.java
│ │ │ ├── PropertyNameRepository.java
│ │ │ ├── ProductTypeRepository.java
│ │ │ └── PropertyValueRepository.java
│ │ │ ├── PersistingReadable.java
│ │ │ ├── Thing.java
│ │ │ ├── event
│ │ │ ├── OrderDeliveredEvent.java
│ │ │ ├── OrderInstalledEvent.java
│ │ │ ├── InstallationEvent.java
│ │ │ └── ShiftEvent.java
│ │ │ ├── repository_util
│ │ │ ├── AbstractStockShiftUnitRepository.java
│ │ │ ├── AbstractDepotRepository.java
│ │ │ ├── AbstractStockSettlementRepository.java
│ │ │ └── AbstractProductRepository.java
│ │ │ ├── LogisticsHostService.java
│ │ │ ├── model
│ │ │ └── DeliverableOrderId.java
│ │ │ ├── service
│ │ │ └── ProductTypeServiceImpl.java
│ │ │ ├── LogisticsConfig.java
│ │ │ └── LogisticsSupplier.java
│ └── share
│ │ └── java
│ │ └── me
│ │ └── jiangcai
│ │ └── logistics
│ │ └── demo
│ │ ├── package-info.java
│ │ ├── DemoSupplier.java
│ │ ├── service
│ │ └── DemoSupplierImpl.java
│ │ └── LogisticsEventCatch.java
└── README.md
├── core-service
└── src
│ ├── test
│ ├── resources
│ │ └── mock
│ │ │ ├── mobileValidation.json
│ │ │ ├── mobileValidation2.json
│ │ │ ├── webUploader.json
│ │ │ └── searchLogin.json
│ └── java
│ │ └── cn
│ │ └── lmjia
│ │ └── market
│ │ └── core
│ │ ├── entity
│ │ ├── OneForElement.java
│ │ ├── SubEntity.java
│ │ ├── OneForEntity.java
│ │ ├── SuperEntity.java
│ │ ├── JpaElementSelect_.java
│ │ ├── JpaElementSelect.java
│ │ └── SubEntityTest.java
│ │ ├── CoreWebTest.java
│ │ ├── define
│ │ └── MoneyTest.java
│ │ ├── service
│ │ ├── InitServiceTest.java
│ │ └── QRCodeServiceTest.java
│ │ ├── controller
│ │ └── ResourceControllerTest.java
│ │ └── test
│ │ └── MainGoodsAndAmountsTestController.java
│ ├── share
│ ├── resources
│ │ ├── mock
│ │ │ └── trj_response.json
│ │ ├── images
│ │ │ └── logo.png
│ │ └── test_wx.properties
│ └── java
│ │ └── cn
│ │ └── lmjia
│ │ └── market
│ │ └── core
│ │ ├── MockSetting.java
│ │ ├── MarketBuildInLogisticsSupplier.java
│ │ └── test
│ │ ├── TestController.java
│ │ ├── MarketBuildInLogisticsSupplierImpl.java
│ │ └── QuickPayBean.java
│ └── main
│ ├── resources
│ ├── defaultPropertyNameValues.properties
│ ├── LoginAgentLevel.h2.sql
│ ├── defaultSystem.properties
│ ├── defaultProducts.properties
│ ├── defaultProductTypes.properties
│ ├── LoginAgentLevel.mysql.sql
│ ├── script
│ │ └── auto-recall.js
│ ├── AgentGoodAdvancePaymentJournal.h2.sql
│ └── AgentGoodAdvancePaymentJournal.mysql.sql
│ └── java
│ └── cn
│ └── lmjia
│ └── market
│ └── core
│ ├── trj
│ ├── package-info.java
│ ├── InvalidAuthorisingException.java
│ └── TRJEnhanceConfig.java
│ ├── util
│ ├── package-info.java
│ ├── CommissionSource.java
│ ├── AbstractLoginRepository.java
│ ├── AbstractTemplateMessageStyle.java
│ └── TimeUtil.java
│ ├── aop
│ ├── package-info.java
│ ├── BusinessLocker.java
│ ├── MultipleBusinessLocker.java
│ ├── MultiBusinessSafe.java
│ └── BusinessSafe.java
│ ├── entity
│ ├── financing
│ │ ├── package-info.java
│ │ ├── AgentGoodPaymentRecord.java
│ │ ├── AgentIncomeRecord.java
│ │ ├── AgentFeeRecord.java
│ │ ├── OutgoRecord.java
│ │ └── IncomeRecord.java
│ ├── support
│ │ ├── PromotionRequestStatus.java
│ │ ├── TagType.java
│ │ ├── PaymentStatus.java
│ │ ├── CommissionType.java
│ │ ├── WithdrawStatus.java
│ │ └── OrderStatus.java
│ ├── settlement
│ │ ├── CommissionJournalType.java
│ │ └── AgentGoodAdvancePaymentJournalType.java
│ ├── channel
│ │ └── InstallmentChannel.java
│ ├── trj
│ │ ├── AuthorisingStatus.java
│ │ └── TRJPayOrder.java
│ ├── deal
│ │ ├── AgentRate.java
│ │ └── pk
│ │ │ └── OrderCommissionPK.java
│ └── record
│ │ └── ProductAmountRecord.java
│ ├── controller
│ ├── main
│ │ └── order
│ │ │ ├── package-info.java
│ │ │ └── AbstractMainOrderController.java
│ └── equipment
│ │ └── EquipmentDataController.java
│ ├── converter
│ ├── GenderConverter.java
│ ├── ManageLevelConverter.java
│ ├── OrderStatusConverter.java
│ ├── WithdrawStatusConverter.java
│ └── LocalDateConverter.java
│ ├── repository
│ ├── LoginRepository.java
│ ├── ManagerRepository.java
│ ├── MainProductRepository.java
│ ├── PayOrderRepository.java
│ ├── deal
│ │ ├── AgentSystemRepository.java
│ │ ├── AgentLevelRepository.java
│ │ ├── CommissionRepository.java
│ │ ├── OrderCommissionRepository.java
│ │ └── SalesAchievementRepository.java
│ ├── ScriptTaskRepository.java
│ ├── channel
│ │ └── ChannelRepository.java
│ ├── financing
│ │ ├── AgentFeeRecordRepository.java
│ │ ├── AgentGoodPaymentRecordRepository.java
│ │ └── AgentGoodAdvancePaymentRepository.java
│ ├── trj
│ │ └── AuthorisingInfoRepository.java
│ ├── FactoryRepository.java
│ ├── order
│ │ └── AgentPrepaymentOrderRepository.java
│ ├── MainOrderRepository.java
│ ├── WithdrawRequestRepository.java
│ ├── settlement
│ │ ├── AgentGoodAdvancePaymentJournalRepository.java
│ │ └── LoginCommissionJournalRepository.java
│ ├── help
│ │ └── CommonProblemRepository.java
│ ├── ContactWayRepository.java
│ ├── MainGoodRepository.java
│ ├── TagRepository.java
│ ├── request
│ │ └── PromotionRequestRepository.java
│ └── CustomerRepository.java
│ ├── service
│ ├── CommissionDetailService.java
│ ├── WechatNoticeHelper.java
│ ├── QuickTradeService.java
│ ├── ManagerService.java
│ ├── TagService.java
│ ├── impl
│ │ └── ManagerServiceImpl.java
│ ├── QRCodeService.java
│ ├── NoticeService.java
│ ├── AgentPrepaymentOrderService.java
│ └── help
│ │ └── CommonProblemService.java
│ ├── event
│ ├── MainDeliverableOrderDeliveryRequired.java
│ ├── MainOrderDeliveredEvent.java
│ ├── LoginRelationChangedEvent.java
│ └── MainOrderFinishEvent.java
│ ├── rows
│ └── AbstractRows.java
│ ├── model
│ ├── TimeLineUnit.java
│ └── ApiResult.java
│ ├── define
│ ├── MarketUserNoticeType.java
│ ├── Money.java
│ └── Journal.java
│ ├── Version.java
│ └── exception
│ ├── GoodAdvancePaymentBalanceNotEnoughException.java
│ └── MainGoodLimitStockException.java
├── web
└── src
│ ├── main
│ ├── webapp
│ │ ├── MP_verify_QATriWIDSEMj0mk9.txt
│ │ ├── MP_verify_YnFyAW9FUGK2XuIP.txt
│ │ ├── assets
│ │ │ ├── images
│ │ │ │ ├── 404.png
│ │ │ │ ├── 500.png
│ │ │ │ └── repair.png
│ │ │ └── css
│ │ │ │ └── error.css
│ │ ├── WEB-INF
│ │ │ └── web.xml
│ │ ├── 404.html
│ │ ├── 500.html
│ │ └── error
│ │ │ └── systemMaintain.html
│ └── java
│ │ └── cn
│ │ └── lmjia
│ │ └── market
│ │ └── web
│ │ ├── config
│ │ ├── RuntimeConfig.java
│ │ ├── SecurityWebApplicationInitializer.java
│ │ ├── WebConfig.java
│ │ └── DispatcherServletInitializer.java
│ │ └── controller
│ │ └── WelcomeController.java
│ └── test
│ ├── resources
│ └── local_aliyun.properties
│ └── java
│ └── cn
│ └── lmjia
│ └── market
│ └── web
│ ├── WorkTest.java
│ ├── controller
│ └── WebTest.java
│ └── page
│ └── WebLoginPage.java
├── dealer
└── src
│ ├── main
│ ├── resources
│ │ ├── functions
│ │ │ ├── agentLevel_0.mysql.sql
│ │ │ ├── agentBelongs_0.mysql.sql
│ │ │ ├── loginBelongs_0.mysql.sql
│ │ │ ├── customers.h2.sql
│ │ │ ├── agentLevel.h2.sql
│ │ │ ├── agentBelongs.h2.sql
│ │ │ ├── loginBelongs.h2.sql
│ │ │ ├── loginBelongs_1.mysql.sql
│ │ │ └── agentBelongs_1.mysql.sql
│ │ ├── README.md
│ │ └── dealer-view
│ │ │ ├── dealer-resource
│ │ │ ├── images
│ │ │ │ ├── logo.png
│ │ │ │ ├── yyzz.jpg
│ │ │ │ └── id-card.png
│ │ │ └── js
│ │ │ │ ├── repairDetail.js
│ │ │ │ └── refundOperate.js
│ │ │ └── mock
│ │ │ ├── commDataNew.json
│ │ │ └── agentList.json
│ └── java
│ │ └── cn
│ │ └── lmjia
│ │ └── market
│ │ └── dealer
│ │ ├── entity
│ │ └── package-info.java
│ │ ├── repository
│ │ └── package-info.java
│ │ ├── mvc
│ │ └── HighestAgent.java
│ │ └── service
│ │ └── CommissionSettlementService.java
│ ├── test
│ └── java
│ │ └── cn
│ │ └── lmjia
│ │ └── market
│ │ ├── core
│ │ ├── B.java
│ │ └── service
│ │ │ └── MainOrderServiceTest.java
│ │ └── dealer
│ │ └── controller
│ │ └── commission
│ │ └── CommissionControllerTest.java
│ └── share
│ └── java
│ └── cn
│ └── lmjia
│ └── market
│ └── dealer
│ └── page
│ ├── AgentPlaceOrderPage.java
│ ├── AgentDetailPage.java
│ └── AgentOrderManagePage.java
├── .travis.yml
├── hosts
├── wechat-service
└── src
│ ├── main
│ ├── resources
│ │ ├── wechat-resource
│ │ │ └── assets
│ │ │ │ ├── img
│ │ │ │ ├── 404.png
│ │ │ │ ├── 500.png
│ │ │ │ ├── empty.png
│ │ │ │ ├── none.png
│ │ │ │ ├── open.png
│ │ │ │ ├── team.jpg
│ │ │ │ ├── temp.png
│ │ │ │ ├── avatar.jpg
│ │ │ │ ├── reject.png
│ │ │ │ ├── repair.png
│ │ │ │ ├── mall
│ │ │ │ │ ├── cart.png
│ │ │ │ │ └── jd-sprites.png
│ │ │ │ ├── poster-1.jpg
│ │ │ │ ├── poster-2.jpg
│ │ │ │ ├── sold-out.png
│ │ │ │ └── agreement
│ │ │ │ │ ├── city
│ │ │ │ │ ├── 0001.jpg
│ │ │ │ │ ├── 0002.jpg
│ │ │ │ │ ├── 0003.jpg
│ │ │ │ │ ├── 0004.jpg
│ │ │ │ │ ├── 0005.jpg
│ │ │ │ │ └── 0006.jpg
│ │ │ │ │ ├── dealer
│ │ │ │ │ ├── 0001.jpg
│ │ │ │ │ ├── 0002.jpg
│ │ │ │ │ ├── 0003.jpg
│ │ │ │ │ ├── 0004.jpg
│ │ │ │ │ ├── 0005.jpg
│ │ │ │ │ └── 0006.jpg
│ │ │ │ │ └── district
│ │ │ │ │ ├── 0001.jpg
│ │ │ │ │ ├── 0002.jpg
│ │ │ │ │ ├── 0003.jpg
│ │ │ │ │ ├── 0004.jpg
│ │ │ │ │ ├── 0005.jpg
│ │ │ │ │ └── 0006.jpg
│ │ │ │ ├── js
│ │ │ │ ├── isWechat.js
│ │ │ │ ├── mall
│ │ │ │ │ ├── index.js
│ │ │ │ │ └── storage.js
│ │ │ │ └── pay.js
│ │ │ │ └── css
│ │ │ │ └── error.css
│ │ ├── mock
│ │ │ ├── extend.js
│ │ │ └── mall.js
│ │ └── wechat-view
│ │ │ ├── error
│ │ │ ├── systemMaintain.html
│ │ │ ├── 404.html
│ │ │ └── 500.html
│ │ │ └── fragments
│ │ │ └── share.html
│ └── java
│ │ └── cn
│ │ └── lmjia
│ │ └── market
│ │ └── wechat
│ │ ├── service
│ │ ├── WechatLoginService.java
│ │ └── WechatService.java
│ │ └── repository
│ │ └── LimitQRCodeRepository.java
│ └── test
│ └── java
│ └── cn
│ └── lmjia
│ └── market
│ └── wechat
│ ├── page
│ ├── WechatMyTeamPage.java
│ ├── IndexPage.java
│ ├── WechatOrderListPage.java
│ ├── WechatWithdrawRecordPage.java
│ ├── WechatSharePage.java
│ ├── WechatOrderPageForHB.java
│ └── WechatGoodAdvanceOrderPage.java
│ ├── controller
│ ├── WechatShareControllerTest.java
│ ├── WechatSalesAchievementControllerTest.java
│ ├── order
│ │ └── WechatMainOrderControllerTest3.java
│ └── help
│ │ ├── HelpIndexPage.java
│ │ └── HelpDetailPage.java
│ └── service
│ └── WechatInitServiceTest.java
├── manage-service
└── src
│ ├── main
│ ├── resources
│ │ └── manage-view
│ │ │ ├── manage-resource
│ │ │ ├── img
│ │ │ │ ├── file.png
│ │ │ │ ├── upload.jpg
│ │ │ │ └── profile_small.jpg
│ │ │ └── js
│ │ │ │ └── repairDetail.js
│ │ │ ├── _joke.html
│ │ │ ├── _dataManage.html
│ │ │ └── mock
│ │ │ ├── login.js
│ │ │ ├── tagList.json
│ │ │ ├── helpCenter.js
│ │ │ ├── orderDelivery.js
│ │ │ ├── salesmanManage.js
│ │ │ └── agentGoodAdvancePayment.js
│ └── java
│ │ └── cn
│ │ └── lmjia
│ │ └── market
│ │ └── manage
│ │ └── controller
│ │ └── AbstractLoginDetailController.java
│ ├── test
│ └── java
│ │ └── cn
│ │ └── lmjia
│ │ └── market
│ │ └── manage
│ │ ├── page
│ │ ├── GoodEditPage.java
│ │ ├── GoodCreatePage.java
│ │ ├── ProductEditPage.java
│ │ ├── ProductCreatePage.java
│ │ ├── ManageLogisticsPage.java
│ │ ├── ManageHelpCenterPage.java
│ │ ├── ProductDetailPage.java
│ │ └── ManageStoragePage.java
│ │ └── controller
│ │ ├── ManageAgentGoodAdvancePaymentControllerTest.java
│ │ ├── ManageLoginControllerTest.java
│ │ └── ManageControllerTest.java
│ └── share
│ └── java
│ └── cn
│ └── lmjia
│ └── market
│ └── manage
│ └── page
│ ├── ManageLoginPage.java
│ └── ManageShiftDetailPage.java
├── sh
├── apply.bat
└── apply.sh
├── logistics-haier
└── src
│ ├── test
│ └── resources
│ │ ├── OrderStatusSync.xml
│ │ ├── 拒收入库.xml
│ │ ├── RejectInfo.xml
│ │ └── OutInStore.xml
│ └── main
│ └── java
│ └── me
│ └── jiangcai
│ └── logistics
│ └── haier
│ ├── repository
│ └── HaierOrderRepository.java
│ ├── util
│ ├── LocalDateTimeConverter.java
│ ├── BooleanDeserializer.java
│ └── LocalDateTimeDeserializer.java
│ ├── entity
│ └── HaierDepot.java
│ ├── http
│ └── ResponseHandler.java
│ ├── model
│ └── InOutItem.java
│ └── HaierConfig.java
├── cash-transfer
├── README.md
└── pom.xml
├── README.md
└── .gitignore
/logistics/src/main/resources/logistics_views/h22.sql:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/core-service/src/test/resources/mock/mobileValidation.json:
--------------------------------------------------------------------------------
1 | true
--------------------------------------------------------------------------------
/core-service/src/test/resources/mock/mobileValidation2.json:
--------------------------------------------------------------------------------
1 | false
--------------------------------------------------------------------------------
/web/src/main/webapp/MP_verify_QATriWIDSEMj0mk9.txt:
--------------------------------------------------------------------------------
1 | QATriWIDSEMj0mk9
--------------------------------------------------------------------------------
/web/src/main/webapp/MP_verify_YnFyAW9FUGK2XuIP.txt:
--------------------------------------------------------------------------------
1 | YnFyAW9FUGK2XuIP
--------------------------------------------------------------------------------
/dealer/src/main/resources/functions/agentLevel_0.mysql.sql:
--------------------------------------------------------------------------------
1 | DROP FUNCTION IF EXISTS `mm_agentLevel`
--------------------------------------------------------------------------------
/dealer/src/main/resources/functions/agentBelongs_0.mysql.sql:
--------------------------------------------------------------------------------
1 | DROP FUNCTION IF EXISTS `mm_agentBelongs`
--------------------------------------------------------------------------------
/dealer/src/main/resources/functions/loginBelongs_0.mysql.sql:
--------------------------------------------------------------------------------
1 | DROP FUNCTION IF EXISTS `mm_loginBelongs`
--------------------------------------------------------------------------------
/web/src/test/resources/local_aliyun.properties:
--------------------------------------------------------------------------------
1 | com.aliyun.ram.accessKeyId=1
2 | com.aliyun.ram.accessKeySecret=2
3 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: java
2 |
3 | cache:
4 | directories:
5 | - .autoconf
6 | - $HOME/.m2
7 |
8 | script: mvn test
9 |
--------------------------------------------------------------------------------
/core-service/src/share/resources/mock/trj_response.json:
--------------------------------------------------------------------------------
1 | {
2 | "success": true,
3 | "message": "OK",
4 | "data": null
5 | }
--------------------------------------------------------------------------------
/dealer/src/main/resources/functions/customers.h2.sql:
--------------------------------------------------------------------------------
1 | CREATE FORCE VIEW `_customers` AS
2 | SELECT *
3 | FROM `agentLevel`
--------------------------------------------------------------------------------
/hosts:
--------------------------------------------------------------------------------
1 | 线上几个域名记录
2 |
3 | r.lmjia.cn -> 该项目资源站
4 | www.lmjia.cn -> 公司首页网站
5 | g.lmjia.cn -> 无定向项目首页
6 | test.lmjia.cn -> 测试项目首页
--------------------------------------------------------------------------------
/core-service/src/test/resources/mock/webUploader.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "filePath",
3 | "url": "http://placehold.it/228x178?text=UPLOADED"
4 | }
--------------------------------------------------------------------------------
/dealer/src/main/resources/README.md:
--------------------------------------------------------------------------------
1 | * functions 是自定义函数
2 | * dealer-view 包含视图
3 | * dealer-view/dealer-resource 包含静态资源 它们的访问路径是 /dealer-resource
--------------------------------------------------------------------------------
/web/src/main/webapp/assets/images/404.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/web/src/main/webapp/assets/images/404.png
--------------------------------------------------------------------------------
/web/src/main/webapp/assets/images/500.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/web/src/main/webapp/assets/images/500.png
--------------------------------------------------------------------------------
/dealer/src/test/java/cn/lmjia/market/core/B.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core;
2 |
3 | /**
4 | * @author CJ
5 | */
6 | public class B {
7 | }
8 |
--------------------------------------------------------------------------------
/web/src/main/webapp/assets/images/repair.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/web/src/main/webapp/assets/images/repair.png
--------------------------------------------------------------------------------
/core-service/src/main/resources/defaultPropertyNameValues.properties:
--------------------------------------------------------------------------------
1 | 颜色=select,true,白色|黑色|香槟色|金色|银色|随机|男款黑|女款黑|透明色
2 | 包装规格=select,true,单片装|盒装(30片)
3 |
--------------------------------------------------------------------------------
/core-service/src/main/resources/LoginAgentLevel.h2.sql:
--------------------------------------------------------------------------------
1 | CREATE ALIAS IF NOT EXISTS `LoginAgentLevel` FOR "cn.lmjia.market.core.jpa.Functions.loginAgentLevel"
--------------------------------------------------------------------------------
/core-service/src/share/resources/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/core-service/src/share/resources/images/logo.png
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/trj/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 关于跟投融家合作的内容
3 | *
4 | * @author CJ
5 | */
6 | package cn.lmjia.market.core.trj;
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/util/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 一些使用的工具类
3 | *
4 | * @author CJ
5 | */
6 | package cn.lmjia.market.core.util;
--------------------------------------------------------------------------------
/logistics/src/share/java/me/jiangcai/logistics/demo/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 这里演示了一个供应商
3 | *
4 | * @author CJ
5 | */
6 | package me.jiangcai.logistics.demo;
--------------------------------------------------------------------------------
/dealer/src/main/java/cn/lmjia/market/dealer/entity/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 代理商所用的一些实体结构
3 | *
4 | * @author CJ
5 | */
6 | package cn.lmjia.market.dealer.entity;
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/aop/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 用于保证线程安全
3 | * Created by helloztt on 2017-01-09.
4 | */
5 | package cn.lmjia.market.core.aop;
--------------------------------------------------------------------------------
/core-service/src/main/resources/defaultSystem.properties:
--------------------------------------------------------------------------------
1 | ## 默认系统属性
2 | com.paymax.spring.hookUriWithoutAppId=/_paymax_events
3 | me.jiangcai.lib.sys.uri=/manageSystemString/
4 |
--------------------------------------------------------------------------------
/dealer/src/main/java/cn/lmjia/market/dealer/repository/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 代理商所涉及的JPA仓库
3 | *
4 | * @author CJ
5 | */
6 | package cn.lmjia.market.dealer.repository;
--------------------------------------------------------------------------------
/dealer/src/main/resources/functions/agentLevel.h2.sql:
--------------------------------------------------------------------------------
1 | DROP ALIAS IF EXISTS `mm_agentLevel`;
2 | CREATE ALIAS IF NOT EXISTS `mm_agentLevel` FOR "cn.lmjia.market.dealer.h2.Functions.agentLevel";
--------------------------------------------------------------------------------
/dealer/src/main/resources/dealer-view/dealer-resource/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/dealer/src/main/resources/dealer-view/dealer-resource/images/logo.png
--------------------------------------------------------------------------------
/dealer/src/main/resources/dealer-view/dealer-resource/images/yyzz.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/dealer/src/main/resources/dealer-view/dealer-resource/images/yyzz.jpg
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/404.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/404.png
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/500.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/500.png
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/empty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/empty.png
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/none.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/none.png
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/open.png
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/team.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/team.jpg
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/temp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/temp.png
--------------------------------------------------------------------------------
/dealer/src/main/resources/dealer-view/dealer-resource/images/id-card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/dealer/src/main/resources/dealer-view/dealer-resource/images/id-card.png
--------------------------------------------------------------------------------
/dealer/src/main/resources/functions/agentBelongs.h2.sql:
--------------------------------------------------------------------------------
1 | DROP ALIAS IF EXISTS `mm_agentBelongs`;
2 | CREATE ALIAS IF NOT EXISTS `mm_agentBelongs` FOR "cn.lmjia.market.dealer.h2.Functions.agentBelongs";
--------------------------------------------------------------------------------
/dealer/src/main/resources/functions/loginBelongs.h2.sql:
--------------------------------------------------------------------------------
1 | DROP ALIAS IF EXISTS `mm_loginBelongs`;
2 | CREATE ALIAS IF NOT EXISTS `mm_loginBelongs` FOR "cn.lmjia.market.dealer.h2.Functions.loginBelongs";
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/avatar.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/avatar.jpg
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/reject.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/reject.png
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/repair.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/repair.png
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/entity/financing/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 这里保存财务相关的实体
3 | * 应当尽量保留初始记录
4 | *
5 | * @author CJ
6 | */
7 | package cn.lmjia.market.core.entity.financing;
--------------------------------------------------------------------------------
/manage-service/src/main/resources/manage-view/manage-resource/img/file.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/manage-service/src/main/resources/manage-view/manage-resource/img/file.png
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/mall/cart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/mall/cart.png
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/poster-1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/poster-1.jpg
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/poster-2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/poster-2.jpg
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/sold-out.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/sold-out.png
--------------------------------------------------------------------------------
/manage-service/src/main/resources/manage-view/manage-resource/img/upload.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/manage-service/src/main/resources/manage-view/manage-resource/img/upload.jpg
--------------------------------------------------------------------------------
/logistics/README.md:
--------------------------------------------------------------------------------
1 | 从需求角度来说,物流帮助我们提供了「资料」在 「供」,「需」以及「仓储」之间的转存的管理服务。
2 |
3 | 按最迫切的需求我们优先解决「仓储」到「需」的转存服务。
4 |
5 | 1. 选择物流提供方
6 | 物流解决方案应该存在众多提供者
7 | 1. 发起「仓储」到「需」的转存需求
8 | 1. 查询转存状态
9 | 1. 转存完成的事件,被动传播
10 |
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/mall/jd-sprites.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/mall/jd-sprites.png
--------------------------------------------------------------------------------
/manage-service/src/main/resources/manage-view/manage-resource/img/profile_small.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/manage-service/src/main/resources/manage-view/manage-resource/img/profile_small.jpg
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/city/0001.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/city/0001.jpg
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/city/0002.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/city/0002.jpg
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/city/0003.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/city/0003.jpg
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/city/0004.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/city/0004.jpg
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/city/0005.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/city/0005.jpg
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/city/0006.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/city/0006.jpg
--------------------------------------------------------------------------------
/core-service/src/share/resources/test_wx.properties:
--------------------------------------------------------------------------------
1 | huotao.weixin.appId=wx59b0162cdf0967af
2 | huotao.weixin.appSecret=ffcf655fce7c4175bbddae7b594c4e27
3 | huotao.weixin.url=http://localhost/weixin/
4 | huotao.weixin.token=jiangcai
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/dealer/0001.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/dealer/0001.jpg
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/dealer/0002.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/dealer/0002.jpg
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/dealer/0003.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/dealer/0003.jpg
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/dealer/0004.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/dealer/0004.jpg
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/dealer/0005.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/dealer/0005.jpg
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/dealer/0006.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/dealer/0006.jpg
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/district/0001.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/district/0001.jpg
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/district/0002.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/district/0002.jpg
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/district/0003.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/district/0003.jpg
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/district/0004.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/district/0004.jpg
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/district/0005.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/district/0005.jpg
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/district/0006.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JoleneOL/market-manage/HEAD/wechat-service/src/main/resources/wechat-resource/assets/img/agreement/district/0006.jpg
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/controller/main/order/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 因为无论是微信短还是PC端都存在相关业务,所以这些业务在core包中完成
3 | * 这里主要负责主要业务商城订单相关的事项
4 | *
5 | * @author CJ
6 | */
7 | package cn.lmjia.market.core.controller.main.order;
--------------------------------------------------------------------------------
/core-service/src/main/resources/defaultProducts.properties:
--------------------------------------------------------------------------------
1 | hzls01=立式净水机,4000,5,0,颜色:黑色
2 | hzls02=立式净水机,5000,5,0,颜色:白色
3 | hzts02=台式净水机,3000,4,0,颜色:白色
4 | hzcx01=厨下净水机,3000,3,0,颜色:白色
5 | ESL-HM01=空气净化器,5000,5,0,颜色:香槟色
6 | SP70=食品优化宝,9800,10,0,颜色:金色
7 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/LogisticsDestination.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics;
2 |
3 | /**
4 | * 物流目的地
5 | *
6 | * @author CJ
7 | */
8 | public interface LogisticsDestination extends Deliverable {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/LogisticsSource.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics;
2 |
3 | /**
4 | * 物流起点
5 | * 可能是供应商,仓库或者需求方(退货)
6 | *
7 | * @author CJ
8 | */
9 | public interface LogisticsSource extends Deliverable {
10 | }
11 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/exception/StockOverrideException.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.exception;
2 |
3 | /**
4 | * 库存不足异常
5 | *
6 | * @author CJ
7 | */
8 | public class StockOverrideException extends Exception {
9 | }
10 |
--------------------------------------------------------------------------------
/core-service/src/main/resources/defaultProductTypes.properties:
--------------------------------------------------------------------------------
1 | 立式净水机=颜色:白色|黑色
2 | 台式净水机=颜色:白色|黑色|红色
3 | 厨下净水机=颜色:白色
4 | 空气净化器=颜色:香槟色
5 | 食品优化宝=颜色:金色|银色
6 | 美容喷瓶=颜色:随机
7 | 激光测霾仪=颜色:黑色
8 | 微循环检测仪=颜色:黑色
9 | 亚克力罩=颜色:透明色
10 | 项链=颜色:男款黑|女款黑
11 | 水宝=颜色:白色
12 | 手机防辐射芯片=包装规格:单片装|盒装(30片)
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/entity/support/PropertyType.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.entity.support;
2 |
3 | /**
4 | * 参数展示在前台的类型
5 | * Created by helloztt on 2017/9/12.
6 | */
7 | public enum PropertyType {
8 | input,
9 | select
10 | }
11 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/entity/support/ProductStatus.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.entity.support;
2 |
3 | /**
4 | * 产品状态
5 | *
6 | * @author CJ
7 | */
8 | public enum ProductStatus {
9 | /**
10 | * 正常
11 | */
12 | normal,
13 | }
14 |
--------------------------------------------------------------------------------
/logistics/src/share/java/me/jiangcai/logistics/demo/DemoSupplier.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.demo;
2 |
3 | import me.jiangcai.logistics.LogisticsSupplier;
4 |
5 | /**
6 | * @author CJ
7 | */
8 | public interface DemoSupplier extends LogisticsSupplier {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/core-service/src/share/java/cn/lmjia/market/core/MockSetting.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core;
2 |
3 | /**
4 | * 放置一些开放设置
5 | *
6 | * @author CJ
7 | */
8 | public class MockSetting {
9 |
10 | /**
11 | * 是否自动支付
12 | */
13 | public static boolean AutoPay = true;
14 | }
15 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/entity/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 物流供应链,定义了包括仓库,货品,进出库订单等基本信息
3 | *
4 | * 还有一种比较特殊的仓库,物流委托仓库,这类仓库有以下显著特点:
5 | *
6 | * - 仓库委托与物流方,所以选择了仓库就是选择了物流方
7 | *
8 | *
9 | * @author CJ
10 | */
11 | package me.jiangcai.logistics.entity;
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/option/LogisticsOptions.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.option;
2 |
3 | /**
4 | * 以组合方式给出
5 | * @author CJ
6 | */
7 | public class LogisticsOptions {
8 | /**
9 | * 是否安装
10 | */
11 | public static final int Installation = 1;
12 | }
13 |
--------------------------------------------------------------------------------
/manage-service/src/main/resources/manage-view/_joke.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Title
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/ProductTypeService.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics;
2 |
3 | import me.jiangcai.logistics.entity.ProductType;
4 |
5 | /**
6 | * Created by helloztt on 2017/9/13.
7 | */
8 | public interface ProductTypeService {
9 | ProductType findOne(Long id);
10 | }
11 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/supplier/ManuallySupplier.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.supplier;
2 |
3 | import me.jiangcai.logistics.LogisticsSupplier;
4 |
5 | /**
6 | * 手动发货的供应商
7 | *
8 | * @author CJ
9 | */
10 | public interface ManuallySupplier extends LogisticsSupplier {
11 | }
12 |
--------------------------------------------------------------------------------
/manage-service/src/main/resources/manage-view/_dataManage.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 数据管理
6 |
7 |
8 |
9 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/sh/apply.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | rem 将数据恢复至本地mysql market 帐号需为root 密码需为空
3 | rem usage: apply.bat [sql]
4 | rem IF NOT EXISTS
5 | mysql -h localhost -u root --execute="DROP DATABASE IF EXISTS market;CREATE USER 'market'@'%';create database market CHARACTER SET=UTF8;reset MASTER;"
6 | mysql -h localhost -u root market < %1
7 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/aop/BusinessLocker.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.aop;
2 |
3 | /**
4 | * 支持成为一个业务锁
5 | * Created by helloztt on 2017-01-09.
6 | */
7 | public interface BusinessLocker {
8 |
9 | /**
10 | * @return 业务锁
11 | */
12 | Object toLock();
13 | }
14 |
--------------------------------------------------------------------------------
/core-service/src/share/java/cn/lmjia/market/core/MarketBuildInLogisticsSupplier.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core;
2 |
3 | import me.jiangcai.logistics.LogisticsSupplier;
4 |
5 | /**
6 | * 内置物流系统
7 | *
8 | * @author CJ
9 | */
10 | public interface MarketBuildInLogisticsSupplier extends LogisticsSupplier {
11 | }
12 |
--------------------------------------------------------------------------------
/logistics/src/main/resources/logistics_views/mysql2.sql:
--------------------------------------------------------------------------------
1 | CREATE OR REPLACE VIEW `UsageStock`
2 | AS
3 | SELECT
4 | concat(`PRODUCT_CODE`, `DEPOT_ID`) AS `ID`,
5 | `PRODUCT_CODE`,
6 | `DEPOT_ID`,
7 | sum(`AMOUNT`) AS `AMOUNT`
8 | FROM UsageStockInfo
9 | GROUP BY `PRODUCT_CODE`, `DEPOT_ID`;
--------------------------------------------------------------------------------
/core-service/src/test/java/cn/lmjia/market/core/entity/OneForElement.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.entity;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Embeddable;
6 |
7 | /**
8 | * @author CJ
9 | */
10 | @Data
11 | @Embeddable
12 | public class OneForElement {
13 | private String data;
14 | }
15 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/converter/GenderConverter.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.converter;
2 |
3 | import me.jiangcai.lib.spring.converter.EnumFormatter;
4 | import me.jiangcai.wx.model.Gender;
5 |
6 | /**
7 | * @author CJ
8 | */
9 | class GenderConverter extends EnumFormatter {
10 | }
11 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/aop/MultipleBusinessLocker.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.aop;
2 |
3 | /**
4 | * 支持成为一个多重业务锁
5 | * Created by helloztt on 2017-01-09.
6 | */
7 | public interface MultipleBusinessLocker {
8 |
9 | /**
10 | * @return 业务锁
11 | */
12 | Object[] toLock();
13 | }
14 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/entity/financing/AgentGoodPaymentRecord.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.entity.financing;
2 |
3 | import javax.persistence.Entity;
4 |
5 | /**
6 | * 代理商进货
7 | *
8 | * @author CJ
9 | */
10 | @Entity
11 | public class AgentGoodPaymentRecord extends AgentIncomeRecord {
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/mock/extend.js:
--------------------------------------------------------------------------------
1 | Mock.setup({
2 | timeout: '1000'
3 | });
4 |
5 | Mock.mock(/\/api\/search\?title=(.*)/, "get", {
6 | "resultCode": 200,
7 | "resultMsg": "ok",
8 | "data|0-5": [
9 | {
10 | 'id': '@id()',
11 | 'title': '@ctitle()'
12 | }
13 | ]
14 | });
--------------------------------------------------------------------------------
/logistics-haier/src/test/resources/OrderStatusSync.xml:
--------------------------------------------------------------------------------
1 |
2 | C12101
3 | 2d1e134ce1b74a849adbf87096f1128d
4 | 6132846602
5 | WMS
6 | 2017-08-02 15:55:03
7 | WMS_ACCEPT
8 | 接单
9 |
--------------------------------------------------------------------------------
/wechat-service/src/main/java/cn/lmjia/market/wechat/service/WechatLoginService.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.wechat.service;
2 |
3 | import cn.lmjia.market.core.entity.Login;
4 |
5 | /**
6 | * 微信登录服务
7 | *
8 | * @author CJ
9 | */
10 | public interface WechatLoginService {
11 |
12 |
13 | Login asWechat(String openId);
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/LoginRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository;
2 |
3 | import cn.lmjia.market.core.entity.Login;
4 | import cn.lmjia.market.core.util.AbstractLoginRepository;
5 |
6 | /**
7 | * @author CJ
8 | */
9 | public interface LoginRepository extends AbstractLoginRepository {
10 | }
11 |
--------------------------------------------------------------------------------
/sh/apply.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # 将数据恢复至本地mysql market 帐号需为root 密码需为空
4 | # usage: apply.sh [sql]
5 | # IF NOT EXISTS
6 | # reset master;
7 | # CREATE USER 'market'@'%';
8 | mysql -h localhost -u root < {
10 | }
11 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/converter/OrderStatusConverter.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.converter;
2 |
3 | import cn.lmjia.market.core.entity.support.OrderStatus;
4 | import me.jiangcai.lib.spring.converter.EnumFormatter;
5 |
6 | /**
7 | * @author CJ
8 | */
9 | class OrderStatusConverter extends EnumFormatter {
10 | }
11 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/ManagerRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository;
2 |
3 | import cn.lmjia.market.core.entity.Manager;
4 | import cn.lmjia.market.core.util.AbstractLoginRepository;
5 |
6 | /**
7 | * @author CJ
8 | */
9 | public interface ManagerRepository extends AbstractLoginRepository {
10 | }
11 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/util/CommissionSource.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.util;
2 |
3 | import java.math.BigDecimal;
4 |
5 | /**
6 | * 分佣的来源
7 | *
8 | * @author CJ
9 | */
10 | public interface CommissionSource {
11 |
12 | /**
13 | * @return 可被分佣的金额
14 | */
15 | BigDecimal getCommissioningAmount();
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/repository/DepotRepository.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.repository;
2 |
3 | import me.jiangcai.logistics.entity.Depot;
4 | import me.jiangcai.logistics.repository_util.AbstractDepotRepository;
5 |
6 | /**
7 | * @author CJ
8 | */
9 | public interface DepotRepository extends AbstractDepotRepository {
10 | }
11 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/converter/WithdrawStatusConverter.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.converter;
2 |
3 | import cn.lmjia.market.core.entity.support.WithdrawStatus;
4 | import me.jiangcai.lib.spring.converter.EnumFormatter;
5 |
6 | /**
7 | * @author CJ
8 | */
9 | class WithdrawStatusConverter extends EnumFormatter {
10 | }
11 |
--------------------------------------------------------------------------------
/core-service/src/test/java/cn/lmjia/market/core/CoreWebTest.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core;
2 |
3 | import cn.lmjia.market.core.config.MVCConfig;
4 | import org.springframework.test.context.ContextConfiguration;
5 |
6 | /**
7 | * @author CJ
8 | */
9 | @ContextConfiguration(classes = MVCConfig.class)
10 | public abstract class CoreWebTest extends CoreServiceTest {
11 | }
12 |
--------------------------------------------------------------------------------
/core-service/src/test/java/cn/lmjia/market/core/entity/SubEntity.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.entity;
2 |
3 | import lombok.Getter;
4 | import lombok.Setter;
5 |
6 | import javax.persistence.Entity;
7 |
8 | /**
9 | * @author CJ
10 | */
11 | @Entity
12 | @Setter
13 | @Getter
14 | public class SubEntity extends SuperEntity {
15 |
16 | private String p2;
17 | }
18 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/repository/ProductRepository.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.repository;
2 |
3 | import me.jiangcai.logistics.entity.Product;
4 | import me.jiangcai.logistics.repository_util.AbstractProductRepository;
5 |
6 | /**
7 | * @author CJ
8 | */
9 | public interface ProductRepository extends AbstractProductRepository {
10 | }
11 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/service/CommissionDetailService.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.service;
2 |
3 | import cn.lmjia.market.core.entity.deal.Commission;
4 |
5 | import java.util.List;
6 |
7 | /**
8 | * 佣金详情服务
9 | *
10 | * @author lxf
11 | */
12 | public interface CommissionDetailService {
13 |
14 | List findByOrderId(long id);
15 | }
16 |
--------------------------------------------------------------------------------
/dealer/src/main/resources/functions/loginBelongs_1.mysql.sql:
--------------------------------------------------------------------------------
1 | CREATE FUNCTION `mm_loginBelongs`(
2 | id BIGINT, superior BIGINT
3 | )
4 | RETURNS SMALLINT DETERMINISTIC COMMENT 'id 从属于或者间接从属于 superior 则1' BEGIN DECLARE result SMALLINT;
5 | SELECT count(t0.`ID`) > 0
6 | INTO result
7 | FROM `loginrelation` AS t0
8 | WHERE t0.`FROM_ID` = superior AND t0.`TO_ID` = id;
9 | RETURN result;
10 | END
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/js/isWechat.js:
--------------------------------------------------------------------------------
1 | $(function () {
2 | var $mask = $('.mask');
3 | function isWechat() {
4 | var ua = navigator.userAgent.toLowerCase();
5 | return ua.match(/MicroMessenger/i) == "micromessenger";
6 | }
7 | if(isWechat()) $mask.show();
8 |
9 | $mask.click(function () {
10 | $(this).hide();
11 | })
12 | });
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/aop/BusinessSafe.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.aop;
2 |
3 | import java.lang.annotation.*;
4 |
5 | /**
6 | * 声明为业务安全的方法,如果参数中有 {@link BusinessLocker}则使用其功能,否者默认使用第一个参数作为业务锁
7 | * Created by helloztt on 2017-01-09.
8 | */
9 | @Target({ElementType.METHOD})
10 | @Retention(RetentionPolicy.RUNTIME)
11 | @Documented
12 | public @interface BusinessSafe {
13 | }
14 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/exception/SupplierException.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.exception;
2 |
3 | /**
4 | * @author CJ
5 | */
6 | public class SupplierException extends RuntimeException {
7 | public SupplierException(String message) {
8 | super(message);
9 | }
10 |
11 | public SupplierException(Throwable cause) {
12 | super(cause);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/web/src/main/java/cn/lmjia/market/web/config/RuntimeConfig.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.web.config;
2 |
3 | import org.springframework.context.annotation.Configuration;
4 | import org.springframework.context.annotation.ImportResource;
5 |
6 | /**
7 | * 运行时配置
8 | *
9 | * @author slt
10 | */
11 | @Configuration
12 | @ImportResource("classpath:/datasource_runtime.xml")
13 | class RuntimeConfig {
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/dealer/src/main/resources/dealer-view/mock/commDataNew.json:
--------------------------------------------------------------------------------
1 | {
2 | "draw": 2,
3 | "recordsTotal": 23,
4 | "recordsFiltered": 23,
5 | "data": [
6 | {
7 | "id": "1",
8 | "commType": "销售收益",
9 | "code": "189348484848",
10 | "user": "测试测试",
11 | "orderTotal": 342525,
12 | "divided": "20%",
13 | "commission": 691.2,
14 | "commTime": "2017-09-09"
15 | }
16 | ]
17 | }
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/repository/StockShiftUnitRepository.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.repository;
2 |
3 | import me.jiangcai.logistics.entity.StockShiftUnit;
4 | import me.jiangcai.logistics.repository_util.AbstractStockShiftUnitRepository;
5 |
6 | /**
7 | * @author CJ
8 | */
9 | public interface StockShiftUnitRepository extends AbstractStockShiftUnitRepository {
10 | }
11 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/event/MainDeliverableOrderDeliveryRequired.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.event;
2 |
3 | import cn.lmjia.market.core.entity.order.MainDeliverableOrder;
4 | import lombok.Data;
5 |
6 | /**
7 | * 该订单可发货了
8 | *
9 | * @author CJ
10 | */
11 | @Data
12 | public class MainDeliverableOrderDeliveryRequired {
13 |
14 | private final MainDeliverableOrder order;
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/repository/StockSettlementRepository.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.repository;
2 |
3 | import me.jiangcai.logistics.entity.StockSettlement;
4 | import me.jiangcai.logistics.repository_util.AbstractStockSettlementRepository;
5 |
6 | /**
7 | * @author CJ
8 | */
9 | public interface StockSettlementRepository extends AbstractStockSettlementRepository {
10 | }
11 |
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/js/mall/index.js:
--------------------------------------------------------------------------------
1 | $(function () {
2 | var swiper = new Swiper('.swiper-container', {
3 | pagination: '.swiper-pagination',
4 | autoplay: 3000,
5 | slidesPerView: 1,
6 | paginationClickable: true,
7 | observer: true,
8 | observeParents: true,
9 | updateOnImagesReady: true,
10 | loop: true
11 | });
12 | });
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/MainProductRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository;
2 |
3 | import cn.lmjia.market.core.entity.MainProduct;
4 | import me.jiangcai.logistics.repository_util.AbstractProductRepository;
5 |
6 | /**
7 | * @author CJ
8 | */
9 | public interface MainProductRepository extends AbstractProductRepository {
10 | MainProduct findByName(String name);
11 | }
12 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/PersistingReadable.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics;
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * 可持久,并且可读的
7 | * 可持久的意思是它可以在JPA系统中持久,基于简单目的的考虑直接使用{@link Serializable Java标准序列化},但是强烈推荐实现自定义的序列化
8 | *
9 | * @author CJ
10 | */
11 | public interface PersistingReadable extends Serializable {
12 | /**
13 | * @return 以HTML方式渲染
14 | */
15 | String toHTML();
16 | }
17 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/entity/support/PromotionRequestStatus.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.entity.support;
2 |
3 | /**
4 | * @author CJ
5 | */
6 | public enum PromotionRequestStatus {
7 | /**
8 | * 初始化
9 | */
10 | init,
11 | /**
12 | * 已提交
13 | */
14 | requested,
15 | /**
16 | * 已拒绝
17 | */
18 | rejected,
19 | /**
20 | * 已同意
21 | */
22 | approved,
23 | }
24 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/PayOrderRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository;
2 |
3 | import me.jiangcai.payment.entity.PayOrder;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 |
6 | import java.util.List;
7 |
8 | /**
9 | * @author CJ
10 | */
11 | public interface PayOrderRepository extends JpaRepository {
12 |
13 | List findByPayableOrderId(String id);
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/Thing.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics;
2 |
3 | import me.jiangcai.logistics.entity.Product;
4 | import me.jiangcai.logistics.entity.support.ProductStatus;
5 |
6 | /**
7 | * 物件,物流所管理和运输的最小单位
8 | *
9 | * @author CJ
10 | */
11 | public interface Thing {
12 |
13 | Product getProduct();
14 |
15 | ProductStatus getProductStatus();
16 |
17 | /**
18 | * @return 数量
19 | */
20 | int getAmount();
21 | }
22 |
--------------------------------------------------------------------------------
/wechat-service/src/test/java/cn/lmjia/market/wechat/page/WechatMyTeamPage.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.wechat.page;
2 |
3 | import org.openqa.selenium.WebDriver;
4 |
5 | /**
6 | * @author CJ
7 | */
8 | public class WechatMyTeamPage extends AbstractWechatPage {
9 | public WechatMyTeamPage(WebDriver webDriver) {
10 | super(webDriver);
11 | }
12 |
13 | @Override
14 | public void validatePage() {
15 | assertTitle("我的团队");
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/wechat-service/src/test/java/cn/lmjia/market/wechat/page/IndexPage.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.wechat.page;
2 |
3 | import org.openqa.selenium.WebDriver;
4 |
5 | /**
6 | * 首页,目前算是 模拟页面
7 | *
8 | * @author CJ
9 | */
10 | public class IndexPage extends AbstractWechatPage {
11 |
12 | public IndexPage(WebDriver webDriver) {
13 | super(webDriver);
14 | }
15 |
16 | @Override
17 | public void validatePage() {
18 | assertTitle("我的");
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/logistics-haier/src/main/java/me/jiangcai/logistics/haier/repository/HaierOrderRepository.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.haier.repository;
2 |
3 | import me.jiangcai.logistics.haier.entity.HaierOrder;
4 | import me.jiangcai.logistics.repository_util.AbstractStockShiftUnitRepository;
5 |
6 | /**
7 | * @author CJ
8 | */
9 | public interface HaierOrderRepository extends AbstractStockShiftUnitRepository {
10 |
11 | HaierOrder findByOrderNumber(String no);
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/event/OrderDeliveredEvent.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.event;
2 |
3 | import lombok.Data;
4 | import me.jiangcai.logistics.DeliverableOrder;
5 |
6 | /**
7 | * 订单物流全部抵达事件
8 | *
9 | * @author CJ
10 | */
11 | @Data
12 | public class OrderDeliveredEvent {
13 | /**
14 | * 事务内订单
15 | */
16 | private final DeliverableOrder order;
17 | /**
18 | * 可选物流事件
19 | */
20 | private final ShiftEvent source;
21 | }
22 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/repository/UsageStockRepository.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.repository;
2 |
3 | import me.jiangcai.logistics.entity.UsageStock;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
6 |
7 | /**
8 | * @author CJ
9 | */
10 | public interface UsageStockRepository extends JpaRepository, JpaSpecificationExecutor {
11 | }
12 |
--------------------------------------------------------------------------------
/core-service/src/share/java/cn/lmjia/market/core/test/TestController.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.test;
2 |
3 | import org.springframework.stereotype.Controller;
4 | import org.springframework.web.bind.annotation.GetMapping;
5 |
6 | /**
7 | * @author CJ
8 | */
9 | @Controller
10 | public class TestController {
11 |
12 | @GetMapping("/redirectSuccessUri")
13 | public String redirectSuccessUri(String successUri) {
14 | return "redirect:" + successUri;
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/core-service/src/test/resources/mock/searchLogin.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_count": 300,
3 | "items": [
4 | {
5 | "id": 1,
6 | "name": "张学友",
7 | "mobile": "19812344321"
8 | },
9 | {
10 | "id": 2,
11 | "name": "刘德华",
12 | "mobile": null
13 | },
14 | {
15 | "id": 3,
16 | "name": null,
17 | "mobile": "18609877890"
18 | },
19 | {
20 | "id": 4,
21 | "name": "汉武帝",
22 | "mobile": "12312341234"
23 | }
24 | ]
25 | }
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/event/OrderInstalledEvent.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.event;
2 |
3 | import lombok.Data;
4 | import me.jiangcai.logistics.DeliverableOrder;
5 |
6 | /**
7 | * 订单物流全部抵达而且该安装已完成或者无需安装
8 | *
9 | * @author CJ
10 | */
11 | @Data
12 | public class OrderInstalledEvent {
13 | /**
14 | * 事务内订单
15 | */
16 | private final DeliverableOrder order;
17 | /**
18 | * 可选
19 | */
20 | private final InstallationEvent source;
21 | }
22 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/deal/AgentSystemRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository.deal;
2 |
3 | import cn.lmjia.market.core.entity.deal.AgentSystem;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
6 |
7 | /**
8 | * @author CJ
9 | */
10 | public interface AgentSystemRepository extends JpaRepository, JpaSpecificationExecutor {
11 | }
12 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/entity/support/ShiftType.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.entity.support;
2 |
3 | /**
4 | * 库存变化类型
5 | *
6 | * @author CJ
7 | */
8 | public enum ShiftType {
9 | /**
10 | * 系统增减
11 | */
12 | root,
13 | /**
14 | * 核准 增减
15 | */
16 | audit,
17 | /**
18 | * 损耗
19 | */
20 | wastage,
21 | /**
22 | * 非良品导致的
23 | */
24 | badness,
25 | /**
26 | * 物流变化导致的
27 | */
28 | logistics
29 | }
30 |
--------------------------------------------------------------------------------
/wechat-service/src/test/java/cn/lmjia/market/wechat/page/WechatOrderListPage.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.wechat.page;
2 |
3 | import org.openqa.selenium.WebDriver;
4 |
5 | /**
6 | * 订单列表
7 | * orderList.html
8 | *
9 | * @author CJ
10 | */
11 | public class WechatOrderListPage extends AbstractWechatPage {
12 | public WechatOrderListPage(WebDriver webDriver) {
13 | super(webDriver);
14 | }
15 |
16 | @Override
17 | public void validatePage() {
18 | assertTitle("订单列表");
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/service/WechatNoticeHelper.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.service;
2 |
3 | import cn.lmjia.market.core.define.MarketUserNoticeType;
4 |
5 | /**
6 | * 微信推送消息助理
7 | *
8 | * @author CJ
9 | */
10 | public interface WechatNoticeHelper {
11 |
12 | /**
13 | * 注册模板消息
14 | *
15 | * @param type 消息类型
16 | * @param urlTemplate URL模板;可以为null表示不支持url
17 | */
18 | void registerTemplateMessage(MarketUserNoticeType type, String urlTemplate);
19 | }
20 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/entity/settlement/CommissionJournalType.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.entity.settlement;
2 |
3 | /**
4 | * @author CJ
5 | */
6 | public enum CommissionJournalType {
7 |
8 | mainOrderCommission("订单收益"),
9 | withdraw("成功提现"),;
10 | private final String message;
11 |
12 | CommissionJournalType(String message) {
13 | this.message = message;
14 | }
15 |
16 | @Override
17 | public String toString() {
18 | return message;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/entity/support/TagType.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.entity.support;
2 |
3 | /**
4 | * 标签类型
5 | * Created by helloztt on 2017-09-16.
6 | */
7 | public enum TagType {
8 | SEARCH("商城分类"),
9 | LIST("首页列表显示"),
10 | IMG("首页滚图");
11 |
12 |
13 | private final String message;
14 |
15 | TagType(String message) {
16 | this.message = message;
17 | }
18 |
19 | @Override
20 | public String toString() {
21 | return message;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/ScriptTaskRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository;
2 |
3 | import cn.lmjia.market.core.entity.ScriptTask;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
6 |
7 | /**
8 | * @author CJ
9 | */
10 | public interface ScriptTaskRepository extends JpaRepository, JpaSpecificationExecutor {
11 |
12 | long countByName(String name);
13 | }
14 |
--------------------------------------------------------------------------------
/core-service/src/test/java/cn/lmjia/market/core/entity/OneForEntity.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.entity;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Entity;
6 | import javax.persistence.GeneratedValue;
7 | import javax.persistence.GenerationType;
8 | import javax.persistence.Id;
9 |
10 | /**
11 | * @author CJ
12 | */
13 | @Entity
14 | @Data
15 | public class OneForEntity {
16 | @Id
17 | @GeneratedValue(strategy = GenerationType.IDENTITY)
18 | private Long id;
19 | private String data;
20 | }
21 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/channel/ChannelRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository.channel;
2 |
3 | import cn.lmjia.market.core.entity.channel.Channel;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
6 |
7 | /**
8 | * @author CJ
9 | */
10 | public interface ChannelRepository extends JpaRepository, JpaSpecificationExecutor {
11 | Channel findByName(String name);
12 | }
13 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/financing/AgentFeeRecordRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository.financing;
2 |
3 | import cn.lmjia.market.core.entity.financing.AgentFeeRecord;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
6 |
7 | /**
8 | * @author CJ
9 | */
10 | public interface AgentFeeRecordRepository extends JpaRepository, JpaSpecificationExecutor {
11 | }
12 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/service/QuickTradeService.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.service;
2 |
3 | import cn.lmjia.market.core.entity.MainOrder;
4 | import org.springframework.transaction.annotation.Transactional;
5 |
6 | /**
7 | * 这是一种临时解决方案
8 | *
9 | * @author CJ
10 | */
11 | public interface QuickTradeService {
12 |
13 | /**
14 | * 让一笔支付完成的订单立刻进入完成状态,并且完成佣金结算
15 | *
16 | * @param order 已完成支付的订单F
17 | */
18 | @Transactional
19 | void makeDone(MainOrder order);
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/entity/support/ProductBatch.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.entity.support;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | import javax.persistence.Embeddable;
8 |
9 | /**
10 | * 产品批次
11 | *
12 | * @author CJ
13 | */
14 | @Embeddable
15 | @Data
16 | @AllArgsConstructor
17 | @NoArgsConstructor
18 | public class ProductBatch {
19 |
20 | private ProductStatus productStatus;
21 | private int amount;
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/trj/AuthorisingInfoRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository.trj;
2 |
3 | import cn.lmjia.market.core.entity.trj.AuthorisingInfo;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
6 |
7 | /**
8 | * @author CJ
9 | */
10 | public interface AuthorisingInfoRepository extends JpaRepository
11 | , JpaSpecificationExecutor {
12 | }
13 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/entity/financing/AgentIncomeRecord.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.entity.financing;
2 |
3 | import lombok.Getter;
4 | import lombok.Setter;
5 |
6 | import javax.persistence.Entity;
7 | import javax.persistence.Inheritance;
8 | import javax.persistence.InheritanceType;
9 |
10 | /**
11 | * 代理商有关的收入
12 | *
13 | * @author CJ
14 | */
15 | @Entity
16 | @Inheritance(strategy = InheritanceType.JOINED)
17 | @Setter
18 | @Getter
19 | public class AgentIncomeRecord extends IncomeRecord {
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/entity/financing/AgentFeeRecord.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.entity.financing;
2 |
3 | import cn.lmjia.market.core.entity.deal.AgentLevel;
4 | import lombok.Getter;
5 | import lombok.Setter;
6 |
7 | import javax.persistence.Entity;
8 | import javax.persistence.ManyToOne;
9 |
10 | /**
11 | * 代理费记录
12 | *
13 | * @author CJ
14 | */
15 | @Entity
16 | @Setter
17 | @Getter
18 | public class AgentFeeRecord extends AgentIncomeRecord {
19 | @ManyToOne
20 | private AgentLevel agent;
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/FactoryRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository;
2 |
3 | import cn.lmjia.market.core.entity.Factory;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * @author CJ
11 | */
12 | public interface FactoryRepository extends JpaRepository, JpaSpecificationExecutor {
13 | List findByEnableTrue();
14 | }
15 |
--------------------------------------------------------------------------------
/wechat-service/src/test/java/cn/lmjia/market/wechat/page/WechatWithdrawRecordPage.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.wechat.page;
2 |
3 | import org.openqa.selenium.WebDriver;
4 |
5 | /**
6 | * 提现记录
7 | * withdrawRecord.html
8 | *
9 | * @author CJ
10 | */
11 | public class WechatWithdrawRecordPage extends AbstractWechatPage {
12 |
13 | public WechatWithdrawRecordPage(WebDriver webDriver) {
14 | super(webDriver);
15 | }
16 |
17 | @Override
18 | public void validatePage() {
19 | assertTitle("提现记录");
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/entity/settlement/AgentGoodAdvancePaymentJournalType.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.entity.settlement;
2 |
3 | /**
4 | * @author CJ
5 | */
6 | public enum AgentGoodAdvancePaymentJournalType {
7 |
8 | makeOrder("批货"),
9 | payment("预付"),;
10 | private final String message;
11 |
12 | AgentGoodAdvancePaymentJournalType(String message) {
13 | this.message = message;
14 | }
15 |
16 | @Override
17 | public String toString() {
18 | return message;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/event/MainOrderDeliveredEvent.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.event;
2 |
3 | import cn.lmjia.market.core.entity.MainOrder;
4 | import lombok.Data;
5 | import me.jiangcai.logistics.event.ShiftEvent;
6 |
7 | /**
8 | * 主订单送达事件,总是因为物流事件导致的
9 | *
10 | * @author CJ
11 | */
12 | @Data
13 | public class MainOrderDeliveredEvent {
14 | /**
15 | * 事务内订单
16 | */
17 | private final MainOrder mainOrder;
18 | /**
19 | * 可选物流事件
20 | */
21 | private final ShiftEvent source;
22 | }
23 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/trj/InvalidAuthorisingException.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.trj;
2 |
3 | import lombok.Getter;
4 |
5 | /**
6 | * 按揭码无效
7 | *
8 | * @author CJ
9 | */
10 | @Getter
11 | public class InvalidAuthorisingException extends Exception {
12 |
13 | private final String authorising;
14 | private final String idNumber;
15 |
16 | public InvalidAuthorisingException(String authorising, String idNumber) {
17 | this.authorising = authorising;
18 | this.idNumber = idNumber;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/repository_util/AbstractStockShiftUnitRepository.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.repository_util;
2 |
3 | import me.jiangcai.logistics.entity.StockShiftUnit;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
6 |
7 | /**
8 | * @author CJ
9 | */
10 | public interface AbstractStockShiftUnitRepository extends JpaRepository
11 | , JpaSpecificationExecutor {
12 |
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/manage-service/src/test/java/cn/lmjia/market/manage/page/GoodEditPage.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.manage.page;
2 |
3 | import org.openqa.selenium.WebDriver;
4 |
5 | /**
6 | * @author CJ
7 | */
8 | public class GoodEditPage extends GoodOperatePage {
9 | public GoodEditPage(WebDriver webDriver) {
10 | super(webDriver);
11 | }
12 |
13 | @Override
14 | protected boolean isCreateNew() {
15 | return false;
16 | }
17 |
18 | @Override
19 | public void validatePage() {
20 | assertTitle("编辑商品");
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/LogisticsHostService.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics;
2 |
3 | import me.jiangcai.logistics.entity.StockShiftUnit;
4 | import org.springframework.transaction.annotation.Transactional;
5 |
6 | /**
7 | * 由项目代码提供的宿主服务
8 | *
9 | * @author CJ
10 | */
11 | public interface LogisticsHostService {
12 |
13 | /**
14 | * @param unit 特定物流转移订单
15 | * @return 获取特定物流转移订单所相关的物流订单;可以返回null如果无关
16 | */
17 | @Transactional(readOnly = true)
18 | DeliverableOrder orderFor(StockShiftUnit unit);
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/repository_util/AbstractDepotRepository.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.repository_util;
2 |
3 | import me.jiangcai.logistics.entity.Depot;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * @author CJ
11 | */
12 | public interface AbstractDepotRepository extends JpaRepository, JpaSpecificationExecutor {
13 | List findByEnableTrue();
14 | }
15 |
--------------------------------------------------------------------------------
/manage-service/src/test/java/cn/lmjia/market/manage/page/GoodCreatePage.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.manage.page;
2 |
3 | import org.openqa.selenium.WebDriver;
4 |
5 | /**
6 | * @author CJ
7 | */
8 | public class GoodCreatePage extends GoodOperatePage {
9 | public GoodCreatePage(WebDriver webDriver) {
10 | super(webDriver);
11 | }
12 |
13 | @Override
14 | protected boolean isCreateNew() {
15 | return true;
16 | }
17 |
18 | @Override
19 | public void validatePage() {
20 | assertTitle("新增商品");
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/order/AgentPrepaymentOrderRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository.order;
2 |
3 | import cn.lmjia.market.core.entity.order.AgentPrepaymentOrder;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
6 |
7 | /**
8 | * @author CJ
9 | */
10 | public interface AgentPrepaymentOrderRepository extends JpaRepository
11 | , JpaSpecificationExecutor {
12 | }
13 |
--------------------------------------------------------------------------------
/manage-service/src/test/java/cn/lmjia/market/manage/page/ProductEditPage.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.manage.page;
2 |
3 | import org.openqa.selenium.WebDriver;
4 |
5 | /**
6 | * @author CJ
7 | */
8 | public class ProductEditPage extends ProductOperatePage {
9 | public ProductEditPage(WebDriver webDriver) {
10 | super(webDriver);
11 | }
12 |
13 | @Override
14 | protected boolean isCreateNew() {
15 | return false;
16 | }
17 |
18 | @Override
19 | public void validatePage() {
20 | assertTitle("编辑货品");
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/financing/AgentGoodPaymentRecordRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository.financing;
2 |
3 | import cn.lmjia.market.core.entity.financing.AgentGoodPaymentRecord;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
6 |
7 | /**
8 | * @author CJ
9 | */
10 | public interface AgentGoodPaymentRecordRepository extends JpaRepository, JpaSpecificationExecutor {
11 | }
12 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/repository/PropertyNameRepository.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.repository;
2 |
3 | import me.jiangcai.logistics.entity.PropertyName;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
6 |
7 | /**
8 | * Created by helloztt on 2017/9/13.
9 | */
10 | public interface PropertyNameRepository extends JpaRepository,JpaSpecificationExecutor {
11 |
12 | PropertyName findTop1ByName(String name);
13 | }
14 |
--------------------------------------------------------------------------------
/manage-service/src/test/java/cn/lmjia/market/manage/page/ProductCreatePage.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.manage.page;
2 |
3 | import org.openqa.selenium.WebDriver;
4 |
5 | /**
6 | * @author CJ
7 | */
8 | public class ProductCreatePage extends ProductOperatePage {
9 | public ProductCreatePage(WebDriver webDriver) {
10 | super(webDriver);
11 | }
12 |
13 | @Override
14 | protected boolean isCreateNew() {
15 | return true;
16 | }
17 |
18 | @Override
19 | public void validatePage() {
20 | assertTitle("新增货品");
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/core-service/src/test/java/cn/lmjia/market/core/entity/SuperEntity.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.entity;
2 |
3 | import lombok.Getter;
4 | import lombok.Setter;
5 |
6 | import javax.persistence.Entity;
7 | import javax.persistence.Id;
8 | import javax.persistence.Inheritance;
9 | import javax.persistence.InheritanceType;
10 |
11 | /**
12 | * @author CJ
13 | */
14 | @Setter
15 | @Getter
16 | @Entity
17 | @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
18 | public abstract class SuperEntity {
19 | @Id
20 | private String id;
21 | private String p1;
22 | }
23 |
--------------------------------------------------------------------------------
/wechat-service/src/test/java/cn/lmjia/market/wechat/controller/WechatShareControllerTest.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.wechat.controller;
2 |
3 | import cn.lmjia.market.core.entity.Login;
4 | import cn.lmjia.market.wechat.WechatTestBase;
5 | import org.junit.Test;
6 |
7 | /**
8 | * @author CJ
9 | */
10 | public class WechatShareControllerTest extends WechatTestBase {
11 |
12 | @Test
13 | public void share() throws Exception {
14 | // 正常用户进入
15 | final Login newUser = createNewUserByShare();
16 |
17 | System.out.println(newUser);
18 | }
19 |
20 | }
--------------------------------------------------------------------------------
/cash-transfer/README.md:
--------------------------------------------------------------------------------
1 | # 现金转账服务
2 | 依然是按照S-A-A-S设计。
3 |
4 | 从业务形态中应该有以下几个角色参与
5 | * 业务所有者,在单业务主场景即以平台为业务主的设计。
6 | * 转账操作者,即直接操作并对负责的财务人员;可能为空 表示是系统自发行为(系统自发行为也应该有其设计者,暂不考虑)
7 | * 现金接收者,通常表现为一个银行帐号
8 |
9 | 从开发角度应该有以下角色参与
10 | * 本服务
11 | * 客户项目
12 | * 转账供应商
13 |
14 | 下面是从职能和需求上对各个角色进行详细定义。
15 |
16 | ## 业务形态
17 | ### 业务所有者
18 | 报表需求
19 | ### 转账操作者
20 | * 获取需执行的现金转账需求
21 | * 获取推荐的转战供应商
22 | * 执行转账
23 | ### 现金接收者
24 | N/a
25 |
26 | ## 开发角度
27 | ### 本服务
28 | 支撑整个服务体系,提供可持久化解决方案;记录足够详细的日志
29 | ### 客户项目
30 | ...
31 | ### 转账供应商
32 | 应该需要以下几个技术支持的操作
33 | * 查询可用余额
34 | * 查询转账记录
35 | * 执行现金转账
36 |
--------------------------------------------------------------------------------
/dealer/src/main/java/cn/lmjia/market/dealer/mvc/HighestAgent.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.dealer.mvc;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 |
9 | /**
10 | * 该值标注一个MVC方法的参数上;可以解析为当前登录者所对应的最高代理级别
11 | *
12 | * @author CJ
13 | */
14 | @Documented
15 | @Target({ElementType.PARAMETER, ElementType.ANNOTATION_TYPE})
16 | @Retention(RetentionPolicy.RUNTIME)
17 | public @interface HighestAgent {
18 | }
19 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/entity/support/PaymentStatus.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.entity.support;
2 |
3 | /**
4 | * 支付状态
5 | *
6 | * @author CJ
7 | */
8 | public enum PaymentStatus {
9 | wait("未支付"),
10 | payed("已支付"),
11 | partialPayed("部分支付"),
12 | refund("已退款"),
13 | partialRefund("部分退款");
14 |
15 | private final String message;
16 |
17 | PaymentStatus(String message) {
18 | this.message = message;
19 | }
20 |
21 | @Override
22 | public String toString() {
23 | return message;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/MainOrderRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository;
2 |
3 | import cn.lmjia.market.core.entity.MainOrder;
4 | import me.jiangcai.payment.entity.PayOrder;
5 | import org.springframework.data.jpa.repository.JpaRepository;
6 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
7 | import org.springframework.data.jpa.repository.Query;
8 |
9 | /**
10 | * @author CJ
11 | */
12 | public interface MainOrderRepository extends JpaRepository, JpaSpecificationExecutor {
13 | }
14 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/rows/AbstractRows.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.rows;
2 |
3 | import me.jiangcai.crud.row.RowDefinition;
4 |
5 | import java.time.LocalDateTime;
6 | import java.util.function.Function;
7 |
8 | /**
9 | * @author CJ
10 | */
11 | abstract class AbstractRows implements RowDefinition {
12 | protected final Function localDateTimeFormatter;
13 |
14 | AbstractRows(Function localDateTimeFormatter) {
15 | this.localDateTimeFormatter = localDateTimeFormatter;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/dealer/src/share/java/cn/lmjia/market/dealer/page/AgentPlaceOrderPage.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.dealer.page;
2 |
3 | import cn.lmjia.market.core.pages.AbstractContentPage;
4 | import org.openqa.selenium.WebDriver;
5 |
6 | /**
7 | * 代理商下单页面
8 | * orderPlace.html
9 | *
10 | * @author CJ
11 | */
12 | public class AgentPlaceOrderPage extends AbstractContentPage {
13 | public AgentPlaceOrderPage(WebDriver webDriver) {
14 | super(webDriver);
15 | }
16 |
17 | @Override
18 | public void validatePage() {
19 | assertTitle("用户订单 - 代理商后台管理");
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/repository_util/AbstractStockSettlementRepository.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.repository_util;
2 |
3 | import me.jiangcai.logistics.entity.StockSettlement;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
6 |
7 | /**
8 | * @author CJ
9 | */
10 | public interface AbstractStockSettlementRepository extends JpaRepository
11 | , JpaSpecificationExecutor {
12 | T findTop1ByOrderByTimeDesc();
13 | }
14 |
--------------------------------------------------------------------------------
/manage-service/src/test/java/cn/lmjia/market/manage/page/ManageLogisticsPage.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.manage.page;
2 |
3 | import cn.lmjia.market.core.pages.AbstractContentPage;
4 | import org.openqa.selenium.WebDriver;
5 |
6 | /**
7 | * 物流管理页面
8 | * _logisticsManage.html
9 | *
10 | * @author CJ
11 | */
12 | public class ManageLogisticsPage extends AbstractContentPage {
13 | public ManageLogisticsPage(WebDriver webDriver) {
14 | super(webDriver);
15 | }
16 |
17 | @Override
18 | public void validatePage() {
19 | assertTitle("物流管理");
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/financing/AgentGoodAdvancePaymentRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository.financing;
2 |
3 | import cn.lmjia.market.core.entity.financing.AgentGoodAdvancePayment;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
6 |
7 | /**
8 | * @author CJ
9 | */
10 | public interface AgentGoodAdvancePaymentRepository extends JpaRepository
11 | , JpaSpecificationExecutor {
12 | }
13 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/exception/UnnecessaryShipException.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.exception;
2 |
3 | import me.jiangcai.logistics.entity.Product;
4 |
5 | /**
6 | * 没必要的物流,可能是某货品已满足订单需要
7 | *
8 | * @author CJ
9 | */
10 | public class UnnecessaryShipException extends Exception {
11 |
12 | private final Product product;
13 |
14 | public UnnecessaryShipException(Product product) {
15 | this.product = product;
16 | }
17 |
18 | @Override
19 | public String getMessage() {
20 | return product.getName() + "无需再发了。";
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/wechat-service/src/test/java/cn/lmjia/market/wechat/controller/WechatSalesAchievementControllerTest.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.wechat.controller;
2 |
3 | import cn.lmjia.market.wechat.WechatTestBase;
4 | import org.junit.Test;
5 |
6 | /**
7 | * @author CJ
8 | */
9 | public class WechatSalesAchievementControllerTest extends WechatTestBase {
10 |
11 | @Test
12 | public void go() throws Exception {
13 | updateAllRunWith(newRandomLogin());
14 |
15 | mockMvc.perform(get("/api/salesList?date=&remark=false&deal=true"))
16 | .andDo(print());
17 | }
18 |
19 | }
--------------------------------------------------------------------------------
/manage-service/src/test/java/cn/lmjia/market/manage/page/ManageHelpCenterPage.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.manage.page;
2 |
3 | import cn.lmjia.market.core.pages.AbstractContentPage;
4 | import org.openqa.selenium.WebDriver;
5 |
6 | public class ManageHelpCenterPage extends AbstractContentPage {
7 |
8 | public ManageHelpCenterPage(WebDriver webDriver) {
9 | super(webDriver);
10 | }
11 |
12 | @Override
13 | public void validatePage() {
14 | assertTitle("帮助中心");
15 | }
16 |
17 | public void assertHasTopic(String title) {
18 | printHtml();
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/entity/channel/InstallmentChannel.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.entity.channel;
2 |
3 | import lombok.Getter;
4 | import lombok.Setter;
5 |
6 | import javax.persistence.Column;
7 | import javax.persistence.Entity;
8 | import java.math.BigDecimal;
9 |
10 | /**
11 | * 分期付款的渠道
12 | *
13 | * @author CJ
14 | */
15 | @Entity
16 | @Setter
17 | @Getter
18 | public class InstallmentChannel extends Channel {
19 |
20 | /**
21 | * 相比较货款所产生的手续费,支持0
22 | */
23 | @Column(scale = 9, precision = 10)
24 | private BigDecimal poundageRate = BigDecimal.ZERO;
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/repository/ProductTypeRepository.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.repository;
2 |
3 | import me.jiangcai.logistics.entity.ProductType;
4 | import me.jiangcai.logistics.entity.support.PropertyType;
5 | import org.springframework.data.jpa.repository.JpaRepository;
6 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
7 |
8 | /**
9 | * Created by helloztt on 2017/9/13.
10 | */
11 | public interface ProductTypeRepository extends JpaRepository, JpaSpecificationExecutor {
12 | ProductType findTop1ByName(String name);
13 | }
14 |
--------------------------------------------------------------------------------
/web/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 | 404
10 | /404.html
11 |
12 |
13 | 500
14 | /404.html
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/event/LoginRelationChangedEvent.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.event;
2 |
3 | import cn.lmjia.market.core.entity.Login;
4 | import lombok.Data;
5 | import me.jiangcai.lib.thread.ThreadLocker;
6 |
7 | /**
8 | * 人物关系发生改变时
9 | *
10 | * @author CJ
11 | */
12 | @Data
13 | public class LoginRelationChangedEvent implements ThreadLocker {
14 |
15 | /**
16 | * 谁的人物关系发生了改变
17 | */
18 | private final Login who;
19 |
20 | @Override
21 | public Object lockObject() {
22 | return ("LoginRelationChangedEvent-" + who.getLoginName()).intern();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/WithdrawRequestRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository;
2 |
3 | import cn.lmjia.market.core.entity.Login;
4 | import cn.lmjia.market.core.entity.withdraw.WithdrawRequest;
5 | import org.springframework.data.domain.Sort;
6 | import org.springframework.data.jpa.repository.JpaRepository;
7 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
8 |
9 | import java.util.List;
10 |
11 | public interface WithdrawRequestRepository extends JpaRepository
12 | , JpaSpecificationExecutor {
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/settlement/AgentGoodAdvancePaymentJournalRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository.settlement;
2 |
3 | import cn.lmjia.market.core.entity.settlement.AgentGoodAdvancePaymentJournal;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
6 |
7 | /**
8 | * @author CJ
9 | */
10 | public interface AgentGoodAdvancePaymentJournalRepository extends JpaRepository
11 | , JpaSpecificationExecutor {
12 | }
13 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/service/ManagerService.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.service;
2 |
3 | import cn.lmjia.market.core.entity.Manager;
4 | import cn.lmjia.market.core.entity.support.ManageLevel;
5 | import org.springframework.transaction.annotation.Transactional;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * 管理员相关服务
11 | *
12 | * @author CJ
13 | */
14 | public interface ManagerService {
15 |
16 | /**
17 | * @param manageLevel 特定管理级别
18 | * @return 拥有特定管理级别的用户
19 | */
20 | @Transactional(readOnly = true)
21 | List levelAs(ManageLevel manageLevel);
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/web/src/main/webapp/assets/css/error.css:
--------------------------------------------------------------------------------
1 | html, body {
2 | margin: 0;
3 | height: 100%;
4 | background-color: #fff;
5 | font-family: "Helvetica Neue", Helvetica, Arial, "Microsoft YaHei", sans-serif;
6 | }
7 | section {
8 | padding-top: 40px;
9 | }
10 | h1 {
11 | text-align: center;
12 | }
13 | h1 img {
14 | margin: 0 auto;
15 | display: block;
16 | width: 100px;
17 | height: auto;
18 | }
19 | .img-big {
20 | width: 200px;
21 | }
22 | h2, p {
23 | color: #676a6c;
24 | text-align: center;
25 | }
26 | .mb-no {
27 | margin-bottom: 0;
28 | }
29 | .mb-no + h2 {
30 | margin-top: 0;
31 | }
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/entity/trj/AuthorisingStatus.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.entity.trj;
2 |
3 | /**
4 | * @author CJ
5 | */
6 | public enum AuthorisingStatus {
7 | Unused("未使用"),
8 | forOrderComplete("待订单完成"),
9 | forAuditing("待信审"),
10 | auditing("信审中"),
11 | auditingRefuse("信审被拒"),
12 | forSettle("待结算"),
13 | settle("已结算");
14 |
15 | private final String message;
16 |
17 | AuthorisingStatus(String message) {
18 | this.message = message;
19 | }
20 |
21 | @Override
22 | public String toString() {
23 | return message;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/help/CommonProblemRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository.help;
2 |
3 | import cn.lmjia.market.core.entity.help.CommonProblem;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
6 | import org.springframework.data.repository.PagingAndSortingRepository;
7 |
8 | /**
9 | * @author lxf
10 | */
11 | public interface CommonProblemRepository extends JpaRepository,JpaSpecificationExecutor,PagingAndSortingRepository {
12 | }
13 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/repository_util/AbstractProductRepository.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.repository_util;
2 |
3 | import me.jiangcai.logistics.entity.Product;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * @author CJ
11 | */
12 | public interface AbstractProductRepository extends JpaRepository
13 | , JpaSpecificationExecutor {
14 | List findByEnableTrue();
15 |
16 | List findByProductTypeNull();
17 | }
18 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/service/TagService.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.service;
2 |
3 | import cn.lmjia.market.core.entity.MainGood;
4 | import cn.lmjia.market.core.entity.Tag;
5 | import org.springframework.transaction.annotation.Transactional;
6 |
7 | /**
8 | * 标签服务
9 | *
10 | * @author CJ
11 | */
12 | public interface TagService {
13 |
14 | @Transactional
15 | Tag save(Tag tag);
16 |
17 | @Transactional
18 | Tag save(String tagName);
19 |
20 | @Transactional
21 | void addTagToGood(MainGood good, String[] tags);
22 |
23 | @Transactional
24 | void delete(String name);
25 | }
26 |
--------------------------------------------------------------------------------
/core-service/src/main/resources/LoginAgentLevel.mysql.sql:
--------------------------------------------------------------------------------
1 | CREATE FUNCTION `LoginAgentLevel`(
2 | id BIGINT
3 | )
4 | RETURNS INT(11) DETERMINISTIC _LoginAgentLevel: BEGIN DECLARE result INT(11);
5 | SET @result = -1;
6 | SELECT min(`LEVEL`)
7 | INTO result
8 | FROM `agentLevel`
9 | WHERE `LOGIN_ID` = id;
10 | IF (result >= 0)
11 | THEN RETURN result;
12 | LEAVE _LoginAgentLevel; END IF;
13 | SET @result = -1;
14 | SELECT COUNT(`id`)
15 | INTO result
16 | FROM `MainOrder`
17 | WHERE `ORDERBY_ID` = id AND `ORDERSTATUS` IN (2, 3, 4, 5);
18 | IF (result > 0)
19 | THEN RETURN 100;
20 | ELSE RETURN 200; END IF;
21 | END
--------------------------------------------------------------------------------
/manage-service/src/main/resources/manage-view/mock/login.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by CJ on 26/10/2017.
3 | */
4 |
5 | Mock.setup({
6 | timeout: 500
7 | });
8 |
9 | Mock.mock(/\/manage\/login/, "get", {
10 | "draw": 1,
11 | "recordsTotal": 23,
12 | "recordsFiltered": 23,
13 | "data|10": [{
14 | 'id|+1': 1,
15 | 'name': 'test' + '@string(3)',
16 | 'mobile': /^1([34578])\d{9}$/,
17 | 'createdTime': '@datetime("yyyy-MM-dd")',
18 | 'level': '级别',
19 | 'wechatID': '@title(1)' + '@natural(10, 1000)',
20 | 'state': '@pick(启用, 禁用)',
21 | 'stateCode': '@pick([0, 1])',
22 | }]
23 | });
--------------------------------------------------------------------------------
/cash-transfer/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | market-manage
9 | cn.lmjia.market-manage
10 | 1.0-SNAPSHOT
11 |
12 |
13 | cash-transfer
14 |
15 | 现金转账服务
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/core-service/src/test/java/cn/lmjia/market/core/entity/JpaElementSelect_.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.entity;
2 |
3 | import javax.persistence.metamodel.ListAttribute;
4 | import javax.persistence.metamodel.SingularAttribute;
5 | import javax.persistence.metamodel.StaticMetamodel;
6 |
7 | /**
8 | * @author CJ
9 | */
10 | @StaticMetamodel(JpaElementSelect.class)
11 | public abstract class JpaElementSelect_ {
12 | public static volatile SingularAttribute id;
13 | public static volatile SingularAttribute name;
14 | public static volatile ListAttribute entityList;
15 | }
16 |
--------------------------------------------------------------------------------
/manage-service/src/main/resources/manage-view/mock/tagList.json:
--------------------------------------------------------------------------------
1 | {
2 | "draw": 1,
3 | "recordsTotal": 23,
4 | "recordsFiltered": 23,
5 | "data": [
6 | {
7 | "name": "净水器",
8 | "type": "商城分类",
9 | "weight": 0,
10 | "disabled": "启用"
11 | },
12 | {
13 | "name": "食品优化宝",
14 | "type": "商城分类",
15 | "weight": 0,
16 | "disabled": "启用"
17 | },
18 | {
19 | "name": "空气净化器",
20 | "type": "商城分类",
21 | "weight": 0,
22 | "disabled": "启用"
23 | },
24 | {
25 | "name": "热销",
26 | "type": "首页列表显示",
27 | "weight": 0,
28 | "disabled": "启用"
29 | }
30 | ]
31 | }
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/css/error.css:
--------------------------------------------------------------------------------
1 | html, body {
2 | margin: 0;
3 | height: 100%;
4 | background-color: #fff;
5 | font-family: "Helvetica Neue", Helvetica, Arial, "Microsoft YaHei", sans-serif;
6 | }
7 | section {
8 | padding-top: 40px;
9 | }
10 | h1 {
11 | text-align: center;
12 | }
13 | h1 img {
14 | margin: 0 auto;
15 | display: block;
16 | width: 100px;
17 | height: auto;
18 | }
19 | .img-big {
20 | width: 200px;
21 | }
22 | h2, p{
23 | color: #676a6c;
24 | text-align: center;
25 | }
26 |
27 | .mb-no {
28 | margin-bottom: 0;
29 | }
30 | .mb-no + h2 {
31 | margin-top: 0;
32 | }
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/model/TimeLineUnit.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.model;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * 时间线单元
9 | *
10 | * @author CJ
11 | */
12 | @Data
13 | @NoArgsConstructor
14 | @AllArgsConstructor
15 | public class TimeLineUnit {
16 | /**
17 | * 事项
18 | */
19 | private String topic;
20 | /**
21 | * 时间相关
22 | */
23 | private Object temporal;
24 |
25 | /**
26 | * 是否已完成
27 | */
28 | private boolean success;
29 | /**
30 | * 是否还未启动
31 | */
32 | private boolean wait;
33 | }
34 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/ContactWayRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository;
2 |
3 | import cn.lmjia.market.core.entity.ContactWay;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * @author CJ
11 | */
12 | public interface ContactWayRepository extends JpaRepository, JpaSpecificationExecutor {
13 | /**
14 | * 根据电话号获取联系人.
15 | * @param mobile 手机号
16 | * @return 联系人
17 | */
18 | ContactWay findByMobile(String mobile);
19 | }
20 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/MainGoodRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository;
2 |
3 | import cn.lmjia.market.core.entity.MainGood;
4 | import cn.lmjia.market.core.entity.MainProduct;
5 | import org.springframework.data.jpa.repository.JpaRepository;
6 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
7 |
8 | import java.util.List;
9 |
10 | /**
11 | * @author CJ
12 | */
13 | public interface MainGoodRepository extends JpaRepository, JpaSpecificationExecutor {
14 |
15 | MainGood findByProduct(MainProduct product);
16 |
17 | List findByEnableTrue();
18 | }
19 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/trj/TRJEnhanceConfig.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.trj;
2 |
3 | import org.springframework.context.annotation.ComponentScan;
4 | import org.springframework.context.annotation.Configuration;
5 |
6 | /**
7 | * 投融家相关配置
8 | *
9 | * @author CJ
10 | */
11 | @Configuration
12 | @ComponentScan(
13 | {"cn.lmjia.market.core.trj.service", "cn.lmjia.market.core.trj.controller"}
14 | )
15 | public class TRJEnhanceConfig {
16 |
17 | /**
18 | * 投融家订单的下单地址
19 | */
20 | public static final String TRJOrderURI = "/wechatTRJOrder";
21 | public static final String SS_PriceKey = "trj.order.price";
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/dealer/src/main/resources/dealer-view/dealer-resource/js/repairDetail.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Neo on 2017/5/5.
3 | */
4 | $(function () {
5 | "use strict";
6 |
7 | $('.img-feedback-list').find('img').click(function () {
8 | var $img = $('
').attr('src', $(this).attr('src'));
9 | var content = $('').append($img);
10 | window.top.layer.open({
11 | type: 1,
12 | shade: 0.5,
13 | title: false,
14 | shadeClose: true,
15 | area: ['auto', 'auto'],
16 | content: content.html()
17 | });
18 | });
19 | });
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # market-manage
2 | ## 当前状态
3 | * production:[](https://travis-ci.org/JoleneOL/market-manage/branches)
4 | * master:[](https://travis-ci.org/JoleneOL/market-manage/branches)
5 |
6 | 它会尽可能将所有模块区分开;每个模块都具备模板处理和静态资源处理的功能
7 |
8 |
9 | ## dealer 分销管理
10 | 负责管理整个代理体系并不负责销售和安装
11 |
12 | ## manage-service 系统管理
13 | 负责管理高阶管理员各项管理职能;比如各种系统运行参数的调整以及所有登录体系的许可
14 |
15 | ## web 项目
16 | 管理各模块共享的web资源
17 |
18 | ## logistics 物流API
19 | 独立设计的物流API,它不依赖于其他项目
20 |
21 | ### 注意
22 | 目前暂时将所有页面都管理与web模块,这是仅仅临时的解决方案
23 | /web/src/main/webapp/
--------------------------------------------------------------------------------
/wechat-service/src/main/java/cn/lmjia/market/wechat/repository/LimitQRCodeRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.wechat.repository;
2 |
3 | import cn.lmjia.market.core.entity.Login;
4 | import cn.lmjia.market.wechat.entity.LimitQRCode;
5 | import org.springframework.data.jpa.repository.JpaRepository;
6 |
7 | /**
8 | * @author CJ
9 | */
10 | public interface LimitQRCodeRepository extends JpaRepository
{
11 |
12 | //id最大的
13 | LimitQRCode findTopByOrderByIdDesc();
14 |
15 | //最长没用的
16 | LimitQRCode findTopByOrderByLastUseTimeAsc();
17 |
18 | LimitQRCode findByLogin(Login login);
19 |
20 | LimitQRCode findByLogin_Id(long id);
21 | }
22 |
--------------------------------------------------------------------------------
/wechat-service/src/test/java/cn/lmjia/market/wechat/controller/order/WechatMainOrderControllerTest3.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.wechat.controller.order;
2 |
3 | import cn.lmjia.market.core.service.SystemService;
4 | import cn.lmjia.market.wechat.page.WechatOrderPageForHB;
5 |
6 | /**
7 | * 针对花呗的订单测试
8 | *
9 | * @author CJ
10 | */
11 | public class WechatMainOrderControllerTest3 extends AbstractWechatMainOrderControllerTest {
12 |
13 | @Override
14 | protected WechatOrderPageForHB openOrderPage() {
15 | driver.get("http://localhost" + SystemService.wechatOrderURiHB);
16 | return initPage(WechatOrderPageForHB.class);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/dealer/src/main/resources/dealer-view/dealer-resource/js/refundOperate.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Chang on 2017/5/7.
3 | */
4 | $(function () {
5 | $('#J_date').datetimepicker({
6 | todayBtn: "linked",
7 | language: "zh-CN",
8 | autoclose: true,
9 | format: "yyyy-m-d",
10 | clearBtn: true,
11 | todayHighlight: true,
12 | minView: 2,
13 | startDate: new Date()
14 | });
15 |
16 | $('#J_time').datetimepicker({
17 | language: "zh-CN",
18 | format: "h:i",
19 | autoclose: true,
20 | clearBtn: true,
21 | startView: 1,
22 | minView: 0,
23 | maxView: 1
24 | });
25 | });
--------------------------------------------------------------------------------
/wechat-service/src/test/java/cn/lmjia/market/wechat/page/WechatSharePage.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.wechat.page;
2 |
3 | import org.openqa.selenium.By;
4 | import org.openqa.selenium.WebDriver;
5 |
6 | /**
7 | * 分享页面
8 | * shareQC.html
9 | *
10 | * @author CJ
11 | */
12 | public class WechatSharePage extends AbstractWechatPage {
13 | public WechatSharePage(WebDriver webDriver) {
14 | super(webDriver);
15 | }
16 |
17 | @Override
18 | public void validatePage() {
19 | assertTitle("分享二维码");
20 | }
21 |
22 | public String getShareUrl() {
23 | return webDriver.findElement(By.tagName("body")).getAttribute("data-url");
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by .ignore support plugin (hsz.mobi)
2 | ### Example user template template
3 | ### Example user template
4 |
5 | # IntelliJ project files
6 | .idea
7 | *.iml
8 | out
9 | gen
10 | ### Maven template
11 | target/
12 | pom.xml.tag
13 | pom.xml.releaseBackup
14 | pom.xml.versionsBackup
15 | pom.xml.next
16 | release.properties
17 | dependency-reduced-pom.xml
18 | buildNumber.properties
19 | .mvn/timing.properties
20 |
21 | # Avoid ignoring Maven wrapper jar file (.jar files are usually ignored)
22 | !/.mvn/wrapper/maven-wrapper.jar
23 |
24 | /dealer/src/main/webapp/
25 | /core-service/src/main/webapp/
26 | /wechat-service/src/main/webapp/
27 | /manage-service/src/main/webapp/
28 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/deal/AgentLevelRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository.deal;
2 |
3 | import cn.lmjia.market.core.entity.Login;
4 | import cn.lmjia.market.core.entity.deal.AgentLevel;
5 | import cn.lmjia.market.core.entity.deal.AgentSystem;
6 | import cn.lmjia.market.core.util.AbstractAgentLevelRepository;
7 |
8 | import java.util.List;
9 |
10 | /**
11 | * @author CJ
12 | */
13 | public interface AgentLevelRepository extends AbstractAgentLevelRepository {
14 |
15 | AgentLevel findTopByLoginAndLevel(Login login, int level);
16 |
17 | List findBySystemAndSuperiorNotNull(AgentSystem system);
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/logistics-haier/src/main/java/me/jiangcai/logistics/haier/util/LocalDateTimeConverter.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.haier.util;
2 |
3 | import com.fasterxml.jackson.databind.util.StdConverter;
4 |
5 | import java.time.LocalDateTime;
6 | import java.time.format.DateTimeFormatter;
7 | import java.util.Locale;
8 |
9 | /**
10 | * @author CJ
11 | */
12 | public class LocalDateTimeConverter extends StdConverter {
13 | private static final DateTimeFormatter format = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss", Locale.CHINA);
14 |
15 | @Override
16 | public LocalDateTime convert(String value) {
17 | return LocalDateTime.parse(value, format);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/manage-service/src/test/java/cn/lmjia/market/manage/controller/ManageAgentGoodAdvancePaymentControllerTest.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.manage.controller;
2 |
3 | import cn.lmjia.market.core.entity.support.ManageLevel;
4 | import cn.lmjia.market.manage.ManageServiceTest;
5 | import cn.lmjia.market.manage.page.ManageAgentGoodAdvancePaymentPage;
6 | import org.junit.Test;
7 |
8 | /**
9 | * @author CJ
10 | */
11 | public class ManageAgentGoodAdvancePaymentControllerTest extends ManageServiceTest {
12 |
13 | @Test
14 | public void go() {
15 | updateAllRunWith(newRandomManager(ManageLevel.root));
16 | ManageAgentGoodAdvancePaymentPage.of(this, driver);
17 | // 添加一个
18 | }
19 |
20 | }
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/TagRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository;
2 |
3 | import cn.lmjia.market.core.entity.Tag;
4 | import cn.lmjia.market.core.entity.support.TagType;
5 | import org.springframework.data.jpa.repository.JpaRepository;
6 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
7 |
8 | import java.util.List;
9 |
10 | /**
11 | * Created by helloztt on 2017-09-16.
12 | */
13 | public interface TagRepository extends JpaRepository, JpaSpecificationExecutor {
14 | List findByDisabledFalseOrderByWeightDesc();
15 |
16 | List findByTypeAndDisabledFalseOrderByWeightDesc(TagType tagType);
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/dealer/src/share/java/cn/lmjia/market/dealer/page/AgentDetailPage.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.dealer.page;
2 |
3 | import cn.lmjia.market.core.pages.AbstractContentPage;
4 | import org.openqa.selenium.WebDriver;
5 |
6 | /**
7 | * agentDetail.html
8 | *
9 | * @author CJ
10 | */
11 | public class AgentDetailPage extends AbstractContentPage {
12 |
13 | public AgentDetailPage(WebDriver webDriver) {
14 | super(webDriver);
15 | }
16 |
17 | @Override
18 | public void validatePage() {
19 | assertTitle("代理商详情 - 代理商后台管理");
20 | }
21 |
22 | public AgentManagePage back() {
23 | clickBreadcrumb();
24 | return initPage(AgentManagePage.class);
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/event/InstallationEvent.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.event;
2 |
3 | import lombok.Data;
4 | import me.jiangcai.logistics.entity.StockShiftUnit;
5 |
6 | import java.time.LocalDateTime;
7 |
8 | /**
9 | * 安装完成事件
10 | * 应当确保在事务内发起该事件!不然必然出问题!
11 | * 如果物流供应商没有提供安装信息,可以提供null
12 | *
13 | * @author CJ
14 | */
15 | @Data
16 | public class InstallationEvent {
17 | /**
18 | * 事务内实体
19 | */
20 | private final StockShiftUnit unit;
21 | private final String installer;
22 | private final String installCompany;
23 | private final String mobile;
24 | /**
25 | * 不可为null
26 | */
27 | private final LocalDateTime installTime;
28 | }
29 |
--------------------------------------------------------------------------------
/manage-service/src/main/resources/manage-view/mock/helpCenter.js:
--------------------------------------------------------------------------------
1 | Mock.setup({
2 | timeout: 1000
3 | });
4 |
5 | Mock.mock(/\/manage\/commonProblemList/, {
6 | "draw": 1,
7 | "recordsTotal": 23,
8 | "recordsFiltered": 23,
9 | "data|5": [
10 | {
11 | 'id': '@id',
12 | 'title': '@ctitle',
13 | /*'updateTime': '@datetime("yyyy-MM-dd")',*/
14 | 'enableLabel': '@pick(启用, 禁用)',
15 | 'enable': '@pick([true, false])',
16 | 'isHotLabel':'@pick(展示,隐藏)',
17 | 'weight':'50'
18 | }
19 | ]
20 | });
21 |
22 | Mock.mock(/\/help\/entry\/\d/, "delete", {
23 | "resultCode": 200,
24 | "resultMsg": "ok"
25 | });
--------------------------------------------------------------------------------
/web/src/main/java/cn/lmjia/market/web/config/SecurityWebApplicationInitializer.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.web.config;
2 |
3 | import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer;
4 | import org.springframework.web.filter.RequestContextFilter;
5 |
6 | import javax.servlet.ServletContext;
7 |
8 | /**
9 | * @author CJ
10 | */
11 | public class SecurityWebApplicationInitializer extends AbstractSecurityWebApplicationInitializer {
12 | @Override
13 | protected void beforeSpringSecurityFilterChain(ServletContext servletContext) {
14 | super.beforeSpringSecurityFilterChain(servletContext);
15 | insertFilters(servletContext, new RequestContextFilter());
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/web/src/test/java/cn/lmjia/market/web/controller/WebTest.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.web.controller;
2 |
3 | import cn.lmjia.market.dealer.DealerServiceTest;
4 | import cn.lmjia.market.web.config.WebConfig;
5 | import org.springframework.context.annotation.Configuration;
6 | import org.springframework.context.annotation.PropertySource;
7 | import org.springframework.test.context.ContextConfiguration;
8 |
9 | /**
10 | * @author CJ
11 | */
12 | @ContextConfiguration(classes = {WebConfig.class, WebTest.Config.class})
13 | public abstract class WebTest extends DealerServiceTest {
14 |
15 | @Configuration
16 | @PropertySource("classpath:/local_aliyun.properties")
17 | public static class Config {
18 |
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/define/MarketUserNoticeType.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.define;
2 |
3 | import me.jiangcai.user.notice.UserNoticeType;
4 | import me.jiangcai.wx.model.message.TemplateMessageParameter;
5 |
6 | import java.util.Collection;
7 |
8 | /**
9 | * @author CJ
10 | */
11 | public interface MarketUserNoticeType extends UserNoticeType {
12 |
13 | /**
14 | * @return 如果不适用于微信模板消息可以返回null
15 | */
16 | Collection extends TemplateMessageParameter> parameterStyles();
17 |
18 | /**
19 | * @return 类型
20 | */
21 | MarketNoticeType type();
22 |
23 | @Override
24 | default String id() {
25 | return type().getUserNoticeTypeId();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/define/Money.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.define;
2 |
3 | import lombok.Data;
4 |
5 | import java.io.Serializable;
6 | import java.math.BigDecimal;
7 | import java.text.NumberFormat;
8 | import java.util.Locale;
9 |
10 | /**
11 | * 钱
12 | * 特指人民币
13 | *
14 | * @author CJ
15 | */
16 | @Data
17 | public class Money implements Serializable {
18 |
19 | public static final NumberFormat format = NumberFormat.getCurrencyInstance(Locale.CHINA);
20 | private static final long serialVersionUID = -4928092332934155142L;
21 | private final BigDecimal amount;
22 |
23 | @Override
24 | public String toString() {
25 | return format.format(amount);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/manage-service/src/test/java/cn/lmjia/market/manage/controller/ManageLoginControllerTest.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.manage.controller;
2 |
3 | import cn.lmjia.market.core.entity.support.ManageLevel;
4 | import cn.lmjia.market.manage.ManageServiceTest;
5 | import cn.lmjia.market.manage.page.ManageLoginPage;
6 | import org.junit.Test;
7 |
8 | /**
9 | * @author CJ
10 | */
11 | public class ManageLoginControllerTest extends ManageServiceTest {
12 |
13 | @Test
14 | public void go() {
15 | updateAllRunWith(newRandomManager(ManageLevel.root));
16 |
17 | ManageLoginPage.of(this, driver);
18 | // ManageLoginPage page = ManageLoginPage.of(this, driver);
19 | // page.printThisPage();
20 | }
21 |
22 | }
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/entity/trj/TRJPayOrder.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.entity.trj;
2 |
3 | import cn.lmjia.market.core.trj.TRJService;
4 | import lombok.Getter;
5 | import lombok.Setter;
6 | import me.jiangcai.payment.PaymentForm;
7 | import me.jiangcai.payment.entity.PayOrder;
8 |
9 | import javax.persistence.Entity;
10 | import javax.persistence.OneToOne;
11 |
12 | /**
13 | * @author CJ
14 | */
15 | @Entity
16 | @Setter
17 | @Getter
18 | public class TRJPayOrder extends PayOrder {
19 |
20 | @OneToOne
21 | private AuthorisingInfo authorisingInfo;
22 |
23 | @Override
24 | public Class extends PaymentForm> getPaymentFormClass() {
25 | return TRJService.class;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/manage-service/src/test/java/cn/lmjia/market/manage/controller/ManageControllerTest.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.manage.controller;
2 |
3 | import cn.lmjia.market.core.entity.Login;
4 | import cn.lmjia.market.manage.ManageServiceTest;
5 | import org.junit.Test;
6 |
7 | import static org.assertj.core.api.Assertions.assertThat;
8 |
9 | /**
10 | * @author CJ
11 | */
12 | public class ManageControllerTest extends ManageServiceTest {
13 |
14 | @Override
15 | protected Login allRunWith() {
16 | return newRandomManager();
17 | }
18 |
19 | @Test
20 | public void go() {
21 | driver.get("http://localhost/manage");
22 | assertThat(driver.getTitle())
23 | .contains("公司后台管理");
24 | }
25 | }
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/entity/support/CommissionType.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.entity.support;
2 |
3 | /**
4 | * @author CJ
5 | */
6 | public enum CommissionType {
7 | directMarketing("直销"),
8 | marketing("销售"),
9 | guideMarketing("推荐"),
10 | regionService("地域"),
11 | sales("促销"),
12 | other("其他"),
13 | /**
14 | * 直接销售奖励
15 | */
16 | firstMarketing("销售"),
17 | /**
18 | * 直接推荐奖励
19 | */
20 | firstGuide("推荐"),;
21 |
22 | private final String message;
23 |
24 | CommissionType(String message) {
25 | this.message = message;
26 | }
27 |
28 | @Override
29 | public String toString() {
30 | return message;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/wechat-service/src/test/java/cn/lmjia/market/wechat/page/WechatOrderPageForHB.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.wechat.page;
2 |
3 | import org.openqa.selenium.WebDriver;
4 | import org.openqa.selenium.WebElement;
5 | import org.openqa.selenium.support.FindBy;
6 |
7 | /**
8 | * @author CJ
9 | */
10 | public class WechatOrderPageForHB extends WechatOrderPage {
11 |
12 | @FindBy(id = "J_installment")
13 | private WebElement checkBox;
14 |
15 | public WechatOrderPageForHB(WebDriver webDriver) {
16 | super(webDriver);
17 | }
18 |
19 | @Override
20 | protected void typeOtherInformation() {
21 | super.typeOtherInformation();
22 | if (!checkBox.isSelected())
23 | checkBox.click();
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/entity/financing/OutgoRecord.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.entity.financing;
2 |
3 | import lombok.Getter;
4 | import lombok.Setter;
5 |
6 | import javax.persistence.Entity;
7 | import javax.persistence.GeneratedValue;
8 | import javax.persistence.GenerationType;
9 | import javax.persistence.Id;
10 | import javax.persistence.Inheritance;
11 | import javax.persistence.InheritanceType;
12 |
13 | /**
14 | * 财务支出记录
15 | *
16 | * @author CJ
17 | */
18 | @Entity
19 | @Inheritance(strategy = InheritanceType.JOINED)
20 | @Setter
21 | @Getter
22 | public class OutgoRecord extends FinancingRecord {
23 |
24 | @Id
25 | @GeneratedValue(strategy = GenerationType.IDENTITY)
26 | private Long id;
27 | }
28 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/event/MainOrderFinishEvent.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.event;
2 |
3 | import cn.lmjia.market.core.entity.MainOrder;
4 | import lombok.Data;
5 | import me.jiangcai.lib.thread.ThreadLocker;
6 | import me.jiangcai.logistics.event.InstallationEvent;
7 |
8 | /**
9 | * 订单完成时间,可以引发诸如佣金收益之类的;总是因为安装事件导致的
10 | *
11 | * @author CJ
12 | */
13 | @Data
14 | public class MainOrderFinishEvent implements ThreadLocker {
15 | /**
16 | * 事务内订单
17 | */
18 | private final MainOrder mainOrder;
19 | /**
20 | * 可选
21 | */
22 | private final InstallationEvent source;
23 |
24 | @Override
25 | public Object lockObject() {
26 | return mainOrder.lockObject();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/dealer/src/main/resources/dealer-view/mock/agentList.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_count": 300,
3 | "items": [
4 | {
5 | "id": 1,
6 | "level": 0,
7 | "rank": "浙江省总代"
8 | },
9 | {
10 | "id": 11,
11 | "level": 1,
12 | "rank": "杭州市总代"
13 | },
14 | {
15 | "id": 21,
16 | "level": 2,
17 | "rank": "江干区总代理"
18 | },
19 | {
20 | "id": 31,
21 | "level": 2,
22 | "rank": "滨江区总代理"
23 | },
24 | {
25 | "id": 32,
26 | "level": 2,
27 | "rank": "拱墅区总代理"
28 | },
29 | {
30 | "id": 33,
31 | "level": 3,
32 | "rank": "滨江长河代理商"
33 | },
34 | {
35 | "id": 34,
36 | "level": 3,
37 | "rank": "拱墅运河代理商"
38 | }
39 | ]
40 | }
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/model/DeliverableOrderId.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.model;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.EqualsAndHashCode;
5 | import lombok.Getter;
6 | import lombok.NoArgsConstructor;
7 | import lombok.Setter;
8 | import me.jiangcai.logistics.DeliverableOrder;
9 |
10 | import java.io.Serializable;
11 |
12 | /**
13 | * @author CJ
14 | */
15 | @Setter
16 | @Getter
17 | @EqualsAndHashCode
18 | @NoArgsConstructor
19 | @AllArgsConstructor
20 | public class DeliverableOrderId {
21 | private Class extends DeliverableOrder> type;
22 | private Serializable id;
23 |
24 | @Override
25 | public String toString() {
26 | return type.getName() + ":" + id;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/entity/financing/IncomeRecord.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.entity.financing;
2 |
3 | import lombok.Getter;
4 | import lombok.Setter;
5 |
6 | import javax.persistence.Entity;
7 | import javax.persistence.GeneratedValue;
8 | import javax.persistence.GenerationType;
9 | import javax.persistence.Id;
10 | import javax.persistence.Inheritance;
11 | import javax.persistence.InheritanceType;
12 |
13 | /**
14 | * 财务收入记录,并不包括下单
15 | *
16 | * @author CJ
17 | */
18 | @Entity
19 | @Inheritance(strategy = InheritanceType.JOINED)
20 | @Setter
21 | @Getter
22 | public class IncomeRecord extends FinancingRecord {
23 | @Id
24 | @GeneratedValue(strategy = GenerationType.IDENTITY)
25 | private Long id;
26 | }
27 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/settlement/LoginCommissionJournalRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository.settlement;
2 |
3 | import cn.lmjia.market.core.entity.Login;
4 | import cn.lmjia.market.core.entity.settlement.LoginCommissionJournal;
5 | import org.springframework.data.jpa.repository.JpaRepository;
6 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
7 |
8 | import java.util.List;
9 |
10 | /**
11 | * @author CJ
12 | */
13 | public interface LoginCommissionJournalRepository extends JpaRepository
14 | , JpaSpecificationExecutor {
15 |
16 | List findByLoginOrderByHappenTimeAsc(Login login);
17 | }
18 |
--------------------------------------------------------------------------------
/core-service/src/test/java/cn/lmjia/market/core/define/MoneyTest.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.define;
2 |
3 | import org.junit.Test;
4 |
5 | import java.math.BigDecimal;
6 | import java.util.Random;
7 |
8 | import static org.assertj.core.api.Assertions.assertThat;
9 |
10 | /**
11 | * @author CJ
12 | */
13 | public class MoneyTest {
14 |
15 | @Test
16 | public void go() {
17 | Money money = new Money(BigDecimal.valueOf(new Random().nextDouble()).multiply(BigDecimal.valueOf(10000)));
18 | System.out.println(money.toString());
19 | money = new Money(new BigDecimal("2820.00000000000000000000"));
20 | System.out.println(money.toString());
21 | assertThat(true)
22 | .isTrue();
23 | }
24 |
25 | }
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/deal/CommissionRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository.deal;
2 |
3 | import cn.lmjia.market.core.entity.deal.Commission;
4 | import cn.lmjia.market.core.entity.deal.OrderCommission;
5 | import org.springframework.data.jpa.repository.JpaRepository;
6 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
7 |
8 | import java.util.List;
9 |
10 | /**
11 | * @author CJ
12 | */
13 | public interface CommissionRepository extends JpaRepository, JpaSpecificationExecutor {
14 |
15 | List findByOrderCommission(OrderCommission orderCommission);
16 |
17 | long deleteByOrderCommission(OrderCommission orderCommission);
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/core-service/src/main/resources/script/auto-recall.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 自动重新调用
3 | * https://kuanyes.quip.com/gA1PAfnTc3TP#QPLACAcfQZ5
4 | * Created by CJ on 30/07/2017.
5 | */
6 | if (_this.executedCount >= 5) {
7 | //延迟到10年之后
8 | _this.targetInstant = _this.targetInstant.plusSeconds(315569520);
9 | } else if (_this.executedCount >= 4) {
10 | _this.targetInstant = _this.targetInstant.plusSeconds(3 * 3600);
11 | } else if (_this.executedCount >= 3) {
12 | _this.targetInstant = _this.targetInstant.plusSeconds(30 * 60);
13 | } else if (_this.executedCount >= 2) {
14 | _this.targetInstant = _this.targetInstant.plusSeconds(10 * 60);
15 | } else if (_this.executedCount >= 1) {
16 | _this.targetInstant = _this.targetInstant.plusSeconds(2 * 60);
17 | }
18 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/entity/deal/AgentRate.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.entity.deal;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | import javax.persistence.Column;
8 | import javax.persistence.Embeddable;
9 | import java.math.BigDecimal;
10 |
11 | /**
12 | * 每一个等级的奖励设置
13 | *
14 | * @author CJ
15 | */
16 | @Data
17 | @NoArgsConstructor
18 | @AllArgsConstructor
19 | @Embeddable
20 | public class AgentRate {
21 | /**
22 | * 销售奖励提成
23 | */
24 | @Column(scale = 8, precision = 10)
25 | private BigDecimal marketRate;
26 | /**
27 | * 推荐奖励提成
28 | */
29 | @Column(scale = 8, precision = 10)
30 | private BigDecimal recommendRate;
31 | }
32 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/deal/OrderCommissionRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository.deal;
2 |
3 | import cn.lmjia.market.core.entity.MainOrder;
4 | import cn.lmjia.market.core.entity.deal.OrderCommission;
5 | import cn.lmjia.market.core.entity.deal.pk.OrderCommissionPK;
6 | import org.springframework.data.jpa.repository.JpaRepository;
7 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
8 |
9 | import java.util.List;
10 |
11 | /**
12 | * @author CJ
13 | */
14 | public interface OrderCommissionRepository extends JpaRepository
15 | , JpaSpecificationExecutor {
16 |
17 | List findBySource(MainOrder mainOrder);
18 | }
19 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/util/AbstractLoginRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.util;
2 |
3 | import cn.lmjia.market.core.entity.Login;
4 | import org.springframework.data.jpa.repository.JpaRepository;
5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * @author CJ
11 | */
12 | public interface AbstractLoginRepository extends JpaRepository, JpaSpecificationExecutor {
13 |
14 | T findByLoginName(String name);
15 |
16 | List findBySuccessOrderTrue();
17 |
18 | long countByGuideUser(Login guide);
19 |
20 | List findByGuideUser(Login guide);
21 |
22 | List findByGuideUserAndSuccessOrderTrue(Login guide);
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/dealer/src/share/java/cn/lmjia/market/dealer/page/AgentOrderManagePage.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.dealer.page;
2 |
3 | import cn.lmjia.market.core.pages.AbstractContentPage;
4 | import org.openqa.selenium.By;
5 | import org.openqa.selenium.WebDriver;
6 |
7 | /**
8 | * 代理商管理订单的页面
9 | * orderManage.html
10 | *
11 | * @author CJ
12 | */
13 | public class AgentOrderManagePage extends AbstractContentPage {
14 | public AgentOrderManagePage(WebDriver webDriver) {
15 | super(webDriver);
16 | }
17 |
18 | @Override
19 | public void validatePage() {
20 | assertTitle("用户订单 - 代理商后台管理");
21 | }
22 |
23 | public String placeOrderUri() {
24 | return webDriver.findElement(By.tagName("body")).getAttribute("data-place-url");
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/service/ProductTypeServiceImpl.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.service;
2 |
3 | import me.jiangcai.logistics.ProductTypeService;
4 | import me.jiangcai.logistics.entity.ProductType;
5 | import me.jiangcai.logistics.repository.ProductTypeRepository;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.stereotype.Service;
8 |
9 | /**
10 | * Created by helloztt on 2017-09-26.
11 | */
12 | @Service("productTypeService")
13 | public class ProductTypeServiceImpl implements ProductTypeService {
14 | @Autowired
15 | private ProductTypeRepository typeRepository;
16 | @Override
17 | public ProductType findOne(Long id) {
18 | return typeRepository.findOne(id);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/web/src/main/webapp/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | 404 Not Found
11 |
12 |
13 |
14 |
15 | 
16 | 页面未找到
17 | 抱歉,页面可能不存在~
18 |
19 |
20 |
--------------------------------------------------------------------------------
/web/src/main/webapp/500.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | 服务器内部错误
11 |
12 |
13 |
14 |
15 | 
16 | 服务器内部错误
17 | 服务器好像出错了,请联系管理人员。
18 |
19 |
20 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/Version.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core;
2 |
3 | /**
4 | * 合并该文件时,请必须注意新增的(未发布的)必须在已发布的后面!!
5 | *
6 | * @author CJ
7 | */
8 | public enum Version {
9 | init,
10 | /**
11 | * 订单包含多样商品版本
12 | */
13 | muPartOrder,
14 | /**
15 | * 新的登录体系
16 | * 在登录关系中不再存在所谓200的客户关系
17 | */
18 | newLogin,
19 | /**
20 | * 一个订单支持多个物流
21 | */
22 | muPartShift,
23 | /**
24 | * 促销人员体系
25 | */
26 | salesman,
27 | /**
28 | * 商城
29 | */
30 | mall,
31 | deleteProduct,
32 | /**
33 | * 178 165新分佣体系
34 | */
35 | newCommission,
36 | /**
37 | * 引导者改变
38 | */
39 | changeGuide,
40 | /**
41 | * 商品分享
42 | */
43 | goodShare
44 | }
45 |
--------------------------------------------------------------------------------
/manage-service/src/main/resources/manage-view/mock/orderDelivery.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 发货相关互动
3 | * Created by CJ on 13/09/2017.
4 | */
5 | // 如果要输入什么信息的话
6 | Mock.mock(/\/api\/logisticsShip/, {
7 | "resultCode": 302,
8 | "resultMsg": "把快递单号给我呀"
9 | });
10 | // 成功->剩余库存
11 | // Mock.mock(/\/api\/logisticsShip/, {
12 | // "resultCode": 200,
13 | // "resultMsg": "ok",
14 | // "data": {
15 | // 1: {
16 | // 1: '2000',
17 | // 2: '1000',
18 | // 3: '200'
19 | // },
20 | // 2: {
21 | // 1: '2000',
22 | // 2: '200',
23 | // 3: '400'
24 | // },
25 | // 3: {
26 | // 1: '500',
27 | // 2: '200',
28 | // 3: '0'
29 | // }
30 | // }
31 | // });
--------------------------------------------------------------------------------
/manage-service/src/test/java/cn/lmjia/market/manage/page/ProductDetailPage.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.manage.page;
2 |
3 | import cn.lmjia.market.core.pages.AbstractContentPage;
4 | import org.openqa.selenium.By;
5 | import org.openqa.selenium.WebDriver;
6 |
7 | /**
8 | * 货品详情
9 | * _productDetail.html
10 | *
11 | * @author CJ
12 | */
13 | public class ProductDetailPage extends AbstractContentPage {
14 | public ProductDetailPage(WebDriver webDriver) {
15 | super(webDriver);
16 | }
17 |
18 | @Override
19 | public void validatePage() {
20 | assertTitle("货品详情");
21 | }
22 |
23 | public ProductEditPage clickEdit() {
24 | webDriver.findElement(By.partialLinkText("修改")).click();
25 | return initPage(ProductEditPage.class);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/entity/record/ProductAmountRecord.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.entity.record;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Column;
6 | import javax.persistence.Embeddable;
7 | import java.math.BigDecimal;
8 |
9 | /**
10 | * @author CJ
11 | */
12 | @Data
13 | @Embeddable
14 | public class ProductAmountRecord {
15 | @Column(length = 40)
16 | private String productName;
17 | @Column(length = 20)
18 | private String productType;
19 | private int amount;
20 | /**
21 | * 购买时价格
22 | */
23 | @Column(scale = 2, precision = 12)
24 | private BigDecimal price;
25 | /**
26 | * 享受佣金 的价格
27 | */
28 | @Column(scale = 2, precision = 12)
29 | private BigDecimal commissioningPrice;
30 | }
31 |
--------------------------------------------------------------------------------
/dealer/src/test/java/cn/lmjia/market/core/service/MainOrderServiceTest.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.service;
2 |
3 | import cn.lmjia.market.core.entity.Login;
4 | import cn.lmjia.market.dealer.DealerServiceTest;
5 | import org.junit.Test;
6 |
7 | import static org.assertj.core.api.Assertions.assertThat;
8 |
9 | /**
10 | * @author CJ
11 | */
12 | public class MainOrderServiceTest extends DealerServiceTest {
13 |
14 | @Test
15 | public void newOrder() throws Exception {
16 | Login login1 = randomLogin(false);
17 | Login login2 = randomLogin(false);
18 | newRandomOrderFor(login1, login2);
19 | // newRandomOrderFor(login1, login2);
20 | // newRandomOrderFor(login1, login2);
21 | assertThat(true)
22 | .isTrue();
23 | }
24 |
25 | }
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/entity/deal/pk/OrderCommissionPK.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.entity.deal.pk;
2 |
3 | import cn.lmjia.market.core.entity.MainOrder;
4 | import lombok.AllArgsConstructor;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | import java.io.Serializable;
9 |
10 | /**
11 | * @author CJ
12 | */
13 | @Data
14 | @AllArgsConstructor
15 | @NoArgsConstructor
16 | public class OrderCommissionPK implements Serializable {
17 |
18 | private long source;
19 | private boolean refund;
20 |
21 | public OrderCommissionPK(MainOrder order) {
22 | this(order, false);
23 | }
24 |
25 | public OrderCommissionPK(MainOrder order, boolean refund) {
26 | source = order.getId();
27 | this.refund = refund;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/wechat-service/src/test/java/cn/lmjia/market/wechat/service/WechatInitServiceTest.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.wechat.service;
2 |
3 | import cn.lmjia.market.wechat.WechatTestBase;
4 | import me.jiangcai.lib.sys.service.SystemStringService;
5 | import org.junit.Test;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 |
8 | /**
9 | * @author CJ
10 | */
11 | public class WechatInitServiceTest extends WechatTestBase {
12 |
13 | // 企业介绍 利每家企业介绍
14 | // 企业视频 利每家企业宣传片
15 | // 招商加盟 利每家招商加盟
16 | @Autowired
17 | private SystemStringService systemStringService;
18 |
19 | @Test
20 | public void go() {
21 | // 参数调整之后可以接受到事件
22 | systemStringService.updateSystemString("market.first.menus", "企业介绍:利每家企业介绍|企业视频:利每家企业宣传片|招商加盟:利每家招商加盟");
23 | }
24 |
25 | }
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/controller/equipment/EquipmentDataController.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.controller.equipment;
2 |
3 | import cn.lmjia.market.core.model.ApiResult;
4 | import org.springframework.stereotype.Controller;
5 | import org.springframework.web.bind.annotation.RequestMapping;
6 | import org.springframework.web.bind.annotation.RequestMethod;
7 | import org.springframework.web.bind.annotation.ResponseBody;
8 |
9 | import java.util.Collections;
10 |
11 | /**
12 | * @author CJ
13 | */
14 | @Controller
15 | public class EquipmentDataController {
16 | @RequestMapping(method = RequestMethod.GET, value = "/api/equipmentList")
17 | @ResponseBody
18 | public ApiResult equipmentList() {
19 | return ApiResult.withOk(Collections.emptyList());
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/entity/support/WithdrawStatus.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.entity.support;
2 |
3 | /**
4 | * 提现状态
5 | */
6 | public enum WithdrawStatus {
7 | EMPTY("E"),
8 | init("待验证"),
9 | /**
10 | * 待审核
11 | */
12 | checkPending("审核中"),
13 | refuse("失败"),
14 | /**
15 | * 提现成功
16 | */
17 | success("成功到账");
18 |
19 | private final String message;
20 |
21 | WithdrawStatus(String message) {
22 | this.message = message;
23 | }
24 |
25 | @Override
26 | public String toString() {
27 | return message;
28 | }
29 |
30 | public boolean isSuccess() {
31 | return this == success;
32 | }
33 |
34 | public boolean isFailed() {
35 | return this == refuse;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/request/PromotionRequestRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository.request;
2 |
3 | import cn.lmjia.market.core.entity.Login;
4 | import cn.lmjia.market.core.entity.request.PromotionRequest;
5 | import cn.lmjia.market.core.entity.support.PromotionRequestStatus;
6 | import org.springframework.data.jpa.repository.JpaRepository;
7 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
8 |
9 | import java.util.List;
10 |
11 | /**
12 | * @author CJ
13 | */
14 | public interface PromotionRequestRepository extends JpaRepository
15 | , JpaSpecificationExecutor {
16 |
17 | List findByWhoseAndRequestStatusOrderByIdDesc(Login login, PromotionRequestStatus status);
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/util/AbstractTemplateMessageStyle.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.util;
2 |
3 | import me.jiangcai.wx.model.message.TemplateMessageStyle;
4 |
5 | /**
6 | * @author CJ
7 | */
8 | public abstract class AbstractTemplateMessageStyle implements TemplateMessageStyle {
9 |
10 | @Override
11 | public String getTemplateId() {
12 | return null;
13 | }
14 |
15 | @Override
16 | public void setTemplateId(String templateId) {
17 |
18 | }
19 |
20 | @Override
21 | public String getTemplateIdShort() {
22 | return null;
23 | }
24 |
25 | @Override
26 | public String getTemplateTitle() {
27 | return null;
28 | }
29 |
30 | @Override
31 | public String getIndustryId() {
32 | return null;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/repository/PropertyValueRepository.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.repository;
2 |
3 | import me.jiangcai.logistics.entity.PropertyName;
4 | import me.jiangcai.logistics.entity.PropertyValue;
5 | import org.springframework.data.jpa.repository.JpaRepository;
6 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
7 |
8 | /**
9 | * Created by helloztt on 2017/9/13.
10 | */
11 | public interface PropertyValueRepository extends JpaRepository, JpaSpecificationExecutor {
12 | /**
13 | * 由属性和属性值名称来决定一个属性值
14 | *
15 | * @param propertyName 属性
16 | * @param value 属性值名称
17 | * @return
18 | */
19 | PropertyValue findTop1ByPropertyNameAndValue(PropertyName propertyName, String value);
20 | }
21 |
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-view/error/systemMaintain.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | 系统正在维护
11 |
12 |
13 |
14 |
15 | 
16 | 系统正在维护中
17 | 带来不便,敬请谅解!
18 |
19 |
20 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/define/Journal.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.define;
2 |
3 | import java.math.BigDecimal;
4 | import java.time.LocalDateTime;
5 |
6 | /**
7 | * 流水
8 | *
9 | * @author CJ
10 | */
11 | public interface Journal {
12 |
13 | /**
14 | * @return 发生时间
15 | */
16 | LocalDateTime getHappenTime();
17 |
18 | /**
19 | * @return 变化额,正数表示增加,负数表示减少
20 | */
21 | BigDecimal getChanged();
22 |
23 | Enum getType();
24 |
25 | /**
26 | * @return 流水id
27 | */
28 | String getId();
29 |
30 | /**
31 | * @return 相关联的主订单 号id
32 | */
33 | Long getMainOrderId();
34 |
35 | Long getAgentPrepaymentOrderId();
36 |
37 |
38 | default Money getChangedAbsMoney() {
39 | return new Money(getChanged().abs());
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/manage-service/src/share/java/cn/lmjia/market/manage/page/ManageLoginPage.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.manage.page;
2 |
3 | import cn.lmjia.market.core.pages.AbstractContentPage;
4 | import me.jiangcai.lib.test.SpringWebTest;
5 | import org.openqa.selenium.WebDriver;
6 |
7 | /**
8 | * 客户管理
9 | * _loginManage.html
10 | *
11 | * @author CJ
12 | */
13 | public class ManageLoginPage extends AbstractContentPage {
14 | public ManageLoginPage(WebDriver webDriver) {
15 | super(webDriver);
16 | }
17 |
18 | public static ManageLoginPage of(SpringWebTest instance, WebDriver driver) {
19 | driver.get("http://localhost/loginManage");
20 | return instance.initPage(ManageLoginPage.class);
21 | }
22 |
23 | @Override
24 | public void validatePage() {
25 | assertTitle("客户管理");
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/logistics-haier/src/test/resources/拒收入库.xml:
--------------------------------------------------------------------------------
1 |
2 | 65c61d30566c447190545bcb598fe70d
3 | 65c61d30566c447190545bcb598fe70d
4 | 2
5 | 11
6 | 2017-08-10 00:00:00
7 | C12101
8 | 1
9 |
10 | 4974752222
11 |
12 |
13 |
14 | 1
15 | 10
16 | hzcx01
17 | 3XQ000122
18 | hzcx01
19 | 1
20 | 1
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-view/error/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | 404 Not Found
11 |
12 |
13 |
14 |
15 | 
16 | 页面未找到
17 | 抱歉,页面可能不存在~
18 |
19 |
20 |
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-view/error/500.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | 服务器内部错误
11 |
12 |
13 |
14 |
15 | 
16 | 服务器内部错误
17 | 服务器好像出错了,请联系管理人员。
18 |
19 |
20 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/entity/ManuallyOrder.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.entity;
2 |
3 | import lombok.Getter;
4 | import lombok.Setter;
5 |
6 | import javax.persistence.Column;
7 | import javax.persistence.Entity;
8 |
9 | /**
10 | * @author CJ
11 | */
12 | @Entity
13 | @Setter
14 | @Getter
15 | public class ManuallyOrder extends StockShiftUnit {
16 | /**
17 | * 快递订单号
18 | */
19 | @Column(length = 40)
20 | private String orderNumber;
21 | /**
22 | * 物流公司名称
23 | */
24 | @Column(length = 30)
25 | private String supplierCompany;
26 |
27 | @Override
28 | public String getSupplierOrganizationName() {
29 | return getSupplierCompany();
30 | }
31 |
32 | @Override
33 | public String getHumanReadableExpressId() {
34 | return orderNumber;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/core-service/src/test/java/cn/lmjia/market/core/service/InitServiceTest.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.service;
2 |
3 | import cn.lmjia.market.core.CoreServiceTest;
4 | import cn.lmjia.market.core.entity.Manager;
5 | import cn.lmjia.market.core.repository.ManagerRepository;
6 | import org.junit.Test;
7 | import org.springframework.beans.factory.annotation.Autowired;
8 |
9 | import static org.assertj.core.api.Assertions.assertThat;
10 |
11 | /**
12 | * @author CJ
13 | */
14 | public class InitServiceTest extends CoreServiceTest {
15 |
16 | @Autowired
17 | private ManagerRepository managerRepository;
18 |
19 | @Test
20 | public void init() throws Exception {
21 | Manager root = managerRepository.findByLoginName("root");
22 | System.out.println(root);
23 | assertThat(root)
24 | .isNotNull();
25 | }
26 |
27 | }
--------------------------------------------------------------------------------
/web/src/main/webapp/error/systemMaintain.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | 系统正在维护
11 |
12 |
13 |
14 |
15 | 
16 | 系统正在维护中
17 | 带来不便,敬请谅解!
18 |
19 |
20 |
--------------------------------------------------------------------------------
/logistics-haier/src/main/java/me/jiangcai/logistics/haier/util/BooleanDeserializer.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.haier.util;
2 |
3 | import com.fasterxml.jackson.core.JsonParser;
4 | import com.fasterxml.jackson.core.JsonProcessingException;
5 | import com.fasterxml.jackson.databind.DeserializationContext;
6 | import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
7 |
8 | import java.io.IOException;
9 |
10 | /**
11 | * 0,1 到 boolean
12 | *
13 | * @author CJ
14 | */
15 | public class BooleanDeserializer extends StdDeserializer {
16 |
17 | public BooleanDeserializer() {
18 | super(Integer.class);
19 | }
20 |
21 | @Override
22 | public Boolean deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
23 | int x = this._parseIntPrimitive(p, ctxt);
24 | return x == 1;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/exception/GoodAdvancePaymentBalanceNotEnoughException.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.exception;
2 |
3 | import cn.lmjia.market.core.define.Money;
4 | import lombok.Getter;
5 |
6 | import java.math.BigDecimal;
7 |
8 | /**
9 | * 代理商预付货款不足
10 | *
11 | * @author CJ
12 | */
13 | @Getter
14 | public class GoodAdvancePaymentBalanceNotEnoughException extends RuntimeException {
15 |
16 |
17 | private final BigDecimal current;
18 | private final BigDecimal required;
19 |
20 | public GoodAdvancePaymentBalanceNotEnoughException(BigDecimal required, BigDecimal current) {
21 | this.required = required;
22 | this.current = current;
23 | }
24 |
25 | @Override
26 | public String getMessage() {
27 | return "余额不足,所需:" + new Money(required).toString() + ",当前:" + new Money(current).toString();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/logistics/src/share/java/me/jiangcai/logistics/demo/service/DemoSupplierImpl.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.demo.service;
2 |
3 | import me.jiangcai.logistics.LogisticsDestination;
4 | import me.jiangcai.logistics.LogisticsSource;
5 | import me.jiangcai.logistics.demo.DemoSupplier;
6 | import me.jiangcai.logistics.entity.StockShiftUnit;
7 | import org.springframework.stereotype.Service;
8 |
9 | import java.util.function.Consumer;
10 |
11 | /**
12 | * @author CJ
13 | */
14 | @Service
15 | public class DemoSupplierImpl implements DemoSupplier {
16 |
17 | @Override
18 | public StockShiftUnit makeShift(LogisticsSource source,
19 | LogisticsDestination destination, Consumer forUnit, int options) {
20 | StockShiftUnit unit = new StockShiftUnit();
21 | forUnit.accept(unit);
22 | return unit;
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/exception/MainGoodLimitStockException.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.exception;
2 |
3 | import cn.lmjia.market.core.entity.MainGood;
4 | import lombok.Getter;
5 | import lombok.Setter;
6 | import org.springframework.data.rest.core.annotation.Description;
7 |
8 | import java.time.LocalDateTime;
9 | import java.util.Map;
10 |
11 | /**
12 | * 商品限购,这也算一种 [ 库存不足 ] 的异常,还应该让客户知道,什么时候解除限制
13 | * Created by helloztt on 2017/8/23.
14 | */
15 | @Getter
16 | @Setter
17 | public class MainGoodLimitStockException extends MainGoodLowStockException {
18 |
19 | @Description("限购解除时间")
20 | private final Map relieveTime;
21 |
22 | public MainGoodLimitStockException(Map goodStock,Map relieveTime) {
23 | super(goodStock);
24 | this.relieveTime = relieveTime;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/core-service/src/test/java/cn/lmjia/market/core/entity/JpaElementSelect.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.entity;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.CascadeType;
6 | import javax.persistence.Entity;
7 | import javax.persistence.GeneratedValue;
8 | import javax.persistence.GenerationType;
9 | import javax.persistence.Id;
10 | import javax.persistence.OneToMany;
11 | import javax.persistence.Transient;
12 | import java.util.List;
13 |
14 | /**
15 | * @author CJ
16 | */
17 | @Entity
18 | @Data
19 | public class JpaElementSelect {
20 |
21 | @Id
22 | @GeneratedValue(strategy = GenerationType.IDENTITY)
23 | private Long id;
24 |
25 | private String name;
26 |
27 | @Transient
28 | // @ElementCollection
29 | private List elementList;
30 | @OneToMany(cascade = CascadeType.ALL)
31 | private List entityList;
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/entity/UsageStock.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.entity;
2 |
3 | import lombok.Getter;
4 | import lombok.Setter;
5 |
6 | import javax.persistence.Column;
7 | import javax.persistence.Entity;
8 | import javax.persistence.Id;
9 | import javax.persistence.JoinColumn;
10 | import javax.persistence.ManyToOne;
11 | import javax.persistence.Table;
12 |
13 | /**
14 | * 包括已结算的库存可用状态
15 | *
16 | * @author CJ
17 | */
18 | @SuppressWarnings("JpaDataSourceORMInspection")
19 | @Table(name = "UsageStock")
20 | @Entity
21 | @Getter
22 | @Setter
23 | public class UsageStock {
24 | @Id
25 | private String id;
26 | @ManyToOne
27 | @JoinColumn(name = "PRODUCT_CODE")
28 | private Product product;
29 | @ManyToOne
30 | @JoinColumn(name = "DEPOT_ID")
31 | private Depot depot;
32 | @Column(name = "AMOUNT")
33 | private int amount;
34 | }
35 |
--------------------------------------------------------------------------------
/logistics/src/share/java/me/jiangcai/logistics/demo/LogisticsEventCatch.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.demo;
2 |
3 | import lombok.Getter;
4 | import me.jiangcai.logistics.event.InstallationEvent;
5 | import me.jiangcai.logistics.event.ShiftEvent;
6 | import org.springframework.context.event.EventListener;
7 | import org.springframework.stereotype.Component;
8 |
9 | /**
10 | * @author CJ
11 | */
12 | @Component
13 | @Getter
14 | public class LogisticsEventCatch {
15 |
16 | private InstallationEvent installationEvent;
17 | private ShiftEvent shiftEvent;
18 |
19 | @EventListener(ShiftEvent.class)
20 | public void forShiftEvent(ShiftEvent event) {
21 | this.shiftEvent = event;
22 | }
23 |
24 | @EventListener(InstallationEvent.class)
25 | public void forInstallationEvent(InstallationEvent event) {
26 | this.installationEvent = event;
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/core-service/src/share/java/cn/lmjia/market/core/test/MarketBuildInLogisticsSupplierImpl.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.test;
2 |
3 | import cn.lmjia.market.core.MarketBuildInLogisticsSupplier;
4 | import me.jiangcai.logistics.LogisticsDestination;
5 | import me.jiangcai.logistics.LogisticsSource;
6 | import me.jiangcai.logistics.entity.StockShiftUnit;
7 | import org.springframework.stereotype.Service;
8 |
9 | import java.util.function.Consumer;
10 |
11 | /**
12 | * @author CJ
13 | */
14 | @Service
15 | public class MarketBuildInLogisticsSupplierImpl implements MarketBuildInLogisticsSupplier {
16 | @Override
17 | public StockShiftUnit makeShift(LogisticsSource source, LogisticsDestination destination
18 | , Consumer forUnit, int options) {
19 | StockShiftUnit unit = new StockShiftUnit();
20 | forUnit.accept(unit);
21 | return unit;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/dealer/src/test/java/cn/lmjia/market/dealer/controller/commission/CommissionControllerTest.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.dealer.controller.commission;
2 |
3 | import org.junit.Test;
4 |
5 | import java.math.BigDecimal;
6 | import java.text.NumberFormat;
7 | import java.util.Locale;
8 |
9 | /**
10 | * @author CJ
11 | */
12 | public class CommissionControllerTest {
13 | @Test
14 | public void formatCommonInfo() throws Exception {
15 | System.out.println(CommissionController.formatCommonInfo("1个厨下净水机 ¥2820.00000000000000000000"));
16 | NumberFormat format = NumberFormat.getPercentInstance(Locale.CHINA);
17 | format.setMaximumFractionDigits(2);
18 | System.out.println(format.format(BigDecimal.valueOf(0.05)));
19 | System.out.println(format.format(BigDecimal.valueOf(0.005)));
20 | System.out.println(format.format(BigDecimal.valueOf(0.0005)));
21 | }
22 |
23 | }
--------------------------------------------------------------------------------
/logistics/src/main/resources/logistics_views/h20.sql:
--------------------------------------------------------------------------------
1 | CREATE OR REPLACE VIEW `UnSettlementUsageStock`
2 | AS
3 | SELECT
4 | amounts.amounts_KEY AS `PRODUCT_CODE`,
5 | destDepot.ID AS `DESTINATION_ID`,
6 | originDepot.ID AS `ORIGIN_ID`,
7 | SUM(amounts.AMOUNT) AS `AMOUNT`
8 | FROM STOCKSHIFTUNIT shift LEFT OUTER JOIN DEPOT destDepot
9 | ON ((destDepot.ID = shift.DESTINATION_ID) AND (shift.CURRENTSTATUS = 5))
10 | LEFT OUTER JOIN DEPOT originDepot
11 | ON ((originDepot.ID = shift.ORIGIN_ID) AND (shift.CURRENTSTATUS <> 2))
12 | , StockShiftUnit_AMOUNTS amounts
13 | WHERE (((
14 | ((shift.LOCKEDTIME IS NULL) OR (shift.LOCKEDTIME > (SELECT MAX(`TIME`)
15 | FROM stocksettlement))))) AND
16 | ((amounts.StockShiftUnit_ID = shift.ID))
17 | )
18 | GROUP BY amounts.amounts_KEY, destDepot.ID, originDepot.ID;
--------------------------------------------------------------------------------
/core-service/src/test/java/cn/lmjia/market/core/controller/ResourceControllerTest.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.controller;
2 |
3 | import cn.lmjia.market.core.CoreWebTest;
4 | import org.junit.Test;
5 | import org.springframework.mock.web.MockMultipartFile;
6 |
7 | import java.io.InputStream;
8 |
9 | /**
10 | * 检测文件上传控制器
11 | *
12 | * @author CJ
13 | */
14 | public class ResourceControllerTest extends CoreWebTest {
15 | @Test
16 | public void webUploader() throws Exception {
17 | try (InputStream inputStream = randomPngImageResource().getInputStream()) {
18 | mockMvc.perform(fileUpload("/resourceUpload/webUploader")
19 | .file(new MockMultipartFile("file", "my_file.png", "image/png", inputStream))
20 | ).andExpect(
21 | similarJsonObjectAs("classpath:/mock/webUploader.json")
22 | );
23 | }
24 | }
25 |
26 | }
--------------------------------------------------------------------------------
/logistics-haier/src/main/java/me/jiangcai/logistics/haier/entity/HaierDepot.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.haier.entity;
2 |
3 | import lombok.Getter;
4 | import lombok.Setter;
5 | import me.jiangcai.logistics.LogisticsSupplier;
6 | import me.jiangcai.logistics.entity.Depot;
7 | import me.jiangcai.logistics.haier.HaierSupplier;
8 |
9 | import javax.persistence.Column;
10 | import javax.persistence.Entity;
11 |
12 | /**
13 | * @author CJ
14 | */
15 | @Entity
16 | @Setter
17 | @Getter
18 | public class HaierDepot extends Depot {
19 | /**
20 | * 海尔(日日顺)仓库编码:按日日顺C码
21 | */
22 | @Column(length = 32)
23 | private String haierCode;
24 |
25 | @Override
26 | public Class extends LogisticsSupplier> getSupplierClass() {
27 | return HaierSupplier.class;
28 | }
29 |
30 | @Override
31 | public boolean isInstallationSupport() {
32 | return true;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/web/src/main/java/cn/lmjia/market/web/config/WebConfig.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.web.config;
2 |
3 | import cn.lmjia.market.core.config.CoreConfig;
4 | import cn.lmjia.market.core.config.MVCConfig;
5 | import cn.lmjia.market.core.config.other.SecurityConfig;
6 | import cn.lmjia.market.dealer.config.DealerConfig;
7 | import cn.lmjia.market.manage.config.ManageConfig;
8 | import cn.lmjia.market.wechat.config.WechatConfig;
9 | import org.springframework.context.annotation.ComponentScan;
10 | import org.springframework.context.annotation.Configuration;
11 | import org.springframework.context.annotation.Import;
12 |
13 | /**
14 | * web 模块的配置
15 | *
16 | * @author CJ
17 | */
18 | @Configuration
19 | @Import({ManageConfig.class, DealerConfig.class, WechatConfig.class, MVCConfig.class, CoreConfig.class, SecurityConfig.class})
20 | @ComponentScan({"cn.lmjia.market.web.controller"})
21 | public class WebConfig {
22 | }
23 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/controller/main/order/AbstractMainOrderController.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.controller.main.order;
2 |
3 | import cn.lmjia.market.core.entity.MainOrder;
4 | import cn.lmjia.market.core.service.MainOrderService;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.util.StringUtils;
7 |
8 | /**
9 | * @author CJ
10 | */
11 |
12 | public abstract class AbstractMainOrderController extends AbstractMainDeliverableOrderController {
13 |
14 | @Autowired
15 | private MainOrderService mainOrderService;
16 |
17 | protected MainOrder from(String orderId, Long id) {
18 | if (id != null)
19 | return mainDeliverableOrderService.getOrder(id);
20 | if (!StringUtils.isEmpty(orderId))
21 | return mainOrderService.getOrder(orderId);
22 | return null;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/service/impl/ManagerServiceImpl.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.service.impl;
2 |
3 | import cn.lmjia.market.core.entity.Manager;
4 | import cn.lmjia.market.core.entity.support.ManageLevel;
5 | import cn.lmjia.market.core.repository.ManagerRepository;
6 | import cn.lmjia.market.core.service.ManagerService;
7 | import org.springframework.beans.factory.annotation.Autowired;
8 | import org.springframework.stereotype.Service;
9 |
10 | import java.util.List;
11 |
12 | /**
13 | * @author CJ
14 | */
15 | @Service
16 | public class ManagerServiceImpl implements ManagerService {
17 |
18 | @Autowired
19 | private ManagerRepository managerRepository;
20 |
21 | @Override
22 | public List levelAs(ManageLevel manageLevel) {
23 | return managerRepository.findAll((root, query, cb) -> cb.isMember(manageLevel, root.get("levelSet")));
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/manage-service/src/main/java/cn/lmjia/market/manage/controller/AbstractLoginDetailController.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.manage.controller;
2 |
3 | import cn.lmjia.market.core.entity.Login;
4 | import org.springframework.ui.Model;
5 |
6 | /**
7 | * @author CJ
8 | */
9 | public abstract class AbstractLoginDetailController {
10 |
11 | /**
12 | * @param model model
13 | * @param login 身份
14 | * @return 可以获取详情页面的视图名称
15 | */
16 | String _detailView(Model model, Login login) {
17 | model.addAttribute("login", login);
18 | model.addAttribute("parentTitle", parentTitle());
19 | model.addAttribute("parentUri", parentUri());
20 | model.addAttribute("detailTitle", detailTitle());
21 | return "_agentDetail.html";
22 | }
23 |
24 | abstract String detailTitle();
25 |
26 | abstract String parentUri();
27 |
28 | abstract String parentTitle();
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-view/fragments/share.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Title
6 |
7 |
8 |
9 |
10 |
11 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/core-service/src/test/java/cn/lmjia/market/core/service/QRCodeServiceTest.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.service;
2 |
3 | import cn.lmjia.market.core.CoreServiceTest;
4 | import org.junit.Ignore;
5 | import org.junit.Test;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 |
8 | import javax.swing.*;
9 | import java.awt.image.BufferedImage;
10 |
11 | import static org.assertj.core.api.Assertions.assertThat;
12 |
13 | /**
14 | * @author CJ
15 | */
16 | @Ignore
17 | public class QRCodeServiceTest extends CoreServiceTest {
18 |
19 | @Autowired
20 | private QRCodeService qrCodeService;
21 |
22 | @Test
23 | public void generateQRCode() throws Exception {
24 | BufferedImage image = qrCodeService.generateQRCode("weixin://wxpay/bizpayurl?pr=THkIR3X");
25 | JOptionPane.showMessageDialog(null, new ImageIcon(image));
26 | assertThat(true)
27 | .isTrue();
28 | }
29 |
30 | }
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/LogisticsConfig.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics;
2 |
3 | import me.jiangcai.lib.jdbc.JdbcSpringConfig;
4 | import org.springframework.context.annotation.ComponentScan;
5 | import org.springframework.context.annotation.Configuration;
6 | import org.springframework.context.annotation.Import;
7 | import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
8 | import org.springframework.web.servlet.config.annotation.EnableWebMvc;
9 |
10 | /**
11 | * @author CJ
12 | */
13 | @Configuration
14 | @Import(JdbcSpringConfig.class)
15 | @ComponentScan({
16 | "me.jiangcai.logistics.service"
17 | , "me.jiangcai.logistics.controller"
18 | })
19 | @EnableJpaRepositories("me.jiangcai.logistics.repository")
20 | @EnableWebMvc
21 | public class LogisticsConfig {
22 | /**
23 | * 可以发货的角色
24 | */
25 | public static final String ROLE_SHIP = "LOGISTICS_SHIP";
26 | }
27 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/event/ShiftEvent.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.event;
2 |
3 | import lombok.Data;
4 | import me.jiangcai.logistics.PersistingReadable;
5 | import me.jiangcai.logistics.entity.StockShiftUnit;
6 | import me.jiangcai.logistics.entity.support.ShiftStatus;
7 |
8 | import java.time.LocalDateTime;
9 |
10 | /**
11 | * 物流订单变化事件,应当确保在事务内发起该事件!不然必然出问题!
12 | *
13 | * @author CJ
14 | */
15 | @Data
16 | public class ShiftEvent {
17 | /**
18 | * 事务内实体
19 | */
20 | private final StockShiftUnit unit;
21 | /**
22 | * 进入的状态,可以为null表示该事件并未导致实际的变化
23 | */
24 | private final ShiftStatus status;
25 | /**
26 | * 可能为null
27 | */
28 | private final LocalDateTime time;
29 | /**
30 | * 人类可识别的信息
31 | */
32 | private final String message;
33 | /**
34 | * 导致该事件的核心来源!
35 | */
36 | private final PersistingReadable source;
37 | }
38 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/entity/support/StockInfo.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.entity.support;
2 |
3 | import lombok.Data;
4 | import lombok.NoArgsConstructor;
5 | import me.jiangcai.logistics.entity.Depot;
6 | import me.jiangcai.logistics.entity.Product;
7 |
8 | import javax.persistence.Embeddable;
9 | import javax.persistence.ManyToOne;
10 |
11 | /**
12 | * @author CJ
13 | */
14 | @Data
15 | @Embeddable
16 | @NoArgsConstructor
17 | public class StockInfo {
18 | @ManyToOne
19 | private Depot depot;
20 | @ManyToOne
21 | private Product product;
22 | private int amount;
23 |
24 | @SuppressWarnings("unused")
25 | public StockInfo(Depot depot, Product product, Number amount) {
26 | this.depot = depot;
27 | this.product = product;
28 | if (amount != null)
29 | this.amount = amount.intValue();
30 | else
31 | this.amount = 0;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/js/pay.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 用于支付的JS
3 | * Created by CJ on 18/05/2017.
4 | */
5 |
6 | var completeCheck = function (data) {
7 | // console.log(data);
8 | if (data && data == true) {
9 | $.success = true;//请勿注释
10 | window.location.href = $('body').attr('data-success-url');
11 | } else {
12 | //继续刷
13 | //等待一会儿
14 | // console.log('稍后再次检测');
15 | setTimeout('$._loginCheck()', 2000)
16 | }
17 | };
18 |
19 | $._loginCheck = function () {
20 | // console.log('检测是否已完成支付');
21 | $.ajax($('body').attr('data-check-url'), {
22 | method: 'get',
23 | dataType: 'json',
24 | success: completeCheck,
25 | error: function (msg) {
26 | // console.log(msg.responseText);
27 | setTimeout('$._loginCheck()', 5000);
28 | }
29 | });
30 | };
31 |
32 | setTimeout('$._loginCheck()', 2000);
33 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/deal/SalesAchievementRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository.deal;
2 |
3 | import cn.lmjia.market.core.entity.Login;
4 | import cn.lmjia.market.core.entity.deal.SalesAchievement;
5 | import cn.lmjia.market.core.entity.deal.Salesman;
6 | import org.springframework.data.jpa.repository.JpaRepository;
7 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
8 |
9 | import java.util.List;
10 |
11 | /**
12 | * @author CJ
13 | */
14 | public interface SalesAchievementRepository extends JpaRepository
15 | , JpaSpecificationExecutor {
16 |
17 | SalesAchievement findTop1ByTargetLoginAndPickedFalseAndWhose_EnableTrueOrderByTargetTimeDesc(Login login);
18 |
19 | List findByTargetLoginAndPickedFalse(Login login);
20 |
21 | List findByWhose(Salesman salesman);
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/service/QRCodeService.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.service;
2 |
3 | import com.google.zxing.WriterException;
4 |
5 | import java.awt.image.BufferedImage;
6 | import java.io.IOException;
7 |
8 | /**
9 | * 二维码服务
10 | * 这个二维码跟微信带有场景标识的公众号二维码并不相同。仅仅是简单的隐藏URL
11 | *
12 | * @author CJ
13 | */
14 | public interface QRCodeService {
15 |
16 | /**
17 | * 生成二维码
18 | *
19 | * @param url 链接
20 | * @return 二维码图片
21 | * @throws IOException 一般不会
22 | * @throws WriterException bad url
23 | */
24 | BufferedImage generateQRCode(String url) throws IOException, WriterException;
25 |
26 | /**
27 | * 解读二维码
28 | *
29 | * @param image 图片
30 | * @return 链接地址
31 | * @throws IOException
32 | * @throws IllegalArgumentException 找不到二维码
33 | */
34 | String scanImage(BufferedImage image) throws IOException, IllegalArgumentException;
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/model/ApiResult.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.model;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 |
6 | /**
7 | * @author CJ
8 | */
9 | @Data
10 | public class ApiResult {
11 |
12 | private final Object data;
13 | @JsonProperty("resultCode")
14 | private final int code;
15 | @JsonProperty("resultMsg")
16 | private final String message;
17 |
18 | public static ApiResult withCodeAndMessage(int code, String message, Object data) {
19 | return new ApiResult(data, code, message);
20 | }
21 |
22 | public static ApiResult withCode(int code, Object data) {
23 | return withCodeAndMessage(code, "ok", data);
24 | }
25 |
26 | public static ApiResult withOk(Object data) {
27 | return withCode(200, data);
28 | }
29 |
30 | public static ApiResult withOk() {
31 | return withOk(null);
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/logistics-haier/src/main/java/me/jiangcai/logistics/haier/http/ResponseHandler.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.haier.http;
2 |
3 | import com.fasterxml.jackson.databind.JsonNode;
4 | import com.fasterxml.jackson.dataformat.xml.XmlMapper;
5 | import me.jiangcai.logistics.exception.SupplierException;
6 | import org.apache.http.HttpEntity;
7 | import org.apache.http.impl.client.AbstractResponseHandler;
8 |
9 | import java.io.IOException;
10 |
11 | /**
12 | * @author CJ
13 | */
14 | public class ResponseHandler extends AbstractResponseHandler {
15 |
16 | private static final XmlMapper xmlMapper = new XmlMapper();
17 |
18 | @Override
19 | public Void handleEntity(HttpEntity entity) throws IOException {
20 | JsonNode node = xmlMapper.readTree(entity.getContent());
21 | if (node.get("flag").asText().equalsIgnoreCase("T"))
22 | return null;
23 | throw new SupplierException(node.get("msg").asText());
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/manage-service/src/share/java/cn/lmjia/market/manage/page/ManageShiftDetailPage.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.manage.page;
2 |
3 | import cn.lmjia.market.core.pages.AbstractContentPage;
4 | import org.openqa.selenium.By;
5 | import org.openqa.selenium.WebDriver;
6 |
7 | /**
8 | * 物流订单详情页
9 | * _logisticsDetail.html
10 | *
11 | * @author CJ
12 | */
13 | public class ManageShiftDetailPage extends AbstractContentPage {
14 | public ManageShiftDetailPage(WebDriver webDriver) {
15 | super(webDriver);
16 | }
17 |
18 | @Override
19 | public void validatePage() {
20 | assertTitle("物流详情");
21 | }
22 |
23 | public void mockReject() {
24 | forLink("已被取消");
25 | }
26 |
27 | private void forLink(String linkText) {
28 | webDriver.findElement(By.partialLinkText(linkText)).click();
29 | layerDialog((s, e) -> true);
30 | }
31 |
32 | public void mockSuccess() {
33 | forLink("已成功送达");
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/logistics/src/main/resources/logistics_views/mysql1.sql:
--------------------------------------------------------------------------------
1 | CREATE OR REPLACE VIEW `UsageStockInfo`
2 | AS
3 | SELECT
4 | `PRODUCT_CODE` AS `PRODUCT_CODE`,
5 | `DEPOT_ID` AS `DEPOT_ID`,
6 | `AMOUNT` AS `AMOUNT`
7 | FROM stocksettlement_usablestock
8 | WHERE StockSettlement_ID = (SELECT `ID`
9 | FROM stocksettlement
10 | WHERE `TIME` = (SELECT max(`TIME`)
11 | FROM stocksettlement))
12 | UNION SELECT
13 | `PRODUCT_CODE` AS `PRODUCT_CODE`,
14 | `DESTINATION_ID` AS `DEPOT_ID`,
15 | `AMOUNT` AS `AMOUNT`
16 | FROM unsettlementusagestock
17 | WHERE DESTINATION_ID IS NOT NULL
18 | UNION SELECT
19 | `PRODUCT_CODE` AS `PRODUCT_CODE`,
20 | `ORIGIN_ID` AS `DEPOT_ID`,
21 | -`AMOUNT` AS `AMOUNT`
22 | FROM unsettlementusagestock
23 | WHERE ORIGIN_ID IS NOT NULL;
--------------------------------------------------------------------------------
/manage-service/src/main/resources/manage-view/mock/salesmanManage.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 伪造的销售人员
3 | * Created by CJ on 08/09/2017.
4 | */
5 |
6 | Mock.mock(/\/manage\/salesmen/, "post", {});
7 |
8 | Mock.mock(/\/manage\/salesmen\/\d\/rate/, "put", {});
9 | Mock.mock(/\/manage\/salesmen\/\d\/rank/, "put", {});
10 | Mock.mock(/\/manage\/salesmen\/\d\/disable/, "put", {});
11 | Mock.mock(/\/manage\/salesmen\/\d\/enable/, "put", {});
12 |
13 | Mock.mock(/\/manage\/salesmen/, "get", {
14 | "draw": 1,
15 | "recordsTotal": 23,
16 | "recordsFiltered": 23,
17 | "data|10": [{
18 | 'id|+1': 1,
19 | 'name': 'test' + '@string(3)',
20 | 'mobile': /^1([34578])\d{9}$/,
21 | 'enableLabel': '@pick(启用, 禁用)',
22 | 'enable': '@pick([true, false])',
23 | 'rateLabel': '50%',
24 | 'rate': 50,
25 | 'rank': ''
26 | }]
27 | });
28 |
29 | // Mock.setup({
30 | // timeout: '99999'
31 | // });
32 | //
33 | // Mock.mock(/\/stopIt/,{});
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/entity/support/ShiftStatus.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.entity.support;
2 |
3 | /**
4 | * @author CJ
5 | */
6 | public enum ShiftStatus {
7 | /**
8 | * 初始状态,应该被扣除可用量
9 | */
10 | init("初始化"),
11 | /**
12 | * 被接受,进入处理状态,应该被扣除可用量
13 | */
14 | accept("已接单"),
15 | /**
16 | * 被拒绝,无需扣除可用量;核心意义是没开始就结束了
17 | * 并非被拒收!而是这个移动没有获得许可!
18 | */
19 | reject("已拒绝"),
20 | /**
21 | * 移动状态,应该被扣除可用量
22 | */
23 | movement("运递中"),
24 | /**
25 | * 核心意义是开始运送了,但因为各种原因失败了
26 | * 最终没有成功,应该需要后续ShiftUnit继续支持,应该被扣除可用量
27 | * 可结算
28 | */
29 | failed("运递失败"),
30 | /**
31 | * 最终成功,应该被扣除可用量
32 | * 可结算
33 | */
34 | success("已送达");
35 | private final String message;
36 |
37 | ShiftStatus(String message) {
38 | this.message = message;
39 | }
40 |
41 | public String toString() {
42 | return message;
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/logistics/src/main/resources/logistics_views/mysql0.sql:
--------------------------------------------------------------------------------
1 | -- 定制一个视图
2 | -- 获取当前 未结算状态的 可用库存
3 | -- 大致返回结果会是
4 | -- Product_Code,Depot_Id,Amount
5 | CREATE OR REPLACE VIEW `UnSettlementUsageStock`
6 | AS
7 | SELECT
8 | amounts.amounts_KEY AS `PRODUCT_CODE`,
9 | destDepot.ID AS `DESTINATION_ID`,
10 | originDepot.ID AS `ORIGIN_ID`,
11 | SUM(amounts.AMOUNT) AS 'AMOUNT'
12 | FROM STOCKSHIFTUNIT shift LEFT OUTER JOIN DEPOT destDepot
13 | ON ((destDepot.ID = shift.DESTINATION_ID) AND (shift.CURRENTSTATUS = 5))
14 | LEFT OUTER JOIN DEPOT originDepot
15 | ON ((originDepot.ID = shift.ORIGIN_ID) AND (shift.CURRENTSTATUS <> 2))
16 | , StockShiftUnit_AMOUNTS amounts
17 | WHERE (((
18 | ((shift.LOCKEDTIME IS NULL) OR (shift.LOCKEDTIME > (SELECT MAX(`TIME`)
19 | FROM stocksettlement))))) AND
20 | ((amounts.StockShiftUnit_ID = shift.ID))
21 | )
22 | GROUP BY amounts.amounts_KEY, destDepot.ID, originDepot.ID;
--------------------------------------------------------------------------------
/wechat-service/src/test/java/cn/lmjia/market/wechat/controller/help/HelpIndexPage.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.wechat.controller.help;
2 |
3 | import cn.lmjia.market.core.entity.help.CommonProblem;
4 | import cn.lmjia.market.wechat.page.AbstractWechatPage;
5 | import org.openqa.selenium.WebDriver;
6 | import org.openqa.selenium.WebElement;
7 | import org.openqa.selenium.support.FindBy;
8 |
9 | public class HelpIndexPage extends AbstractWechatPage {
10 |
11 | @FindBy(xpath="a[@class='weui-cell weui-cell_access']")
12 | private WebElement helpDetail;
13 |
14 | @FindBy(id = "J_searchInput")
15 | private WebElement searchInput;
16 |
17 | public HelpIndexPage(WebDriver webDriver) {
18 | super(webDriver);
19 | }
20 |
21 | @Override
22 | public void validatePage() {
23 | assertTitle("帮助中心");
24 | }
25 |
26 | /**
27 | * 校验某个常见问题
28 | * @param commonProblem
29 | */
30 | public void validataHelp(CommonProblem commonProblem){
31 |
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/entity/support/OrderStatus.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.entity.support;
2 |
3 | /**
4 | * 订单状态
5 | *
6 | * @author CJ
7 | */
8 | public enum OrderStatus {
9 | EMPTY("E"),
10 | /**
11 | * 等待支付
12 | */
13 | forPay("待付款"),
14 | /**
15 | * 等待发货
16 | */
17 | forDeliver("待发货"),
18 | /**
19 | * 等待发货
20 | */
21 | forDeliverConfirm("待收货"),
22 | /**
23 | * 等待安装
24 | */
25 | forInstall("未安装"),
26 | /**
27 | * 订单完成,进入售后状态
28 | */
29 | afterSale("已安装"),
30 | /**
31 | * 总而言之是在退款
32 | * 这个状态并不会实际用于订单状态中,仅仅表示一个模糊值
33 | */
34 | almostRefund("退款状态"),
35 | /**
36 | * 订单在指定时间内未付款,自动关闭
37 | */
38 | close("已关闭");
39 |
40 | private final String message;
41 |
42 | OrderStatus(String message) {
43 | this.message = message;
44 | }
45 |
46 | @Override
47 | public String toString() {
48 | return message;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/wechat-service/src/test/java/cn/lmjia/market/wechat/page/WechatGoodAdvanceOrderPage.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.wechat.page;
2 |
3 | import me.jiangcai.lib.test.SpringWebTest;
4 | import org.openqa.selenium.WebDriver;
5 |
6 | /**
7 | * 预付货款下单界面
8 | *
9 | * @author CJ
10 | */
11 | public class WechatGoodAdvanceOrderPage extends WechatOrderPage {
12 |
13 | public WechatGoodAdvanceOrderPage(WebDriver webDriver) {
14 | super(webDriver);
15 | }
16 |
17 | public static WechatGoodAdvanceOrderPage of(SpringWebTest instance, WebDriver driver) {
18 | // 首先打开
19 | // driver.get("http://localhost" + SystemService.goodAdvanceOrderList);
20 | // driver.findElement(By.className("weui-btn-area"))
21 | // .click();
22 | driver.get("http://localhost/wechatAgentPrepaymentOrder");
23 | return instance.initPage(WechatGoodAdvanceOrderPage.class);
24 | }
25 |
26 | @Override
27 | public void validatePage() {
28 | assertTitle("批货下单");
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/wechat-service/src/main/java/cn/lmjia/market/wechat/service/WechatService.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.wechat.service;
2 |
3 | import cn.lmjia.market.core.entity.Login;
4 | import cn.lmjia.market.core.entity.deal.Salesman;
5 | import org.springframework.transaction.annotation.Transactional;
6 |
7 | /**
8 | * 微信相关时间
9 | *
10 | * @author CJ
11 | */
12 | public interface WechatService {
13 |
14 | /**
15 | * @param login 用户
16 | * @return 足够长的临时二维码https地址可以引导新用户关注本公众号并且最终认可是login分享的
17 | */
18 | // @Transactional
19 | String qrCodeForLogin(Login login);
20 |
21 | /**
22 | * @param salesman 销售人员
23 | * @return 足够长的临时二维码https地址可以引导新用户关注本公众号并且最终认可是销售人员分享的
24 | */
25 | // @Transactional
26 | String qrCodeFor(Salesman salesman);
27 |
28 | /**
29 | * loginId分享应用给了openId
30 | *
31 | * @param loginId 老用户Id
32 | * @param openId 微信openId
33 | * @return openId相关的身份
34 | */
35 | @Transactional
36 | Login shareTo(long loginId, String openId);
37 | }
38 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/LogisticsSupplier.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics;
2 |
3 | import me.jiangcai.logistics.entity.StockShiftUnit;
4 |
5 | import java.util.Locale;
6 | import java.util.function.Consumer;
7 |
8 | /**
9 | * 物流服务供应商
10 | *
11 | * @author CJ
12 | */
13 | public interface LogisticsSupplier {
14 |
15 | /**
16 | * 供应商创建物流订单
17 | *
18 | * @param source 来源,如果来源是一个{@link me.jiangcai.logistics.entity.Depot}则创建出库单
19 | * @param destination 目的,如果目的是一个{@link me.jiangcai.logistics.entity.Depot}则创建入库单
20 | * @param options 额外选项
21 | * @return 新的库存变化单
22 | */
23 | StockShiftUnit makeShift(LogisticsSource source,
24 | LogisticsDestination destination, Consumer forUnit, int options);
25 |
26 | /**
27 | * @param locale 用户语言偏好
28 | * @return 是否需要输入订单号,null表示不需要;返回信息是提示输入订单号的描述
29 | */
30 | default String orderNumberRequireMessage(Locale locale) {
31 | return null;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/core-service/src/share/java/cn/lmjia/market/core/test/QuickPayBean.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.test;
2 |
3 | import cn.lmjia.market.core.entity.MainOrder;
4 | import cn.lmjia.market.core.repository.MainOrderRepository;
5 | import me.jiangcai.payment.event.OrderPaySuccess;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.context.ApplicationEventPublisher;
8 | import org.springframework.stereotype.Service;
9 | import org.springframework.transaction.annotation.Transactional;
10 |
11 | /**
12 | * @author CJ
13 | */
14 | @Service
15 | public class QuickPayBean {
16 |
17 | @Autowired
18 | private ApplicationEventPublisher applicationEventPublisher;
19 | @Autowired
20 | private MainOrderRepository mainOrderRepository;
21 |
22 | @Transactional
23 | public void makePay(MainOrder orderInput) {
24 | MainOrder order = mainOrderRepository.getOne(orderInput.getId());
25 | applicationEventPublisher.publishEvent(new OrderPaySuccess(order, null));
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/dealer/src/main/java/cn/lmjia/market/dealer/service/CommissionSettlementService.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.dealer.service;
2 |
3 | import cn.lmjia.market.core.entity.MainOrder;
4 | import cn.lmjia.market.core.event.MainOrderFinishEvent;
5 | import me.jiangcai.lib.thread.ThreadSafe;
6 | import me.jiangcai.payment.event.OrderPaySuccess;
7 | import org.springframework.context.event.EventListener;
8 | import org.springframework.transaction.annotation.Transactional;
9 |
10 | /**
11 | * 佣金结算
12 | *
13 | * @author CJ
14 | */
15 | public interface CommissionSettlementService {
16 |
17 | @EventListener(MainOrderFinishEvent.class)
18 | @ThreadSafe
19 | @Transactional
20 | void orderFinish(MainOrderFinishEvent event);
21 |
22 | @EventListener(OrderPaySuccess.class)
23 | @Transactional
24 | void orderPaySuccess(OrderPaySuccess event);
25 |
26 | /**
27 | * 重新结算这个订单
28 | *
29 | * @param order 订单
30 | */
31 | @ThreadSafe
32 | @Transactional
33 | void reSettlement(MainOrder order);
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/logistics/src/main/java/me/jiangcai/logistics/entity/UnSettlementUsageStock.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.entity;
2 |
3 | import lombok.Getter;
4 | import lombok.Setter;
5 |
6 | import javax.persistence.Column;
7 | import javax.persistence.Entity;
8 | import javax.persistence.Id;
9 | import javax.persistence.JoinColumn;
10 | import javax.persistence.ManyToOne;
11 | import javax.persistence.Table;
12 |
13 | /**
14 | * 未结算的库存使用状态
15 | *
16 | * @author CJ
17 | */
18 | @SuppressWarnings("JpaDataSourceORMInspection")
19 | @Table(name = "UnSettlementUsageStock")
20 | @Entity
21 | @Getter
22 | @Setter
23 | public class UnSettlementUsageStock {
24 | @Id
25 | private String id;
26 | @ManyToOne
27 | @JoinColumn(name = "PRODUCT_CODE")
28 | private Product product;
29 | @ManyToOne
30 | @JoinColumn(name = "DESTINATION_ID")
31 | private Depot destination;
32 | @ManyToOne
33 | @JoinColumn(name = "ORIGIN_ID")
34 | private Depot origin;
35 | @Column(name = "AMOUNT")
36 | private int amount;
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/web/src/main/java/cn/lmjia/market/web/config/DispatcherServletInitializer.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.web.config;
2 |
3 | import org.springframework.web.filter.CharacterEncodingFilter;
4 | import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
5 |
6 | import javax.servlet.Filter;
7 |
8 |
9 | public class DispatcherServletInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
10 | @Override
11 | protected Class>[] getRootConfigClasses() {
12 | return new Class>[]{
13 | WebConfig.class, RuntimeConfig.class
14 | };
15 | }
16 |
17 | @Override
18 | protected Class>[] getServletConfigClasses() {
19 | return null;
20 | }
21 |
22 | @Override
23 | protected String[] getServletMappings() {
24 | return new String[]{"/"};
25 | }
26 |
27 | @Override
28 | protected Filter[] getServletFilters() {
29 | return new Filter[]{new CharacterEncodingFilter("utf-8")};
30 | }
31 |
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/mock/mall.js:
--------------------------------------------------------------------------------
1 | Mock.setup({
2 | timeout: '1000'
3 | });
4 |
5 | Mock.mock(/\/api\/goodsList\?productName=(.*)/, "get", {
6 | "resultCode": 200,
7 | "resultMsg": "ok",
8 | "data|0-5": [
9 | {
10 | id: '@id',
11 | productName: '@csentence(50)',
12 | goodsImage: Mock.Random.image('357x357'),
13 | description: '@csentence',
14 | price: '@integer(3000, 10000)',
15 | salesVolume:'@integer(1000, 99999)'
16 | }
17 | ]
18 | });
19 |
20 | Mock.mock(/\/api\/goodsList\?tag=(.*)&propertyValue=(.*)&priceOrder=(.*)&page=(.*)/, {
21 | "resultCode": 200,
22 | "resultMsg": "ok",
23 | "data|0-2": [
24 | {
25 | id: '@id',
26 | productName: '@csentence(50)',
27 | goodsImage: Mock.Random.image('357x357'),
28 | description: '@csentence',
29 | price: '@integer(3000, 10000)',
30 | salesVolume:'@integer(1000, 99999)'
31 | }
32 | ]
33 | });
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/service/NoticeService.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.service;
2 |
3 | import cn.lmjia.market.core.entity.Login;
4 | import cn.lmjia.market.core.event.MainDeliverableOrderDeliveryRequired;
5 | import me.jiangcai.payment.event.OrderPaySuccess;
6 | import org.springframework.context.event.EventListener;
7 |
8 | import javax.annotation.PostConstruct;
9 |
10 | /**
11 | * 负责消息发布
12 | *
13 | * @author CJ
14 | */
15 | public interface NoticeService {
16 |
17 | @PostConstruct
18 | void init();
19 |
20 | // 订单支付时发送事件
21 | @EventListener(OrderPaySuccess.class)
22 | void orderPaySuccess(OrderPaySuccess event);
23 |
24 | @EventListener(MainDeliverableOrderDeliveryRequired.class)
25 | void mainDeliverableOrderDeliveryRequired(MainDeliverableOrderDeliveryRequired event);
26 |
27 | /**
28 | * login刚刚加入,如果存在引导者 请给他发布通知
29 | *
30 | * @param login login
31 | * @param mobile 它的手机号码
32 | */
33 | void newLogin(Login login, String mobile);
34 |
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/core-service/src/main/resources/AgentGoodAdvancePaymentJournal.h2.sql:
--------------------------------------------------------------------------------
1 | CREATE OR REPLACE VIEW `AgentGoodAdvancePaymentJournal`
2 | AS
3 | SELECT
4 | concat('APO-', c.ID) AS `ID`,
5 | c.BELONGS_ID AS `LOGIN_ID`,
6 | c.ID AS `AGENT_PREPAYMENT_ORDER_ID`,
7 | c.ORDERTIME AS `HAPPEN_TIME`,
8 | 0 AS `TYPE`,
9 | -c.GOODTOTALPRICEAMOUNTINDEPENDENT AS `CHANGED`
10 | FROM agentprepaymentorder AS c
11 | UNION SELECT
12 | concat('APR-', wr.ID) AS `ID`,
13 | wr.LOGIN_ID AS `LOGIN_ID`,
14 | NULL AS `AGENT_PREPAYMENT_ORDER_ID`,
15 | wr.HAPPENTIME AS `HAPPEN_TIME`,
16 | 1 AS `TYPE`,
17 | wr.AMOUNT AS `CHANGED`
18 | FROM agentgoodadvancepayment AS wr
19 | WHERE wr.APPROVED = 1
--------------------------------------------------------------------------------
/logistics-haier/src/main/java/me/jiangcai/logistics/haier/util/LocalDateTimeDeserializer.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.haier.util;
2 |
3 | import com.fasterxml.jackson.core.JsonParser;
4 | import com.fasterxml.jackson.databind.DeserializationContext;
5 | import com.fasterxml.jackson.databind.JsonDeserializer;
6 |
7 | import java.io.IOException;
8 | import java.time.LocalDateTime;
9 | import java.time.format.DateTimeFormatter;
10 | import java.util.Locale;
11 |
12 | /**
13 | * @author CJ
14 | */
15 | public class LocalDateTimeDeserializer extends JsonDeserializer {
16 | private static final DateTimeFormatter format = DateTimeFormatter.ofPattern("yyyyMMddHHmmss", Locale.CHINA);
17 |
18 | @Override
19 | public LocalDateTime deserialize(JsonParser p, DeserializationContext ctxt)
20 | throws IOException {
21 | // ctxt.getAnnotationIntrospector().findFormat(new AnnotatedField());
22 | String time = p.readValueAs(String.class);
23 | return LocalDateTime.parse(time, format);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/core-service/src/main/resources/AgentGoodAdvancePaymentJournal.mysql.sql:
--------------------------------------------------------------------------------
1 | CREATE OR REPLACE VIEW `AgentGoodAdvancePaymentJournal`
2 | AS
3 | SELECT
4 | concat('APO-', c.ID) AS `ID`,
5 | c.BELONGS_ID AS `LOGIN_ID`,
6 | c.ID AS `AGENT_PREPAYMENT_ORDER_ID`,
7 | c.ORDERTIME AS `HAPPEN_TIME`,
8 | 0 AS `TYPE`,
9 | -c.GOODTOTALPRICEAMOUNTINDEPENDENT AS `CHANGED`
10 | FROM agentprepaymentorder AS c
11 | UNION SELECT
12 | concat('APR-', wr.ID) AS `ID`,
13 | wr.LOGIN_ID AS `LOGIN_ID`,
14 | NULL AS `AGENT_PREPAYMENT_ORDER_ID`,
15 | wr.HAPPENTIME AS `HAPPEN_TIME`,
16 | 1 AS `TYPE`,
17 | wr.AMOUNT AS `CHANGED`
18 | FROM agentgoodadvancepayment AS wr
19 | WHERE wr.APPROVED = 1
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/repository/CustomerRepository.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.repository;
2 |
3 | import cn.lmjia.market.core.entity.Customer;
4 | import cn.lmjia.market.core.entity.Login;
5 | import cn.lmjia.market.core.entity.deal.AgentSystem;
6 | import org.springframework.data.jpa.repository.JpaRepository;
7 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
8 |
9 | import java.util.List;
10 |
11 | /**
12 | * @author CJ
13 | */
14 | public interface CustomerRepository extends JpaRepository, JpaSpecificationExecutor {
15 | Customer findByNameAndMobile(String name, String mobile);
16 |
17 | @Deprecated
18 | List findByLogin(Login login);
19 |
20 | /**
21 | * @return 该login已完成订单的客户数
22 | */
23 | @Deprecated
24 | long countByLoginAndSuccessOrderTrue(Login login);
25 |
26 | /**
27 | * @return 这个代理体系的所有客户
28 | */
29 | @Deprecated
30 | List findByAgentLevel_SystemAndSuccessOrderTrue(AgentSystem system);
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/service/AgentPrepaymentOrderService.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.service;
2 |
3 | import cn.lmjia.market.core.aop.BusinessLocker;
4 | import cn.lmjia.market.core.aop.BusinessSafe;
5 | import cn.lmjia.market.core.entity.Login;
6 | import cn.lmjia.market.core.entity.MainGood;
7 | import cn.lmjia.market.core.entity.order.AgentPrepaymentOrder;
8 | import cn.lmjia.market.core.exception.MainGoodLowStockException;
9 | import me.jiangcai.jpa.entity.support.Address;
10 | import me.jiangcai.wx.model.Gender;
11 |
12 | import java.util.Map;
13 |
14 | /**
15 | * @author CJ
16 | */
17 | public interface AgentPrepaymentOrderService extends MainDeliverableOrderService {
18 |
19 | // 内部API
20 | @BusinessSafe
21 | AgentPrepaymentOrder newOrder(BusinessLocker locker, Login who, Login recommendBy, String name, String mobile
22 | , int age, Gender gender, Address installAddress
23 | , Map amounts, String mortgageIdentifier) throws MainGoodLowStockException;
24 | }
25 |
--------------------------------------------------------------------------------
/manage-service/src/main/resources/manage-view/mock/agentGoodAdvancePayment.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 预付货款的mock 数据
3 | * Created by CJ on 13/10/2017.
4 | */
5 |
6 | Mock.setup({
7 | timeout: 500
8 | });
9 |
10 | Mock.Random.extend({
11 | toNull: function () {
12 | return null;
13 | }
14 | });
15 |
16 | Mock.mock(/\/manage\/agentGoodAdvancePayment/, "get", {
17 | "draw": 1,
18 | "recordsTotal": 23,
19 | "recordsFiltered": 23,
20 | "data|5": [
21 | {
22 | 'id': '@id',
23 | 'user': '@cname',
24 | 'loginId': '@id',
25 | 'amount': '@integer(100, 10000)',
26 | 'balance': '@integer(100, 10000)',
27 | 'mobile': /^1([34578])\d{9}$/,
28 | 'status': '@pick(["待处理","已拒绝","已成功"])',
29 | 'approved': '@pick(@bool,@toNull)',
30 | 'serial': null,
31 | 'comment': null,
32 | 'happenTime': '@datetime("yyyy-MM-dd")',
33 | 'operator': '@cname',
34 | 'approval': '@cname'
35 |
36 | }
37 | ]
38 | });
39 |
--------------------------------------------------------------------------------
/wechat-service/src/test/java/cn/lmjia/market/wechat/controller/help/HelpDetailPage.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.wechat.controller.help;
2 |
3 | import cn.lmjia.market.wechat.page.AbstractWechatPage;
4 | import org.openqa.selenium.By;
5 | import org.openqa.selenium.WebDriver;
6 | import org.openqa.selenium.WebElement;
7 |
8 | import static org.assertj.core.api.Assertions.assertThat;
9 |
10 | public class HelpDetailPage extends AbstractWechatPage {
11 | public HelpDetailPage(WebDriver webDriver) {
12 | super(webDriver);
13 | }
14 |
15 | @Override
16 | public void validatePage() {
17 | assertTitle("帮助详情");
18 | }
19 |
20 |
21 | public void asssertHasTopic(String title) {
22 | assertThat(webDriver.findElements(By.className("weui-article")).stream()
23 | .map(webElement -> webElement.findElement(By.tagName("h1")))
24 | .map(WebElement::getText)
25 | .anyMatch(title::equalsIgnoreCase))
26 | .as("我们确保看到了这个标题的帮助的详情")
27 | .isTrue();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/wechat-service/src/main/resources/wechat-resource/assets/js/mall/storage.js:
--------------------------------------------------------------------------------
1 | var Storage = {
2 | setData: function (data) {
3 | console.log("data:" + data);
4 | var self = this;
5 | var storage = self.getData();
6 | $.extend(storage, data);
7 | localStorage.setItem('_cart', JSON.stringify(storage));
8 | },
9 | getData: function () {
10 | var storage = JSON.parse(localStorage.getItem('_cart'));
11 | storage = storage ? storage : {};
12 | return storage;
13 | },
14 | clear: function (key) {
15 | var storage = this.getData();
16 | delete storage[key];
17 | localStorage.setItem('_cart', JSON.stringify(storage));
18 | }
19 | };
20 |
21 | function updateCartLength() {
22 | $('.js-cartBtn').find('.cart-badge').text(Object.keys(Storage.getData()).length);
23 | }
24 |
25 | updateCartLength();
26 |
27 | $('.js-cartBtn').click(function () {
28 | $('#J_cartForm')
29 | .find('input').val(JSON.stringify(Storage.getData()))
30 | .end()
31 | .submit();
32 | });
--------------------------------------------------------------------------------
/core-service/src/test/java/cn/lmjia/market/core/entity/SubEntityTest.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.entity;
2 |
3 | import cn.lmjia.market.core.CoreServiceTest;
4 | import org.junit.Test;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.test.annotation.Rollback;
7 | import org.springframework.transaction.annotation.Transactional;
8 |
9 | import javax.persistence.EntityManager;
10 | import java.util.UUID;
11 |
12 | /**
13 | * @author CJ
14 | */
15 | //@ActiveProfiles("mysql")
16 | public class SubEntityTest extends CoreServiceTest {
17 |
18 | @SuppressWarnings("SpringJavaAutowiringInspection")
19 | @Autowired
20 | private EntityManager entityManager;
21 |
22 | @Test
23 | @Transactional
24 | @Rollback(false)
25 | public void go() {
26 |
27 | SubEntity entity = new SubEntity();
28 | entity.setId(UUID.randomUUID().toString());
29 | entity.setP1(UUID.randomUUID().toString());
30 | entity.setP2(UUID.randomUUID().toString());
31 | entityManager.merge(entity);
32 | }
33 |
34 | }
--------------------------------------------------------------------------------
/core-service/src/test/java/cn/lmjia/market/core/test/MainGoodsAndAmountsTestController.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.test;
2 |
3 | import cn.lmjia.market.core.model.MainGoodsAndAmounts;
4 | import org.apache.commons.logging.Log;
5 | import org.apache.commons.logging.LogFactory;
6 | import org.springframework.stereotype.Controller;
7 | import org.springframework.web.bind.annotation.PostMapping;
8 | import org.springframework.web.bind.annotation.ResponseBody;
9 |
10 | /**
11 | * @author CJ
12 | */
13 | @Controller
14 | public class MainGoodsAndAmountsTestController {
15 |
16 | private static final Log log = LogFactory.getLog(MainGoodsAndAmountsTestController.class);
17 |
18 | @PostMapping("/MainGoodsAndAmountsTestController")
19 | @ResponseBody
20 | public String model(String[] goods) {
21 | MainGoodsAndAmounts amounts = MainGoodsAndAmounts.ofArray(goods);
22 | log.info("goods:" + amounts);
23 | return amounts.toString();
24 | // log.info("goods:" + Arrays.toString(goods));
25 | // return Arrays.toString(goods);
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/manage-service/src/main/resources/manage-view/manage-resource/js/repairDetail.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Neo on 2017/6/30.
3 | */
4 | $(function () {
5 | "use strict";
6 |
7 | $('.img-feedback-list').find('img').click(function () {
8 | var $img = $('
').attr('src', $(this).attr('src'));
9 | var content = $('').append($img);
10 | window.top.layer.open({
11 | type: 1,
12 | shade: 0.5,
13 | title: false,
14 | shadeClose: true,
15 | area: ['auto', 'auto'],
16 | content: content.html()
17 | });
18 | });
19 |
20 | $('#J_datePicker').flatpickr({
21 | minDate: new Date(),
22 | locale: 'zh'
23 | });
24 |
25 | $('#J_timePicker').flatpickr({
26 | minDate: new Date(),
27 | enableTime: true,
28 | noCalendar: true,
29 | enableSeconds: false,
30 | time_24hr: true,
31 | dateFormat: "H:i",
32 | minuteIncrement: 1,
33 | locale: 'zh'
34 | });
35 | });
--------------------------------------------------------------------------------
/web/src/main/java/cn/lmjia/market/web/controller/WelcomeController.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.web.controller;
2 |
3 | import cn.lmjia.market.core.entity.Login;
4 | import cn.lmjia.market.core.entity.deal.AgentLevel;
5 | import cn.lmjia.market.dealer.mvc.HighestAgent;
6 | import org.springframework.security.core.annotation.AuthenticationPrincipal;
7 | import org.springframework.stereotype.Controller;
8 | import org.springframework.web.bind.annotation.RequestMapping;
9 | import org.springframework.web.bind.annotation.RequestMethod;
10 |
11 | /**
12 | * @author CJ
13 | */
14 | @Controller
15 | public class WelcomeController {
16 |
17 | @RequestMapping(method = RequestMethod.GET, value = {"", "/"})
18 | public String index(@AuthenticationPrincipal Login login, @HighestAgent AgentLevel agentLevel) {
19 | if (login.isManageable())
20 | return "redirect:/manage";
21 | // 如果当前登录者是管理员 或者是代理体系内的一般代理则都给予引导至管理页
22 | if (agentLevel != null)
23 | return "redirect:/agentMain";
24 | throw new IllegalStateException("不知道引到至何处。");
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/service/help/CommonProblemService.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.service.help;
2 |
3 | import cn.lmjia.market.core.entity.help.CommonProblem;
4 | import org.springframework.transaction.annotation.Transactional;
5 |
6 | import java.util.List;
7 |
8 | /**
9 | * 常见问题服务
10 | */
11 | public interface CommonProblemService {
12 |
13 | /**
14 | * @return 返回常见问题对象
15 | */
16 | @Transactional(readOnly = true)
17 | CommonProblem getOne(long id);
18 |
19 | /**
20 | * 添加与修改常见问题
21 | * 默认问题即被加入热门展示中。
22 | * @param id 常见问题id,添加时可以为null.
23 | * @param title 标题
24 | * @param weight 权重
25 | * @param content 内容
26 | */
27 | @Transactional
28 | CommonProblem addAndEditCommonProblem(Long id, String title, int weight, String content);
29 |
30 | /**
31 | * @return 所有直接展示在微信端的常见问题.
32 | */
33 | List
findByWeight();
34 |
35 | /**
36 | * @param keyword 关键字
37 | * @return 返回所有包含关键字的对象.
38 | */
39 | List findByTitle(String keyword);
40 | }
41 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/util/TimeUtil.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.util;
2 |
3 | import java.time.LocalDate;
4 |
5 | /**
6 | * @Author: lixuefeng
7 | */
8 |
9 | public class TimeUtil {
10 | private TimeUtil() {}
11 |
12 | /**
13 | * 比对给定时间是否是当月的某一天前的时间.
14 | *
15 | * @param date 给定时间
16 | * @param before 当月某一天
17 | * @return
18 | */
19 | public static boolean beforeTheDate(LocalDate date, int before) {
20 | LocalDate fifthDay = LocalDate.now().withDayOfMonth(before);
21 | return date.isBefore(fifthDay);
22 | }
23 |
24 | /**
25 | * 比对给定时间是都在当月某个时间范围内
26 | *
27 | * @param date 给定时间
28 | * @param start 开始时间
29 | * @param end 截止时间
30 | * @return
31 | */
32 | public static boolean timeFrame(LocalDate date, int start, int end) {
33 | LocalDate startTime = LocalDate.now().withDayOfMonth(start);
34 | LocalDate endTime = LocalDate.now().withDayOfMonth(end);
35 | return date.isAfter(startTime) && date.isBefore(endTime);
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/logistics-haier/src/test/resources/RejectInfo.xml:
--------------------------------------------------------------------------------
1 |
2 | 2d1e134ce1b74a849adbf87096f1128d
3 | 6132846602
4 | 1
5 | 2
6 | 2017-08-02 00:00:00
7 | C12101
8 | 1
9 |
10 |
11 | 1
12 | 10
13 | KWkLZc
14 | 3XQ000122
15 | KWkLZc
16 | 500
17 | 1
18 |
19 |
20 | 2
21 | 10
22 | uXkelZ
23 | 3XQ000121
24 | uXkelZ
25 | 500
26 | 1
27 |
28 |
29 | 1
30 |
--------------------------------------------------------------------------------
/dealer/src/main/resources/functions/agentBelongs_1.mysql.sql:
--------------------------------------------------------------------------------
1 | CREATE FUNCTION `mm_agentBelongs`(
2 | id BIGINT, superior BIGINT
3 | )
4 | RETURNS SMALLINT DETERMINISTIC COMMENT 'id 从属于或者间接从属于 superior 则1' BEGIN DECLARE result SMALLINT;
5 | SELECT
6 | superior IN (t0.`ID`, t1.`ID`, t2.`ID`, t3.`ID`, t4.`ID`, t5.`ID`, t6.`ID`, t7.`ID`, t8.`ID`, t9.`ID`, t10.`ID`)
7 | INTO result
8 | FROM `AGENTLEVEL` AS t0 LEFT JOIN `AGENTLEVEL` AS t1 ON t0.`SUPERIOR_ID` = t1.`ID`
9 | LEFT JOIN `AGENTLEVEL` AS t2 ON t1.`SUPERIOR_ID` = t2.`ID`
10 | LEFT JOIN `AGENTLEVEL` AS t3 ON t2.`SUPERIOR_ID` = t3.`ID`
11 | LEFT JOIN `AGENTLEVEL` AS t4 ON t3.`SUPERIOR_ID` = t4.`ID`
12 | LEFT JOIN `AGENTLEVEL` AS t5 ON t4.`SUPERIOR_ID` = t5.`ID`
13 | LEFT JOIN `AGENTLEVEL` AS t6 ON t5.`SUPERIOR_ID` = t6.`ID`
14 | LEFT JOIN `AGENTLEVEL` AS t7 ON t6.`SUPERIOR_ID` = t7.`ID`
15 | LEFT JOIN `AGENTLEVEL` AS t8 ON t7.`SUPERIOR_ID` = t8.`ID`
16 | LEFT JOIN `AGENTLEVEL` AS t9 ON t8.`SUPERIOR_ID` = t9.`ID`
17 | LEFT JOIN `AGENTLEVEL` AS t10 ON t9.`SUPERIOR_ID` = t10.`ID`
18 | WHERE t0.`ID` = id;
19 | RETURN result;
20 | END
--------------------------------------------------------------------------------
/logistics-haier/src/main/java/me/jiangcai/logistics/haier/model/InOutItem.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.haier.model;
2 |
3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4 | import com.fasterxml.jackson.annotation.JsonProperty;
5 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
6 | import lombok.Data;
7 | import me.jiangcai.logistics.haier.util.BooleanDeserializer;
8 |
9 | import java.io.Serializable;
10 |
11 | /**
12 | * @author CJ
13 | */
14 | @Data
15 | @JsonIgnoreProperties(ignoreUnknown = true)
16 | public class InOutItem implements Serializable {
17 |
18 | private static final long serialVersionUID = 5928930928174888678L;
19 |
20 | @JsonProperty("storagetype")
21 | private String type;
22 | @JsonProperty("productcode")
23 | private String productCode;
24 | @JsonProperty("hrcode")
25 | private String hrCode;
26 | @JsonProperty("prodes")
27 | private String productModel;
28 | private int number;
29 | @JsonProperty("iscomplete")
30 | @JsonDeserialize(using = BooleanDeserializer.class)
31 | private boolean complete;
32 | }
33 |
--------------------------------------------------------------------------------
/core-service/src/main/java/cn/lmjia/market/core/converter/LocalDateConverter.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.core.converter;
2 |
3 | import org.springframework.format.Formatter;
4 | import org.springframework.stereotype.Component;
5 | import org.springframework.util.StringUtils;
6 |
7 | import java.text.ParseException;
8 | import java.time.LocalDate;
9 | import java.time.format.DateTimeFormatter;
10 | import java.util.Locale;
11 |
12 | /**
13 | * @author CJ
14 | */
15 | @Component
16 | public class LocalDateConverter implements Formatter {
17 |
18 | public static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-M-d", Locale.CHINA);
19 |
20 | @Override
21 | public LocalDate parse(String text, Locale locale) throws ParseException {
22 | if (StringUtils.isEmpty(text))
23 | return null;
24 | return LocalDate.from(formatter.parse(text));
25 | }
26 |
27 | @Override
28 | public String print(LocalDate object, Locale locale) {
29 | if (object == null)
30 | return null;
31 | return formatter.format(object);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/manage-service/src/test/java/cn/lmjia/market/manage/page/ManageStoragePage.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.manage.page;
2 |
3 | import cn.lmjia.market.core.pages.AbstractContentPage;
4 | import org.openqa.selenium.By;
5 | import org.openqa.selenium.WebDriver;
6 | import org.openqa.selenium.support.ui.ExpectedConditions;
7 | import org.openqa.selenium.support.ui.WebDriverWait;
8 |
9 | /**
10 | * _storageManage.html
11 | * 仓储管理
12 | *
13 | * @author CJ
14 | */
15 | public class ManageStoragePage extends AbstractContentPage {
16 | public ManageStoragePage(WebDriver webDriver) {
17 | super(webDriver);
18 | }
19 |
20 | @Override
21 | public void validatePage() {
22 | assertTitle("仓储管理");
23 | }
24 |
25 | /**
26 | * 点击发货
27 | *
28 | * @return
29 | */
30 | public ManageStorageDeliveryPage clickDelivery() {
31 | new WebDriverWait(webDriver, 1).until(ExpectedConditions.elementToBeClickable(By.id("J_DeliveryLink")));
32 | webDriver.findElement(By.id("J_DeliveryLink")).click();
33 | return initPage(ManageStorageDeliveryPage.class);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/logistics-haier/src/main/java/me/jiangcai/logistics/haier/HaierConfig.java:
--------------------------------------------------------------------------------
1 | package me.jiangcai.logistics.haier;
2 |
3 | import me.jiangcai.logistics.LogisticsConfig;
4 | import org.springframework.context.annotation.ComponentScan;
5 | import org.springframework.context.annotation.Configuration;
6 | import org.springframework.context.annotation.Import;
7 | import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
8 | import org.springframework.web.servlet.config.annotation.EnableWebMvc;
9 |
10 | /**
11 | * 需要配置gateway URL,会读取以下系统参数作为URL
12 | *
13 | * - haier.gateway.URL 默认http://58.56.128.84:9001/EAI/service/VOM/CommonGetWayToVOM/CommonGetWayToVOM
14 | * - haier.keyValue 约定的keyValue
15 | * - haier.key AES密钥
16 | *
17 | * 而且它将监视/_haier_vom_callback
18 | *
19 | * @author CJ
20 | */
21 | @Configuration
22 | @Import(LogisticsConfig.class)
23 | @EnableWebMvc
24 | @ComponentScan({
25 | "me.jiangcai.logistics.haier.service", "me.jiangcai.logistics.haier.controller"
26 | })
27 | @EnableJpaRepositories("me.jiangcai.logistics.haier.repository")
28 | public class HaierConfig {
29 | }
30 |
--------------------------------------------------------------------------------
/web/src/test/java/cn/lmjia/market/web/page/WebLoginPage.java:
--------------------------------------------------------------------------------
1 | package cn.lmjia.market.web.page;
2 |
3 | import cn.lmjia.market.core.pages.AbstractPage;
4 | import org.openqa.selenium.WebDriver;
5 | import org.openqa.selenium.WebElement;
6 | import org.openqa.selenium.support.FindBy;
7 |
8 | /**
9 | * login.html
10 | *
11 | * @author CJ
12 | */
13 | public class WebLoginPage extends AbstractPage {
14 |
15 | private WebElement username;
16 | private WebElement password;
17 | @FindBy(id = "loginButton")
18 | private WebElement loginButton;
19 |
20 | public WebLoginPage(WebDriver webDriver) {
21 | super(webDriver);
22 | }
23 |
24 | @Override
25 | public void validatePage() {
26 | assertTitle("登录 - 代理商后台管理");
27 | }
28 |
29 | /**
30 | * 登录
31 | *
32 | * @param name 用户名
33 | * @param password 密码
34 | */
35 | public void login(String name, String password) {
36 | this.username.clear();
37 | this.username.sendKeys(name);
38 | this.password.clear();
39 | this.password.sendKeys(password);
40 | loginButton.click();
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/logistics-haier/src/test/resources/OutInStore.xml:
--------------------------------------------------------------------------------
1 |
2 | 2d1e134ce1b74a849adbf87096f1128d
3 | 6132846602
4 | 1
5 | 2
6 | 2017-08-02 00:00:00
7 | C12101
8 | 1
9 |
10 | 4974752222
11 |
12 |
13 |
14 | 1
15 | 10
16 | KWkLZc
17 | 3XQ000122
18 | KWkLZc
19 | 500
20 | 1
21 |
22 |
23 | 2
24 | 10
25 | uXkelZ
26 | 3XQ000121
27 | uXkelZ
28 | 500
29 | 1
30 |
31 |
32 |
--------------------------------------------------------------------------------