Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
DutyManager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
邢皓翔
DutyManager
Commits
d4501847
Commit
d4501847
authored
Apr 10, 2018
by
xinghx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coding
parent
72d46854
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
549 additions
and
22 deletions
+549
-22
misc.xml
.idea/misc.xml
+1
-11
modules.xml
.idea/modules.xml
+1
-1
DutyAPI.java
app/src/main/java/cn/bsl/bxbg/zhiban/net/api/DutyAPI.java
+12
-0
DutyPlanClient.java
...in/java/cn/bsl/bxbg/zhiban/net/client/DutyPlanClient.java
+13
-0
CCShiftsUni.java
...ain/java/cn/bsl/bxbg/zhiban/net/response/CCShiftsUni.java
+345
-0
DutiesTbResponse.java
...ava/cn/bsl/bxbg/zhiban/net/response/DutiesTbResponse.java
+6
-6
Constant.java
app/src/main/java/cn/bsl/bxbg/zhiban/utils/Constant.java
+1
-1
TiaobanDetailsActivity.java
.../java/cn/bsl/bxbg/zhiban/view/TiaobanDetailsActivity.java
+120
-0
agreen.png
app/src/main/res/drawable-xhdpi/agreen.png
+0
-0
disagreen.png
app/src/main/res/drawable-xhdpi/disagreen.png
+0
-0
activity_tiaoban_details.xml
app/src/main/res/layout/activity_tiaoban_details.xml
+47
-0
colors.xml
app/src/main/res/values/colors.xml
+1
-1
gradle-wrapper.properties
gradle/wrapper/gradle-wrapper.properties
+2
-2
No files found.
.idea/misc.xml
View file @
d4501847
...
...
@@ -27,17 +27,7 @@
</value>
</option>
</component>
<component
name=
"ProjectLevelVcsManager"
settingsEditedManually=
"false"
>
<OptionsSetting
value=
"true"
id=
"Add"
/>
<OptionsSetting
value=
"true"
id=
"Remove"
/>
<OptionsSetting
value=
"true"
id=
"Checkout"
/>
<OptionsSetting
value=
"true"
id=
"Update"
/>
<OptionsSetting
value=
"true"
id=
"Status"
/>
<OptionsSetting
value=
"true"
id=
"Edit"
/>
<ConfirmationsSetting
value=
"0"
id=
"Add"
/>
<ConfirmationsSetting
value=
"0"
id=
"Remove"
/>
</component>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_8"
default=
"true"
assert-keyword=
"true"
jdk-15=
"true"
project-jdk-name=
"1.8 (1)"
project-jdk-type=
"JavaSDK"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_8"
default=
"true"
project-jdk-name=
"1.8"
project-jdk-type=
"JavaSDK"
>
<output
url=
"file://$PROJECT_DIR$/build/classes"
/>
</component>
<component
name=
"ProjectType"
>
...
...
.idea/modules.xml
View file @
d4501847
...
...
@@ -2,7 +2,7 @@
<project
version=
"4"
>
<component
name=
"ProjectModuleManager"
>
<modules>
<module
fileurl=
"file://$PROJECT_DIR$/
Zhiban.iml"
filepath=
"$PROJECT_DIR$/Zhiban
.iml"
/>
<module
fileurl=
"file://$PROJECT_DIR$/
DutyManager.iml"
filepath=
"$PROJECT_DIR$/DutyManager
.iml"
/>
<module
fileurl=
"file://$PROJECT_DIR$/app/app.iml"
filepath=
"$PROJECT_DIR$/app/app.iml"
/>
</modules>
</component>
...
...
app/src/main/java/cn/bsl/bxbg/zhiban/net/api/DutyAPI.java
View file @
d4501847
...
...
@@ -5,6 +5,7 @@ import java.util.List;
import
cn.bsl.bxbg.zhiban.net.response.CCDuties
;
import
cn.bsl.bxbg.zhiban.net.response.CCDutiesEdit
;
import
cn.bsl.bxbg.zhiban.net.response.CCShifts
;
import
cn.bsl.bxbg.zhiban.net.response.CCShiftsUni
;
import
cn.bsl.bxbg.zhiban.net.response.DutiesTbResponse
;
import
cn.bsl.bxbg.zhiban.net.response.DutyPlanResponse
;
import
cn.bsl.bxbg.zhiban.net.response.TiaobanBean
;
...
...
@@ -88,4 +89,15 @@ public interface DutyAPI {
Call
<
List
<
CCShifts
>>
ccShifts
(
@Query
(
"pageNo"
)
String
pageNo
,
@Query
(
"pageSize"
)
String
pageSize
,
@Query
(
"filters"
)
String
filters
);
@GET
(
"cc_shifts"
)
Observable
<
List
<
CCShiftsUni
>>
ccShiftsUnique
(
@Query
(
"pageNo"
)
String
pageNo
,
@Query
(
"pageSize"
)
String
pageSize
,
@Query
(
"filters"
)
String
filters
,
@Query
(
"includes"
)
String
includes
);
@FormUrlEncoded
@POST
(
"cc_shifts/{cc_shift_id}/edit"
)
Observable
<
CCShifts
>
ccShiftsEdit
(
@Header
(
"X-Auth-Token"
)
String
header
,
@Path
(
"cc_shift_id"
)
String
id
,
@Field
(
"status"
)
String
status
);
}
app/src/main/java/cn/bsl/bxbg/zhiban/net/client/DutyPlanClient.java
View file @
d4501847
...
...
@@ -6,11 +6,14 @@ import cn.bsl.bxbg.zhiban.net.api.DutyAPI;
import
cn.bsl.bxbg.zhiban.net.response.CCDuties
;
import
cn.bsl.bxbg.zhiban.net.response.CCDutiesEdit
;
import
cn.bsl.bxbg.zhiban.net.response.CCShifts
;
import
cn.bsl.bxbg.zhiban.net.response.CCShiftsUni
;
import
cn.bsl.bxbg.zhiban.net.response.DutiesTbResponse
;
import
cn.bsl.bxbg.zhiban.net.response.DutyPlanResponse
;
import
cn.bsl.bxbg.zhiban.net.response.TiaobanBean
;
import
cn.bsl.bxbg.zhiban.utils.Constant
;
import
io.reactivex.Observable
;
import
io.reactivex.ObservableSource
;
import
io.reactivex.functions.Function
;
import
retrofit2.Call
;
import
retrofit2.Retrofit
;
import
retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
;
...
...
@@ -72,4 +75,14 @@ public class DutyPlanClient extends BaseClient {
return
dutyAPI
.
ccShifts
(
"1"
,
"1000"
,
"{'cc_shift':{'applicantTransferredNameequalTo':{'fieldsValuesOr':{'fields':['transferred_class','transferred_name'],'values':['"
+
Constant
.
USER_NAME
+
"']}}}}"
);
}
public
Observable
<
List
<
CCShiftsUni
>>
ccshiftUni
(
String
id
)
{
return
dutyAPI
.
ccShiftsUnique
(
"1"
,
"1000"
,
"{'cc_shift':{'applicant_duty_id':{'equalTo':'"
+
id
+
"'}}}"
,
"{'cc_duty':{'includes':['applicant_duty_id']}}"
);
}
public
Observable
<
CCShifts
>
ccShiftsEdit
(
String
id
,
String
status
)
{
return
dutyAPI
.
ccShiftsEdit
(
Constant
.
USER_ID
,
id
,
status
);
}
}
app/src/main/java/cn/bsl/bxbg/zhiban/net/response/CCShiftsUni.java
0 → 100644
View file @
d4501847
package
cn
.
bsl
.
bxbg
.
zhiban
.
net
.
response
;
/**
* Created by Xinghx on 2018/3/20 0020.
*/
public
class
CCShiftsUni
{
private
SuperiorBean
superior
;
private
IncludesBean
includes
;
private
RefersBean
refers
;
private
RelatesBean
relates
;
public
SuperiorBean
getSuperior
()
{
return
superior
;
}
public
void
setSuperior
(
SuperiorBean
superior
)
{
this
.
superior
=
superior
;
}
public
IncludesBean
getIncludes
()
{
return
includes
;
}
public
void
setIncludes
(
IncludesBean
includes
)
{
this
.
includes
=
includes
;
}
public
RefersBean
getRefers
()
{
return
refers
;
}
public
void
setRefers
(
RefersBean
refers
)
{
this
.
refers
=
refers
;
}
public
RelatesBean
getRelates
()
{
return
relates
;
}
public
void
setRelates
(
RelatesBean
relates
)
{
this
.
relates
=
relates
;
}
public
static
class
SuperiorBean
{
/**
* id : d6a7755b5f7c426f94fa294a992eb493
* applicantId : 11
* applicant : 王小米
* transferredName : 测试0
* transferredClass : 刘云山
* shiftTime : 2018-03-03
* applicantDutyId : 94ce70a409f34c0e890100f8de301595
* transferredClassTime : null
* transferredClassDutyId : null
* status : 0
* reason : 考虑考虑
* applicationTime : null
* createTime : 2018-03-20 16:48:11
* lastUpdateTime : 2018-04-10 23:55:26
* leaderId : null
* applicantPosition : null
* approvalResult : null
*/
private
String
id
;
private
String
applicantId
;
private
String
applicant
;
private
String
transferredName
;
private
String
transferredClass
;
private
String
shiftTime
;
private
String
applicantDutyId
;
private
Object
transferredClassTime
;
private
Object
transferredClassDutyId
;
private
String
status
;
private
String
reason
;
private
Object
applicationTime
;
private
String
createTime
;
private
String
lastUpdateTime
;
private
Object
leaderId
;
private
Object
applicantPosition
;
private
Object
approvalResult
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getApplicantId
()
{
return
applicantId
;
}
public
void
setApplicantId
(
String
applicantId
)
{
this
.
applicantId
=
applicantId
;
}
public
String
getApplicant
()
{
return
applicant
;
}
public
void
setApplicant
(
String
applicant
)
{
this
.
applicant
=
applicant
;
}
public
String
getTransferredName
()
{
return
transferredName
;
}
public
void
setTransferredName
(
String
transferredName
)
{
this
.
transferredName
=
transferredName
;
}
public
String
getTransferredClass
()
{
return
transferredClass
;
}
public
void
setTransferredClass
(
String
transferredClass
)
{
this
.
transferredClass
=
transferredClass
;
}
public
String
getShiftTime
()
{
return
shiftTime
;
}
public
void
setShiftTime
(
String
shiftTime
)
{
this
.
shiftTime
=
shiftTime
;
}
public
String
getApplicantDutyId
()
{
return
applicantDutyId
;
}
public
void
setApplicantDutyId
(
String
applicantDutyId
)
{
this
.
applicantDutyId
=
applicantDutyId
;
}
public
Object
getTransferredClassTime
()
{
return
transferredClassTime
;
}
public
void
setTransferredClassTime
(
Object
transferredClassTime
)
{
this
.
transferredClassTime
=
transferredClassTime
;
}
public
Object
getTransferredClassDutyId
()
{
return
transferredClassDutyId
;
}
public
void
setTransferredClassDutyId
(
Object
transferredClassDutyId
)
{
this
.
transferredClassDutyId
=
transferredClassDutyId
;
}
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
String
getReason
()
{
return
reason
;
}
public
void
setReason
(
String
reason
)
{
this
.
reason
=
reason
;
}
public
Object
getApplicationTime
()
{
return
applicationTime
;
}
public
void
setApplicationTime
(
Object
applicationTime
)
{
this
.
applicationTime
=
applicationTime
;
}
public
String
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
String
createTime
)
{
this
.
createTime
=
createTime
;
}
public
String
getLastUpdateTime
()
{
return
lastUpdateTime
;
}
public
void
setLastUpdateTime
(
String
lastUpdateTime
)
{
this
.
lastUpdateTime
=
lastUpdateTime
;
}
public
Object
getLeaderId
()
{
return
leaderId
;
}
public
void
setLeaderId
(
Object
leaderId
)
{
this
.
leaderId
=
leaderId
;
}
public
Object
getApplicantPosition
()
{
return
applicantPosition
;
}
public
void
setApplicantPosition
(
Object
applicantPosition
)
{
this
.
applicantPosition
=
applicantPosition
;
}
public
Object
getApprovalResult
()
{
return
approvalResult
;
}
public
void
setApprovalResult
(
Object
approvalResult
)
{
this
.
approvalResult
=
approvalResult
;
}
}
public
static
class
IncludesBean
{
/**
* cc_duty : {"id":"94ce70a409f34c0e890100f8de301595","classLeadersId":"12","classLeaders":"部门负责人","department":"APP技术支持","postLeaders":"部门负责人","morning":"测试0,李亮","noon":"李亮,董春海","evening":"董春海,李亮","watchPeople":null,"type":null,"dutyDate":"2018-03-03","endTime":null,"startTime":null,"createTime":"2018-03-20 16:38:14","lastUpdateTime":"2018-03-20 16:48:11","onDutyPlanId":"3a157900491f41d6b1bab142e46038e1","dutyStage":null,"postDuty":null,"remark":null,"numberDays":null,"holiday":null,"holidayName":null}
*/
private
CcDutyBean
cc_duty
;
public
CcDutyBean
getCc_duty
()
{
return
cc_duty
;
}
public
void
setCc_duty
(
CcDutyBean
cc_duty
)
{
this
.
cc_duty
=
cc_duty
;
}
public
static
class
CcDutyBean
{
/**
* id : 94ce70a409f34c0e890100f8de301595
* classLeadersId : 12
* classLeaders : 部门负责人
* department : APP技术支持
* postLeaders : 部门负责人
* morning : 测试0,李亮
* noon : 李亮,董春海
* evening : 董春海,李亮
* watchPeople : null
* type : null
* dutyDate : 2018-03-03
* endTime : null
* startTime : null
* createTime : 2018-03-20 16:38:14
* lastUpdateTime : 2018-03-20 16:48:11
* onDutyPlanId : 3a157900491f41d6b1bab142e46038e1
* dutyStage : null
* postDuty : null
* remark : null
* numberDays : null
* holiday : null
* holidayName : null
*/
private
String
id
;
private
String
classLeadersId
;
private
String
classLeaders
;
private
String
department
;
private
String
postLeaders
;
public
String
getMorning
()
{
return
morning
;
}
public
void
setMorning
(
String
morning
)
{
this
.
morning
=
morning
;
}
public
String
getNoon
()
{
return
noon
;
}
public
void
setNoon
(
String
noon
)
{
this
.
noon
=
noon
;
}
public
String
getEvening
()
{
return
evening
;
}
public
void
setEvening
(
String
evening
)
{
this
.
evening
=
evening
;
}
private
String
morning
;
private
String
noon
;
private
String
evening
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getClassLeadersId
()
{
return
classLeadersId
;
}
public
void
setClassLeadersId
(
String
classLeadersId
)
{
this
.
classLeadersId
=
classLeadersId
;
}
public
String
getClassLeaders
()
{
return
classLeaders
;
}
public
void
setClassLeaders
(
String
classLeaders
)
{
this
.
classLeaders
=
classLeaders
;
}
public
String
getDepartment
()
{
return
department
;
}
public
void
setDepartment
(
String
department
)
{
this
.
department
=
department
;
}
public
String
getPostLeaders
()
{
return
postLeaders
;
}
public
void
setPostLeaders
(
String
postLeaders
)
{
this
.
postLeaders
=
postLeaders
;
}
}
}
public
static
class
RefersBean
{
}
public
static
class
RelatesBean
{
}
}
app/src/main/java/cn/bsl/bxbg/zhiban/net/response/DutiesTbResponse.java
View file @
d4501847
...
...
@@ -316,12 +316,12 @@ public class DutiesTbResponse {
private
String
applicantId
;
private
String
applicant
;
private
String
transferredName
;
private
Object
transferredClass
;
private
String
transferredClass
;
private
Object
shiftTime
;
private
String
applicantDutyId
;
private
Object
transferredClassTime
;
private
Object
transferredClassDutyId
;
private
Object
status
;
private
String
status
;
private
String
reason
;
private
Object
applicationTime
;
private
String
createTime
;
...
...
@@ -361,11 +361,11 @@ public class DutiesTbResponse {
this
.
transferredName
=
transferredName
;
}
public
Object
getTransferredClass
()
{
public
String
getTransferredClass
()
{
return
transferredClass
;
}
public
void
setTransferredClass
(
Object
transferredClass
)
{
public
void
setTransferredClass
(
String
transferredClass
)
{
this
.
transferredClass
=
transferredClass
;
}
...
...
@@ -401,11 +401,11 @@ public class DutiesTbResponse {
this
.
transferredClassDutyId
=
transferredClassDutyId
;
}
public
Object
getStatus
()
{
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Object
status
)
{
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
...
...
app/src/main/java/cn/bsl/bxbg/zhiban/utils/Constant.java
View file @
d4501847
...
...
@@ -7,7 +7,7 @@ package cn.bsl.bxbg.zhiban.utils;
public
interface
Constant
{
String
HOST
=
"http://zjk.haomo-studio.com/zhangjiakouOA/"
;
String
USER_ID
=
"11"
;
String
USER_NAME
=
"
科员
"
;
String
USER_NAME
=
"
测试1号
"
;
String
BASE_URL
=
"http://haomo-tech.com:8077/hbOA/"
;
// 获取全部人员
String
URL_GET_ALL_PEOPLE1
=
BASE_URL
+
"roleManagerController.do?method=searchDeptTree"
;
...
...
app/src/main/java/cn/bsl/bxbg/zhiban/view/TiaobanDetailsActivity.java
View file @
d4501847
package
cn
.
bsl
.
bxbg
.
zhiban
.
view
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.LinearLayout
;
import
android.widget.RadioButton
;
import
android.widget.RadioGroup
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
java.util.List
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.OnClick
;
import
cn.bsl.bxbg.zhiban.BaseActivity
;
import
cn.bsl.bxbg.zhiban.R
;
import
cn.bsl.bxbg.zhiban.net.client.DutyPlanClient
;
import
cn.bsl.bxbg.zhiban.net.response.CCDutiesEdit
;
import
cn.bsl.bxbg.zhiban.net.response.CCShifts
;
import
cn.bsl.bxbg.zhiban.net.response.CCShiftsUni
;
import
cn.bsl.bxbg.zhiban.net.response.DutiesTbResponse
;
import
cn.bsl.bxbg.zhiban.utils.Constant
;
import
io.reactivex.ObservableSource
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.functions.Consumer
;
import
io.reactivex.functions.Function
;
import
io.reactivex.schedulers.Schedulers
;
public
class
TiaobanDetailsActivity
extends
BaseActivity
{
...
...
@@ -25,8 +38,22 @@ public class TiaobanDetailsActivity extends BaseActivity {
TextView
changePerson
;
@BindView
(
R
.
id
.
reason
)
TextView
reason
;
@BindView
(
R
.
id
.
agree
)
RadioButton
agree
;
@BindView
(
R
.
id
.
disagree
)
RadioButton
disagree
;
@BindView
(
R
.
id
.
submit
)
Button
submit
;
@BindView
(
R
.
id
.
isAgreen
)
LinearLayout
isAgreen
;
@BindView
(
R
.
id
.
rg
)
RadioGroup
rg
;
@BindView
(
R
.
id
.
tv_status
)
TextView
tvStatus
;
private
String
id
;
DutyPlanClient
dutyPlanClient
=
new
DutyPlanClient
();
String
status
=
"1"
;
private
String
ccShift_id
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
@@ -34,6 +61,7 @@ public class TiaobanDetailsActivity extends BaseActivity {
setContentView
(
R
.
layout
.
activity_tiaoban_details
);
ButterKnife
.
bind
(
this
);
initData
();
initView
();
}
private
void
initData
()
{
...
...
@@ -44,6 +72,7 @@ public class TiaobanDetailsActivity extends BaseActivity {
.
subscribe
(
new
Consumer
<
List
<
DutiesTbResponse
>>()
{
@Override
public
void
accept
(
List
<
DutiesTbResponse
>
dutiesTbResponses
)
throws
Exception
{
ccShift_id
=
dutiesTbResponses
.
get
(
0
).
getRefers
().
getCc_shift
().
get
(
0
).
getId
();
String
createTime
=
dutiesTbResponses
.
get
(
0
).
getRefers
().
getCc_shift
().
get
(
0
).
getCreateTime
();
String
dutyDate
=
dutiesTbResponses
.
get
(
0
).
getSuperior
().
getDutyDate
();
String
people
=
" 早:"
+
dutiesTbResponses
.
get
(
0
).
getSuperior
().
getMorning
()
+
"\n 中:"
+
dutiesTbResponses
.
get
(
0
).
getSuperior
().
getNoon
()
+
"\n 晚:"
+
dutiesTbResponses
.
get
(
0
).
getSuperior
().
getEvening
();
...
...
@@ -51,9 +80,100 @@ public class TiaobanDetailsActivity extends BaseActivity {
dutyTimes
.
setText
(
dutyDate
);
person
.
setText
(
people
);
changePerson
.
setText
(
change
);
// simple if 换班人是我判断id 如果被换班是我 直接修改
if
(
dutiesTbResponses
.
get
(
0
).
getRefers
().
getCc_shift
().
get
(
0
).
getTransferredName
().
equals
(
Constant
.
USER_NAME
))
{
if
(
dutiesTbResponses
.
get
(
0
).
getRefers
().
getCc_shift
().
get
(
0
).
getStatus
().
equals
(
"0"
))
{
tvStatus
.
setText
(
"调班状态:等待对方操作"
);
rg
.
setVisibility
(
View
.
GONE
);
submit
.
setVisibility
(
View
.
GONE
);
}
else
if
(
dutiesTbResponses
.
get
(
0
).
getRefers
().
getCc_shift
().
get
(
0
).
getStatus
().
equals
(
"1"
))
{
tvStatus
.
setVisibility
(
View
.
VISIBLE
);
tvStatus
.
setText
(
"调班状态:对方同意了您的申请"
);
rg
.
setVisibility
(
View
.
GONE
);
submit
.
setVisibility
(
View
.
GONE
);
}
else
if
(
dutiesTbResponses
.
get
(
0
).
getRefers
().
getCc_shift
().
get
(
0
).
getStatus
().
equals
(
"2"
))
{
tvStatus
.
setVisibility
(
View
.
VISIBLE
);
tvStatus
.
setText
(
"调班状态:对方不同意您的申请"
);
rg
.
setVisibility
(
View
.
GONE
);
submit
.
setVisibility
(
View
.
GONE
);
}
}
else
if
(
dutiesTbResponses
.
get
(
0
).
getRefers
().
getCc_shift
().
get
(
0
).
getTransferredClass
().
equals
(
Constant
.
USER_NAME
))
{
// 被换班人是我
if
(
dutiesTbResponses
.
get
(
0
).
getRefers
().
getCc_shift
().
get
(
0
).
getStatus
().
equals
(
"0"
))
{
tvStatus
.
setVisibility
(
View
.
GONE
);
}
else
if
(
dutiesTbResponses
.
get
(
0
).
getRefers
().
getCc_shift
().
get
(
0
).
getStatus
().
equals
(
"1"
))
{
tvStatus
.
setVisibility
(
View
.
VISIBLE
);
tvStatus
.
setText
(
"调班状态:您同意了对方申请"
);
rg
.
setVisibility
(
View
.
GONE
);
submit
.
setVisibility
(
View
.
GONE
);
}
else
if
(
dutiesTbResponses
.
get
(
0
).
getRefers
().
getCc_shift
().
get
(
0
).
getStatus
().
equals
(
"2"
))
{
tvStatus
.
setVisibility
(
View
.
VISIBLE
);
tvStatus
.
setText
(
"调班状态:您不同意了对方申请"
);
rg
.
setVisibility
(
View
.
GONE
);
submit
.
setVisibility
(
View
.
GONE
);
}
}
reason
.
setText
(
dutiesTbResponses
.
get
(
0
).
getRefers
().
getCc_shift
().
get
(
0
).
getReason
());
}
},
Throwable:
:
printStackTrace
);
}
private
void
initView
()
{
rg
.
setOnCheckedChangeListener
(
new
RadioGroup
.
OnCheckedChangeListener
()
{
@Override
public
void
onCheckedChanged
(
RadioGroup
radioGroup
,
int
i
)
{
switch
(
radioGroup
.
getId
())
{
case
R
.
id
.
agree
:
// 修改status
// 改值班表
status
=
"1"
;
break
;
case
R
.
id
.
disagree
:
// 修改status
//
status
=
"2"
;
break
;
}
}
});
}
@OnClick
(
R
.
id
.
submit
)
public
void
onViewClicked
()
{
if
(
status
.
equals
(
"1"
))
{
dutyPlanClient
.
ccShiftsEdit
(
ccShift_id
,
status
).
flatMap
(
new
Function
<
CCShifts
,
ObservableSource
<
List
<
CCShiftsUni
>>>()
{
@Override
public
ObservableSource
<
List
<
CCShiftsUni
>>
apply
(
CCShifts
ccShifts
)
throws
Exception
{
return
dutyPlanClient
.
ccshiftUni
(
id
);
}
}).
flatMap
(
new
Function
<
List
<
CCShiftsUni
>,
ObservableSource
<
CCDutiesEdit
>>()
{
@Override
public
ObservableSource
<
CCDutiesEdit
>
apply
(
List
<
CCShiftsUni
>
ccShiftsUnis
)
throws
Exception
{
if
(
ccShiftsUnis
.
get
(
0
).
getSuperior
().
getTransferredClassTime
().
equals
(
"0"
))
{
String
morning
=
ccShiftsUnis
.
get
(
0
).
getIncludes
().
getCc_duty
().
getMorning
();
return
dutyPlanClient
.
editMorning
(
id
,
morning
.
replace
(
Constant
.
USER_NAME
,
ccShiftsUnis
.
get
(
0
).
getSuperior
().
getTransferredClass
()));
}
else
if
(
ccShiftsUnis
.
get
(
0
).
getSuperior
().
getTransferredClassTime
().
equals
(
"1"
))
{
String
noon
=
ccShiftsUnis
.
get
(
0
).
getIncludes
().
getCc_duty
().
getNoon
();
return
dutyPlanClient
.
editNoon
(
id
,
noon
.
replace
(
Constant
.
USER_NAME
,
ccShiftsUnis
.
get
(
0
).
getSuperior
().
getTransferredClass
()));
}
else
{
String
eve
=
ccShiftsUnis
.
get
(
0
).
getIncludes
().
getCc_duty
().
getEvening
();
return
dutyPlanClient
.
editNight
(
id
,
eve
.
replace
(
Constant
.
USER_NAME
,
ccShiftsUnis
.
get
(
0
).
getSuperior
().
getTransferredClass
()));
}
}
}).
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
ccDutiesEdit
->
{
Toast
.
makeText
(
TiaobanDetailsActivity
.
this
,
"操作成功"
,
Toast
.
LENGTH_SHORT
).
show
();
finish
();
},
Throwable:
:
printStackTrace
);
}
else
{
dutyPlanClient
.
ccShiftsEdit
(
id
,
status
).
subscribeOn
(
Schedulers
.
io
()).
observeOn
(
AndroidSchedulers
.
mainThread
()).
subscribe
(
ccShifts
->
{
Toast
.
makeText
(
TiaobanDetailsActivity
.
this
,
"操作成功"
,
Toast
.
LENGTH_SHORT
).
show
();
finish
();
},
Throwable:
:
printStackTrace
);
}
}
}
app/src/main/res/drawable-xhdpi/agreen.png
0 → 100644
View file @
d4501847
442 Bytes
app/src/main/res/drawable-xhdpi/disagreen.png
0 → 100644
View file @
d4501847
449 Bytes
app/src/main/res/layout/activity_tiaoban_details.xml
View file @
d4501847
...
...
@@ -149,4 +149,51 @@
android:textSize=
"16sp"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/isAgreen"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:layout_marginLeft=
"10dp"
android:layout_marginTop=
"20dp"
>
<TextView
android:id=
"@+id/tv_status"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"调班状态:对方还未进行操作"
/>
<RadioGroup
android:id=
"@+id/rg"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<RadioButton
android:id=
"@+id/agree"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:checked=
"true"
android:text=
"同意"
/>
<RadioButton
android:id=
"@+id/disagree"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"不同意"
/>
</RadioGroup>
<Button
android:id=
"@+id/submit"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"10dp"
android:layout_marginTop=
"20dp"
android:text=
"确定"
android:textColor=
"#FFF"
android:background=
"@drawable/sign_button_shape"
/>
</LinearLayout>
</LinearLayout>
app/src/main/res/values/colors.xml
View file @
d4501847
...
...
@@ -2,5 +2,5 @@
<resources>
<color
name=
"colorPrimary"
>
#3F51B5
</color>
<color
name=
"colorPrimaryDark"
>
#303F9F
</color>
<color
name=
"colorAccent"
>
#
FF4081
</color>
<color
name=
"colorAccent"
>
#
00BF8B
</color>
</resources>
gradle/wrapper/gradle-wrapper.properties
View file @
d4501847
#Mon
Mar 05 15:10:20 GMT+08:00
2018
#Mon
Apr 09 20:48:30 CST
2018
distributionBase
=
GRADLE_USER_HOME
distributionPath
=
wrapper/dists
zipStoreBase
=
GRADLE_USER_HOME
zipStorePath
=
wrapper/dists
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-
3.3
-all.zip
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-
4.1
-all.zip
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