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
59bec11c
提交
59bec11c
authored
3月 24, 2020
作者:
lgd
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.部门
2.//TODO erp用户激活,忘记密码测试,产品下单还差附件,bat,mes,消息,我的,刷新token
上级
f668c59c
显示空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
1121 行增加
和
74 行删除
+1121
-74
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+17
-2
DepBean.java
app/src/main/java/com/wd/workoffice/bean/DepBean.java
+548
-53
ApiService.java
app/src/main/java/com/wd/workoffice/retrofit/ApiService.java
+10
-1
WorkDepActivity.java
...m/wd/workoffice/ui/activity/bat/work/WorkDepActivity.java
+9
-6
WorkDepDetailActivity.java
...orkoffice/ui/activity/bat/work/WorkDepDetailActivity.java
+140
-0
WorkDepPersonActivity.java
...orkoffice/ui/activity/bat/work/WorkDepPersonActivity.java
+89
-0
WorkProPriceActivity.java
...workoffice/ui/activity/bat/work/WorkProPriceActivity.java
+1
-0
WorkDepAdapter.java
...ain/java/com/wd/workoffice/ui/adapter/WorkDepAdapter.java
+9
-9
WorkDepManageAdapter.java
...va/com/wd/workoffice/ui/adapter/WorkDepManageAdapter.java
+25
-0
MainFragment.java
app/src/main/java/com/wd/workoffice/ui/fg/MainFragment.java
+2
-2
WorkUtils.java
app/src/main/java/com/wd/workoffice/util/WorkUtils.java
+22
-0
activity_work_dep.xml
app/src/main/res/layout/activity_work_dep.xml
+1
-1
activity_work_dep_details.xml
app/src/main/res/layout/activity_work_dep_details.xml
+206
-0
activity_work_dep_person.xml
app/src/main/res/layout/activity_work_dep_person.xml
+42
-0
没有找到文件。
app/src/main/AndroidManifest.xml
浏览文件 @
59bec11c
...
...
@@ -369,14 +369,29 @@
android:theme=
"@style/Work.Base"
android:windowSoftInputMode=
"adjustPan"
/>
<activity
android:name=
".ui.activity.bat.work.Work
Pro
DepActivity"
android:name=
".ui.activity.bat.work.WorkDepActivity"
android:configChanges=
"keyboardHidden|orientation"
android:label=
"部门"
android:launchMode=
"singleTop"
android:screenOrientation=
"portrait"
android:theme=
"@style/Work.Base"
android:windowSoftInputMode=
"adjustPan"
/>
<activity
android:name=
".ui.activity.bat.work.WorkDepDetailActivity"
android:configChanges=
"keyboardHidden|orientation"
android:label=
"部门详情"
android:launchMode=
"singleTop"
android:screenOrientation=
"portrait"
android:theme=
"@style/Work.Base"
android:windowSoftInputMode=
"adjustPan"
/>
<activity
android:name=
".ui.activity.bat.work.WorkDepPersonActivity"
android:configChanges=
"keyboardHidden|orientation"
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/DepBean.java
浏览文件 @
59bec11c
package
com
.
wd
.
workoffice
.
bean
;
import
java.util.List
;
/**
* author : flexible
* email : lgd19940421@163.com
...
...
@@ -8,29 +10,30 @@ package com.wd.workoffice.bean;
**/
public
class
DepBean
{
/* createdBy : 1
/**
* createdBy : 1
* createdByName : null
* createdTime : 2019-09-02 10:53:47
* updatedBy : 1
43
* updatedBy : 1
11
* updatedByName : null
* updatedTime : 2019-1
0-18 14:38:44
* id : 1
* parentId :
0
* updatedTime : 2019-1
1-26 17:41:42
* id : 1
21
* parentId :
CO001
* status : 1
* type :
null
* type :
1
* typeString : null
* outdeptLedger : {"gk":"","gt":""}
* permission :
null
* permission :
["销售接单"]
* permissionString : null
* tag :
null
* code :
CO
* name :
正望钢水股份有限公司
* level :
1
* erpId :
CO001
* tag :
[]
* code :
0004
* name :
模具车间
* level :
2
* erpId :
GK17
* children : null
* deptRulers : null
* deptRulerList :
null
* deptUserList :
null
* deptRulerList :
[{"createdBy":675,"createdByName":null,"createdTime":"2020-03-24 14:10:39","updatedBy":null,"updatedByName":null,"updatedTime":null,"id":735,"userName":"13791807752","nickName":"刘中纲","identifier":null,"phone":"13791807752","email":"lghiworld@126.com","type":"2","status":"1","erpId":"EM0903001","roles":null,"permissionList":null,"ofDept":null,"access":null,"ofDeptRuler":"1","roleNames":null,"deptName":null,"roleId":null,"deptId":null},{"createdBy":111,"createdByName":null,"createdTime":"2019-11-27 09:45:02","updatedBy":null,"updatedByName":null,"updatedTime":null,"id":686,"userName":"muju","nickName":"模具","identifier":null,"phone":"15020099999","email":"dd@dd.com","type":"2","status":"1","erpId":"58","roles":null,"permissionList":null,"ofDept":null,"access":null,"ofDeptRuler":"1","roleNames":null,"deptName":null,"roleId":null,"deptId":null}]
* deptUserList :
[{"createdBy":675,"createdByName":null,"createdTime":"2020-03-24 14:10:44","updatedBy":null,"updatedByName":null,"updatedTime":null,"id":761,"userName":"13553070808","nickName":"王慧","identifier":null,"phone":"13553070808","email":"","type":"2","status":"1","erpId":"EM1503005","roles":null,"permissionList":null,"ofDept":null,"access":null,"ofDeptRuler":"0","roleNames":null,"deptName":null,"roleId":null,"deptId":null}]
* targetUserOfRuler : null
* deptRulerTotal : null
* gk : null
...
...
@@ -46,24 +49,24 @@ public class DepBean {
private
int
id
;
private
String
parentId
;
private
String
status
;
private
Objec
t
type
;
private
in
t
type
;
private
Object
typeString
;
private
String
outdeptLedger
;
private
Object
permission
;
private
Object
permissionString
;
private
Object
tag
;
private
String
code
;
private
String
name
;
private
int
level
;
private
String
erpId
;
private
Object
children
;
private
Object
deptRulers
;
private
Object
deptRulerList
;
private
Object
deptUserList
;
private
Object
targetUserOfRuler
;
private
Object
deptRulerTotal
;
private
Object
gk
;
private
Object
gt
;
private
List
<
String
>
permission
;
private
List
<
String
>
tag
;
private
List
<
DeptRulerListBean
>
deptRulerList
;
private
List
<
DeptUserListBean
>
deptUserList
;
public
int
getCreatedBy
()
{
return
createdBy
;
...
...
@@ -137,11 +140,11 @@ public class DepBean {
this
.
status
=
status
;
}
public
Objec
t
getType
()
{
public
in
t
getType
()
{
return
type
;
}
public
void
setType
(
Objec
t
type
)
{
public
void
setType
(
in
t
type
)
{
this
.
type
=
type
;
}
...
...
@@ -161,14 +164,6 @@ public class DepBean {
this
.
outdeptLedger
=
outdeptLedger
;
}
public
Object
getPermission
()
{
return
permission
;
}
public
void
setPermission
(
Object
permission
)
{
this
.
permission
=
permission
;
}
public
Object
getPermissionString
()
{
return
permissionString
;
}
...
...
@@ -177,14 +172,6 @@ public class DepBean {
this
.
permissionString
=
permissionString
;
}
public
Object
getTag
()
{
return
tag
;
}
public
void
setTag
(
Object
tag
)
{
this
.
tag
=
tag
;
}
public
String
getCode
()
{
return
code
;
}
...
...
@@ -233,22 +220,6 @@ public class DepBean {
this
.
deptRulers
=
deptRulers
;
}
public
Object
getDeptRulerList
()
{
return
deptRulerList
;
}
public
void
setDeptRulerList
(
Object
deptRulerList
)
{
this
.
deptRulerList
=
deptRulerList
;
}
public
Object
getDeptUserList
()
{
return
deptUserList
;
}
public
void
setDeptUserList
(
Object
deptUserList
)
{
this
.
deptUserList
=
deptUserList
;
}
public
Object
getTargetUserOfRuler
()
{
return
targetUserOfRuler
;
}
...
...
@@ -280,4 +251,528 @@ public class DepBean {
public
void
setGt
(
Object
gt
)
{
this
.
gt
=
gt
;
}
public
List
<
String
>
getPermission
()
{
return
permission
;
}
public
void
setPermission
(
List
<
String
>
permission
)
{
this
.
permission
=
permission
;
}
public
List
<
String
>
getTag
()
{
return
tag
;
}
public
void
setTag
(
List
<
String
>
tag
)
{
this
.
tag
=
tag
;
}
public
List
<
DeptRulerListBean
>
getDeptRulerList
()
{
return
deptRulerList
;
}
public
void
setDeptRulerList
(
List
<
DeptRulerListBean
>
deptRulerList
)
{
this
.
deptRulerList
=
deptRulerList
;
}
public
List
<
DeptUserListBean
>
getDeptUserList
()
{
return
deptUserList
;
}
public
void
setDeptUserList
(
List
<
DeptUserListBean
>
deptUserList
)
{
this
.
deptUserList
=
deptUserList
;
}
public
static
class
DeptRulerListBean
{
/**
* createdBy : 675
* createdByName : null
* createdTime : 2020-03-24 14:10:39
* updatedBy : null
* updatedByName : null
* updatedTime : null
* id : 735
* userName : 13791807752
* nickName : 刘中纲
* identifier : null
* phone : 13791807752
* email : lghiworld@126.com
* type : 2
* status : 1
* erpId : EM0903001
* roles : null
* permissionList : null
* ofDept : null
* access : null
* ofDeptRuler : 1
* roleNames : null
* deptName : null
* roleId : null
* deptId : null
*/
private
int
createdBy
;
private
Object
createdByName
;
private
String
createdTime
;
private
Object
updatedBy
;
private
Object
updatedByName
;
private
Object
updatedTime
;
private
int
id
;
private
String
userName
;
private
String
nickName
;
private
Object
identifier
;
private
String
phone
;
private
String
email
;
private
String
type
;
private
String
status
;
private
String
erpId
;
private
Object
roles
;
private
Object
permissionList
;
private
Object
ofDept
;
private
Object
access
;
private
String
ofDeptRuler
;
private
Object
roleNames
;
private
Object
deptName
;
private
Object
roleId
;
private
Object
deptId
;
public
int
getCreatedBy
()
{
return
createdBy
;
}
public
void
setCreatedBy
(
int
createdBy
)
{
this
.
createdBy
=
createdBy
;
}
public
Object
getCreatedByName
()
{
return
createdByName
;
}
public
void
setCreatedByName
(
Object
createdByName
)
{
this
.
createdByName
=
createdByName
;
}
public
String
getCreatedTime
()
{
return
createdTime
;
}
public
void
setCreatedTime
(
String
createdTime
)
{
this
.
createdTime
=
createdTime
;
}
public
Object
getUpdatedBy
()
{
return
updatedBy
;
}
public
void
setUpdatedBy
(
Object
updatedBy
)
{
this
.
updatedBy
=
updatedBy
;
}
public
Object
getUpdatedByName
()
{
return
updatedByName
;
}
public
void
setUpdatedByName
(
Object
updatedByName
)
{
this
.
updatedByName
=
updatedByName
;
}
public
Object
getUpdatedTime
()
{
return
updatedTime
;
}
public
void
setUpdatedTime
(
Object
updatedTime
)
{
this
.
updatedTime
=
updatedTime
;
}
public
int
getId
()
{
return
id
;
}
public
void
setId
(
int
id
)
{
this
.
id
=
id
;
}
public
String
getUserName
()
{
return
userName
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
public
String
getNickName
()
{
return
nickName
;
}
public
void
setNickName
(
String
nickName
)
{
this
.
nickName
=
nickName
;
}
public
Object
getIdentifier
()
{
return
identifier
;
}
public
void
setIdentifier
(
Object
identifier
)
{
this
.
identifier
=
identifier
;
}
public
String
getPhone
()
{
return
phone
;
}
public
void
setPhone
(
String
phone
)
{
this
.
phone
=
phone
;
}
public
String
getEmail
()
{
return
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
String
getErpId
()
{
return
erpId
;
}
public
void
setErpId
(
String
erpId
)
{
this
.
erpId
=
erpId
;
}
public
Object
getRoles
()
{
return
roles
;
}
public
void
setRoles
(
Object
roles
)
{
this
.
roles
=
roles
;
}
public
Object
getPermissionList
()
{
return
permissionList
;
}
public
void
setPermissionList
(
Object
permissionList
)
{
this
.
permissionList
=
permissionList
;
}
public
Object
getOfDept
()
{
return
ofDept
;
}
public
void
setOfDept
(
Object
ofDept
)
{
this
.
ofDept
=
ofDept
;
}
public
Object
getAccess
()
{
return
access
;
}
public
void
setAccess
(
Object
access
)
{
this
.
access
=
access
;
}
public
String
getOfDeptRuler
()
{
return
ofDeptRuler
;
}
public
void
setOfDeptRuler
(
String
ofDeptRuler
)
{
this
.
ofDeptRuler
=
ofDeptRuler
;
}
public
Object
getRoleNames
()
{
return
roleNames
;
}
public
void
setRoleNames
(
Object
roleNames
)
{
this
.
roleNames
=
roleNames
;
}
public
Object
getDeptName
()
{
return
deptName
;
}
public
void
setDeptName
(
Object
deptName
)
{
this
.
deptName
=
deptName
;
}
public
Object
getRoleId
()
{
return
roleId
;
}
public
void
setRoleId
(
Object
roleId
)
{
this
.
roleId
=
roleId
;
}
public
Object
getDeptId
()
{
return
deptId
;
}
public
void
setDeptId
(
Object
deptId
)
{
this
.
deptId
=
deptId
;
}
}
public
static
class
DeptUserListBean
{
/**
* createdBy : 675
* createdByName : null
* createdTime : 2020-03-24 14:10:44
* updatedBy : null
* updatedByName : null
* updatedTime : null
* id : 761
* userName : 13553070808
* nickName : 王慧
* identifier : null
* phone : 13553070808
* email :
* type : 2
* status : 1
* erpId : EM1503005
* roles : null
* permissionList : null
* ofDept : null
* access : null
* ofDeptRuler : 0
* roleNames : null
* deptName : null
* roleId : null
* deptId : null
*/
private
int
createdBy
;
private
Object
createdByName
;
private
String
createdTime
;
private
Object
updatedBy
;
private
Object
updatedByName
;
private
Object
updatedTime
;
private
int
id
;
private
String
userName
;
private
String
nickName
;
private
Object
identifier
;
private
String
phone
;
private
String
email
;
private
String
type
;
private
String
status
;
private
String
erpId
;
private
Object
roles
;
private
Object
permissionList
;
private
Object
ofDept
;
private
Object
access
;
private
String
ofDeptRuler
;
private
Object
roleNames
;
private
Object
deptName
;
private
Object
roleId
;
private
Object
deptId
;
public
int
getCreatedBy
()
{
return
createdBy
;
}
public
void
setCreatedBy
(
int
createdBy
)
{
this
.
createdBy
=
createdBy
;
}
public
Object
getCreatedByName
()
{
return
createdByName
;
}
public
void
setCreatedByName
(
Object
createdByName
)
{
this
.
createdByName
=
createdByName
;
}
public
String
getCreatedTime
()
{
return
createdTime
;
}
public
void
setCreatedTime
(
String
createdTime
)
{
this
.
createdTime
=
createdTime
;
}
public
Object
getUpdatedBy
()
{
return
updatedBy
;
}
public
void
setUpdatedBy
(
Object
updatedBy
)
{
this
.
updatedBy
=
updatedBy
;
}
public
Object
getUpdatedByName
()
{
return
updatedByName
;
}
public
void
setUpdatedByName
(
Object
updatedByName
)
{
this
.
updatedByName
=
updatedByName
;
}
public
Object
getUpdatedTime
()
{
return
updatedTime
;
}
public
void
setUpdatedTime
(
Object
updatedTime
)
{
this
.
updatedTime
=
updatedTime
;
}
public
int
getId
()
{
return
id
;
}
public
void
setId
(
int
id
)
{
this
.
id
=
id
;
}
public
String
getUserName
()
{
return
userName
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
public
String
getNickName
()
{
return
nickName
;
}
public
void
setNickName
(
String
nickName
)
{
this
.
nickName
=
nickName
;
}
public
Object
getIdentifier
()
{
return
identifier
;
}
public
void
setIdentifier
(
Object
identifier
)
{
this
.
identifier
=
identifier
;
}
public
String
getPhone
()
{
return
phone
;
}
public
void
setPhone
(
String
phone
)
{
this
.
phone
=
phone
;
}
public
String
getEmail
()
{
return
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
String
getErpId
()
{
return
erpId
;
}
public
void
setErpId
(
String
erpId
)
{
this
.
erpId
=
erpId
;
}
public
Object
getRoles
()
{
return
roles
;
}
public
void
setRoles
(
Object
roles
)
{
this
.
roles
=
roles
;
}
public
Object
getPermissionList
()
{
return
permissionList
;
}
public
void
setPermissionList
(
Object
permissionList
)
{
this
.
permissionList
=
permissionList
;
}
public
Object
getOfDept
()
{
return
ofDept
;
}
public
void
setOfDept
(
Object
ofDept
)
{
this
.
ofDept
=
ofDept
;
}
public
Object
getAccess
()
{
return
access
;
}
public
void
setAccess
(
Object
access
)
{
this
.
access
=
access
;
}
public
String
getOfDeptRuler
()
{
return
ofDeptRuler
;
}
public
void
setOfDeptRuler
(
String
ofDeptRuler
)
{
this
.
ofDeptRuler
=
ofDeptRuler
;
}
public
Object
getRoleNames
()
{
return
roleNames
;
}
public
void
setRoleNames
(
Object
roleNames
)
{
this
.
roleNames
=
roleNames
;
}
public
Object
getDeptName
()
{
return
deptName
;
}
public
void
setDeptName
(
Object
deptName
)
{
this
.
deptName
=
deptName
;
}
public
Object
getRoleId
()
{
return
roleId
;
}
public
void
setRoleId
(
Object
roleId
)
{
this
.
roleId
=
roleId
;
}
public
Object
getDeptId
()
{
return
deptId
;
}
public
void
setDeptId
(
Object
deptId
)
{
this
.
deptId
=
deptId
;
}
}
}
app/src/main/java/com/wd/workoffice/retrofit/ApiService.java
浏览文件 @
59bec11c
...
...
@@ -497,7 +497,16 @@ public interface ApiService {
* @return
*/
@GET
(
"/sys/dept/list"
)
Observable
<
BaseBean
>
getDep
(
@QueryMap
Map
<
String
,
Object
>
param
);
Observable
<
BaseBean
>
getDep
(
@QueryMap
Map
<
String
,
Object
>
param
);
/**
* 获取部门详情
*
* @param id
* @return
*/
@GET
(
"/sys/dept/{deptId}"
)
Observable
<
BaseBean
>
getDepDetail
(
@Path
(
"deptId"
)
String
id
);
}
app/src/main/java/com/wd/workoffice/ui/activity/bat/work/Work
Pro
DepActivity.java
→
app/src/main/java/com/wd/workoffice/ui/activity/bat/work/WorkDepActivity.java
浏览文件 @
59bec11c
package
com
.
wd
.
workoffice
.
ui
.
activity
.
bat
.
work
;
import
android.
os.Bundle
;
import
android.
view.View
;
import
android.widget.Button
;
import
android.widget.EditText
;
...
...
@@ -13,12 +13,9 @@ import com.wd.workoffice.R;
import
com.wd.workoffice.app.BaseBean
;
import
com.wd.workoffice.app.WorkToolBarActivity
;
import
com.wd.workoffice.bean.DepBean
;
import
com.wd.workoffice.bean.ProPriceBean
;
import
com.wd.workoffice.bean.WorkDep
;
import
com.wd.workoffice.retrofit.RtfUtils
;
import
com.wd.workoffice.retrofit.WorkObserver
;
import
com.wd.workoffice.ui.adapter.WorkDepAdapter
;
import
com.wd.workoffice.ui.adapter.WorkProPriceAdapter
;
import
com.wd.workoffice.util.WorkUtils
;
import
java.util.ArrayList
;
...
...
@@ -39,7 +36,7 @@ import io.reactivex.disposables.Disposable;
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public
class
Work
Pro
DepActivity
extends
WorkToolBarActivity
{
public
class
WorkDepActivity
extends
WorkToolBarActivity
{
@BindView
(
R
.
id
.
rv_data
)
RecyclerView
rvData
;
...
...
@@ -122,6 +119,12 @@ public class WorkProDepActivity extends WorkToolBarActivity {
getData
();
}
});
dataAdapter
.
setOnItemClickListener
(
new
BaseQuickAdapter
.
OnItemClickListener
()
{
@Override
public
void
onItemClick
(
BaseQuickAdapter
adapter
,
View
view
,
int
position
)
{
startActivity
(
WorkDepDetailActivity
.
class
,
"id"
,
dataList
.
get
(
position
).
getId
()
+
""
);
}
});
// dataAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
// @Override
// public void onLoadMoreRequested() {
...
...
@@ -140,7 +143,7 @@ public class WorkProDepActivity extends WorkToolBarActivity {
@OnClick
(
R
.
id
.
btn_search
)
public
void
onViewClicked
()
{
page
=
1
;
param
.
put
(
"
current
"
,
etKey
.
getText
().
toString
());
param
.
put
(
"
name
"
,
etKey
.
getText
().
toString
());
getData
();
}
}
app/src/main/java/com/wd/workoffice/ui/activity/bat/work/WorkDepDetailActivity.java
0 → 100644
浏览文件 @
59bec11c
package
com
.
wd
.
workoffice
.
ui
.
activity
.
bat
.
work
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
android.widget.RelativeLayout
;
import
android.widget.Switch
;
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.AccountBean
;
import
com.wd.workoffice.bean.DepBean
;
import
com.wd.workoffice.retrofit.RtfUtils
;
import
com.wd.workoffice.retrofit.WorkObserver
;
import
com.wd.workoffice.util.MathUtils
;
import
com.wd.workoffice.util.WorkUtils
;
import
java.util.List
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.OnClick
;
import
flexible.xd.android_base.network.rtfhttp.Transformer
;
import
io.reactivex.disposables.Disposable
;
/**
* 工作台 - 部门列表 -详情
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public
class
WorkDepDetailActivity
extends
WorkToolBarActivity
{
@BindView
(
R
.
id
.
tv_name
)
TextView
tvName
;
@BindView
(
R
.
id
.
tv_type
)
TextView
tvType
;
@BindView
(
R
.
id
.
tv_manager
)
TextView
tvManager
;
@BindView
(
R
.
id
.
rl_person
)
RelativeLayout
rlPerson
;
@BindView
(
R
.
id
.
tv_label
)
TextView
tvLabel
;
@BindView
(
R
.
id
.
tv_role
)
TextView
tvRole
;
@BindView
(
R
.
id
.
switch_open
)
Switch
switchOpen
;
private
DepBean
dataBean
;
@Override
protected
void
initView
()
{
ButterKnife
.
bind
(
this
);
}
@Override
protected
void
initData
()
{
getData
();
}
private
void
getData
()
{
RtfUtils
.
getRtf
().
getDepDetail
(
getIntent
().
getStringExtra
(
"id"
)).
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
(),
DepBean
.
class
);
tvName
.
setText
(
dataBean
.
getName
());
tvType
.
setText
(
WorkUtils
.
getDepType
(
dataBean
.
getType
()));
List
<
DepBean
.
DeptRulerListBean
>
deptRulerList
=
dataBean
.
getDeptRulerList
();
String
returnData
=
""
;
if
(
deptRulerList
!=
null
&&
deptRulerList
.
size
()
!=
0
)
{
for
(
DepBean
.
DeptRulerListBean
s
:
deptRulerList
)
{
returnData
=
returnData
+
s
.
getNickName
()
+
","
;
}
returnData
=
returnData
.
substring
(
0
,
returnData
.
length
()
-
1
);
}
else
{
returnData
=
"无"
;
}
tvManager
.
setText
(
"管理员:"
+
returnData
);
tvLabel
.
setText
(
"标签:"
+
coverList
(
dataBean
.
getTag
()));
tvRole
.
setText
(
"权限:"
+
coverList
(
dataBean
.
getPermission
()));
if
(
TextUtils
.
equals
(
dataBean
.
getStatus
(),
"1"
))
{
switchOpen
.
setChecked
(
true
);
}
else
{
switchOpen
.
setChecked
(
false
);
}
}
});
}
private
String
coverList
(
List
<
String
>
data
)
{
if
(
data
!=
null
&&
data
.
size
()
!=
0
)
{
String
returnData
=
""
;
for
(
String
s
:
data
)
{
returnData
=
returnData
.
concat
(
s
).
concat
(
","
);
}
return
returnData
.
substring
(
0
,
returnData
.
length
()
-
1
);
}
else
{
return
"无"
;
}
}
@Override
protected
void
initEvent
()
{
}
@Override
protected
int
layoutId
()
{
return
R
.
layout
.
activity_work_dep_details
;
}
@OnClick
(
R
.
id
.
rl_person
)
public
void
onViewClicked
()
{
if
(
dataBean
==
null
)
{
toast
(
"正在加载中,请稍后"
);
return
;
}
startActivity
(
WorkDepPersonActivity
.
class
,
"simple"
,
JSON
.
toJSONString
(
dataBean
.
getDeptUserList
()),
"manage"
,
JSON
.
toJSONString
(
dataBean
.
getDeptRulerList
()));
}
}
app/src/main/java/com/wd/workoffice/ui/activity/bat/work/WorkDepPersonActivity.java
0 → 100644
浏览文件 @
59bec11c
package
com
.
wd
.
workoffice
.
ui
.
activity
.
bat
.
work
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.TextView
;
import
com.alibaba.fastjson.JSON
;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.app.WorkToolBarActivity
;
import
com.wd.workoffice.bean.DepBean
;
import
com.wd.workoffice.ui.adapter.WorkDepManageAdapter
;
import
java.util.ArrayList
;
import
java.util.List
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
/**
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public
class
WorkDepPersonActivity
extends
WorkToolBarActivity
{
@BindView
(
R
.
id
.
rv_manger
)
RecyclerView
rvManger
;
@BindView
(
R
.
id
.
rv_simple
)
RecyclerView
rvSimple
;
@BindView
(
R
.
id
.
tv_manage
)
TextView
tvManage
;
@BindView
(
R
.
id
.
tv_simple
)
TextView
tvSimple
;
private
List
<
String
>
manageList
;
private
List
<
String
>
simpleList
;
private
WorkDepManageAdapter
manageAdapter
;
private
WorkDepManageAdapter
simpleAdapter
;
@Override
protected
void
initView
()
{
ButterKnife
.
bind
(
this
);
rvSimple
.
setLayoutManager
(
new
LinearLayoutManager
(
this
,
RecyclerView
.
VERTICAL
,
false
));
rvManger
.
setLayoutManager
(
new
LinearLayoutManager
(
this
,
RecyclerView
.
VERTICAL
,
false
));
}
@Override
protected
void
initData
()
{
List
<
DepBean
.
DeptUserListBean
>
simple
=
JSON
.
parseArray
(
getIntent
().
getStringExtra
(
"simple"
),
DepBean
.
DeptUserListBean
.
class
);
List
<
DepBean
.
DeptRulerListBean
>
manage
=
JSON
.
parseArray
(
getIntent
().
getStringExtra
(
"manage"
),
DepBean
.
DeptRulerListBean
.
class
);
manageList
=
new
ArrayList
<>();
simpleList
=
new
ArrayList
<>();
for
(
DepBean
.
DeptUserListBean
deptUserListBean
:
simple
)
{
simpleList
.
add
(
deptUserListBean
.
getNickName
());
}
for
(
DepBean
.
DeptRulerListBean
deptUserListBean
:
manage
)
{
manageList
.
add
(
deptUserListBean
.
getNickName
());
}
if
(
manageList
.
size
()
==
0
)
{
tvManage
.
setVisibility
(
View
.
GONE
);
}
if
(
simpleList
.
size
()
==
0
)
{
tvSimple
.
setVisibility
(
View
.
GONE
);
}
manageAdapter
=
new
WorkDepManageAdapter
(
R
.
layout
.
item_store_client
,
manageList
);
simpleAdapter
=
new
WorkDepManageAdapter
(
R
.
layout
.
item_store_client
,
simpleList
);
manageAdapter
.
bindToRecyclerView
(
rvManger
);
simpleAdapter
.
bindToRecyclerView
(
rvSimple
);
}
@Override
protected
void
initEvent
()
{
}
@Override
protected
int
layoutId
()
{
return
R
.
layout
.
activity_work_dep_person
;
}
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
// TODO: add setContentView(...) invocation
ButterKnife
.
bind
(
this
);
}
}
app/src/main/java/com/wd/workoffice/ui/activity/bat/work/WorkProPriceActivity.java
浏览文件 @
59bec11c
...
...
@@ -54,6 +54,7 @@ public class WorkProPriceActivity extends WorkToolBarActivity {
dataList
=
new
ArrayList
<>();
dataAdapter
=
new
WorkProPriceAdapter
(
R
.
layout
.
item_pro_price
,
dataList
);
dataAdapter
.
bindToRecyclerView
(
rvData
);
dataAdapter
.
setEmptyView
(
R
.
layout
.
view_empty_content
,
rvData
);
param
=
WorkUtils
.
pageKey
();
param
.
put
(
"productId"
,
getIntent
().
getStringExtra
(
"id"
));
param
.
put
(
"current"
,
page
);
...
...
app/src/main/java/com/wd/workoffice/ui/adapter/WorkDepAdapter.java
浏览文件 @
59bec11c
...
...
@@ -8,6 +8,7 @@ import com.chad.library.adapter.base.BaseViewHolder;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.bean.DepBean
;
import
com.wd.workoffice.bean.ProPriceBean
;
import
com.wd.workoffice.util.WorkUtils
;
import
java.util.List
;
...
...
@@ -24,15 +25,14 @@ public class WorkDepAdapter extends BaseQuickAdapter<DepBean, BaseViewHolder> {
@Override
protected
void
convert
(
BaseViewHolder
helper
,
DepBean
item
)
{
helper
.
setText
(
R
.
id
.
tv_name
,
item
.
getName
());
helper
.
setText
(
R
.
id
.
tv_dep
,
item
.
getParentId
());
if
(
TextUtils
.
equals
(
item
.
getStatus
(),
"1"
)){
helper
.
setText
(
R
.
id
.
tv_status
,
"正常"
);
helper
.
setBackgroundRes
(
R
.
id
.
tv_status
,
R
.
drawable
.
shape_dep_status
);
}
else
{
helper
.
setText
(
R
.
id
.
tv_status
,
"冻结"
);
helper
.
setBackgroundRes
(
R
.
id
.
tv_status
,
R
.
drawable
.
shape_dep_status_freeze
);
helper
.
setText
(
R
.
id
.
tv_name
,
item
.
getName
());
helper
.
setText
(
R
.
id
.
tv_dep
,
WorkUtils
.
getDepType
(
item
.
getType
()));
if
(
TextUtils
.
equals
(
item
.
getStatus
(),
"1"
))
{
helper
.
setText
(
R
.
id
.
tv_status
,
"正常"
);
helper
.
setBackgroundRes
(
R
.
id
.
tv_status
,
R
.
drawable
.
shape_dep_status
);
}
else
{
helper
.
setText
(
R
.
id
.
tv_status
,
"冻结"
);
helper
.
setBackgroundRes
(
R
.
id
.
tv_status
,
R
.
drawable
.
shape_dep_status_freeze
);
}
}
...
...
app/src/main/java/com/wd/workoffice/ui/adapter/WorkDepManageAdapter.java
0 → 100644
浏览文件 @
59bec11c
package
com
.
wd
.
workoffice
.
ui
.
adapter
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.wd.workoffice.R
;
import
com.wd.workoffice.bean.ClientBean
;
import
java.util.List
;
/**
* Created by flexible on 2018/8/13.
*/
public
class
WorkDepManageAdapter
extends
BaseQuickAdapter
<
String
,
BaseViewHolder
>
{
public
WorkDepManageAdapter
(
int
layoutResId
,
List
data
)
{
super
(
layoutResId
,
data
);
}
@Override
protected
void
convert
(
BaseViewHolder
helper
,
String
item
)
{
helper
.
setText
(
R
.
id
.
tv_name
,
item
);
}
}
app/src/main/java/com/wd/workoffice/ui/fg/MainFragment.java
浏览文件 @
59bec11c
...
...
@@ -26,8 +26,8 @@ import com.wd.workoffice.ui.activity.bat.sale.SaleSaleOrderActivity;
import
com.wd.workoffice.ui.activity.bat.sale.SaleSupplierOrderActivity
;
import
com.wd.workoffice.ui.activity.bat.work.WorkAccountActivity
;
import
com.wd.workoffice.ui.activity.bat.work.WorkContactsActivity
;
import
com.wd.workoffice.ui.activity.bat.work.WorkDepActivity
;
import
com.wd.workoffice.ui.activity.bat.work.WorkProActivity
;
import
com.wd.workoffice.ui.activity.bat.work.WorkProDepActivity
;
import
com.wd.workoffice.ui.activity.bat.work.WorkWarehouseActivity
;
import
com.wd.workoffice.ui.adapter.BatLayoutAdapter
;
import
com.wd.workoffice.util.UserKeeper
;
...
...
@@ -257,7 +257,7 @@ public class MainFragment extends WorkBaseFg {
startActivity
(
WorkWarehouseActivity
.
class
);
break
;
case
4
:
startActivity
(
Work
Pro
DepActivity
.
class
);
startActivity
(
WorkDepActivity
.
class
);
break
;
case
5
:
break
;
...
...
app/src/main/java/com/wd/workoffice/util/WorkUtils.java
浏览文件 @
59bec11c
...
...
@@ -65,6 +65,28 @@ public class WorkUtils {
}
}
/**
* code: 1:生产部门 2:销售部门 3:业务部门
*
* @param code
* @return
*/
public
static
String
getDepType
(
Integer
code
)
{
String
name
=
""
;
switch
(
code
)
{
case
1
:
name
=
"生产部门"
;
break
;
case
2
:
name
=
"销售部门"
;
break
;
case
3
:
name
=
"业务部门"
;
break
;
}
return
name
;
}
public
static
File
uriToFile
(
Uri
uri
,
Context
context
)
{
String
path
=
null
;
if
(
"file"
.
equals
(
uri
.
getScheme
()))
{
...
...
app/src/main/res/layout/activity_work_dep.xml
浏览文件 @
59bec11c
...
...
@@ -37,7 +37,7 @@
android:layout_height=
"match_parent"
android:layout_marginLeft=
"2mm"
android:background=
"@null"
android:hint=
"
搜索客户
"
android:hint=
"
输入部门
"
android:textColor=
"#91ABBA"
android:textColorHint=
"#91ABBA"
android:textSize=
"14sp"
/>
...
...
app/src/main/res/layout/activity_work_dep_details.xml
0 → 100644
浏览文件 @
59bec11c
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginTop=
"10mm"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:background=
"@color/white"
android:gravity=
"center"
android:paddingHorizontal=
"20mm"
android:paddingVertical=
"15mm"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"部门名称"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/tv_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:text=
"销售二公司"
android:textColor=
"@color/main_sup_color"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginTop=
"1mm"
android:background=
"@color/white"
android:gravity=
"center"
android:paddingHorizontal=
"20mm"
android:paddingVertical=
"15mm"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"部门类别"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/tv_type"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:text=
"销售部"
android:textColor=
"@color/main_sup_color"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
</RelativeLayout>
<RelativeLayout
android:id=
"@+id/rl_person"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"1mm"
android:background=
"@color/white"
android:orientation=
"horizontal"
android:paddingHorizontal=
"20mm"
android:paddingVertical=
"10mm"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"部门成员"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/tv_manager"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"3mm"
android:text=
"管理员:无"
android:textColor=
"@color/main_sup_color"
android:textSize=
"12sp"
/>
</LinearLayout>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_alignParentRight=
"true"
android:background=
"@mipmap/arrow_right_blue"
/>
</RelativeLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"1mm"
android:background=
"@color/white"
android:orientation=
"vertical"
android:paddingHorizontal=
"20mm"
android:paddingVertical=
"10mm"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"部门标签"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/tv_label"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"3mm"
android:text=
"标签:无"
android:textColor=
"@color/main_sup_color"
android:textSize=
"12sp"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"1mm"
android:background=
"@color/white"
android:orientation=
"vertical"
android:paddingHorizontal=
"20mm"
android:paddingVertical=
"10mm"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"部门权限"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/tv_role"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"3mm"
android:text=
"权限:无"
android:textColor=
"@color/main_sup_color"
android:textSize=
"12sp"
/>
</LinearLayout>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginTop=
"1mm"
android:background=
"@color/white"
android:gravity=
"center"
android:paddingHorizontal=
"20mm"
android:paddingVertical=
"10mm"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:text=
"是否启用"
android:textSize=
"16sp"
/>
<Switch
android:id=
"@+id/switch_open"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginTop=
"8mm"
android:checked=
"false"
android:clickable=
"false"
android:thumb=
"@color/mainTextColor"
android:showText=
"false"
/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/activity_work_dep_person.xml
0 → 100644
浏览文件 @
59bec11c
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/tv_manage"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:paddingVertical=
"15mm"
android:text=
"管理员"
android:textColor=
"@color/main_sup_color"
android:textSize=
"16sp"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_manger"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/white"
/>
<TextView
android:id=
"@+id/tv_simple"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:paddingVertical=
"15mm"
android:text=
"普通成员"
android:textColor=
"@color/main_sup_color"
android:textSize=
"16sp"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_simple"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/white"
/>
</LinearLayout>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论