Commit ff0e6497 authored by UIUANG\Zsc's avatar UIUANG\Zsc

添加注释

parent 9a475fd4
......@@ -38,31 +38,18 @@ android {
}
buildTypes {
// debug {
// buildConfigField 'String', 'HOST', DEBUG_HOST
// minifyEnabled false
// proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
// signingConfig signingConfigs.config
// }
debug {
buildConfigField 'String', 'HOST', SIT_HOST
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
// pre {
// buildConfigField 'String', 'HOST', PRE_HOST
// minifyEnabled false
// proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
// }
// release {
// buildConfigField 'String', 'HOST', RELEASE_HOST
// minifyEnabled false
// proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
// signingConfig signingConfigs.config
// }
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
......
......@@ -39,6 +39,9 @@ interface ApiService {
@POST("newretail/api/sys/user/pos/logout")
suspend fun posLogout(): ApiResponse<String?>
/**
* 强制退出
*/
@POST("newretail/api/sys/user/kickoff")
suspend fun posKickOff(@Body request: KickoffRequest): ApiResponse<String?>
......@@ -94,12 +97,9 @@ interface ApiService {
suspend fun saveCommandResult(@Body saveCommandResult: SaveCommandResultRequest): ApiResponse<String>
// /**
// * 根据小票号查询订单
// */
// @GET("/api/mall/order/getByOrderNo")
// suspend fun
/**
* 获取促销信息
*/
@POST("newretail/api/mall/promotion/getProductPromotions")
suspend fun getProductPromotions(@Body request: ProductPromotionRequest): ApiResponse<ProductPromotionsResponse>
......@@ -121,11 +121,15 @@ interface ApiService {
@GET("newretail/api/mall/order/getOrderStatusById")
suspend fun getOrderStatusById(@Query("orderId") orderId: String): ApiResponse<OrderStatusResponse>
/**
* 根据订单id获取订单详情
*/
@GET("newretail/api/mall/order/getDetailsById")
suspend fun getOrderDetailById(@Query("orderId") orderId: String): ApiResponse<OrderDetailsResponse>
/**
* 获取配置
*/
@GET("newretail/api/sys/options/query")
suspend fun getOptionsByKeys(@Query("keys") keys: String = CacheUtil.getAliYunKey()): ApiResponse<List<OptionsResponse>>
......
......@@ -28,6 +28,9 @@ val HttpRequestCoroutine: HttpRequestManger by lazy(mode = LazyThreadSafetyMode.
class HttpRequestManger {
/**
* 申请注册
*/
suspend fun applyPos(applyPosMachineRequest: ApplyPosMachineRequest): ApiResponse<PosMachineResponse> {
val applyPosData = apiService.applyPos(applyPosMachineRequest)
if (applyPosData.isSuccess()) {
......@@ -65,6 +68,9 @@ class HttpRequestManger {
}
/**
* 用户登录并获取配置,获取商品信息
*/
suspend fun posLogin(
posId: String,
storeId: String,
......@@ -100,6 +106,9 @@ class HttpRequestManger {
}
/**
* 创建订单
*/
suspend fun createOrder(
insertOrderRequest: InsertOrderRequest,
authCode: String,
......@@ -146,6 +155,9 @@ class HttpRequestManger {
}
}
/**
* 获取订单状态
*/
suspend fun getOrderStatusById(orderId: String): ApiResponse<OrderStatusResponse> {
val orderStatusData = apiService.getOrderStatusById(orderId)
if (orderStatusData.isSuccess()) {
......@@ -171,6 +183,9 @@ class HttpRequestManger {
}
/**
* 根据命令,上传日志或数据库
*/
suspend fun uploadLog(posCode: String) {
val commandByPosCode = apiService.getCommandByPosCode(posCode)
if (commandByPosCode.isSuccess()) {
......@@ -231,6 +246,9 @@ class HttpRequestManger {
}
}
/**
* 保护命令
*/
private suspend fun saveCommand(
zipUrl: String,
startTime: Long,
......@@ -262,19 +280,24 @@ class HttpRequestManger {
}
}
/**
* 回复命令
*/
private suspend fun replyCommand(id: Long) {
var replyCommand =
apiService.replyCommand(ReplyCommandListRequest(arrayListOf<String>(id.toString())))
}
/**
* 同步商品
*/
suspend fun syncProduct(storeId: String) {
val updateTimeBigger = CacheUtil.getUpdateTimeBigger()
val todayDateTime = DateUtil.getTodayDateTime()
val productData = apiService.getProductList(storeId, updateTimeBigger)
if (productData.isSuccess()) {
var data = productData.data
val data = productData.data
PosProductRepository.getInstance().insertAll(data)
CacheUtil.setUpdateTimeBigger(todayDateTime)
delay(1000 * 60 * 5)
......
......@@ -17,6 +17,9 @@ import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
/**
* 上传日志
*/
class LogService : Service() {
var posConfig: PosConfig? = null
......
......@@ -17,6 +17,9 @@ import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
/**
* 同步商品的任务
*/
class SyncProductService: Service() {
var posConfig: PosConfig? = null
var job: Job? = null
......
......@@ -20,22 +20,16 @@ android {
}
buildTypes {
// debug {
// minifyEnabled false
// proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
// }
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
// pre {
// minifyEnabled false
// proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
// }
// release {
// minifyEnabled false
// proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
// }
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment