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
d9dedc2f
authored
Apr 25, 2018
by
罗翻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加服务详情
parent
2c6a1183
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
184 additions
and
38 deletions
baseSDK/src/main/java/com/dayu/common/Constants.java
locationComponent/build.gradle
locationComponent/libs/Amap_2DMap_V5.2.0_20170627.jar
locationComponent/src/main/AndroidManifest.xml
locationComponent/src/main/java/com/dayu/location/base/BaseMapActivity.java
locationComponent/src/main/res/layout/basicmap_activity.xml
orderCenter/src/main/java/com/dayu/order/api/protocol/OrderDetail.java
orderCenter/src/main/java/com/dayu/order/presenter/orderserver/OrderServerContract.java
orderCenter/src/main/java/com/dayu/order/presenter/orderserver/OrderServerPresenter.java
orderCenter/src/main/java/com/dayu/order/presenter/processorder/ProcessOrderPresenter.java
orderCenter/src/main/java/com/dayu/order/sqlbean/CheckContentOrder.java
orderCenter/src/main/java/com/dayu/order/ui/activity/CheckContentActivity.java
orderCenter/src/main/java/com/dayu/order/ui/adapter/OrderServerAdapter.java
orderCenter/src/main/res/layout/serve_datails_item.xml
baseSDK/src/main/java/com/dayu/common/Constants.java
View file @
d9dedc2f
...
...
@@ -132,6 +132,10 @@ public class Constants {
public
static
final
String
COURIER_NUM
=
"courier_num"
;
public
static
final
String
PART
=
"part"
;
public
static
final
String
LONGITUDE
=
"longitude"
;
public
static
final
String
LATITUDE
=
"latitude"
;
/**
* 主动申请备件.
*/
...
...
locationComponent/build.gradle
View file @
d9dedc2f
...
...
@@ -29,4 +29,5 @@ dependencies {
testImplementation
'junit:junit:4.12'
androidTestImplementation
'com.android.support.test:runner:1.0.1'
androidTestImplementation
'com.android.support.test.espresso:espresso-core:3.0.1'
implementation
files
(
'libs/Amap_2DMap_V5.2.0_20170627.jar'
)
}
locationComponent/libs/Amap_2DMap_V5.2.0_20170627.jar
0 → 100644
View file @
d9dedc2f
File added
locationComponent/src/main/AndroidManifest.xml
View file @
d9dedc2f
...
...
@@ -6,7 +6,7 @@
android:label=
"@string/app_name"
android:supportsRtl=
"true"
>
<activity
android:name=
".base.Bas
ic
MapActivity"
android:name=
".base.Bas
e
MapActivity"
android:screenOrientation=
"portrait"
/>
</application>
</manifest>
locationComponent/src/main/java/com/dayu/location/base/BaseMapActivity.java
0 → 100644
View file @
d9dedc2f
package
com
.
dayu
.
location
.
base
;
import
android.app.Activity
;
import
android.os.Bundle
;
import
android.view.Window
;
import
com.amap.api.maps2d.AMap
;
import
com.amap.api.maps2d.CameraUpdate
;
import
com.amap.api.maps2d.CameraUpdateFactory
;
import
com.amap.api.maps2d.MapView
;
import
com.amap.api.maps2d.model.CameraPosition
;
import
com.amap.api.maps2d.model.LatLng
;
import
com.amap.api.maps2d.model.MarkerOptions
;
import
com.dayu.location.R
;
/**
* Created by luofan
* on 2018/4/24.
*/
public
class
BaseMapActivity
extends
Activity
{
private
AMap
aMap
;
private
MapView
mapView
;
private
double
mLatitude
;
private
double
mLongitude
;
private
String
mAddress
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
requestWindowFeature
(
Window
.
FEATURE_NO_TITLE
);
// 不显示程序的标题栏
setContentView
(
R
.
layout
.
basicmap_activity
);
mapView
=
findViewById
(
R
.
id
.
map
);
mapView
.
onCreate
(
savedInstanceState
);
// 此方法必须重写
init
();
}
/**
* 初始化
*/
private
void
init
()
{
Bundle
bundle
=
getIntent
().
getBundleExtra
(
"bundle"
);
mLatitude
=
bundle
.
getDouble
(
"latitude"
,
0
);
mLongitude
=
bundle
.
getDouble
(
"longitude"
,
0
);
mAddress
=
bundle
.
getString
(
"address"
);
if
(
aMap
==
null
)
{
aMap
=
mapView
.
getMap
();
setUpMap
();
}
}
/**
* 设置一些amap的属性
*/
private
void
setUpMap
()
{
CameraUpdate
cameraUpdate
=
CameraUpdateFactory
.
newCameraPosition
(
new
CameraPosition
(
new
LatLng
(
mLatitude
,
mLongitude
),
16
,
0
,
0
));
aMap
.
moveCamera
(
cameraUpdate
);
//地图移向指定区域
aMap
.
addMarker
(
new
MarkerOptions
().
position
(
new
LatLng
(
mLatitude
,
mLongitude
)).
snippet
(
mAddress
));
}
/**
* 方法必须重写
*/
@Override
protected
void
onResume
()
{
super
.
onResume
();
mapView
.
onResume
();
}
/**
* 方法必须重写
*/
@Override
protected
void
onPause
()
{
super
.
onPause
();
mapView
.
onPause
();
}
/**
* 方法必须重写
*/
@Override
protected
void
onSaveInstanceState
(
Bundle
outState
)
{
super
.
onSaveInstanceState
(
outState
);
mapView
.
onSaveInstanceState
(
outState
);
}
/**
* 方法必须重写
*/
@Override
protected
void
onDestroy
()
{
super
.
onDestroy
();
mapView
.
onDestroy
();
}
}
locationComponent/src/main/res/layout/basicmap_activity.xml
View file @
d9dedc2f
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<com.amap.api.maps2d.MapView
android:id=
"@+id/map"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
android:layout_height=
"match_parent"
/>
</RelativeLayout>
orderCenter/src/main/java/com/dayu/order/api/protocol/OrderDetail.java
View file @
d9dedc2f
...
...
@@ -640,6 +640,15 @@ public class OrderDetail implements Serializable {
private
String
orderObj
;
private
double
latitude
;
private
double
longitude
;
private
String
address
;
public
String
getAddress
()
{
return
address
;
}
public
void
setAddress
(
String
address
)
{
this
.
address
=
address
;
}
public
int
getId
()
{
return
id
;
...
...
orderCenter/src/main/java/com/dayu/order/presenter/orderserver/OrderServerContract.java
View file @
d9dedc2f
...
...
@@ -16,6 +16,9 @@ public interface OrderServerContract {
abstract
class
Presenter
extends
BaseListPresenter
<
View
>
{
public
abstract
void
dumpToSop
();
public
abstract
void
dumpCheckContent
(
int
postion
);
public
abstract
void
dumpCheckContent
(
int
postion
,
int
state
);
public
abstract
void
dumpMap
(
double
latitude
,
double
longitude
,
String
address
);
}
}
orderCenter/src/main/java/com/dayu/order/presenter/orderserver/OrderServerPresenter.java
View file @
d9dedc2f
...
...
@@ -4,14 +4,19 @@ import android.databinding.ObservableField;
import
android.os.Bundle
;
import
com.dayu.common.Constants
;
import
com.dayu.location.base.BaseMapActivity
;
import
com.dayu.order.api.protocol.OrderDetail
;
import
com.dayu.order.common.OrderConstant
;
import
com.dayu.order.ui.activity.CheckContentActivity
;
import
com.dayu.order.ui.activity.SopWebViewActivity
;
import
com.dayu.utils.ToastUtils
;
import
java.util.Collections
;
import
java.util.List
;
import
static
com
.
dayu
.
common
.
Constants
.
ORDER_ID
;
import
static
com
.
dayu
.
common
.
Constants
.
ORDER_POSTION
;
import
static
com
.
dayu
.
common
.
Constants
.
ORDER_STATE
;
/**
* Created by luofan
...
...
@@ -53,10 +58,24 @@ public class OrderServerPresenter extends OrderServerContract.Presenter {
}
@Override
public
void
dumpCheckContent
(
int
postion
)
{
public
void
dumpCheckContent
(
int
postion
,
int
state
)
{
Bundle
bundle
=
new
Bundle
();
bundle
.
putSerializable
(
Constants
.
ORDER_DETAIL
,
mDetails
);
bundle
.
putInt
(
Constants
.
ORDER_POSTION
,
postion
);
mView
.
startActivity
(
CheckContentActivity
.
class
,
bundle
);
bundle
.
putSerializable
(
Constants
.
ORDER_DETAIL
,
mDetails
);
bundle
.
putInt
(
Constants
.
ORDER_POSTION
,
postion
);
bundle
.
putInt
(
ORDER_STATE
,
state
);
mView
.
startActivity
(
CheckContentActivity
.
class
,
bundle
);
}
@Override
public
void
dumpMap
(
double
latitude
,
double
longitude
,
String
address
)
{
Bundle
bundle
=
new
Bundle
();
bundle
.
putDouble
(
Constants
.
LONGITUDE
,
longitude
);
bundle
.
putDouble
(
Constants
.
LATITUDE
,
latitude
);
bundle
.
putString
(
"address"
,
address
);
if
(
longitude
==
0
&&
latitude
==
0
)
{
ToastUtils
.
showShortToast
(
"获取位置失败!"
);
return
;
}
mView
.
startActivity
(
BaseMapActivity
.
class
,
bundle
);
}
}
orderCenter/src/main/java/com/dayu/order/presenter/processorder/ProcessOrderPresenter.java
View file @
d9dedc2f
...
...
@@ -132,6 +132,8 @@ public class ProcessOrderPresenter extends ProcessOrderContract.Presenter {
mOrderDetail
=
detail
;
if
(
detail
.
getCreatedSource
()
!=
3
)
{
mView
.
setFoucesable
();
mOrderInfo
.
setPayer
(
detail
.
getRepairType
()
+
""
);
mOrderField
.
set
(
mOrderInfo
);
}
mDetail
.
set
(
detail
);
mAnyContacts
=
detail
.
getAnyContacts
();
...
...
@@ -224,7 +226,7 @@ public class ProcessOrderPresenter extends ProcessOrderContract.Presenter {
@Override
public
void
commitPhoto
(
List
<
String
>
imageUrl
,
List
<
String
>
payerUrl
)
{
MultipartBody
.
Part
[]
parts
;
if
(
imageUrl
!=
null
&&
payer
Url
.
size
()
>
0
)
{
if
(
imageUrl
!=
null
&&
image
Url
.
size
()
>
0
)
{
parts
=
packPhoto
(
imageUrl
);
BaseApiFactory
.
uploadPhoto
(
parts
).
subscribe
(
baseObserver
(
list
->
{
if
(
payerUrl
.
size
()
>
0
)
{
...
...
@@ -296,11 +298,6 @@ public class ProcessOrderPresenter extends ProcessOrderContract.Presenter {
}
mView
.
getData
();
OrderInfo
info
=
mOrderField
.
get
();
if
(
"1"
.
equals
(
mOrderInfo
.
getPayer
()))
{
mPayer
.
set
(
UIUtils
.
getString
(
R
.
string
.
payer_baonei
));
}
else
if
(
"2"
.
equals
(
mOrderInfo
.
getPayer
()))
{
mPayer
.
set
(
UIUtils
.
getString
(
R
.
string
.
payer_baowai
));
}
if
(
mOrderDetail
.
getCreatedSource
()
==
3
)
{
if
(
TextUtils
.
isEmpty
(
info
.
getPayer
()))
{
mView
.
showNoPayerDialog
();
...
...
@@ -318,7 +315,7 @@ public class ProcessOrderPresenter extends ProcessOrderContract.Presenter {
private
void
commite
(
OrderInfo
info
)
{
mView
.
showDialog
();
if
(
mImages
.
size
()
!=
0
&&
mPayerImages
.
size
()
!=
0
)
{
if
(
mImages
.
size
()
!=
0
||
mPayerImages
.
size
()
!=
0
)
{
mView
.
showDialog
();
commitPhoto
(
mImages
,
mPayerImages
);
}
else
{
...
...
orderCenter/src/main/java/com/dayu/order/sqlbean/CheckContentOrder.java
View file @
d9dedc2f
...
...
@@ -16,7 +16,7 @@ public class CheckContentOrder {
private
String
brandName
;
private
String
productModel
;
private
String
sn
;
private
int
repairType
;
private
String
repairType
;
public
String
getCustomerCheckComment
()
{
return
customerCheckComment
;
...
...
@@ -90,12 +90,11 @@ public class CheckContentOrder {
this
.
sn
=
sn
;
}
public
int
getRepairType
()
{
public
String
getRepairType
()
{
return
repairType
;
}
public
void
setRepairType
(
int
payer
)
{
public
void
setRepairType
(
String
payer
)
{
this
.
repairType
=
payer
;
}
...
...
orderCenter/src/main/java/com/dayu/order/ui/activity/CheckContentActivity.java
View file @
d9dedc2f
...
...
@@ -43,6 +43,7 @@ public class CheckContentActivity extends DataBindingActivity<ActivityCheckConte
serverUrl
=
new
ArrayList
<>();
mdimension
=
(
UtilsScreen
.
getScreenWidth
(
mActivity
)
-
UtilsScreen
.
dip2px
(
mActivity
,
20
))
/
5
;
Bundle
bundle
=
getIntent
().
getBundleExtra
(
Constants
.
BUNDLE
);
int
state
=
bundle
.
getInt
(
Constants
.
ORDER_STATE
,
0
);
OrderDetail
detail
=
(
OrderDetail
)
bundle
.
getSerializable
(
Constants
.
ORDER_DETAIL
);
int
position
=
bundle
.
getInt
(
Constants
.
ORDER_POSTION
);
String
obj
=
detail
.
getRecord
().
get
(
position
).
getOrderObj
();
...
...
@@ -51,12 +52,14 @@ public class CheckContentActivity extends DataBindingActivity<ActivityCheckConte
return
;
}
List
<
OrderDetail
.
Pics
>
pics
=
detail
.
getPic
();
if
(
pics
!=
null
&&
pics
.
size
()
>
0
)
{
for
(
OrderDetail
.
Pics
pic
:
pics
)
{
if
(
pic
.
getPictureType
()
==
1
)
{
payerUrl
.
add
(
pic
.
getPictureUrl
());
}
else
{
serverUrl
.
add
(
pic
.
getPictureUrl
());
if
(
state
==
Constants
.
FINISH_ORDER
)
{
if
(
pics
!=
null
&&
pics
.
size
()
>
0
)
{
for
(
OrderDetail
.
Pics
pic
:
pics
)
{
if
(
pic
.
getPictureType
()
==
1
)
{
payerUrl
.
add
(
pic
.
getPictureUrl
());
}
else
{
serverUrl
.
add
(
pic
.
getPictureUrl
());
}
}
}
}
...
...
@@ -121,9 +124,9 @@ public class CheckContentActivity extends DataBindingActivity<ActivityCheckConte
}
else
{
mBind
.
ivSwitch
.
setSwitchButton
(
true
);
}
if
(
1
==
info
.
getRepairType
(
))
{
if
(
"1"
.
equals
(
info
.
getRepairType
()
))
{
mBind
.
tvPayer
.
setText
(
UIUtils
.
getString
(
R
.
string
.
payer_baonei
));
}
else
if
(
2
==
info
.
getRepairType
(
))
{
}
else
if
(
"2"
.
equals
(
info
.
getRepairType
()
))
{
mBind
.
tvPayer
.
setText
(
UIUtils
.
getString
(
R
.
string
.
payer_baowai
));
}
if
(
payerUrl
.
size
()
==
0
)
{
...
...
@@ -133,7 +136,7 @@ public class CheckContentActivity extends DataBindingActivity<ActivityCheckConte
ImageView
iv
=
new
ImageView
(
mActivity
);
iv
.
setLayoutParams
(
new
ViewGroup
.
LayoutParams
(
mdimension
,
mdimension
));
iv
.
setPadding
(
0
,
0
,
10
,
0
);
iv
.
setOnClickListener
(
v
->
dumpPic
(
payerUrl
));
iv
.
setOnClickListener
(
v
->
dumpPic
(
payerUrl
));
GlideImageLoader
.
load
(
mActivity
,
url
,
iv
);
mBind
.
llPlayerImage
.
addView
(
iv
);
}
...
...
@@ -145,7 +148,7 @@ public class CheckContentActivity extends DataBindingActivity<ActivityCheckConte
ImageView
iv
=
new
ImageView
(
mActivity
);
iv
.
setLayoutParams
(
new
ViewGroup
.
LayoutParams
(
mdimension
,
mdimension
));
iv
.
setPadding
(
0
,
0
,
10
,
0
);
iv
.
setOnClickListener
(
v
->
dumpPic
(
serverUrl
));
iv
.
setOnClickListener
(
v
->
dumpPic
(
serverUrl
));
GlideImageLoader
.
load
(
mActivity
,
url
,
iv
);
mBind
.
llImage
.
addView
(
iv
);
}
...
...
orderCenter/src/main/java/com/dayu/order/ui/adapter/OrderServerAdapter.java
View file @
d9dedc2f
...
...
@@ -4,6 +4,7 @@ import android.text.TextUtils;
import
android.view.View
;
import
com.dayu.base.ui.adapter.CoreAdapter
;
import
com.dayu.common.Constants
;
import
com.dayu.order.R
;
import
com.dayu.order.api.protocol.OrderDetail
;
import
com.dayu.order.databinding.ServeDatailsItemBinding
;
...
...
@@ -29,11 +30,20 @@ public class OrderServerAdapter extends CoreAdapter<OrderDetail.RecordBean, Serv
holder
.
ivCircle
.
setImageResource
(
R
.
drawable
.
icon_circle_blue
);
holder
.
serverCheck
.
setBackgroundResource
(
R
.
drawable
.
tab_blue_react
);
holder
.
serverCheck
.
setTextColor
(
UIUtils
.
getColor
(
R
.
color
.
white
));
holder
.
serverTimeComment
.
setTextColor
(
UIUtils
.
getColor
(
R
.
color
.
default_text_color
));
holder
.
serverTime
.
setTextColor
(
UIUtils
.
getColor
(
R
.
color
.
default_text_color
));
holder
.
serverComment
.
setTextColor
(
UIUtils
.
getColor
(
R
.
color
.
default_text_color
));
holder
.
serverState
.
setTextColor
(
UIUtils
.
getColor
(
R
.
color
.
default_text_color
));
}
else
{
holder
.
ivCircle
.
setImageResource
(
R
.
drawable
.
icon_circle_gray
);
holder
.
serverCheck
.
setBackground
(
null
);
holder
.
serverCheck
.
setPadding
(
0
,
0
,
0
,
0
);
holder
.
serverCheck
.
setTextColor
(
UIUtils
.
getColor
(
R
.
color
.
cl_receiving_order_item_data
));
holder
.
serverTimeComment
.
setTextColor
(
UIUtils
.
getColor
(
R
.
color
.
cl_order_text_one
));
holder
.
serverTime
.
setTextColor
(
UIUtils
.
getColor
(
R
.
color
.
cl_order_text_one
));
holder
.
serverComment
.
setTextColor
(
UIUtils
.
getColor
(
R
.
color
.
cl_order_text_one
));
holder
.
serverState
.
setTextColor
(
UIUtils
.
getColor
(
R
.
color
.
cl_order_text_one
));
}
holder
.
serverState
.
setText
(
"【"
+
item
.
getOperation
()
+
"】"
);
holder
.
serverComment
.
setText
(
item
.
getOperationComment
());
...
...
@@ -51,15 +61,16 @@ public class OrderServerAdapter extends CoreAdapter<OrderDetail.RecordBean, Serv
if
(
TextUtils
.
isEmpty
(
item
.
getCommentInfo
()))
{
holder
.
serverTimeComment
.
setText
(
"改派原因:暂无"
);
}
else
{
holder
.
serverTimeComment
.
setText
(
"改派原因:"
+
item
.
getCommentInfo
());
holder
.
serverTimeComment
.
setText
(
"改派原因:"
+
item
.
getCommentInfo
());
}
holder
.
serverCheck
.
setVisibility
(
View
.
GONE
);
}
else
if
(
"取消原因"
.
equals
(
item
.
getCommentName
()))
{
if
(
TextUtils
.
isEmpty
(
item
.
getCommentInfo
()))
{
holder
.
serverTimeComment
.
setText
(
"取消原因:暂无"
);
}
else
{
holder
.
serverTimeComment
.
setText
(
"取消原因:"
+
item
.
getCommentInfo
());
holder
.
serverTimeComment
.
setText
(
"取消原因:"
+
item
.
getCommentInfo
());
}
holder
.
serverCheck
.
setVisibility
(
View
.
GONE
);
}
else
{
holder
.
serverTimeComment
.
setVisibility
(
View
.
GONE
);
if
(
TextUtils
.
isEmpty
(
item
.
getCommentName
()))
{
...
...
@@ -71,12 +82,14 @@ public class OrderServerAdapter extends CoreAdapter<OrderDetail.RecordBean, Serv
if
(
"查看结果"
.
equals
(
item
.
getCommentName
()))
{
holder
.
serverCheck
.
setOnClickListener
(
v
->
presenter
.
dumpToSop
());
}
if
(
"查看验收申请"
.
equals
(
item
.
getCommentName
())
||
"工单备注"
.
equals
(
item
.
getCommentName
()))
{
holder
.
serverCheck
.
setOnClickListener
(
v
->
presenter
.
dumpCheckContent
(
position
));
if
(
"查看验收申请"
.
equals
(
item
.
getCommentName
()))
{
holder
.
serverCheck
.
setOnClickListener
(
v
->
presenter
.
dumpCheckContent
(
position
,
Constants
.
FINISH_ORDER
));
}
if
(
"工单备注"
.
equals
(
item
.
getCommentName
()))
{
holder
.
serverCheck
.
setOnClickListener
(
v
->
presenter
.
dumpCheckContent
(
position
,
Constants
.
WATING_ORDER
));
}
if
(
"查看位置"
.
equals
(
item
.
getCommentName
()))
{
holder
.
serverCheck
.
setOnClickListener
(
v
->
ToastUtils
.
showShortToast
(
"longtitude"
+
item
.
getLongitude
()
+
"latitude"
+
item
.
getLatitude
()));
holder
.
serverCheck
.
setOnClickListener
(
v
->
presenter
.
dumpMap
(
item
.
getLatitude
(),
item
.
getLongitude
(),
item
.
getAddress
()));
}
if
(
"查看结果"
.
equals
(
item
.
getCommentName
()))
{
holder
.
serverCheck
.
setOnClickListener
(
v
->
ToastUtils
.
showShortToast
(
"查看结果"
));
...
...
orderCenter/src/main/res/layout/serve_datails_item.xml
View file @
d9dedc2f
...
...
@@ -94,4 +94,4 @@
</LinearLayout>
</LinearLayout>
</layout>
\ No newline at end of file
</layout>
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