Skip to content
项目
Groups
代码片段
帮助
正在加载...
Sign in / Register
Toggle navigation
W
workoffice
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图表
统计图
Create a new issue
作业
提交
议题看板
Open sidebar
冷广德
workoffice
Commits
0ce36597
提交
0ce36597
authored
8月 04, 2020
作者:
lgd
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.供应订单,新加领料退回,未测试
上级
dd47f531
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
1164 行增加
和
1 行删除
+1164
-1
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+24
-0
OrderDetail.java
app/src/main/java/com/wd/workoffice/bean/OrderDetail.java
+8
-0
ApiService.java
app/src/main/java/com/wd/workoffice/retrofit/ApiService.java
+25
-0
BackActivity.java
...com/wd/workoffice/ui/activity/bat/order/BackActivity.java
+214
-0
BackAddActivity.java
.../wd/workoffice/ui/activity/bat/order/BackAddActivity.java
+368
-0
BackDetailActivity.java
.../workoffice/ui/activity/bat/order/BackDetailActivity.java
+470
-0
ReturnDetailActivity.java
...orkoffice/ui/activity/bat/order/ReturnDetailActivity.java
+12
-1
SupplierOrderDetailActivity.java
...ce/ui/activity/bat/order/SupplierOrderDetailActivity.java
+15
-0
SupplierOrderDetailProductAdapter.java
...koffice/ui/adapter/SupplierOrderDetailProductAdapter.java
+2
-0
item_order_product.xml
app/src/main/res/layout/item_order_product.xml
+26
-0
没有找到文件。
app/src/main/AndroidManifest.xml
浏览文件 @
0ce36597
...
...
@@ -2327,6 +2327,30 @@
android:screenOrientation=
"portrait"
android:theme=
"@style/Work.Base"
android:windowSoftInputMode=
"adjustPan"
/>
<activity
android:name=
".ui.activity.bat.order.BackActivity"
android:configChanges=
"orientation|screenSize|keyboardHidden"
android:label=
"领料退回申请"
android:launchMode=
"singleTop"
android:screenOrientation=
"portrait"
android:theme=
"@style/Work.Base"
android:windowSoftInputMode=
"adjustPan"
/>
<activity
android:name=
".ui.activity.bat.order.BackAddActivity"
android:configChanges=
"orientation|screenSize|keyboardHidden"
android:label=
"领料退回新增"
android:launchMode=
"singleTop"
android:screenOrientation=
"portrait"
android:theme=
"@style/Work.Base"
android:windowSoftInputMode=
"adjustPan"
/>
<activity
android:name=
".ui.activity.bat.order.BackDetailActivity"
android:configChanges=
"orientation|screenSize|keyboardHidden"
android:label=
"领料退回详情"
android:launchMode=
"singleTop"
android:screenOrientation=
"portrait"
android:theme=
"@style/Work.Base"
android:windowSoftInputMode=
"adjustPan"
/>
<provider
android:name=
"androidx.core.content.FileProvider"
android:authorities=
"com.wd.workoffice.fileprovider"
...
...
app/src/main/java/com/wd/workoffice/bean/OrderDetail.java
浏览文件 @
0ce36597
...
...
@@ -950,7 +950,15 @@ public class OrderDetail {
private
List
<
StockQuantityDetailMapsBean
>
stockQuantityDetailMaps
;
private
String
chooseNum
;
private
double
productBeyondCount
;
private
String
canPickReturnProductSum
;
public
String
getCanPickReturnProductSum
()
{
return
canPickReturnProductSum
;
}
public
void
setCanPickReturnProductSum
(
String
canPickReturnProductSum
)
{
this
.
canPickReturnProductSum
=
canPickReturnProductSum
;
}
public
String
getCanReturnProductSum
()
{
return
canReturnProductSum
;
...
...
app/src/main/java/com/wd/workoffice/retrofit/ApiService.java
浏览文件 @
0ce36597
...
...
@@ -1452,6 +1452,14 @@ public interface ApiService {
*/
@GET
(
"/returnApply/fo/page/list"
)
Observable
<
BaseBean
>
returnFoApplyList
(
@QueryMap
Map
<
String
,
Object
>
param
);
/**
* 领料退回
*
* @return
*/
@GET
(
"returnApply/fo/pick-return/page/list"
)
Observable
<
BaseBean
>
returnPickList
(
@QueryMap
Map
<
String
,
Object
>
param
);
/**
* step7_6 发送订单退货申请
*
...
...
@@ -1459,6 +1467,14 @@ public interface ApiService {
*/
@POST
(
"/procedureStart/po/applyReturn/{id}"
)
Observable
<
BaseBean
>
returnPoAdd
(
@Path
(
"id"
)
String
id
,
@Body
RequestBody
requestBody
);
/**
* 领料退回申请
*f
* @return
*/
@POST
(
"/procedureStart/fo/pickReturn/{id}"
)
Observable
<
BaseBean
>
pickReturnFoAdd
(
@Path
(
"id"
)
String
id
,
@Body
RequestBody
requestBody
);
/**
* step7_6 发送订单退货申请
*
...
...
@@ -1709,6 +1725,7 @@ public interface ApiService {
*/
@PUT
(
"/returnApply/so/audit/group/{applyId}"
)
Observable
<
BaseBean
>
soGroupReturnApply
(
@Path
(
"applyId"
)
String
id
,
@Body
RequestBody
requestBody
);
/**
* 集团审核
*
...
...
@@ -1724,6 +1741,14 @@ public interface ApiService {
*/
@PUT
(
"/returnApply/fo/audit/group/{applyId}"
)
Observable
<
BaseBean
>
foGroupReturnApply
(
@Path
(
"applyId"
)
String
id
,
@Body
RequestBody
requestBody
);
/**
* 集团审核
*
* @return
*/
@PUT
(
"/returnApply/fo/pick-return/audit/group/{applyId}"
)
Observable
<
BaseBean
>
foGroupPickReturnApply
(
@Path
(
"applyId"
)
String
id
,
@Body
RequestBody
requestBody
);
/**
* 获取一个订单子表的全部流水
*
...
...
app/src/main/java/com/wd/workoffice/ui/activity/bat/order/BackActivity.java
0 → 100644
浏览文件 @
0ce36597
package
com
.
wd
.
workoffice
.
ui
.
activity
.
bat
.
order
;
import
android.text.TextUtils
;
import
android.view.Menu
;
import
android.view.MenuItem
;
import
android.view.View
;
import
com.alibaba.fastjson.JSON
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.scwang.smartrefresh.layout.SmartRefreshLayout
;
import
com.scwang.smartrefresh.layout.api.RefreshLayout
;
import
com.scwang.smartrefresh.layout.listener.OnRefreshListener
;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.app.BaseBean
;
import
com.wd.workoffice.app.WorkToolBarActivity
;
import
com.wd.workoffice.bean.ReturnApplyBean
;
import
com.wd.workoffice.bean.event.CheckReturnEvent
;
import
com.wd.workoffice.bean.workEnum.OrderType
;
import
com.wd.workoffice.bean.workEnum.PagePermissionType
;
import
com.wd.workoffice.retrofit.RtfUtils
;
import
com.wd.workoffice.retrofit.WorkObserver
;
import
com.wd.workoffice.ui.adapter.ReturnSendApplyAdapter
;
import
com.wd.workoffice.util.WorkUtils
;
import
org.greenrobot.eventbus.EventBus
;
import
org.greenrobot.eventbus.Subscribe
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
androidx.annotation.NonNull
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
flexible.xd.android_base.network.rtfhttp.Transformer
;
import
io.reactivex.Observable
;
import
io.reactivex.disposables.Disposable
;
/**
* 领料退回
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public
class
BackActivity
extends
WorkToolBarActivity
{
@BindView
(
R
.
id
.
rv_data
)
RecyclerView
rvData
;
@BindView
(
R
.
id
.
srl_refresh
)
SmartRefreshLayout
srlRefresh
;
private
Map
<
String
,
Object
>
param
;
private
List
<
ReturnApplyBean
.
RecordsBean
>
dataList
;
private
ReturnSendApplyAdapter
dataAdapter
;
private
int
page
=
1
;
private
String
orderType
;
@Override
protected
void
initView
()
{
ButterKnife
.
bind
(
this
);
rvData
.
setLayoutManager
(
new
LinearLayoutManager
(
this
,
RecyclerView
.
VERTICAL
,
false
));
}
@Override
protected
void
initData
()
{
orderType
=
getIntent
().
getStringExtra
(
"orderType"
);
dataList
=
new
ArrayList
<>();
dataAdapter
=
new
ReturnSendApplyAdapter
(
R
.
layout
.
item_return_apply
,
dataList
);
dataAdapter
.
bindToRecyclerView
(
rvData
);
dataAdapter
.
setEmptyView
(
R
.
layout
.
view_empty_content
,
rvData
);
param
=
WorkUtils
.
pageKey
();
page
=
1
;
param
.
put
(
"current"
,
page
);
param
.
put
(
"orderId"
,
getIntent
().
getStringExtra
(
"orderId"
));
param
.
put
(
"productId"
,
getIntent
().
getStringExtra
(
"productId"
));
getData
();
}
private
void
getData
()
{
Observable
<
BaseBean
>
observable
;
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
SUPPLIER
.
getCode
()))
{
observable
=
RtfUtils
.
getRtf
().
returnPickList
(
param
);
}
else
{
observable
=
RtfUtils
.
getRtf
().
returnPickList
(
param
);
}
observable
.
compose
(
Transformer
.
schedule
()).
subscribe
(
new
WorkObserver
<
BaseBean
>()
{
@Override
public
void
doOnSubscribe
(
Disposable
d
)
{
}
@Override
public
void
onFail
(
String
errorMsg
)
{
hideLoading
();
toast
(
errorMsg
);
}
@Override
public
void
onSuccess
(
BaseBean
data
)
{
hideLoading
();
if
(
data
.
getCode
()
!=
0
)
{
toast
(
data
.
getMessage
());
return
;
}
List
<
ReturnApplyBean
.
RecordsBean
>
getList
=
JSON
.
parseObject
(
data
.
getData
().
toString
(),
ReturnApplyBean
.
class
).
getRecords
();
if
(
page
==
1
)
{
srlRefresh
.
finishRefresh
();
dataList
.
clear
();
dataList
.
addAll
(
getList
);
dataAdapter
.
notifyDataSetChanged
();
dataAdapter
.
loadMoreComplete
();
}
else
{
dataAdapter
.
loadMoreComplete
();
dataList
.
addAll
(
getList
);
dataAdapter
.
notifyDataSetChanged
();
}
if
(
getList
.
size
()
==
0
)
{
dataAdapter
.
loadMoreEnd
();
}
else
{
page
++;
}
}
});
}
@Override
protected
void
initEvent
()
{
srlRefresh
.
setOnRefreshListener
(
new
OnRefreshListener
()
{
@Override
public
void
onRefresh
(
@NonNull
RefreshLayout
refreshLayout
)
{
page
=
1
;
param
.
put
(
"current"
,
page
);
getData
();
}
});
dataAdapter
.
setOnLoadMoreListener
(
new
BaseQuickAdapter
.
RequestLoadMoreListener
()
{
@Override
public
void
onLoadMoreRequested
()
{
param
.
put
(
"current"
,
page
);
getData
();
}
},
rvData
);
dataAdapter
.
setOnItemClickListener
(
new
BaseQuickAdapter
.
OnItemClickListener
()
{
@Override
public
void
onItemClick
(
BaseQuickAdapter
adapter
,
View
view
,
int
position
)
{
startActivity
(
BackDetailActivity
.
class
,
"info"
,
JSON
.
toJSONString
(
dataList
.
get
(
position
)),
"orderType"
,
orderType
,
"status"
,
getIntent
().
getStringExtra
(
"status"
)
,
"id"
,
getIntent
().
getStringExtra
(
"orderId"
)
,
"identity"
,
getIntent
().
getStringExtra
(
"identity"
));
}
});
}
@Override
protected
int
layoutId
()
{
return
R
.
layout
.
activity_pro_price
;
}
@Override
public
void
onStart
()
{
super
.
onStart
();
EventBus
.
getDefault
().
register
(
this
);
}
@Override
public
void
onStop
()
{
super
.
onStop
();
EventBus
.
getDefault
().
unregister
(
this
);
}
@Subscribe
public
void
refresh
(
CheckReturnEvent
event
)
{
page
=
1
;
param
.
put
(
"current"
,
page
);
getData
();
}
@Override
public
boolean
onCreateOptionsMenu
(
Menu
menu
)
{
String
orderType
=
getIntent
().
getStringExtra
(
"orderType"
);
String
num
=
getIntent
().
getStringExtra
(
"num"
);
if
(
Double
.
valueOf
(
num
)
==
0
d
)
{
return
super
.
onCreateOptionsMenu
(
menu
);
}
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
SUPPLIER
.
getCode
()))
{
if
(
WorkUtils
.
hasPermission
(
PagePermissionType
.
FO_PICK_RETURN_SAVE
.
getPermission
()))
{
getMenuInflater
().
inflate
(
R
.
menu
.
menu_add
,
menu
);
}
}
return
super
.
onCreateOptionsMenu
(
menu
);
}
@Override
public
boolean
onOptionsItemSelected
(
MenuItem
item
)
{
switch
(
item
.
getItemId
())
{
case
R
.
id
.
add
:
startActivity
(
BackAddActivity
.
class
,
"returnNum"
,
getIntent
().
getStringExtra
(
"returnNum"
),
"orderType"
,
getIntent
().
getStringExtra
(
"orderType"
),
"productId"
,
getIntent
().
getStringExtra
(
"productId"
),
"orderItemId"
,
getIntent
().
getStringExtra
(
"orderItemId"
),
"enterStockType"
,
getIntent
().
getStringExtra
(
"enterStockType"
),
"deptId"
,
getIntent
().
getStringExtra
(
"deptId"
),
"id"
,
getIntent
().
getStringExtra
(
"orderId"
));
break
;
}
return
super
.
onOptionsItemSelected
(
item
);
}
}
app/src/main/java/com/wd/workoffice/ui/activity/bat/order/BackAddActivity.java
0 → 100644
浏览文件 @
0ce36597
package
com
.
wd
.
workoffice
.
ui
.
activity
.
bat
.
order
;
import
android.content.DialogInterface
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
android.view.View
;
import
android.widget.EditText
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.qmuiteam.qmui.widget.dialog.QMUIDialog
;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.app.BaseBean
;
import
com.wd.workoffice.app.WorkToolBarActivity
;
import
com.wd.workoffice.bean.OrderDetail
;
import
com.wd.workoffice.bean.event.CheckReturnEvent
;
import
com.wd.workoffice.bean.workEnum.OrderType
;
import
com.wd.workoffice.retrofit.RtfUtils
;
import
com.wd.workoffice.retrofit.WorkObserver
;
import
com.wd.workoffice.util.DialogUtils
;
import
com.wd.workoffice.util.MathUtils
;
import
com.wd.workoffice.util.WorkUtils
;
import
org.greenrobot.eventbus.EventBus
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.OnClick
;
import
flexible.xd.android_base.network.rtfhttp.Transformer
;
import
io.reactivex.Observable
;
import
io.reactivex.disposables.Disposable
;
/**
* 添加领料退回-只有供应订单用到了
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public
class
BackAddActivity
extends
WorkToolBarActivity
{
@BindView
(
R
.
id
.
tv_bottom
)
TextView
tvBottom
;
@BindView
(
R
.
id
.
tv_num
)
TextView
tvNum
;
@BindView
(
R
.
id
.
et_num
)
EditText
etNum
;
@BindView
(
R
.
id
.
tv_return_type
)
TextView
tvReturnType
;
@BindView
(
R
.
id
.
tv_stock
)
TextView
tvStock
;
@BindView
(
R
.
id
.
ll_choose_stock
)
LinearLayout
llChooseStock
;
@BindView
(
R
.
id
.
et_price
)
EditText
etPrice
;
@BindView
(
R
.
id
.
et_remark
)
EditText
etRemark
;
@BindView
(
R
.
id
.
tv_remark_num
)
TextView
tvRemarkNum
;
@BindView
(
R
.
id
.
tv_max_num
)
TextView
tvMaxNum
;
@BindView
(
R
.
id
.
ll_money
)
LinearLayout
llMoney
;
@BindView
(
R
.
id
.
ll_type
)
LinearLayout
llType
;
@BindView
(
R
.
id
.
iv_choose_type
)
ImageView
ivChooseType
;
private
Map
<
String
,
Object
>
param
;
private
String
orderType
;
private
List
<
String
>
typeList
=
new
ArrayList
<>();
private
String
enterStockType
;
private
QMUIDialog
.
MenuDialogBuilder
typeDialog
;
private
QMUIDialog
.
MenuDialogBuilder
deptDialog
;
private
int
chooseType
=
0
;
//1 从现场库退到内库 3 未结算库核 4 现场库退给供应商 (6)从内库退到供应商(5)退回入库仓库
private
JSONArray
deptList
;
private
List
<
String
>
deptNameList
;
private
Integer
chooseDep
;
private
OrderDetail
dataBean
;
@Override
protected
void
initView
()
{
ButterKnife
.
bind
(
this
);
orderType
=
getIntent
().
getStringExtra
(
"orderType"
);
enterStockType
=
getIntent
().
getStringExtra
(
"enterStockType"
);
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
SALE
.
getCode
()))
{
typeList
.
add
(
"从现场库退到内库"
);
tvReturnType
.
setText
(
"从现场库退到内库"
);
}
else
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
SUPPLIER
.
getCode
()))
{
tvReturnType
.
setText
(
"退回入库仓库"
);
}
else
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
OUT_BUY
.
getCode
()))
{
switch
(
enterStockType
)
{
case
"1"
:
typeList
.
add
(
"从现场库退到内库"
);
typeList
.
add
(
"未结算库核销"
);
typeList
.
add
(
"现场库退给供应商"
);
break
;
case
"2"
:
typeList
.
add
(
"未结算库核销"
);
typeList
.
add
(
"现场库退给供应商"
);
break
;
}
}
typeDialog
=
DialogUtils
.
listDialog
(
this
);
typeDialog
.
addItems
(
typeList
.
toArray
(
new
String
[
typeList
.
size
()]),
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
tvReturnType
.
setText
(
typeList
.
get
(
which
));
changeView
();
dialog
.
dismiss
();
}
});
deptDialog
=
DialogUtils
.
listDialog
(
this
);
WorkUtils
.
addDecimalsListener
(
etNum
);
WorkUtils
.
addNumListener
(
etRemark
,
tvRemarkNum
);
}
private
void
changeView
()
{
//1 从现场库退到内库 3 未结算库核 4 现场库退给供应商
String
returnType
=
tvReturnType
.
getText
().
toString
();
switch
(
returnType
)
{
case
"从现场库退到内库"
:
chooseType
=
1
;
llChooseStock
.
setVisibility
(
View
.
VISIBLE
);
llMoney
.
setVisibility
(
View
.
GONE
);
break
;
case
"未结算库核销"
:
chooseType
=
3
;
llChooseStock
.
setVisibility
(
View
.
GONE
);
llMoney
.
setVisibility
(
View
.
VISIBLE
);
break
;
case
"现场库退给供应商"
:
chooseType
=
4
;
llChooseStock
.
setVisibility
(
View
.
GONE
);
llMoney
.
setVisibility
(
View
.
GONE
);
break
;
case
"从内库退给供应商"
:
chooseType
=
6
;
llMoney
.
setVisibility
(
View
.
GONE
);
llChooseStock
.
setVisibility
(
View
.
GONE
);
ivChooseType
.
setVisibility
(
View
.
GONE
);
llType
.
setClickable
(
false
);
break
;
case
"退回入库仓库"
:
chooseType
=
6
;
llMoney
.
setVisibility
(
View
.
GONE
);
llChooseStock
.
setVisibility
(
View
.
GONE
);
ivChooseType
.
setVisibility
(
View
.
GONE
);
llType
.
setClickable
(
false
);
break
;
default
:
llChooseStock
.
setVisibility
(
View
.
GONE
);
llMoney
.
setVisibility
(
View
.
GONE
);
break
;
}
param
.
put
(
"returnType"
,
chooseType
);
}
@Override
protected
void
initData
()
{
// String num = getIntent().getStringExtra("returnNum");
// tvMaxNum.setText(String.format("*退货最大数量(%s)", num));
param
=
new
HashMap
<>();
param
.
put
(
"orderId"
,
getIntent
().
getStringExtra
(
"id"
));
param
.
put
(
"productId"
,
getIntent
().
getStringExtra
(
"productId"
));
param
.
put
(
"orderItemId"
,
getIntent
().
getStringExtra
(
"orderItemId"
));
changeView
();
getDept
();
getNum
();
}
/**
* 获取数量
*/
private
void
getNum
()
{
Observable
<
BaseBean
>
observable
;
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
SALE
.
getCode
()))
{
observable
=
RtfUtils
.
getRtf
().
saleOrderDetail
(
getIntent
().
getStringExtra
(
"id"
),
"1"
);
}
else
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
OUT_BUY
.
getCode
()))
{
observable
=
RtfUtils
.
getRtf
().
purchaseOrderDetail
(
getIntent
().
getStringExtra
(
"id"
),
"1"
);
}
else
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
SUPPLIER
.
getCode
()))
{
observable
=
RtfUtils
.
getRtf
().
supplierOrderDetail
(
getIntent
().
getStringExtra
(
"id"
),
"1"
);
}
else
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
CRUCIBLE
.
getCode
()))
{
observable
=
RtfUtils
.
getRtf
().
crucibleOrderDetail
(
getIntent
().
getStringExtra
(
"id"
),
"1"
);
}
else
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
IN
.
getCode
()))
{
observable
=
RtfUtils
.
getRtf
().
insideOrderDetail
(
getIntent
().
getStringExtra
(
"id"
),
"1"
);
}
else
{
observable
=
RtfUtils
.
getRtf
().
insideOrderDetail
(
getIntent
().
getStringExtra
(
"id"
),
"1"
);
}
observable
.
compose
(
Transformer
.
schedule
()).
subscribe
(
new
WorkObserver
<
BaseBean
>()
{
@Override
public
void
doOnSubscribe
(
Disposable
d
)
{
}
@Override
public
void
onFail
(
String
errorMsg
)
{
hideLoading
();
toast
(
errorMsg
);
}
@Override
public
void
onSuccess
(
BaseBean
data
)
{
hideLoading
();
if
(
data
.
getCode
()
!=
0
)
{
toast
(
data
.
getMessage
());
return
;
}
dataBean
=
JSON
.
parseObject
(
data
.
getData
().
toString
(),
OrderDetail
.
class
);
List
<
OrderDetail
.
OrderItemsBean
>
orderItems
=
dataBean
.
getOrderItems
();
for
(
OrderDetail
.
OrderItemsBean
orderItem
:
orderItems
)
{
if
(
TextUtils
.
equals
(
orderItem
.
getId
(),
getIntent
().
getStringExtra
(
"orderItemId"
)))
{
if
(
TextUtils
.
isEmpty
(
enterStockType
))
{
tvMaxNum
.
setText
(
String
.
format
(
"*退货最大数量(%s)"
,
MathUtils
.
converData
(
orderItem
.
getCanUseProductSum
(),
3
)));
}
else
{
String
returnNum
=
TextUtils
.
equals
(
enterStockType
,
"1"
)
?
orderItem
.
getCanOutReturnSum
()
:
orderItem
.
getCanUsedReturnSum
();
tvMaxNum
.
setText
(
String
.
format
(
"*退货最大数量(%s)"
,
MathUtils
.
converData
(
returnNum
,
3
)));
}
}
}
}
});
}
private
void
getDept
()
{
RtfUtils
.
getRtf
().
returnDept
(
getIntent
().
getStringExtra
(
"deptId"
)).
compose
(
Transformer
.
schedule
()).
subscribe
(
new
WorkObserver
<
BaseBean
>()
{
@Override
public
void
doOnSubscribe
(
Disposable
d
)
{
}
@Override
public
void
onFail
(
String
errorMsg
)
{
hideLoading
();
toast
(
errorMsg
);
}
@Override
public
void
onSuccess
(
BaseBean
data
)
{
hideLoading
();
if
(
data
.
getCode
()
!=
0
)
{
toast
(
data
.
getMessage
());
return
;
}
deptList
=
JSON
.
parseArray
(
data
.
getData
().
toString
());
deptNameList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
deptList
.
size
();
i
++)
{
JSONObject
deptData
=
deptList
.
getJSONObject
(
i
);
deptNameList
.
add
(
deptData
.
getString
(
"name"
));
}
deptDialog
.
addItems
(
deptNameList
.
toArray
(
new
String
[
deptNameList
.
size
()]),
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
tvStock
.
setText
(
deptNameList
.
get
(
which
));
chooseDep
=
deptList
.
getJSONObject
(
which
).
getInteger
(
"id"
);
dialog
.
dismiss
();
}
});
}
});
}
@Override
protected
void
initEvent
()
{
}
@Override
protected
int
layoutId
()
{
return
R
.
layout
.
activity_return_add
;
}
private
void
submit
()
{
String
num
=
etNum
.
getText
().
toString
();
String
price
=
etPrice
.
getText
().
toString
();
String
remark
=
etRemark
.
getText
().
toString
();
if
(
TextUtils
.
isEmpty
(
num
))
{
toast
(
"请输入退货数量"
);
return
;
}
if
(
dataBean
!=
null
)
{
List
<
OrderDetail
.
OrderItemsBean
>
orderItems
=
dataBean
.
getOrderItems
();
for
(
OrderDetail
.
OrderItemsBean
orderItem
:
orderItems
)
{
if
(
TextUtils
.
equals
(
orderItem
.
getId
(),
getIntent
().
getStringExtra
(
"orderItemId"
)))
{
if
(
new
BigDecimal
(
Double
.
valueOf
(
num
)).
compareTo
(
new
BigDecimal
(
orderItem
.
getCanPickReturnProductSum
()))
==
1
)
{
toast
(
String
.
format
(
"可申请退货数量最大为%s"
,
MathUtils
.
converData
(
orderItem
.
getCanPickReturnProductSum
(),
3
)));
return
;
}
}
}
}
if
(
TextUtils
.
isEmpty
(
price
)
&&
chooseType
==
3
)
{
toast
(
"请输入核销金额"
);
return
;
}
param
.
put
(
"productAmount"
,
num
);
param
.
put
(
"writeOff"
,
price
);
param
.
put
(
"applyRemark"
,
remark
);
if
(
chooseType
==
1
)
{
if
(
chooseDep
==
null
)
{
toast
(
"请选择退货仓库"
);
return
;
}
param
.
put
(
"backStockId"
,
chooseDep
);
}
Observable
<
BaseBean
>
observable
;
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
SALE
.
getCode
()))
{
observable
=
RtfUtils
.
getRtf
().
returnSoAdd
(
getIntent
().
getStringExtra
(
"id"
),
WorkUtils
.
convertMapToBody
(
param
));
}
else
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
OUT_BUY
.
getCode
()))
{
observable
=
RtfUtils
.
getRtf
().
returnPoAdd
(
getIntent
().
getStringExtra
(
"id"
),
WorkUtils
.
convertMapToBody
(
param
));
}
else
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
SUPPLIER
.
getCode
()))
{
observable
=
RtfUtils
.
getRtf
().
pickReturnFoAdd
(
getIntent
().
getStringExtra
(
"id"
),
WorkUtils
.
convertMapToBody
(
param
));
}
else
{
observable
=
RtfUtils
.
getRtf
().
pickReturnFoAdd
(
getIntent
().
getStringExtra
(
"id"
),
WorkUtils
.
convertMapToBody
(
param
));
}
observable
.
compose
(
Transformer
.
schedule
()).
subscribe
(
new
WorkObserver
<
BaseBean
>()
{
@Override
public
void
doOnSubscribe
(
Disposable
d
)
{
}
@Override
public
void
onFail
(
String
errorMsg
)
{
hideLoading
();
toast
(
errorMsg
);
}
@Override
public
void
onSuccess
(
BaseBean
data
)
{
hideLoading
();
if
(
data
.
getCode
()
!=
0
)
{
toast
(
data
.
getMessage
());
return
;
}
toast
(
"提交申请成功"
);
EventBus
.
getDefault
().
post
(
new
CheckReturnEvent
());
finish
();
}
});
}
@OnClick
({
R
.
id
.
tv_bottom
,
R
.
id
.
ll_type
,
R
.
id
.
ll_choose_stock
})
public
void
onViewClicked
(
View
view
)
{
switch
(
view
.
getId
())
{
case
R
.
id
.
tv_bottom
:
submit
();
break
;
case
R
.
id
.
ll_type
:
typeDialog
.
show
();
break
;
case
R
.
id
.
ll_choose_stock
:
deptDialog
.
show
();
break
;
}
}
}
app/src/main/java/com/wd/workoffice/ui/activity/bat/order/BackDetailActivity.java
0 → 100644
浏览文件 @
0ce36597
package
com
.
wd
.
workoffice
.
ui
.
activity
.
bat
.
order
;
import
android.graphics.Color
;
import
android.text.TextUtils
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.widget.EditText
;
import
android.widget.LinearLayout
;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
com.alibaba.fastjson.JSON
;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.app.BaseBean
;
import
com.wd.workoffice.app.WorkToolBarActivity
;
import
com.wd.workoffice.bean.ReturnApplyBean
;
import
com.wd.workoffice.bean.event.CheckReturnEvent
;
import
com.wd.workoffice.bean.workEnum.OrderType
;
import
com.wd.workoffice.bean.workEnum.PagePermissionType
;
import
com.wd.workoffice.retrofit.RtfUtils
;
import
com.wd.workoffice.retrofit.WorkObserver
;
import
com.wd.workoffice.util.WorkUtils
;
import
org.greenrobot.eventbus.EventBus
;
import
java.util.Map
;
import
androidx.appcompat.app.AlertDialog
;
import
androidx.recyclerview.widget.GridLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.OnClick
;
import
flexible.xd.android_base.network.rtfhttp.Transformer
;
import
io.reactivex.Observable
;
import
io.reactivex.disposables.Disposable
;
/**
* 领料退回详情-只有供应订单用到了
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public
class
BackDetailActivity
extends
WorkToolBarActivity
{
@BindView
(
R
.
id
.
tv_status
)
TextView
tvStatus
;
@BindView
(
R
.
id
.
ll_top
)
RelativeLayout
llTop
;
@BindView
(
R
.
id
.
tv_refuse
)
TextView
tvRefuse
;
@BindView
(
R
.
id
.
tv_agree
)
TextView
tvAgree
;
@BindView
(
R
.
id
.
ll_check
)
LinearLayout
llCheck
;
@BindView
(
R
.
id
.
ll_bottom
)
LinearLayout
llBottom
;
@BindView
(
R
.
id
.
rv_process
)
RecyclerView
rvProcess
;
@BindView
(
R
.
id
.
rl_history
)
RelativeLayout
rlHistory
;
@BindView
(
R
.
id
.
tv_name
)
TextView
tvName
;
@BindView
(
R
.
id
.
tv_pro_code
)
TextView
tvProCode
;
@BindView
(
R
.
id
.
tv_pro_name
)
TextView
tvProName
;
@BindView
(
R
.
id
.
tv_return_num
)
TextView
tvReturnNum
;
@BindView
(
R
.
id
.
tv_return_type
)
TextView
tvReturnType
;
@BindView
(
R
.
id
.
tv_stock
)
TextView
tvStock
;
@BindView
(
R
.
id
.
tv_person
)
TextView
tvPerson
;
@BindView
(
R
.
id
.
tv_time
)
TextView
tvTime
;
@BindView
(
R
.
id
.
tv_remark
)
TextView
tvRemark
;
@BindView
(
R
.
id
.
rl_order
)
RelativeLayout
rlOrder
;
@BindView
(
R
.
id
.
tv_top1
)
TextView
tvTop1
;
@BindView
(
R
.
id
.
tv_top2
)
TextView
tvTop2
;
@BindView
(
R
.
id
.
tv_top3
)
TextView
tvTop3
;
@BindView
(
R
.
id
.
tv_top4
)
TextView
tvTop4
;
@BindView
(
R
.
id
.
tv_top5
)
TextView
tvTop5
;
@BindView
(
R
.
id
.
view_node1
)
View
viewNode1
;
@BindView
(
R
.
id
.
view_line1
)
View
viewLine1
;
@BindView
(
R
.
id
.
view_node2
)
View
viewNode2
;
@BindView
(
R
.
id
.
view_line2
)
View
viewLine2
;
@BindView
(
R
.
id
.
view_node3
)
View
viewNode3
;
@BindView
(
R
.
id
.
view_line3
)
View
viewLine3
;
@BindView
(
R
.
id
.
view_node4
)
View
viewNode4
;
@BindView
(
R
.
id
.
view_line4
)
View
viewLine4
;
@BindView
(
R
.
id
.
view_node5
)
View
viewNode5
;
@BindView
(
R
.
id
.
view_line5
)
View
viewLine5
;
@BindView
(
R
.
id
.
tv_dep1
)
TextView
tvDep1
;
@BindView
(
R
.
id
.
tv_dep2
)
TextView
tvDep2
;
@BindView
(
R
.
id
.
tv_dep3
)
TextView
tvDep3
;
@BindView
(
R
.
id
.
tv_dep4
)
TextView
tvDep4
;
@BindView
(
R
.
id
.
tv_dep5
)
TextView
tvDep5
;
@BindView
(
R
.
id
.
ll_process
)
LinearLayout
llProcess
;
private
ReturnApplyBean
.
RecordsBean
info
;
private
String
orderType
;
@Override
protected
void
initView
()
{
ButterKnife
.
bind
(
this
);
rvProcess
.
setLayoutManager
(
new
GridLayoutManager
(
this
,
5
,
RecyclerView
.
VERTICAL
,
false
));
rlOrder
.
setVisibility
(
View
.
GONE
);
}
@Override
protected
void
initData
()
{
info
=
JSON
.
parseObject
(
getIntent
().
getStringExtra
(
"info"
),
ReturnApplyBean
.
RecordsBean
.
class
);
orderType
=
getIntent
().
getStringExtra
(
"orderType"
);
changeView
();
//ReturnProcessAdapter returnProcessAdapter =new ReturnProcessAdapter(R.layout.item_return_process,info.getStatus());
// returnProcessAdapter.bindToRecyclerView(rvProcess);
}
private
void
changeView
()
{
tvName
.
setText
(
info
.
getProductSimpleCode
());
tvProName
.
setText
(
info
.
getProductName
());
tvProCode
.
setText
(
info
.
getProductSoleCode
());
tvReturnNum
.
setText
(
String
.
valueOf
(
info
.
getProductAmount
()));
tvReturnType
.
setText
(
info
.
getReturnTypeName
());
tvStock
.
setText
(
info
.
getBackStockName
());
tvPerson
.
setText
(
String
.
valueOf
(
info
.
getCreatedByName
()));
tvTime
.
setText
(
info
.
getCreatedTime
());
tvRemark
.
setText
(
String
.
valueOf
(
info
.
getApplyRemark
()));
tvStatus
.
setText
(
WorkUtils
.
getReturnStatus
(
Integer
.
valueOf
(
info
.
getStatus
())));
changeProcess
(
info
.
getStatus
());
changeCheckView
(
info
.
getStatus
());
changePermission
(
info
.
getStatus
());
}
/**
* 修改审核显示隐藏
*
* @param status
*/
private
void
changeCheckView
(
String
status
)
{
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
SALE
.
getCode
()))
{
if
(
status
.
startsWith
(
"1"
)
&&
!
status
.
endsWith
(
"4"
))
{
llBottom
.
setVisibility
(
View
.
VISIBLE
);
llCheck
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
llBottom
.
setVisibility
(
View
.
GONE
);
llCheck
.
setVisibility
(
View
.
GONE
);
}
}
else
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
OUT_BUY
.
getCode
()))
{
if
(
status
.
startsWith
(
"1"
)
&&
!
status
.
endsWith
(
"4"
))
{
llBottom
.
setVisibility
(
View
.
VISIBLE
);
llCheck
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
llBottom
.
setVisibility
(
View
.
GONE
);
llCheck
.
setVisibility
(
View
.
GONE
);
}
rlHistory
.
setVisibility
(
View
.
GONE
);
llProcess
.
setVisibility
(
View
.
GONE
);
}
else
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
SUPPLIER
.
getCode
()))
{
if
(
status
.
startsWith
(
"1"
)
&&
!
status
.
endsWith
(
"4"
))
{
llBottom
.
setVisibility
(
View
.
VISIBLE
);
llCheck
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
llBottom
.
setVisibility
(
View
.
GONE
);
llCheck
.
setVisibility
(
View
.
GONE
);
}
rlHistory
.
setVisibility
(
View
.
GONE
);
llProcess
.
setVisibility
(
View
.
GONE
);
}
}
/**
* 退件状态
* 10未审核
* 11 12 13 14已通过
* 21 22 23 24不通过
* (尾号1部门管理员 2业务部 3财务部 4集团,首数字1:通过,2:驳回)
*
* @param status
* @return
*/
private
void
changeProcess
(
String
status
)
{
if
(
status
.
startsWith
(
"1"
))
{
if
(
status
.
endsWith
(
"1"
))
{
changeProcessView
(
viewNode2
,
viewLine2
,
0
);
changeProcessView
(
viewNode3
,
viewLine3
,
1
);
tvTop2
.
setText
(
"通过"
);
tvTop3
.
setText
(
"待审核"
);
}
else
if
(
status
.
endsWith
(
"2"
))
{
changeProcessView
(
viewNode2
,
viewLine2
,
0
);
changeProcessView
(
viewNode3
,
viewLine3
,
0
);
changeProcessView
(
viewNode4
,
viewLine4
,
1
);
tvTop2
.
setText
(
"通过"
);
tvTop3
.
setText
(
"通过"
);
tvTop4
.
setText
(
"待审核"
);
}
else
if
(
status
.
endsWith
(
"3"
))
{
changeProcessView
(
viewNode2
,
viewLine2
,
0
);
changeProcessView
(
viewNode3
,
viewLine3
,
0
);
changeProcessView
(
viewNode4
,
viewLine4
,
0
);
changeProcessView
(
viewNode5
,
viewLine5
,
1
);
tvTop2
.
setText
(
"通过"
);
tvTop3
.
setText
(
"通过"
);
tvTop4
.
setText
(
"通过"
);
tvTop5
.
setText
(
"待审核"
);
}
else
if
(
status
.
endsWith
(
"4"
))
{
changeProcessView
(
viewNode2
,
viewLine2
,
0
);
changeProcessView
(
viewNode3
,
viewLine3
,
0
);
changeProcessView
(
viewNode4
,
viewLine4
,
0
);
changeProcessView
(
viewNode5
,
viewLine5
,
0
);
tvTop2
.
setText
(
"通过"
);
tvTop3
.
setText
(
"通过"
);
tvTop4
.
setText
(
"通过"
);
tvTop5
.
setText
(
"通过"
);
}
}
else
if
(
status
.
startsWith
(
"2"
))
{
if
(
status
.
endsWith
(
"1"
))
{
changeProcessView
(
viewNode2
,
viewLine2
,
1
);
tvTop2
.
setText
(
"驳回"
);
}
else
if
(
status
.
endsWith
(
"2"
))
{
changeProcessView
(
viewNode2
,
viewLine2
,
0
);
changeProcessView
(
viewNode3
,
viewLine3
,
1
);
tvTop2
.
setText
(
"通过"
);
tvTop3
.
setText
(
"驳回"
);
}
else
if
(
status
.
endsWith
(
"3"
))
{
changeProcessView
(
viewNode2
,
viewLine2
,
0
);
changeProcessView
(
viewNode3
,
viewLine3
,
0
);
changeProcessView
(
viewNode4
,
viewLine4
,
1
);
tvTop2
.
setText
(
"通过"
);
tvTop3
.
setText
(
"通过"
);
tvTop4
.
setText
(
"驳回"
);
}
else
if
(
status
.
endsWith
(
"4"
))
{
changeProcessView
(
viewNode2
,
viewLine2
,
0
);
changeProcessView
(
viewNode3
,
viewLine3
,
0
);
changeProcessView
(
viewNode4
,
viewLine4
,
0
);
changeProcessView
(
viewNode4
,
viewLine5
,
1
);
tvTop2
.
setText
(
"通过"
);
tvTop3
.
setText
(
"通过"
);
tvTop4
.
setText
(
"通过"
);
tvTop5
.
setText
(
"驳回"
);
}
}
}
/**
* status 1 变红
* 0 变蓝
*
* @param changeView
* @param changeLine
* @param status
*/
private
void
changeProcessView
(
View
changeView
,
View
changeLine
,
int
status
)
{
if
(
status
==
0
)
{
changeView
.
setBackgroundResource
(
R
.
drawable
.
shape_circle
);
changeLine
.
setBackgroundColor
(
Color
.
parseColor
(
"#5D99C4"
));
}
else
{
changeView
.
setBackgroundResource
(
R
.
drawable
.
shape_red_circle
);
changeLine
.
setBackgroundColor
(
getResources
().
getColor
(
R
.
color
.
flexible_gray_background
));
}
}
@Override
protected
void
initEvent
()
{
}
@Override
protected
int
layoutId
()
{
return
R
.
layout
.
activity_bat_retrun_detail
;
}
private
void
changePermission
(
String
status
)
{
boolean
hasPermission
=
true
;
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
SALE
.
getCode
()))
{
// if (status.startsWith("1")) {
// if (status.endsWith("0")) {
// hasPermission = WorkUtils.hasPermission(PagePermissionType.SO_RETURN_EDIT_DEPT_ADMIN.getPermission());
// } else if (status.endsWith("1")) {
// hasPermission = WorkUtils.hasPermission(PagePermissionType.SO_RETURN_EDIT_BUSINESS_DEPARTMENT.getPermission());
// } else if (status.endsWith("2")) {
// hasPermission = WorkUtils.hasPermission(PagePermissionType.SO_RETURN_EDIT_FINANCE_DEPT.getPermission());
// } else if (status.endsWith("3")) {
// hasPermission = WorkUtils.hasPermission(PagePermissionType.SO_RETURN_EDIT_GROUP.getPermission());
// }
// }
}
else
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
OUT_BUY
.
getCode
()))
{
// hasPermission = WorkUtils.hasPermission(PagePermissionType.PO_RETURN_EDIT.getPermission());
}
else
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
SUPPLIER
.
getCode
()))
{
hasPermission
=
WorkUtils
.
hasPermission
(
PagePermissionType
.
FO_PICK_RETURN_EDIT
.
getPermission
());
}
if
(!
hasPermission
)
{
tvRefuse
.
setVisibility
(
View
.
GONE
);
tvAgree
.
setVisibility
(
View
.
GONE
);
}
}
private
void
checkDialog
(
int
status
,
int
id
)
{
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
this
);
View
view
=
LayoutInflater
.
from
(
this
).
inflate
(
R
.
layout
.
view_check
,
null
);
TextView
tvOk
=
view
.
findViewById
(
R
.
id
.
tv_ok
);
TextView
tvDesc
=
view
.
findViewById
(
R
.
id
.
tv_desc
);
tvDesc
.
setText
(
status
==
1
?
"通过"
:
"拒绝"
);
TextView
tvNum
=
view
.
findViewById
(
R
.
id
.
tv_num
);
TextView
tvCancel
=
view
.
findViewById
(
R
.
id
.
tv_cancel
);
EditText
etRemark
=
view
.
findViewById
(
R
.
id
.
et_content
);
WorkUtils
.
addNumListener
(
etRemark
,
tvNum
);
builder
.
setView
(
view
);
AlertDialog
addCartDialog
=
builder
.
create
();
tvOk
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
if
(
status
!=
1
&&
TextUtils
.
isEmpty
(
etRemark
.
getText
().
toString
())
&&
status
==
2
)
{
toast
(
"请填写备注"
);
return
;
}
check
(
status
,
etRemark
.
getText
().
toString
(),
id
);
addCartDialog
.
dismiss
();
}
});
tvCancel
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
addCartDialog
.
dismiss
();
}
});
addCartDialog
.
show
();
}
private
void
check
(
int
status
,
String
remark
,
int
id
)
{
Map
<
String
,
Object
>
param
=
WorkUtils
.
simpleParam
();
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
SALE
.
getCode
()))
{
param
.
put
(
"status"
,
status
==
1
?
Integer
.
valueOf
(
info
.
getStatus
())
+
1
:
Integer
.
valueOf
(
info
.
getStatus
())
+
11
);
}
else
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
OUT_BUY
.
getCode
()))
{
param
.
put
(
"status"
,
status
);
param
.
put
(
"productAmount"
,
info
.
getProductAmount
());
}
else
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
SUPPLIER
.
getCode
()))
{
param
.
put
(
"status"
,
status
);
param
.
put
(
"productAmount"
,
info
.
getProductAmount
());
}
param
.
put
(
"auditRemark"
,
remark
);
param
.
put
(
"productAmount"
,
info
.
getProductAmount
());
param
.
put
(
"id"
,
id
);
Observable
<
BaseBean
>
observable
;
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
SALE
.
getCode
()))
{
if
(
info
.
getStatus
().
endsWith
(
"0"
))
{
observable
=
RtfUtils
.
getRtf
().
soReturnApply
(
id
+
""
,
WorkUtils
.
convertMapToBody
(
param
));
}
else
if
(
info
.
getStatus
().
endsWith
(
"1"
))
{
observable
=
RtfUtils
.
getRtf
().
soBusinessReturnApply
(
id
+
""
,
WorkUtils
.
convertMapToBody
(
param
));
}
else
if
(
info
.
getStatus
().
endsWith
(
"2"
))
{
observable
=
RtfUtils
.
getRtf
().
soFinanceReturnApply
(
id
+
""
,
WorkUtils
.
convertMapToBody
(
param
));
}
else
if
(
info
.
getStatus
().
endsWith
(
"3"
))
{
observable
=
RtfUtils
.
getRtf
().
soGroupReturnApply
(
id
+
""
,
WorkUtils
.
convertMapToBody
(
param
));
}
else
{
observable
=
RtfUtils
.
getRtf
().
soReturnApply
(
id
+
""
,
WorkUtils
.
convertMapToBody
(
param
));
}
}
else
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
OUT_BUY
.
getCode
()))
{
observable
=
RtfUtils
.
getRtf
().
poGroupReturnApply
(
id
+
""
,
WorkUtils
.
convertMapToBody
(
param
));
}
else
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
SUPPLIER
.
getCode
()))
{
observable
=
RtfUtils
.
getRtf
().
foGroupPickReturnApply
(
id
+
""
,
WorkUtils
.
convertMapToBody
(
param
));
}
else
{
observable
=
RtfUtils
.
getRtf
().
foGroupPickReturnApply
(
id
+
""
,
WorkUtils
.
convertMapToBody
(
param
));
}
observable
.
compose
(
Transformer
.
schedule
()).
subscribe
(
new
WorkObserver
<
BaseBean
>()
{
@Override
public
void
doOnSubscribe
(
Disposable
d
)
{
}
@Override
public
void
onFail
(
String
errorMsg
)
{
hideLoading
();
toast
(
errorMsg
);
}
@Override
public
void
onSuccess
(
BaseBean
data
)
{
hideLoading
();
if
(
data
.
getCode
()
!=
0
)
{
toast
(
data
.
getMessage
());
return
;
}
toast
(
"操作成功"
);
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
SALE
.
getCode
()))
{
int
changeStatus
=
status
==
1
?
Integer
.
valueOf
(
info
.
getStatus
())
+
1
:
Integer
.
valueOf
(
info
.
getStatus
())
+
11
;
info
.
setStatus
(
changeStatus
+
""
);
changeView
();
}
else
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
OUT_BUY
.
getCode
()))
{
llBottom
.
setVisibility
(
View
.
GONE
);
}
else
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
SUPPLIER
.
getCode
()))
{
llBottom
.
setVisibility
(
View
.
GONE
);
}
EventBus
.
getDefault
().
post
(
new
CheckReturnEvent
());
}
});
}
@OnClick
({
R
.
id
.
tv_refuse
,
R
.
id
.
tv_agree
,
R
.
id
.
rl_history
,
R
.
id
.
rl_order
})
public
void
onViewClicked
(
View
view
)
{
switch
(
view
.
getId
())
{
case
R
.
id
.
tv_refuse
:
checkDialog
(
2
,
info
.
getId
());
break
;
case
R
.
id
.
tv_agree
:
checkDialog
(
1
,
info
.
getId
());
break
;
case
R
.
id
.
rl_history
:
startActivity
(
ReturnApplyHistoryActivity
.
class
,
"id"
,
info
.
getId
()+
""
);
break
;
case
R
.
id
.
rl_order
:
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
SALE
.
getCode
()))
{
if
(!
WorkUtils
.
hasPermission
(
PagePermissionType
.
SALE_ORDER_DETAIL
.
getPermission
()))
{
toast
(
R
.
string
.
permission
);
return
;
}
startActivity
(
SaleOrderDetailActivity
.
class
,
"identity"
,
getIntent
().
getStringExtra
(
"identity"
),
"id"
,
getIntent
().
getStringExtra
(
"id"
),
"status"
,
getIntent
().
getStringExtra
(
"status"
));
}
else
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
OUT_BUY
.
getCode
()))
{
if
(!
WorkUtils
.
hasPermission
(
PagePermissionType
.
PO_PURCHASE_DETAILS
.
getPermission
())){
toast
(
R
.
string
.
permission
);
return
;
}
startActivity
(
OutOrderDetailActivity
.
class
,
"identity"
,
getIntent
().
getStringExtra
(
"identity"
),
"id"
,
getIntent
().
getStringExtra
(
"id"
),
"status"
,
getIntent
().
getStringExtra
(
"status"
));
}
else
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
SUPPLIER
.
getCode
()))
{
if
(!
WorkUtils
.
hasPermission
(
PagePermissionType
.
FO_SUPPLIER_DETAILS
.
getPermission
())){
toast
(
R
.
string
.
permission
);
return
;
}
startActivity
(
OutOrderDetailActivity
.
class
,
"identity"
,
getIntent
().
getStringExtra
(
"identity"
),
"id"
,
getIntent
().
getStringExtra
(
"id"
),
"status"
,
getIntent
().
getStringExtra
(
"status"
));
}
break
;
}
}
}
app/src/main/java/com/wd/workoffice/ui/activity/bat/order/ReturnDetailActivity.java
浏览文件 @
0ce36597
...
...
@@ -390,7 +390,7 @@ public class ReturnDetailActivity extends WorkToolBarActivity {
}
else
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
OUT_BUY
.
getCode
()))
{
observable
=
RtfUtils
.
getRtf
().
poGroupReturnApply
(
id
+
""
,
WorkUtils
.
convertMapToBody
(
param
));
}
else
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
SUPPLIER
.
getCode
()))
{
observable
=
RtfUtils
.
getRtf
().
p
oGroupReturnApply
(
id
+
""
,
WorkUtils
.
convertMapToBody
(
param
));
observable
=
RtfUtils
.
getRtf
().
f
oGroupReturnApply
(
id
+
""
,
WorkUtils
.
convertMapToBody
(
param
));
}
else
{
observable
=
RtfUtils
.
getRtf
().
soReturnApply
(
id
+
""
,
WorkUtils
.
convertMapToBody
(
param
));
}
...
...
@@ -419,6 +419,8 @@ public class ReturnDetailActivity extends WorkToolBarActivity {
changeView
();
}
else
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
OUT_BUY
.
getCode
()))
{
llBottom
.
setVisibility
(
View
.
GONE
);
}
else
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
SUPPLIER
.
getCode
()))
{
llBottom
.
setVisibility
(
View
.
GONE
);
}
EventBus
.
getDefault
().
post
(
new
CheckReturnEvent
());
}
...
...
@@ -456,6 +458,15 @@ public class ReturnDetailActivity extends WorkToolBarActivity {
"identity"
,
getIntent
().
getStringExtra
(
"identity"
),
"id"
,
getIntent
().
getStringExtra
(
"id"
),
"status"
,
getIntent
().
getStringExtra
(
"status"
));
}
else
if
(
TextUtils
.
equals
(
orderType
,
OrderType
.
SUPPLIER
.
getCode
()))
{
if
(!
WorkUtils
.
hasPermission
(
PagePermissionType
.
FO_SUPPLIER_DETAILS
.
getPermission
())){
toast
(
R
.
string
.
permission
);
return
;
}
startActivity
(
OutOrderDetailActivity
.
class
,
"identity"
,
getIntent
().
getStringExtra
(
"identity"
),
"id"
,
getIntent
().
getStringExtra
(
"id"
),
"status"
,
getIntent
().
getStringExtra
(
"status"
));
}
break
;
}
...
...
app/src/main/java/com/wd/workoffice/ui/activity/bat/order/SupplierOrderDetailActivity.java
浏览文件 @
0ce36597
...
...
@@ -334,6 +334,21 @@ public class SupplierOrderDetailActivity extends WorkToolBarActivity {
"orderItemId"
,
proList
.
get
(
position
).
getId
(),
"productId"
,
proList
.
get
(
position
).
getProductId
()
+
""
);
break
;
case
R
.
id
.
tv_back
:
startActivity
(
BackActivity
.
class
,
"identity"
,
identity
,
"status"
,
dataBean
.
getStatus
()
+
""
,
"enterStockType"
,
dataBean
.
getEnterStockType
(),
"deptId"
,
dataBean
.
getLaunchDeptId
()
+
""
,
"returnNum"
,
proList
.
get
(
position
).
getCanPickReturnProductSum
(),
"orderType"
,
dataBean
.
getExpandInfo
().
getOrderType
(),
"num"
,
proList
.
get
(
position
).
getCanUseProductSum
()
+
""
,
"product"
,
proList
.
get
(
position
).
getProductName
(),
"simpleCode"
,
proList
.
get
(
position
).
getProductSimpleCode
(),
"orderId"
,
getIntent
().
getStringExtra
(
"id"
),
"orderItemId"
,
proList
.
get
(
position
).
getId
(),
"productId"
,
proList
.
get
(
position
).
getProductId
()
+
""
);
break
;
case
R
.
id
.
tv_flow
:
startActivity
(
ProFlowActivity
.
class
,
"status"
,
dataBean
.
getStatus
()
+
""
,
...
...
app/src/main/java/com/wd/workoffice/ui/adapter/SupplierOrderDetailProductAdapter.java
浏览文件 @
0ce36597
...
...
@@ -49,6 +49,7 @@ public class SupplierOrderDetailProductAdapter extends BaseQuickAdapter<OrderDet
helper
.
addOnClickListener
(
R
.
id
.
tv_flow
);
helper
.
addOnClickListener
(
R
.
id
.
tv_add
);
helper
.
addOnClickListener
(
R
.
id
.
tv_quality
);
helper
.
addOnClickListener
(
R
.
id
.
tv_back
);
helper
.
setGone
(
R
.
id
.
fl_quality
,
true
);
switch
(
status
)
{
// "待审核", "待接单", "待生产", "已入库","已交付"};
...
...
@@ -91,6 +92,7 @@ public class SupplierOrderDetailProductAdapter extends BaseQuickAdapter<OrderDet
if
(!
WorkUtils
.
hasPermission
(
PagePermissionType
.
FO_RETURN_LIST
.
getPermission
()))
{
helper
.
setGone
(
R
.
id
.
fl_return
,
false
);
}
helper
.
setGone
(
R
.
id
.
fl_back
,
WorkUtils
.
hasPermission
(
PagePermissionType
.
FO_RETURN_LIST
.
getPermission
()));
changeStats
(
helper
,
item
.
getProductId
());
}
private
void
changeStats
(
BaseViewHolder
helper
,
int
productId
)
{
...
...
app/src/main/res/layout/item_order_product.xml
浏览文件 @
0ce36597
...
...
@@ -255,6 +255,32 @@
android:layout_gravity=
"right"
android:layout_marginTop=
"10mm"
android:visibility=
"gone"
>
<FrameLayout
android:id=
"@+id/fl_back"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:visibility=
"gone"
android:layout_marginRight=
"10mm"
>
<TextView
android:id=
"@+id/tv_back"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"3mm"
android:background=
"@drawable/shape_blue_btn"
android:paddingHorizontal=
"10mm"
android:paddingVertical=
"5mm"
android:text=
"领料退回"
android:textColor=
"@color/white"
/>
<View
android:id=
"@+id/view_back"
android:layout_width=
"8mm"
android:layout_height=
"8mm"
android:visibility=
"gone"
android:layout_gravity=
"right"
android:background=
"@drawable/shape_red_circle"
/>
</FrameLayout>
<FrameLayout
android:id=
"@+id/fl_get"
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论