Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
android
/
dayu
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d9ed14d3
authored
Sep 29, 2020
by
mReturn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
V2.6.7
parent
209c7003
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
104 additions
and
13 deletions
baseSDK/src/main/java/com/dayu/base/api/Api.java
build.gradle
orderCenter/src/main/java/com/dayu/order/api/OrderService.java
orderCenter/src/main/java/com/dayu/order/api/protocol/bean/GreenPersionSiteInfo.java
orderCenter/src/main/java/com/dayu/order/ui/fragment/MultiOrderDetailFragment.java
orderCenter/src/main/res/layout/fragment_multi_detail.xml
baseSDK/src/main/java/com/dayu/base/api/Api.java
View file @
d9ed14d3
...
...
@@ -9,7 +9,6 @@ import com.dayu.common.BaseConstant;
import
com.dayu.common.Constants
;
import
com.dayu.event.UserInfo
;
import
com.dayu.utils.AppUtils
;
import
com.dayu.utils.CommonUtils
;
import
com.dayu.utils.LogUtils
;
import
com.dayu.utils.UserManager
;
import
com.google.gson.Gson
;
...
...
@@ -132,6 +131,11 @@ public class Api {
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
flatMap
(
Api:
:
flatResponse
);
}
public
static
<
T
>
ObservableTransformer
<
T
,
T
>
applySchedulersSource
()
{
return
upstream
->
upstream
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
flatMap
(
Api:
:
flatResponseSource
);
}
// final static ObservableTransformer transformer = new ObservableTransformer() {
...
...
@@ -172,6 +176,20 @@ public class Api {
}
});
}
private
static
<
T
>
Observable
<
T
>
flatResponseSource
(
final
T
response
)
{
return
Observable
.
create
(
e
->
{
if
(!
e
.
isDisposed
())
{
if
(
response
!=
null
)
{
e
.
onNext
(
response
);
}
else
{
e
.
onError
(
new
ServerException
(
Constants
.
ERROR_NULL
,
""
));
}
}
if
(!
e
.
isDisposed
())
{
e
.
onComplete
();
}
});
}
}
build.gradle
View file @
d9ed14d3
...
...
@@ -5,8 +5,8 @@ buildscript {
ext
.
build_tools_version
=
"27.0.3"
ext
.
min_sdk_version
=
17
ext
.
target_sdk_version
=
26
ext
.
version_code
=
26
6
ext
.
verson_name
=
"2.6.
6
"
ext
.
version_code
=
26
7
ext
.
verson_name
=
"2.6.
7
"
ext
.
gradle_version
=
'3.1.4'
ext
.
isReleaseMinify
=
false
ext
.
isDebugMinify
=
false
...
...
orderCenter/src/main/java/com/dayu/order/api/OrderService.java
View file @
d9ed14d3
...
...
@@ -13,6 +13,7 @@ import com.dayu.order.api.protocol.OperateInfo;
import
com.dayu.order.api.protocol.Order
;
import
com.dayu.order.api.protocol.OrderDetail
;
import
com.dayu.order.api.protocol.OrderPart
;
import
com.dayu.order.api.protocol.bean.GreenPersionSiteInfo
;
import
com.dayu.order.api.protocol.bean.KnowledgeListBean
;
import
com.dayu.order.api.protocol.bean.OrderDetailDeviceInfoBean
;
import
com.dayu.order.api.protocol.bean.OrderDetailSiteInfoBean
;
...
...
@@ -562,10 +563,10 @@ public interface OrderService {
@Query
(
"type"
)
int
type
);
/**
* 获取站点信息
* 获取
小绿人
站点信息
*
* @return
*/
@GET
(
Constants
.
API_7200
+
"/orders/greenPerson"
)
Observable
<
BaseResponse
<
OrderDetailSiteInfoBean
>
>
getSiteInfo
(
@Query
(
"sn"
)
String
sn
);
Observable
<
GreenPersionSiteInfo
>
getSiteInfo
(
@Query
(
"sn"
)
String
sn
);
}
orderCenter/src/main/java/com/dayu/order/api/protocol/bean/GreenPersionSiteInfo.java
0 → 100644
View file @
d9ed14d3
This diff is collapsed.
Click to expand it.
orderCenter/src/main/java/com/dayu/order/ui/fragment/MultiOrderDetailFragment.java
View file @
d9ed14d3
...
...
@@ -24,6 +24,7 @@ import com.dayu.order.api.OrderApiFactory;
import
com.dayu.order.api.OrderService
;
import
com.dayu.order.api.protocol.OrderDetail
;
import
com.dayu.order.api.protocol.Spu
;
import
com.dayu.order.api.protocol.bean.GreenPersionSiteInfo
;
import
com.dayu.order.api.protocol.data.AddDialRecordData
;
import
com.dayu.order.common.OperatePhoneEvent
;
import
com.dayu.order.common.OrderConstant
;
...
...
@@ -202,26 +203,60 @@ public class MultiOrderDetailFragment extends BaseFragment<SImplePresenter, Frag
},
responeThrowable
->
{
mBind
.
tvDeviceTime
.
setText
(
R
.
string
.
no_data
);
}));
Api
.
getService
(
OrderService
.
class
).
getSiteInfo
(
detail
.
getSn
()).
compose
(
Api
.
applySchedulers
())
Api
.
getService
(
OrderService
.
class
).
getSiteInfo
(
detail
.
getSn
()).
compose
(
Api
.
applySchedulers
Source
())
.
subscribe
(
mPresenter
.
baseObserver
(
result
->{
if
(
result
!=
null
){
String
info
=
result
.
getProvince
()+
result
.
getCityName
()+
result
.
getDistrict
()+
result
.
getStreet
()+
result
.
getAddress
();
info
=
info
.
replace
(
"null"
,
""
);
mBind
.
tvSiteInfo
.
setText
(
info
);
mBind
.
tvSiteId
.
setText
(
result
.
getStationId
()+
""
);
if
(
result
.
getErrorCode
()
==
200
&&
result
.
getData
()
!=
null
){
if
(
result
.
getData
().
getStation
()
!=
null
){
GreenPersionSiteInfo
.
DataBean
.
StationBean
sResult
=
result
.
getData
().
getStation
();
String
info
=
sResult
.
getProvince
()+
sResult
.
getCityName
()+
sResult
.
getDistrict
()+
sResult
.
getStreet
()+
sResult
.
getAddress
();
setText
(
mBind
.
tvSiteInfo
,
info
);
setText
(
mBind
.
tvSiteId
,
sResult
.
getStationName
());
}
else
{
mBind
.
tvSiteInfo
.
setText
(
R
.
string
.
no_data
);
mBind
.
tvSiteId
.
setText
(
R
.
string
.
no_data
);
}
if
(
result
.
getData
().
getProblem
()!=
null
)
setWrongInfoAdapter
(
result
.
getData
().
getProblem
());
}
else
{
mBind
.
tvSiteInfo
.
setText
(
R
.
string
.
no_data
);
mBind
.
tvSiteId
.
setText
(
R
.
string
.
no_data
);
mBind
.
llWrongInfo
.
setVisibility
(
View
.
GONE
);
}
},
responeThrowable
->
{
mBind
.
tvSiteInfo
.
setText
(
R
.
string
.
no_data
);
mBind
.
tvSiteId
.
setText
(
R
.
string
.
no_data
);
mBind
.
llWrongInfo
.
setVisibility
(
View
.
GONE
);
}));
}
else
{
mBind
.
tvSiteId
.
setText
(
R
.
string
.
no_data
);
mBind
.
tvSiteInfo
.
setText
(
R
.
string
.
no_data
);
mBind
.
tvDeviceSn
.
setText
(
R
.
string
.
no_data
);
mBind
.
tvDeviceTime
.
setText
(
R
.
string
.
no_data
);
mBind
.
llWrongInfo
.
setVisibility
(
View
.
GONE
);
}
}
private
void
setWrongInfoAdapter
(
List
<
GreenPersionSiteInfo
.
DataBean
.
ProblemBean
>
problems
)
{
BaseQuickAdapter
<
GreenPersionSiteInfo
.
DataBean
.
ProblemBean
,
BaseViewHolder
>
wrongAdapter
=
new
BaseQuickAdapter
<
GreenPersionSiteInfo
.
DataBean
.
ProblemBean
,
BaseViewHolder
>(
R
.
layout
.
item_wrong_part
,
problems
)
{
@Override
protected
void
convert
(
BaseViewHolder
helper
,
GreenPersionSiteInfo
.
DataBean
.
ProblemBean
item
)
{
helper
.
getView
(
R
.
id
.
iv_picture
).
setVisibility
(
View
.
GONE
);
helper
.
setText
(
R
.
id
.
tv_desc
,
item
.
getErrorName
());
}
};
LinearLayoutManager
layoutManager
=
new
LinearLayoutManager
(
getContext
());
mBind
.
rvWrongInfo
.
setLayoutManager
(
layoutManager
);
mBind
.
rvWrongInfo
.
setAdapter
(
wrongAdapter
);
mBind
.
llWrongInfo
.
setVisibility
(
View
.
VISIBLE
);
}
private
void
setText
(
TextView
textView
,
String
info
)
{
if
(
TextUtils
.
isEmpty
(
info
)){
textView
.
setText
(
R
.
string
.
no_data
);
}
else
{
textView
.
setText
(
info
);
}
}
...
...
orderCenter/src/main/res/layout/fragment_multi_detail.xml
View file @
d9ed14d3
...
...
@@ -199,13 +199,50 @@
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_wrong_info"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/ll_wrong"
android:layout_marginTop=
"15dp"
android:orientation=
"horizontal"
android:visibility=
"gone"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"故障信息"
android:textColor=
"@color/tv_cl"
android:textSize=
"14sp"
/>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"19dp"
>
<TextView
android:id=
"@+id/tv_no_wrong_info"
style=
"@style/common_text_style"
android:text=
"@string/no_data"
android:visibility=
"gone"
android:drawableLeft=
"@drawable/ic_wrong_num"
android:textSize=
"14sp"
/>
<android.support.v7.widget.RecyclerView
android:id=
"@+id/rv_wrong_info"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:visibility=
"gone"
android:id=
"@+id/ll_site_info"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/ll_wrong"
android:layout_below=
"@+id/ll_wrong
_info
"
android:orientation=
"vertical"
>
<LinearLayout
...
...
@@ -259,7 +296,7 @@
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"站点
编号
"
android:text=
"站点
名称
"
android:textColor=
"@color/tv_cl"
android:textSize=
"14sp"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment