Commit ed97effc authored by Xinghaoxiang's avatar Xinghaoxiang

first commit

parents
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.externalNativeBuild
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>
\ No newline at end of file
<component name="CopyrightManager">
<settings default="" />
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MarkdownProjectSettings">
<PreviewSettings splitEditorLayout="SPLIT" splitEditorPreview="PREVIEW" useGrayscaleRendering="false" zoomFactor="1.0" maxImageWidth="0" showGitHubPageIfSynced="false" allowBrowsingInPreview="false" synchronizePreviewPosition="true" highlightPreviewType="NONE" highlightFadeOut="5" highlightOnTyping="true" synchronizeSourcePosition="true" verticallyAlignSourceAndPreviewSyncPosition="true" showSearchHighlightsInPreview="false" showSelectionInPreview="true">
<PanelProvider>
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.panel" providerName="Default - Swing" />
</PanelProvider>
</PreviewSettings>
<ParserSettings gitHubSyntaxChange="false">
<PegdownExtensions>
<option name="ABBREVIATIONS" value="false" />
<option name="ANCHORLINKS" value="true" />
<option name="ASIDE" value="false" />
<option name="ATXHEADERSPACE" value="true" />
<option name="AUTOLINKS" value="true" />
<option name="DEFINITIONS" value="false" />
<option name="DEFINITION_BREAK_DOUBLE_BLANK_LINE" value="false" />
<option name="FENCED_CODE_BLOCKS" value="true" />
<option name="FOOTNOTES" value="false" />
<option name="HARDWRAPS" value="false" />
<option name="HTML_DEEP_PARSER" value="false" />
<option name="INSERTED" value="false" />
<option name="QUOTES" value="false" />
<option name="RELAXEDHRULES" value="true" />
<option name="SMARTS" value="false" />
<option name="STRIKETHROUGH" value="true" />
<option name="SUBSCRIPT" value="false" />
<option name="SUPERSCRIPT" value="false" />
<option name="SUPPRESS_HTML_BLOCKS" value="false" />
<option name="SUPPRESS_INLINE_HTML" value="false" />
<option name="TABLES" value="true" />
<option name="TASKLISTITEMS" value="true" />
<option name="TOC" value="false" />
<option name="WIKILINKS" value="true" />
</PegdownExtensions>
<ParserOptions>
<option name="COMMONMARK_LISTS" value="true" />
<option name="DUMMY" value="false" />
<option name="EMOJI_SHORTCUTS" value="true" />
<option name="FLEXMARK_FRONT_MATTER" value="false" />
<option name="GFM_LOOSE_BLANK_LINE_AFTER_ITEM_PARA" value="false" />
<option name="GFM_TABLE_RENDERING" value="true" />
<option name="GITBOOK_URL_ENCODING" value="false" />
<option name="GITHUB_EMOJI_URL" value="false" />
<option name="GITHUB_LISTS" value="false" />
<option name="GITHUB_WIKI_LINKS" value="true" />
<option name="JEKYLL_FRONT_MATTER" value="false" />
<option name="SIM_TOC_BLANK_LINE_SPACER" value="true" />
</ParserOptions>
</ParserSettings>
<HtmlSettings headerTopEnabled="false" headerBottomEnabled="false" bodyTopEnabled="false" bodyBottomEnabled="false" embedUrlContent="false" addPageHeader="true">
<GeneratorProvider>
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.generator" providerName="Default Swing HTML Generator" />
</GeneratorProvider>
<headerTop />
<headerBottom />
<bodyTop />
<bodyBottom />
</HtmlSettings>
<CssSettings previewScheme="UI_SCHEME" cssUri="" isCssUriEnabled="false" isCssTextEnabled="false" isDynamicPageWidth="true">
<StylesheetProvider>
<provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.css" providerName="Default Swing Stylesheet" />
</StylesheetProvider>
<ScriptProviders />
<cssText />
</CssSettings>
<HtmlExportSettings updateOnSave="false" parentDir="$ProjectFileDir$" targetDir="$ProjectFileDir$" cssDir="" scriptDir="" plainHtml="false" imageDir="" copyLinkedImages="false" imageUniquifyType="0" targetExt="" useTargetExt="false" noCssNoScripts="false" linkToExportedHtml="true" exportOnSettingsChange="true" regenerateOnProjectOpen="false" />
<LinkMapSettings>
<textMaps />
</LinkMapSettings>
</component>
</project>
\ No newline at end of file
<component name="MarkdownNavigator.ProfileManager">
<settings default="" pdf-export="" />
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
</list>
</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">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
<component name="masterDetails">
<states>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.3104435" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Zhiban.iml" filepath="$PROJECT_DIR$/Zhiban.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
## 值班管理
\ No newline at end of file
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "cn.bsl.bxbg.zhiban"
minSdkVersion 22
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
jackOptions {
enabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.jakewharton:butterknife:8.8.1'
compile 'com.squareup.okhttp3:okhttp:3.10.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.10.0'
compile 'com.google.code.gson:gson:2.8.2'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'io.reactivex.rxjava2:rxjava:2.1.0'
compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
compile 'io.reactivex.rxjava2:rxandroid:2.0.2'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in D:\android-sdk-eclipse\android-sdk-windows/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
package cn.bsl.bxbg.zhiban;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("cn.bsl.bxbg.zhiban", appContext.getPackageName());
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="cn.bsl.bxbg.zhiban">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".view.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<!--<category android:name="android.intent.category.LAUNCHER" />-->
</intent-filter>
</activity>
<activity
android:name=".view.ZhibanInfoActivity"
android:label="值班信息" />
<activity
android:name=".view.ZhibanTableActivity"
android:label="值班表" />
<activity
android:name=".view.TiaobanRecordActivity"
android:label="调班记录" />
<activity
android:name=".view.ZhibanDetailsActivity"
android:label="值班详情" />
<activity
android:name=".view.TiaobanDetailsActivity"
android:label="调班记录详情" />
<activity
android:name=".view.TiaoBanPublish"
android:label="调班申请" />
<activity android:name=".view.DutyChangePeopleActivity"
android:label="变更人选择"
/>
</application>
</manifest>
\ No newline at end of file
package cn.bsl.bxbg.zhiban;
import android.os.Bundle;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* Created by Xinghx on 2018/3/5 0005.
*/
public class BaseActivity extends AppCompatActivity{
@Nullable
@BindView(R.id.title)
TextView title;
@Nullable
@BindView(R.id.back)
ImageView back;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public void setContentView(@LayoutRes int layoutResID) {
super.setContentView(layoutResID);
ButterKnife.bind(this);
initTitle();
initBack();
}
private void initTitle() {
if (title != null) {
title.setText(getTitle());
}
}
private void initBack() {
if (back != null) {
back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}
}
}
package cn.bsl.bxbg.zhiban.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import cn.bsl.bxbg.zhiban.R;
import cn.bsl.bxbg.zhiban.bean.AllPersonBean;
/**
* Created by Xinghx on 2018/3/20 0020.
*/
public class DutyChangePeopleAdapter extends BaseAdapter {
private List<AllPersonBean> allPersonBeen;
public DutyChangePeopleAdapter(List<AllPersonBean> allPersonBeen) {
this.allPersonBeen = allPersonBeen;
}
@Override
public int getCount() {
return allPersonBeen.size();
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder = null;
if (convertView == null) {
convertView = LayoutInflater.from(parent.getContext())
.inflate(R.layout.item_duty_people, parent, false);
viewHolder = new ViewHolder(convertView);
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
viewHolder.username.setText(allPersonBeen.get(position).getUserName());
return convertView;
}
static class ViewHolder {
@BindView(R.id.username)
TextView username;
ViewHolder(View view) {
ButterKnife.bind(this, view);
}
}
}
package cn.bsl.bxbg.zhiban.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.List;
import cn.bsl.bxbg.zhiban.R;
import cn.bsl.bxbg.zhiban.bean.MenuBean;
/**
* Created by Xinghx on 2018/2/5 0005.
*/
public class HomeAdapter extends BaseAdapter {
private List<MenuBean> menuBeen;
public HomeAdapter(List<MenuBean> menuBeen) {
this.menuBeen = menuBeen;
}
@Override
public int getCount() {
return menuBeen.size();
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
convertView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_home_adapter, parent, false);
ImageView iv = (ImageView) convertView.findViewById(R.id.iv_title);
TextView tv = (TextView) convertView.findViewById(R.id.tv_title);
iv.setImageResource(menuBeen.get(position).getResId());
tv.setText(menuBeen.get(position).getLabelTitle());
return convertView;
}
}
package cn.bsl.bxbg.zhiban.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import cn.bsl.bxbg.zhiban.R;
import cn.bsl.bxbg.zhiban.net.response.CCShifts;
/**
* Created by Xinghx on 2018/3/6 0006.
*/
public class TiaobanInfoAdapter extends BaseAdapter {
private List<CCShifts> ccShiftses;
public TiaobanInfoAdapter(List<CCShifts> ccShiftses) {
this.ccShiftses = ccShiftses;
}
@Override
public int getCount() {
return ccShiftses.size();
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
if (convertView == null) {
convertView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_tiaoban_info, parent, false);
holder = new ViewHolder(convertView);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.tbName.setText(ccShiftses.get(position).getApplicant());
holder.tbTime.setText(ccShiftses.get(position).getShiftTime());
return convertView;
}
static class ViewHolder {
@BindView(R.id.tb_title)
TextView tbTitle;
@BindView(R.id.tb_name)
TextView tbName;
@BindView(R.id.tb_time)
TextView tbTime;
ViewHolder(View view) {
ButterKnife.bind(this, view);
}
}
}
package cn.bsl.bxbg.zhiban.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import cn.bsl.bxbg.zhiban.R;
import cn.bsl.bxbg.zhiban.net.response.CCDuties;
/**
* Created by Xinghx on 2018/3/19 0019.
*/
public class ZbPeopleAdapter extends BaseAdapter {
private List<CCDuties> ccDuties;
public ZbPeopleAdapter(List<CCDuties> ccDuties) {
this.ccDuties = ccDuties;
}
@Override
public int getCount() {
return ccDuties.size();
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder = null;
if (convertView == null) {
convertView = LayoutInflater.from(parent.getContext())
.inflate(R.layout.item_zb_people, parent, false);
viewHolder = new ViewHolder(convertView);
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
viewHolder.zbLeaderName.setText(ccDuties.get(position).getClassLeaders());
viewHolder.zbZaoName.setText(ccDuties.get(position).getMorning());
viewHolder.zbZhongName.setText(ccDuties.get(position).getNoon());
viewHolder.zbWanName.setText(ccDuties.get(position).getEvening());
return convertView;
}
static class ViewHolder {
@BindView(R.id.zb_leader_name)
TextView zbLeaderName;
@BindView(R.id.zb_zao_name)
TextView zbZaoName;
@BindView(R.id.zb_zhong_name)
TextView zbZhongName;
@BindView(R.id.zb_wan_name)
TextView zbWanName;
ViewHolder(View view) {
ButterKnife.bind(this, view);
}
}
}
package cn.bsl.bxbg.zhiban.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import cn.bsl.bxbg.zhiban.R;
import cn.bsl.bxbg.zhiban.bean.DutyPlanDutiesBean;
/**
* Created by Xinghx on 2018/3/6 0006.
*/
public class ZhibanInfoAdapter extends BaseAdapter {
List<DutyPlanDutiesBean> dutyPlanResponses;
public ZhibanInfoAdapter(List<DutyPlanDutiesBean> dutyPlanResponses) {
this.dutyPlanResponses = dutyPlanResponses;
}
@Override
public int getCount() {
return dutyPlanResponses.size();
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
if (convertView == null) {
convertView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_zhiban_info, parent,false);
holder = new ViewHolder(convertView);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.zbName.setText(dutyPlanResponses.get(position).getLeader());
holder.zbTime.setText(dutyPlanResponses.get(position).getDutyDate());
return convertView;
}
class ViewHolder {
@BindView(R.id.zb_title)
TextView zbTitle;
@BindView(R.id.zb_name)
TextView zbName;
@BindView(R.id.zb_time)
TextView zbTime;
ViewHolder(View view) {
ButterKnife.bind(this, view);
}
}
}
package cn.bsl.bxbg.zhiban.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import cn.bsl.bxbg.zhiban.R;
import cn.bsl.bxbg.zhiban.bean.DutyPlanDutiesBean;
/**
* Created by Xinghx on 2018/3/6 0006.
*/
public class ZhibanTableAdapter extends BaseAdapter {
private List<DutyPlanDutiesBean> testBeen;
public ZhibanTableAdapter(List<DutyPlanDutiesBean> testBeen) {
this.testBeen = testBeen;
}
@Override
public int getCount() {
return testBeen.size();
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder = null;
if (viewHolder == null) {
convertView = LayoutInflater.from(parent.getContext())
.inflate(R.layout.item_zhiban_table, parent, false);
viewHolder = new ViewHolder(convertView);
convertView.setTag(convertView);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
viewHolder.zbTableLeader.setText(testBeen.get(position).getDutyDate() + "\n 带班领导:" +testBeen.get(position).getLeader());
// viewHolder.zbTableLeader.setText("\n2018-01-01" + "\n\n带班领导:" + testBeen.get(position).getLeader() + "\n");
viewHolder.zao.setText(testBeen.get(position).getMorning());
viewHolder.zhong.setText(testBeen.get(position).getNoon());
viewHolder.wan.setText(testBeen.get(position).getEvening());
// String[] split = testBeen.get(position).getTime().split(",");
// String time = "";
// for (int i = 0; i < split.length; i++) {
// if (i != split.length - 1) {
// time += split[i] + "\n\n";
// } else {
// time += split[i];
// }
// }
// String[] personSplit = testBeen.get(position).getPerson().split(",");
// String person = "";
// for (int i = 0; i < personSplit.length; i++) {
// if (i != personSplit.length - 1) {
// person += personSplit[i] + "\n\n";
// } else {
// person += personSplit[i];
// }
// }
return convertView;
}
static class ViewHolder {
@BindView(R.id.zb_table_leader)
TextView zbTableLeader;
@BindView(R.id.zao)
TextView zao;
@BindView(R.id.zhong)
TextView zhong;
@BindView(R.id.wan)
TextView wan;
ViewHolder(View view) {
ButterKnife.bind(this, view);
}
}
}
package cn.bsl.bxbg.zhiban.bean;
import android.support.annotation.NonNull;
import cn.bsl.bxbg.zhiban.utils.PinYin;
/**
* Created by Xinghx on 2018/3/20 0020.
*/
public class AllPersonBean implements Comparable<AllPersonBean>{
private String userId;
private String userName;
private String namePy;
public String getNamePy() {
return namePy;
}
public AllPersonBean(String userId, String userName) {
this.userId = userId;
this.userName = userName;
this.namePy = PinYin.getPinYin(userName);
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
@Override
public int compareTo(@NonNull AllPersonBean o) {
return this.getNamePy().compareTo(o.getNamePy());
}
}
package cn.bsl.bxbg.zhiban.bean;
/**
* Created by Xinghx on 2018/3/14 0014.
*/
public class DutyPlanDutiesBean {
private String planId;
private String dutyId;
private String year;
private String month;
private String morning;
private String noon;
private String evening;
private String leader;
private String dutyDate;
public String getPlanId() {
return planId;
}
public void setPlanId(String planId) {
this.planId = planId;
}
public String getDutyId() {
return dutyId;
}
public void setDutyId(String dutyId) {
this.dutyId = dutyId;
}
public String getYear() {
return year;
}
public void setYear(String year) {
this.year = year;
}
public String getMonth() {
return month;
}
public void setMonth(String month) {
this.month = month;
}
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;
}
public String getLeader() {
return leader;
}
public void setLeader(String leader) {
this.leader = leader;
}
public String getDutyDate() {
return dutyDate;
}
public void setDutyDate(String dutyDate) {
this.dutyDate = dutyDate;
}
@Override
public String toString() {
return "DutyPlanDutiesBean{" +
"planId='" + planId + '\'' +
", dutyId='" + dutyId + '\'' +
", year='" + year + '\'' +
", month='" + month + '\'' +
", morning='" + morning + '\'' +
", noon='" + noon + '\'' +
", evening='" + evening + '\'' +
", leader='" + leader + '\'' +
", dutyDate='" + dutyDate + '\'' +
'}';
}
}
package cn.bsl.bxbg.zhiban.bean;
/**
* Created by Xinghx on 2018/2/5 0005.
*/
public class MenuBean {
private int resId;
private String labelTitle;
public MenuBean(int resId, String labelTitle) {
this.resId = resId;
this.labelTitle = labelTitle;
}
public int getResId() {
return resId;
}
public void setResId(int resId) {
this.resId = resId;
}
public String getLabelTitle() {
return labelTitle;
}
public void setLabelTitle(String labelTitle) {
this.labelTitle = labelTitle;
}
}
package cn.bsl.bxbg.zhiban.bean;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Xinghx on 2018/3/6 0006.
*/
public class TestBean {
private String leader;
private String time;
private String person;
public TestBean(String leader, String time, String person) {
this.leader = leader;
this.time = time;
this.person = person;
}
public String getLeader() {
return leader;
}
public void setLeader(String leader) {
this.leader = leader;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getPerson() {
return person;
}
public void setPerson(String person) {
this.person = person;
}
public static List<TestBean> testBeen() {
List<TestBean> testBeen = new ArrayList<>();
TestBean testBean = new TestBean("赵云峰","08:30-12:00,12:00-18:30","李亮 董春梅,李亮 董春梅");
TestBean tb1 = new TestBean("赵云峰","08:30-12:00,12:00-18:30,18:30-08:30","李亮 董春梅");
testBeen.add(testBean);
testBeen.add(tb1);
testBeen.add(testBean);
testBeen.add(tb1);
testBeen.add(testBean);
testBeen.add(tb1);
testBeen.add(testBean);
testBeen.add(tb1);
testBeen.add(testBean);
testBeen.add(testBean);
testBeen.add(testBean);
testBeen.add(tb1);
testBeen.add(testBean);
testBeen.add(tb1);
testBeen.add(tb1);
testBeen.add(tb1);
testBeen.add(testBean);
return testBeen;
}
}
package cn.bsl.bxbg.zhiban.bean;
import java.util.List;
/**
* Created by Xinghx on 2018/3/19 0019.
*/
public class TreeChildren {
private String id;
private String text;
private String state;
private List<TreeChildren> children;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public List<TreeChildren> getChildren() {
return children;
}
public void setChildren(List<TreeChildren> children) {
this.children = children;
}
@Override
public String toString() {
return "TreeChildren{" +
"id='" + id + '\'' +
", text='" + text + '\'' +
", state='" + state + '\'' +
", children=" + children +
'}';
}
}
package cn.bsl.bxbg.zhiban.net.api;
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.DutiesTbResponse;
import cn.bsl.bxbg.zhiban.net.response.DutyPlanResponse;
import cn.bsl.bxbg.zhiban.net.response.TiaobanBean;
import io.reactivex.Observable;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;
/**
* Created by Xinghx on 2018/3/14 0014.
*/
public interface DutyAPI {
@GET("cc_duty_plans")
Observable<List<DutyPlanResponse>> dutyPlanLeader(@Query("pageNo") String pageNo,
@Query("pageSize") String pageSize);
@GET("cc_duties")
Observable<List<CCDuties>> dutiesRecord(@Query("pageNo") String pageNo,
@Query("pageSize") String pageSize,
@Query("sortItem") String filters);
@GET("cc_duties/{id}")
Observable<CCDuties> dutiesById(@Header("X-Auth-Token") String header,
@Path("id") String id);
@FormUrlEncoded
@POST("roleManagerController.do")
Call<ResponseBody> people(@Field("method") String method, @Field("userId") String userId);
@FormUrlEncoded
@POST("cc_shifts/new")
Observable<TiaobanBean> tbRecord(@Header("X-Auth-Token") String header,
@Field("applicantId") String applicantId,
@Field("applicant") String applicant,
@Field("transferredName") String transferredName,
@Field("applicantDutyId") String applicantDutyId,
@Field("reason") String reason,
@Field("shiftTime") String shiftTime);
@FormUrlEncoded
@POST("cc_duties/{id}/edit")
Observable<CCDutiesEdit> editMorning(@Header("X-Auth-Token") String header,
@Path("id") String cc_duty_id,
@Field("morning") String morning);
@FormUrlEncoded
@POST("cc_duties/{id}/edit")
Observable<CCDutiesEdit> editNoon(@Header("X-Auth-Token") String header,
@Path("id") String cc_duty_id,
@Field("noon") String noon);
@FormUrlEncoded
@POST("cc_duties/{id}/edit")
Observable<CCDutiesEdit> editNight(@Header("X-Auth-Token") String header,
@Path("id") String cc_duty_id,
@Field("night") String night);
@GET("cc_duties")
Observable<List<DutiesTbResponse>> dutiesTb(@Query("pageNo") String pageNo,
@Query("pageSize") String pageSize,
@Query("refers") String refers);
@GET("cc_duties")
Observable<List<DutiesTbResponse>> dutiesTbDetails(@Query("pageNo") String pageNo,
@Query("pageSize") String pageSize,
@Query("filters") String filters,
@Query("refers") String refers);
@GET("cc_shifts")
Call<List<CCShifts>> ccShifts(@Query("pageNo") String pageNo,
@Query("pageSize") String pageSize,
@Query("filters") String filters);
}
package cn.bsl.bxbg.zhiban.net.client;
import cn.bsl.bxbg.zhiban.net.api.DutyAPI;
import cn.bsl.bxbg.zhiban.utils.Constant;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
/**
* Created by Xinghx on 2018/3/19 0019.
*/
public class AllPeopleClient extends BaseClient {
DutyAPI dutyAPI = new Retrofit.Builder()
.baseUrl(Constant.BASE_URL)
.client(getClient())
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.addConverterFactory(GsonConverterFactory.create())
.build()
.create(DutyAPI.class);
public Call<ResponseBody> stringCall() {
return dutyAPI.people("searchDeptTree","11");
}
}
package cn.bsl.bxbg.zhiban.net.client;
import java.util.concurrent.TimeUnit;
import cn.bsl.bxbg.zhiban.BuildConfig;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
/**
* Created by Xinghx on 2018/3/2
*/
public class BaseClient {
public OkHttpClient getClient() {
HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
loggingInterceptor.setLevel(BuildConfig.DEBUG ?
HttpLoggingInterceptor.Level.BODY : HttpLoggingInterceptor.Level.NONE);
return new OkHttpClient.Builder()
.addInterceptor(loggingInterceptor)
.connectTimeout(30000, TimeUnit.MILLISECONDS)
.writeTimeout(30000, TimeUnit.MILLISECONDS)
.readTimeout(30000, TimeUnit.MILLISECONDS)
.build();
}
}
package cn.bsl.bxbg.zhiban.net.client;
import java.util.List;
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.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 retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
/**
* Created by Xinghx on 2018/3/14 0014.
*/
public class DutyPlanClient extends BaseClient {
DutyAPI dutyAPI = new Retrofit.Builder()
.baseUrl(Constant.HOST)
.client(getClient())
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.addConverterFactory(GsonConverterFactory.create())
.build()
.create(DutyAPI.class);
public Observable<List<DutyPlanResponse>> dutyPlanLeaderRecord() {
return dutyAPI.dutyPlanLeader("1","100");
}
public Observable<List<CCDuties>> dutiesRecord() {
return dutyAPI.dutiesRecord("1", "100","duty_date");
}
public Observable<CCDuties> dutiesById(String id) {
return dutyAPI.dutiesById(Constant.USER_ID+"",id);
}
public Observable<TiaobanBean> tiaobanBean(String transferredName,String id,String reason,String dutyTime) {
return dutyAPI.tbRecord(Constant.USER_ID,Constant.USER_ID,Constant.USER_NAME,
transferredName,id,reason,dutyTime);
}
public Observable<CCDutiesEdit> editMorning(String cc_id,String morning) {
return dutyAPI.editMorning(Constant.USER_ID, cc_id, morning);
}
public Observable<CCDutiesEdit> editNoon(String cc_id,String noon) {
return dutyAPI.editNoon(Constant.USER_ID, cc_id, noon);
}
public Observable<CCDutiesEdit> editNight(String cc_id,String night) {
return dutyAPI.editNight(Constant.USER_ID, cc_id, night);
}
public Observable<List<DutiesTbResponse>> dutiesTb() {
return dutyAPI.dutiesTb("1", "1000", "{'cc_shift':{'includes':['applicant_duty_id']}}");
}
public Observable<List<DutiesTbResponse>> dutiesTbDetails(String id) {
return dutyAPI.dutiesTbDetails("1", "1000","{'cc_duty':{'id':{'like':'"+id+"'}}}","{'cc_shift':{'includes':['applicant_duty_id']}}");
}
public Call<List<CCShifts>> shiftsRecord() {
return dutyAPI.ccShifts("1","1000","{'cc_shift':{'applicant':{'equalTo':'"+Constant.USER_NAME+"'}}}");
}
}
package cn.bsl.bxbg.zhiban.net.response;
/**
* Created by Xinghx on 2018/3/14 0014.
*/
public class CCDuties {
/**
* id : 4393fd967ef84e938271846882895dd1
* classLeadersId : 12
* classLeaders : 部门负责人
* department : App技术支持
* postLeaders : 部门负责人
* morning : 李亮,董春梅
* noon : 董春梅,李亮
* evening : 李亮,董春梅
* watchPeople : null
* type : null
* dutyDate : null
* endTime : null
* startTime : null
* createTime : 2018-03-18 16:12:01
* lastUpdateTime : 2018-03-18 16:12:01
* 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;
private String morning;
private String noon;
private String evening;
private Object watchPeople;
private Object type;
private String dutyDate;
private Object endTime;
private Object startTime;
private String createTime;
private String lastUpdateTime;
private String onDutyPlanId;
private Object dutyStage;
private Object postDuty;
private Object remark;
private Object numberDays;
private Object holiday;
private Object holidayName;
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 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;
}
public Object getWatchPeople() {
return watchPeople;
}
public void setWatchPeople(Object watchPeople) {
this.watchPeople = watchPeople;
}
public Object getType() {
return type;
}
public void setType(Object type) {
this.type = type;
}
public String getDutyDate() {
return dutyDate;
}
public void setDutyDate(String dutyDate) {
this.dutyDate = dutyDate;
}
public Object getEndTime() {
return endTime;
}
public void setEndTime(Object endTime) {
this.endTime = endTime;
}
public Object getStartTime() {
return startTime;
}
public void setStartTime(Object startTime) {
this.startTime = startTime;
}
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 String getOnDutyPlanId() {
return onDutyPlanId;
}
public void setOnDutyPlanId(String onDutyPlanId) {
this.onDutyPlanId = onDutyPlanId;
}
public Object getDutyStage() {
return dutyStage;
}
public void setDutyStage(Object dutyStage) {
this.dutyStage = dutyStage;
}
public Object getPostDuty() {
return postDuty;
}
public void setPostDuty(Object postDuty) {
this.postDuty = postDuty;
}
public Object getRemark() {
return remark;
}
public void setRemark(Object remark) {
this.remark = remark;
}
public Object getNumberDays() {
return numberDays;
}
public void setNumberDays(Object numberDays) {
this.numberDays = numberDays;
}
public Object getHoliday() {
return holiday;
}
public void setHoliday(Object holiday) {
this.holiday = holiday;
}
public Object getHolidayName() {
return holidayName;
}
public void setHolidayName(Object holidayName) {
this.holidayName = holidayName;
}
}
package cn.bsl.bxbg.zhiban.net.response;
/**
* Created by Xinghx on 2018/3/20 0020.
*/
public class CCDutiesEdit {
/**
* id : 4393fd967ef84e938271846882895dd1
* classLeadersId : 12
* classLeaders : 部门负责人
* department : App技术支持
* postLeaders : 部门负责人
* morning : 李亮,科员
* noon : 董春梅,李亮
* evening : 李亮,董春梅
* watchPeople : null
* type : null
* dutyDate : 2018-03-01
* endTime : null
* startTime : null
* createTime : 2018-03-18 16:12:01
* lastUpdateTime : 2018-03-20 15:06:18
* 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;
private String morning;
private String noon;
private String evening;
private Object watchPeople;
private Object type;
private String dutyDate;
private Object endTime;
private Object startTime;
private String createTime;
private String lastUpdateTime;
private String onDutyPlanId;
private Object dutyStage;
private Object postDuty;
private Object remark;
private Object numberDays;
private Object holiday;
private Object holidayName;
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 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;
}
public Object getWatchPeople() {
return watchPeople;
}
public void setWatchPeople(Object watchPeople) {
this.watchPeople = watchPeople;
}
public Object getType() {
return type;
}
public void setType(Object type) {
this.type = type;
}
public String getDutyDate() {
return dutyDate;
}
public void setDutyDate(String dutyDate) {
this.dutyDate = dutyDate;
}
public Object getEndTime() {
return endTime;
}
public void setEndTime(Object endTime) {
this.endTime = endTime;
}
public Object getStartTime() {
return startTime;
}
public void setStartTime(Object startTime) {
this.startTime = startTime;
}
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 String getOnDutyPlanId() {
return onDutyPlanId;
}
public void setOnDutyPlanId(String onDutyPlanId) {
this.onDutyPlanId = onDutyPlanId;
}
public Object getDutyStage() {
return dutyStage;
}
public void setDutyStage(Object dutyStage) {
this.dutyStage = dutyStage;
}
public Object getPostDuty() {
return postDuty;
}
public void setPostDuty(Object postDuty) {
this.postDuty = postDuty;
}
public Object getRemark() {
return remark;
}
public void setRemark(Object remark) {
this.remark = remark;
}
public Object getNumberDays() {
return numberDays;
}
public void setNumberDays(Object numberDays) {
this.numberDays = numberDays;
}
public Object getHoliday() {
return holiday;
}
public void setHoliday(Object holiday) {
this.holiday = holiday;
}
public Object getHolidayName() {
return holidayName;
}
public void setHolidayName(Object holidayName) {
this.holidayName = holidayName;
}
}
package cn.bsl.bxbg.zhiban.net.response;
/**
* Created by Xinghx on 2018/3/20 0020.
*/
public class CCShifts {
/**
* id : 6d151791912c44b78a317972c3073479
* applicantId : 11
* applicant : 科员
* transferredName : 测试0
* transferredClass : null
* shiftTime : null
* applicantDutyId : 4393fd967ef84e938271846882895dd1
* transferredClassTime : null
* transferredClassDutyId : null
* status : null
* reason : 测试
* applicationTime : null
* createTime : 2018-03-20 15:20:53
* lastUpdateTime : 2018-03-20 15:20:53
* leaderId : null
* applicantPosition : null
*/
private String id;
private String applicantId;
private String applicant;
private String transferredName;
private Object transferredClass;
private String shiftTime;
private String applicantDutyId;
private Object transferredClassTime;
private Object transferredClassDutyId;
private Object status;
private String reason;
private String applicationTime;
private String createTime;
private String lastUpdateTime;
private Object leaderId;
private Object applicantPosition;
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 Object getTransferredClass() {
return transferredClass;
}
public void setTransferredClass(Object 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 Object getStatus() {
return status;
}
public void setStatus(Object status) {
this.status = status;
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public String getApplicationTime() {
return applicationTime;
}
public void setApplicationTime(String 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;
}
}
package cn.bsl.bxbg.zhiban.net.response;
/**
* Created by Xinghx on 2018/3/14 0014.
*/
public class DutyPlanResponse {
/**
* id : 3a157900491f41d6b1bab142e46038e1
* name : 值班3月计划
* createTime : 2018-03-18 16:09:47
* lastUpdateTime : 2018-03-18 16:09:47
* dutyType : 1
* whatYear : 2018
* whatMonth : 3
*/
private String id;
private String name;
private String createTime;
private String lastUpdateTime;
private String dutyType;
private String whatYear;
private String whatMonth;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
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 String getDutyType() {
return dutyType;
}
public void setDutyType(String dutyType) {
this.dutyType = dutyType;
}
public String getWhatYear() {
return whatYear;
}
public void setWhatYear(String whatYear) {
this.whatYear = whatYear;
}
public String getWhatMonth() {
return whatMonth;
}
public void setWhatMonth(String whatMonth) {
this.whatMonth = whatMonth;
}
}
package cn.bsl.bxbg.zhiban.net.response;
/**
* Created by Xinghx on 2018/3/20 0020.
*/
public class TiaobanBean {
/**
* id : c7d835a8fb234268b8bb101a5f186b74
* applicantId :
* applicant :
* transferredName :
* transferredClass :
* shiftTime :
* applicantDutyId :
* transferredClassTime :
* transferredClassDutyId :
* status :
* reason :
* applicationTime :
* createTime : 2018-03-20 14:43:10
* lastUpdateTime : 2018-03-20 14:43:10
* leaderId :
* applicantPosition :
*/
private String id;
private String applicantId;
private String applicant;
private String transferredName;
private String transferredClass;
private String shiftTime;
private String applicantDutyId;
private String transferredClassTime;
private String transferredClassDutyId;
private String status;
private String reason;
private String applicationTime;
private String createTime;
private String lastUpdateTime;
private String leaderId;
private String applicantPosition;
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 String getTransferredClassTime() {
return transferredClassTime;
}
public void setTransferredClassTime(String transferredClassTime) {
this.transferredClassTime = transferredClassTime;
}
public String getTransferredClassDutyId() {
return transferredClassDutyId;
}
public void setTransferredClassDutyId(String 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 String getApplicationTime() {
return applicationTime;
}
public void setApplicationTime(String 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 String getLeaderId() {
return leaderId;
}
public void setLeaderId(String leaderId) {
this.leaderId = leaderId;
}
public String getApplicantPosition() {
return applicantPosition;
}
public void setApplicantPosition(String applicantPosition) {
this.applicantPosition = applicantPosition;
}
}
package cn.bsl.bxbg.zhiban.utils;
/**
* Created by Xinghx on 2018/3/14 0014.
*/
public interface Constant {
String HOST = "http://zjk.haomo-studio.com/zhangjiakouOA/";
String USER_ID = "12";
String USER_NAME = "部门负责人";
String BASE_URL="http://haomo-tech.com:8077/hbOA/";
// 获取全部人员
String URL_GET_ALL_PEOPLE1 = BASE_URL + "roleManagerController.do?method=searchDeptTree";
}
This diff is collapsed.
package cn.bsl.bxbg.zhiban.utils;
import java.util.ArrayList;
import java.util.Locale;
/**
* Created by Xinghx on 2018/3/20 0020.
*/
public class PinYin {
// 汉字返回拼音,字母原样返回,都转换为小写
public static String getPinYin(String input) {
ArrayList<HanziToPinyin.Token> tokens = HanziToPinyin.getInstance().get(input);
StringBuilder sb = new StringBuilder();
if (tokens != null && tokens.size() > 0) {
for (HanziToPinyin.Token token : tokens) {
if (HanziToPinyin.Token.PINYIN == token.type) {
sb.append(token.target);
} else {
sb.append(token.source);
}
}
}
return sb.toString().toLowerCase(Locale.US);
}
}
package cn.bsl.bxbg.zhiban.utils;
import java.util.regex.Pattern;
/**
* Created by Administrator on 2017/8/7 0007.
*/
public class StringUtil {
/*
* 判断是否为整数
* @param str 传入的字符串
* @return 是整数返回true,否则返回false
*/
public static boolean isInteger(String str) {
Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
return pattern.matcher(str).matches();
}
}
/*
* Copyright 2016 - 2017 ShineM (Xinyuan)
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
* ANY KIND, either express or implied. See the License for the specific language governing
* permissions and limitations under.
*/
package cn.bsl.bxbg.zhiban.utils;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* Created by xinyuanzhong on 2017/4/20.
*/
public class TreeNode implements Serializable {
private int level;
private String userId;
private boolean isPerson;
private Object value;
private TreeNode parent;
private List<TreeNode> children;
private int index;
private boolean expanded;
private boolean selected;
private boolean itemClickEnable = true;
public TreeNode(Object value) {
this.value = value;
this.children = new ArrayList<>();
}
public TreeNode(Object value, String id) {
this.value = value;
this.userId = id;
this.children = new ArrayList<>();
this.isPerson = StringUtil.isInteger(id);
}
public static TreeNode root() {
TreeNode treeNode = new TreeNode(null);
return treeNode;
}
public void addChild(TreeNode treeNode) {
if (treeNode == null) {
return;
}
children.add(treeNode);
treeNode.setIndex(getChildren().size());
treeNode.setParent(this);
}
public void removeChild(TreeNode treeNode) {
if (treeNode == null || getChildren().size() < 1) {
return;
}
if (getChildren().indexOf(treeNode) != -1) {
getChildren().remove(treeNode);
}
}
public boolean isLastChild() {
if (parent == null) {
return false;
}
List<TreeNode> children = parent.getChildren();
return children.size() > 0 && children.indexOf(this) == children.size() - 1;
}
public boolean isRoot() {
return parent == null;
}
public int getLevel() {
return level;
}
public void setLevel(int level) {
this.level = level;
}
public Object getValue() {
return value;
}
public void setValue(Object value) {
this.value = value;
}
public TreeNode getParent() {
return parent;
}
public void setParent(TreeNode parent) {
this.parent = parent;
}
public List<TreeNode> getChildren() {
if (children == null) {
return new ArrayList<>();
}
return children;
}
public void setChildren(List<TreeNode> children) {
this.children = children;
}
public void setExpanded(boolean expanded) {
this.expanded = expanded;
}
public boolean isExpanded() {
return expanded;
}
public boolean hasChild() {
return children.size() > 0;
}
public boolean isItemClickEnable() {
return itemClickEnable;
}
public void setItemClickEnable(boolean itemClickEnable) {
this.itemClickEnable = itemClickEnable;
}
public String getId() {
return getLevel() + "," + getIndex();
}
private int getIndex() {
return index;
}
public void setIndex(int index) {
this.index = index;
}
public boolean isSelected() {
return selected;
}
public void setSelected(boolean selected) {
this.selected = selected;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public boolean isPerson() {
return isPerson;
}
public void setPerson(boolean person) {
isPerson = person;
}
}
package cn.bsl.bxbg.zhiban.utils;
import java.util.ArrayList;
import java.util.List;
import cn.bsl.bxbg.zhiban.bean.TreeChildren;
/**
* Created by Administrator on 2017/8/14 0014.
*/
public class TreeNodeHelper {
public static TreeNode buildTree(TreeNode root, List<TreeChildren> list) {
root.getChildren().clear();
for (int i = 0; i < list.size(); i++) {
TreeNode treeNode = new TreeNode(new String(list.get(i).getText()), list.get(i).getId());
treeNode.setLevel(0);
if (list.get(i).getChildren() != null && list.get(i).getChildren().size() > 0) {
for (int j = 0; j < list.get(i).getChildren().size(); j++) {
TreeNode treeNode1 = new TreeNode(new String(list.get(i).getChildren().get(j).getText()), list.get(i).getChildren().get(j).getId());
treeNode1.setLevel(1);
if (list.get(i).getChildren().get(j).getChildren() != null && list.get(i).getChildren().get(j).getChildren().size() > 0) {
for (int k = 0; k < list.get(i).getChildren().get(j).getChildren().size(); k++) {
TreeNode treeNode2 = new TreeNode(new String(list.get(i).getChildren().get(j).getChildren().get(k).getText()), list.get(i).getChildren().get(j).getChildren().get(k).getId());
treeNode2.setLevel(2);
if (list.get(i).getChildren().get(j).getChildren().get(k).getChildren() != null && list.get(i).getChildren().get(j).getChildren().get(k).getChildren().size() > 0) {
for (int l = 0; l < list.get(i).getChildren().get(j).getChildren().get(k).getChildren().size(); l++) {
TreeNode treeNode3 = new TreeNode(new String(list.get(i).getChildren().get(j).getChildren().get(k).getChildren().get(l).getText()), list.get(i).getChildren().get(j).getChildren().get(k).getChildren().get(l).getId());
treeNode3.setLevel(3);
treeNode2.addChild(treeNode3);
}
}
treeNode1.addChild(treeNode2);
}
}
treeNode.addChild(treeNode1);
}
}
root.addChild(treeNode);
}
return root;
}
public static TreeNode getSelectTreeNode(TreeNode root) {
for (int i = root.getChildren().size() - 1; i >= 0; i--) {
for (int j = root.getChildren().get(i).getChildren().size() - 1; j >= 0; j--) {
for (int k = root.getChildren().get(i).getChildren().get(j).getChildren().size() - 1; k >= 0; k--) {
for (int l = root.getChildren().get(i).getChildren().get(j).getChildren().get(k).getChildren().size() - 1; l >= 0; l--) {
if ((root.getChildren().get(i).getChildren().get(j).getChildren().get(k).getChildren().get(l).isPerson() && !root.getChildren().get(i).getChildren().get(j).getChildren().get(k).getChildren().get(l).isSelected()) || (!root.getChildren().get(i).getChildren().get(j).getChildren().get(k).getChildren().get(l).isPerson() && !root.getChildren().get(i).getChildren().get(j).getChildren().get(k).getChildren().get(l).hasChild())) {
root.getChildren().get(i).getChildren().get(j).getChildren().get(k).removeChild(root.getChildren().get(i).getChildren().get(j).getChildren().get(k).getChildren().get(l));
}
}
if ((root.getChildren().get(i).getChildren().get(j).getChildren().get(k).isPerson() && !root.getChildren().get(i).getChildren().get(j).getChildren().get(k).isSelected()) || (!root.getChildren().get(i).getChildren().get(j).getChildren().get(k).isPerson() && !root.getChildren().get(i).getChildren().get(j).getChildren().get(k).hasChild())) {
root.getChildren().get(i).getChildren().get(j).removeChild(root.getChildren().get(i).getChildren().get(j).getChildren().get(k));
}
}
if ((root.getChildren().get(i).getChildren().get(j).isPerson() && !root.getChildren().get(i).getChildren().get(j).isSelected()) || (!root.getChildren().get(i).getChildren().get(j).isPerson() && !root.getChildren().get(i).getChildren().get(j).hasChild())) {
root.getChildren().get(i).removeChild(root.getChildren().get(i).getChildren().get(j));
}
}
if ((root.getChildren().get(i).isPerson() && !root.getChildren().get(i).isSelected()) || (!root.getChildren().get(i).isPerson() && !root.getChildren().get(i).hasChild())) {
root.removeChild(root.getChildren().get(i));
}
}
return root;
}
public static List<Integer> changeToUserIdStr(List<TreeNode> treeNode, List<Integer> stringBuilder) {
if (stringBuilder == null) {
stringBuilder = new ArrayList<Integer>();
}
for (TreeNode node : treeNode) {
if (node.isPerson()) {
stringBuilder.add(Integer.parseInt(node.getUserId()));
}
changeToUserIdStr(node.getChildren(), stringBuilder);
}
return stringBuilder;
}
}
\ No newline at end of file
package cn.bsl.bxbg.zhiban.view;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import cn.bsl.bxbg.zhiban.BaseActivity;
import cn.bsl.bxbg.zhiban.R;
import cn.bsl.bxbg.zhiban.adapter.DutyChangePeopleAdapter;
import cn.bsl.bxbg.zhiban.bean.AllPersonBean;
import cn.bsl.bxbg.zhiban.bean.TreeChildren;
import cn.bsl.bxbg.zhiban.net.client.AllPeopleClient;
import cn.bsl.bxbg.zhiban.utils.TreeNode;
import cn.bsl.bxbg.zhiban.utils.TreeNodeHelper;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class DutyChangePeopleActivity extends BaseActivity implements AdapterView.OnItemClickListener{
@BindView(R.id.dutyLv)
ListView dutyLv;
private TreeNode root;
private AllPeopleClient dutyPlanClient = new AllPeopleClient();
private List<AllPersonBean> allPersonBeen = new ArrayList<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_duty_change_people);
ButterKnife.bind(this);
root = TreeNode.root();
dutyPlanClient.stringCall().enqueue(new Callback<ResponseBody>() {
@Override
public void onResponse(@NonNull Call<ResponseBody> call, @NonNull Response<ResponseBody> response) {
try {
String string = response.body().string();
String replace = string.replace("\"children\":\"\"", "\"children\":[]");
List<TreeChildren> list = new Gson().fromJson(replace, new TypeToken<List<TreeChildren>>() {
}.getType());
TreeNode treeNode = TreeNodeHelper.buildTree(root, list);
for (int i = 0; i < treeNode.getChildren().size(); i++) {
List<TreeNode> dept = treeNode.getChildren().get(i).getChildren();
for (int idept = 0; idept < dept.size(); idept++) {
List<TreeNode> children = dept.get(idept).getChildren();
for (int i1 = 0; i1 < children.size(); i1++) {
TreeNode treeNode1 = children.get(i1);
if (treeNode1.isPerson()) {
String id = treeNode1.getUserId();
String value = (String) treeNode1.getValue();
allPersonBeen.add(new AllPersonBean(id, value));
}
}
}
}
} catch (IOException e) {
e.printStackTrace();
}
Collections.sort(allPersonBeen);
dutyLv.setAdapter(new DutyChangePeopleAdapter(allPersonBeen));
dutyLv.setOnItemClickListener(DutyChangePeopleActivity.this);
}
@Override
public void onFailure(@NonNull Call<ResponseBody> call, @NonNull Throwable t) {
t.printStackTrace();
}
});
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent intent = new Intent();
intent.putExtra("id", allPersonBeen.get(position).getUserId());
intent.putExtra("name", allPersonBeen.get(position).getUserName());
setResult(RESULT_OK,intent);
finish();
}
}
package cn.bsl.bxbg.zhiban.view;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.GridView;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import cn.bsl.bxbg.zhiban.BaseActivity;
import cn.bsl.bxbg.zhiban.R;
import cn.bsl.bxbg.zhiban.adapter.HomeAdapter;
import cn.bsl.bxbg.zhiban.bean.MenuBean;
public class MainActivity extends BaseActivity implements AdapterView.OnItemClickListener{
@BindView(R.id.home_gv)
GridView homeGv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
initTab();
}
private void initTab() {
homeGv.setAdapter(new HomeAdapter(menuData()));
homeGv.setOnItemClickListener(this);
}
private List<MenuBean> menuData() {
List<MenuBean> menuList = new ArrayList<>();
MenuBean fbjl = new MenuBean(R.drawable.zb_info,"值班信息");
MenuBean fbj2 = new MenuBean(R.drawable.zb_table,"值班表");
MenuBean fbj3 = new MenuBean(R.drawable.tb_record,"调班记录");
menuList.add(fbjl);
menuList.add(fbj2);
menuList.add(fbj3);
return menuList;
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent intent = new Intent();
switch (position) {
case 0:
intent.setClass(MainActivity.this, ZhibanInfoActivity.class);
break;
case 1:
intent.setClass(MainActivity.this, ZhibanTableActivity.class);
break;
case 2:
intent.setClass(MainActivity.this,TiaobanRecordActivity.class);
break;
}
startActivity(intent);
}
}
package cn.bsl.bxbg.zhiban.view;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import java.util.ArrayList;
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.TiaobanBean;
import cn.bsl.bxbg.zhiban.utils.Constant;
import io.reactivex.ObservableSource;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.annotations.NonNull;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.Function;
import io.reactivex.schedulers.Schedulers;
public class TiaoBanPublish extends BaseActivity {
@BindView(R.id.reason)
EditText reason;
@BindView(R.id.button)
TextView button;
private static final String TAG = "TiaoBanPublish";
@BindView(R.id.choose_result)
TextView chooseResult;
@BindView(R.id.choose_time_area)
TextView chooseTimeArea;
private String morning;
private String noon;
private String evening;
private DutyPlanClient dutyPlanClient = new DutyPlanClient();
private String id;
private String dutyTime;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tiao_ban_publish);
ButterKnife.bind(this);
initData();
}
private void initData() {
id = getIntent().getStringExtra("id");
morning = getIntent().getStringExtra("morning");
noon = getIntent().getStringExtra("noon");
evening = getIntent().getStringExtra("evening");
dutyTime = getIntent().getStringExtra("dutyTime");
}
@OnClick({R.id.change_people,R.id.choose_time,R.id.button})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.change_people:
Intent intent = new Intent(this, DutyChangePeopleActivity.class);
startActivityForResult(intent, 0x00);
break;
case R.id.choose_time:
showTimeSelector();
break;
case R.id.button:
submit();
break;
}
}
private void submit() {
String choose_person = chooseResult.getText().toString();
String choose_time = chooseTimeArea.getText().toString();
String choose_reason = reason.getText().toString();
if (TextUtils.isEmpty(choose_reason)) {
Toast.makeText(this, "请输入调班原因", Toast.LENGTH_SHORT).show();
return;
}
if (choose_time.equals("选择您要调整的时间段")) {
Toast.makeText(this, "请选择时间", Toast.LENGTH_SHORT).show();
return;
}
if (choose_person.equals("请选择变更人")) {
Toast.makeText(this, "请选择变更人", Toast.LENGTH_SHORT).show();
return;
}
dutyPlanClient.tiaobanBean(choose_person,id,choose_reason,dutyTime).flatMap(new Function<TiaobanBean, ObservableSource<CCDutiesEdit>>() {
@Override
public ObservableSource<CCDutiesEdit> apply(@NonNull TiaobanBean tiaobanBean) throws Exception {
if (choose_time.equals("08:30 - 12:00")) {
// morning
return dutyPlanClient.editMorning(id, morning.replace(Constant.USER_NAME, choose_person));
} else if (choose_time.equals("12:00 - 18:30")){
// noon
return dutyPlanClient.editNoon(id, noon.replace(Constant.USER_NAME, choose_person));
} else {
// evening
return dutyPlanClient.editNight(id, evening.replace(Constant.USER_NAME, choose_person));
}
}
}).subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<CCDutiesEdit>() {
@Override
public void accept(CCDutiesEdit ccDutiesEdit) throws Exception {
Toast.makeText(TiaoBanPublish.this, "申请成功", Toast.LENGTH_SHORT).show();
finish();
}
},Throwable::printStackTrace);
}
private void showTimeSelector() {
List<String> times = new ArrayList<>(3);
if (morning.contains(Constant.USER_NAME)) {
times.add("08:30 - 12:00");
}
if (noon.contains(Constant.USER_NAME)) {
times.add("12:00 - 18:30");
}
if (evening.contains(Constant.USER_NAME)) {
times.add("18:30 - 08:30");
}
String[] strings = times.toArray(new String[0]);
final AlertDialog publish_sign_type = new AlertDialog
.Builder(this)
.setTitle("请选择时间段")
.setItems(strings, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
chooseTimeArea.setText(strings[which]);
}
})
.create();
publish_sign_type.show();
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 0x00 && data != null) {
String id = data.getStringExtra("id");
String name = data.getStringExtra("name");
chooseResult.setText(name);
}
}
}
package cn.bsl.bxbg.zhiban.view;
import android.os.Bundle;
import android.widget.TextView;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
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.DutiesTbResponse;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
public class TiaobanDetailsActivity extends BaseActivity {
@BindView(R.id.duty_times)
TextView dutyTimes;
@BindView(R.id.person)
TextView person;
@BindView(R.id.change_person)
TextView changePerson;
@BindView(R.id.reason)
TextView reason;
private String id;
DutyPlanClient dutyPlanClient = new DutyPlanClient();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tiaoban_details);
ButterKnife.bind(this);
initData();
}
private void initData() {
id = getIntent().getStringExtra("id");
dutyPlanClient.dutiesTbDetails(id)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<List<DutiesTbResponse>>() {
@Override
public void accept(List<DutiesTbResponse> dutiesTbResponses) throws Exception {
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();
String change = dutiesTbResponses.get(0).getRefers().getCc_shift().get(0).getApplicant() + " 变更为 " + dutiesTbResponses.get(0).getRefers().getCc_shift().get(0).getTransferredName();
dutyTimes.setText(dutyDate);
person.setText(people);
changePerson.setText(change);
reason.setText(dutiesTbResponses.get(0).getRefers().getCc_shift().get(0).getReason());
}
}, Throwable::printStackTrace);
}
}
package cn.bsl.bxbg.zhiban.view;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import cn.bsl.bxbg.zhiban.BaseActivity;
import cn.bsl.bxbg.zhiban.R;
import cn.bsl.bxbg.zhiban.adapter.TiaobanInfoAdapter;
import cn.bsl.bxbg.zhiban.net.client.DutyPlanClient;
import cn.bsl.bxbg.zhiban.net.response.CCShifts;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class TiaobanRecordActivity extends BaseActivity {
@BindView(R.id.tbLv)
ListView tbLv;
private DutyPlanClient dutyPlanClient = new DutyPlanClient();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tiaoban_record);
ButterKnife.bind(this);
queryRecord();
}
private void queryRecord() {
dutyPlanClient.shiftsRecord().enqueue(new Callback<List<CCShifts>>() {
@Override
public void onResponse(Call<List<CCShifts>> call, Response<List<CCShifts>> response) {
List<CCShifts> ccShift = response.body();
tbLv.setAdapter(new TiaobanInfoAdapter(ccShift));
tbLv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent intent = new Intent(TiaobanRecordActivity.this,TiaobanDetailsActivity.class);
intent.putExtra("id", ccShift.get(position).getApplicantDutyId());
startActivity(intent);
}
});
}
@Override
public void onFailure(Call<List<CCShifts>> call, Throwable t) {
t.printStackTrace();
}
});
}
}
package cn.bsl.bxbg.zhiban.view;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ListView;
import android.widget.TextView;
import java.util.ArrayList;
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.adapter.ZbPeopleAdapter;
import cn.bsl.bxbg.zhiban.net.client.DutyPlanClient;
import cn.bsl.bxbg.zhiban.net.response.CCDuties;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
public class ZhibanDetailsActivity extends BaseActivity {
private List<CCDuties> ccDuties = new ArrayList<>();
@BindView(R.id.duty_time)
TextView dutyTime;
@BindView(R.id.zb_people)
ListView zbPeople;
DutyPlanClient dutyPlanClient = new DutyPlanClient();
private String dutyId;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_zhiban_details);
ButterKnife.bind(this);
initData();
}
private void initData() {
dutyId = getIntent().getStringExtra("dutyId");
queryDetails(dutyId);
}
private void queryDetails(String dutyId) {
dutyPlanClient.dutiesById(dutyId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(clcDuties -> {
ccDuties.clear();
dutyTime.setText(clcDuties.getDutyDate());
ccDuties.add(clcDuties);
zbPeople.setAdapter(new ZbPeopleAdapter(ccDuties));
}, Throwable::printStackTrace);
}
@OnClick(R.id.tb)
public void onViewClicked() {
Intent intent = new Intent(this,TiaoBanPublish.class);
intent.putExtra("id", dutyId);
intent.putExtra("morning", ccDuties.get(0).getMorning());
intent.putExtra("noon", ccDuties.get(0).getNoon());
intent.putExtra("evening", ccDuties.get(0).getEvening());
intent.putExtra("dutyTime", dutyTime.getText().toString());
startActivity(intent);
}
}
package cn.bsl.bxbg.zhiban.view;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import cn.bsl.bxbg.zhiban.BaseActivity;
import cn.bsl.bxbg.zhiban.R;
import cn.bsl.bxbg.zhiban.adapter.ZhibanInfoAdapter;
import cn.bsl.bxbg.zhiban.bean.DutyPlanDutiesBean;
import cn.bsl.bxbg.zhiban.net.client.DutyPlanClient;
import cn.bsl.bxbg.zhiban.net.response.CCDuties;
import cn.bsl.bxbg.zhiban.net.response.DutyPlanResponse;
import cn.bsl.bxbg.zhiban.utils.Constant;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.annotations.NonNull;
import io.reactivex.functions.BiFunction;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
public class ZhibanInfoActivity extends BaseActivity implements AdapterView.OnItemClickListener{
@BindView(R.id.zb_lv)
ListView zbLv;
private DutyPlanClient dutyPlanClient = new DutyPlanClient();
private static final String TAG = "ZhibanInfoActivity";
private ZhibanInfoAdapter zhibanInfoAdapter;
private List<DutyPlanDutiesBean> planDuties;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_zhiban_info);
ButterKnife.bind(this);
initView();
queryRecord();
}
private void initView() {
zbLv.setOnItemClickListener(this);
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent intent = new Intent(ZhibanInfoActivity.this, ZhibanDetailsActivity.class);
intent.putExtra("dutyId", planDuties.get(position).getDutyId());
startActivity(intent);
}
/**
* TODO 按本月查询信息 需要添加filters
* 判断id相等并且早中晚包含本人信息的将加入列表
*/
private void queryRecord() {
Observable.zip(dutyPlanClient.dutyPlanLeaderRecord(), dutyPlanClient.dutiesRecord(),
new BiFunction<List<DutyPlanResponse>, List<CCDuties>, List<DutyPlanDutiesBean>>() {
@Override
public List<DutyPlanDutiesBean> apply(@NonNull List<DutyPlanResponse> dutyPlanResponses,
@NonNull List<CCDuties> ccDuties) throws Exception {
List<DutyPlanDutiesBean> dutyPlanDutiesBeen = new ArrayList<>();
DutyPlanDutiesBean dutyPlanDutiesBean;
for (int i = 0; i < dutyPlanResponses.size(); i++) {
for (int i1 = 0; i1 < ccDuties.size(); i1++) {
String id = dutyPlanResponses.get(i).getId();
String onDutyPlanId = ccDuties.get(i1).getOnDutyPlanId();
if (id.equals(onDutyPlanId) && (ccDuties.get(i1).getMorning().contains(Constant.USER_NAME)
||ccDuties.get(i1).getNoon().contains(Constant.USER_NAME)
||ccDuties.get(i1).getEvening().contains(Constant.USER_NAME)
|| ccDuties.get(i1).getClassLeaders().contains(Constant.USER_NAME))) {
dutyPlanDutiesBean = new DutyPlanDutiesBean();
dutyPlanDutiesBean.setPlanId(id);
dutyPlanDutiesBean.setDutyId(ccDuties.get(i1).getId());
dutyPlanDutiesBean.setLeader(ccDuties.get(i1).getClassLeaders());
dutyPlanDutiesBean.setYear(dutyPlanResponses.get(i).getWhatYear());
dutyPlanDutiesBean.setMonth(dutyPlanResponses.get(i).getWhatMonth());
dutyPlanDutiesBean.setMorning(ccDuties.get(i1).getMorning());
dutyPlanDutiesBean.setNoon(ccDuties.get(i1).getNoon());
dutyPlanDutiesBean.setEvening(ccDuties.get(i1).getEvening());
dutyPlanDutiesBean.setDutyDate(ccDuties.get(i1).getDutyDate());
dutyPlanDutiesBeen.add(dutyPlanDutiesBean);
}
}
}
return dutyPlanDutiesBeen;
}
}).observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.io())
.subscribe(new Consumer<List<DutyPlanDutiesBean>>() {
@Override
public void accept(List<DutyPlanDutiesBean> dutyPlanDutiesBeen) throws Exception {
// zbLv.setAdapter(new ZhibanTableAdapter(dutyPlanDutiesBeen));
Log.d(TAG, "accept: " + dutyPlanDutiesBeen.size());
planDuties = dutyPlanDutiesBeen;
zhibanInfoAdapter=new ZhibanInfoAdapter(planDuties);
zbLv.setAdapter(zhibanInfoAdapter);
}
}, Throwable::printStackTrace);
}
}
package cn.bsl.bxbg.zhiban.view;
import android.os.Bundle;
import android.widget.ListView;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import cn.bsl.bxbg.zhiban.BaseActivity;
import cn.bsl.bxbg.zhiban.R;
import cn.bsl.bxbg.zhiban.adapter.ZhibanTableAdapter;
import cn.bsl.bxbg.zhiban.bean.DutyPlanDutiesBean;
import cn.bsl.bxbg.zhiban.net.client.DutyPlanClient;
import cn.bsl.bxbg.zhiban.net.response.CCDuties;
import cn.bsl.bxbg.zhiban.net.response.DutyPlanResponse;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.annotations.NonNull;
import io.reactivex.functions.BiFunction;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
public class ZhibanTableActivity extends BaseActivity {
@BindView(R.id.zb_table_lv)
ListView zbTableLv;
private static final String TAG = "ZhibanTableActivity";
private DutyPlanClient dutyPlanClient = new DutyPlanClient();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_zhiban_table);
ButterKnife.bind(this);
// zbTableLv.setAdapter(new ZhibanTableAdapter(TestBean.testBeen()));
queryRecord();
}
private void queryRecord() {
Observable.zip(dutyPlanClient.dutyPlanLeaderRecord(), dutyPlanClient.dutiesRecord(),
new BiFunction<List<DutyPlanResponse>, List<CCDuties>, List<DutyPlanDutiesBean>>() {
@Override
public List<DutyPlanDutiesBean> apply(@NonNull List<DutyPlanResponse> dutyPlanResponses,
@NonNull List<CCDuties> ccDuties) throws Exception {
List<DutyPlanDutiesBean> dutyPlanDutiesBeen = new ArrayList<>();
DutyPlanDutiesBean dutyPlanDutiesBean;
for (int i = 0; i < dutyPlanResponses.size(); i++) {
for (int i1 = 0; i1 < ccDuties.size(); i1++) {
String id = dutyPlanResponses.get(i).getId();
String onDutyPlanId = ccDuties.get(i1).getOnDutyPlanId();
if (id.equals(onDutyPlanId)) {
dutyPlanDutiesBean = new DutyPlanDutiesBean();
dutyPlanDutiesBean.setPlanId(id);
dutyPlanDutiesBean.setDutyId(onDutyPlanId);
dutyPlanDutiesBean.setLeader(ccDuties.get(i1).getClassLeaders());
dutyPlanDutiesBean.setYear(dutyPlanResponses.get(i).getWhatYear());
dutyPlanDutiesBean.setMonth(dutyPlanResponses.get(i).getWhatMonth());
dutyPlanDutiesBean.setMorning(ccDuties.get(i1).getMorning());
dutyPlanDutiesBean.setNoon(ccDuties.get(i1).getNoon());
dutyPlanDutiesBean.setEvening(ccDuties.get(i1).getEvening());
dutyPlanDutiesBean.setDutyDate(ccDuties.get(i1).getDutyDate());
dutyPlanDutiesBeen.add(dutyPlanDutiesBean);
}
}
}
return dutyPlanDutiesBeen;
}
}).observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.io())
.subscribe(new Consumer<List<DutyPlanDutiesBean>>() {
@Override
public void accept(List<DutyPlanDutiesBean> dutyPlanDutiesBeen) throws Exception {
zbTableLv.setAdapter(new ZhibanTableAdapter(dutyPlanDutiesBeen));
}
}, Throwable::printStackTrace);
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="8dp" />
<solid android:color="#00BF8B" />
<stroke
android:width="1dp"
android:color="#00BF8B" />
</shape>
\ No newline at end of file
<?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"
tools:context="cn.bsl.bxbg.zhiban.view.DutyChangePeopleActivity">
<include layout="@layout/conn" />
<ListView
android:id="@+id/dutyLv"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
<?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"
tools:context="cn.bsl.bxbg.zhiban.view.MainActivity">
<include layout="@layout/conn" />
<ImageView
android:layout_width="match_parent"
android:layout_height="120dp" />
<GridView
android:id="@+id/home_gv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff"
android:paddingTop="10dp"
android:gravity="center_horizontal"
android:numColumns="3"
/>
</LinearLayout>
<?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:background="#FFF"
android:orientation="vertical"
tools:context="cn.bsl.bxbg.zhiban.view.TiaoBanPublish">
<include layout="@layout/conn" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="原因" />
<EditText
android:id="@+id/reason"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_margin="10dp"
android:layout_marginTop="10dp"
android:background="@null"
android:gravity="top"
android:hint="请输入原因" />
<LinearLayout
android:id="@+id/choose_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="时间选择 "
android:textSize="18sp" />
<TextView
android:id="@+id/choose_time_area"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="选择您要调整的时间段" />
</LinearLayout>
<LinearLayout
android:id="@+id/change_people"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="值班变更人"
android:textSize="18sp" />
<TextView
android:id="@+id/choose_result"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="请选择变更人" />
</LinearLayout>
<TextView
android:id="@+id/button"
android:layout_width="250dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:layout_marginTop="30dp"
android:background="@drawable/sign_button_shape"
android:gravity="center"
android:text="申请"
android:textColor="#FFF" />
</LinearLayout>
<?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"
tools:context="cn.bsl.bxbg.zhiban.view.TiaobanDetailsActivity">
<include layout="@layout/conn" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:visibility="gone"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:textColor="#000"
android:text="值班部门"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="办公室"
android:layout_marginLeft="10dp"
android:textSize="16sp"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:visibility="gone"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:textColor="#000"
android:text="申请时间"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2018-1-1"
android:layout_marginLeft="10dp"
android:textSize="16sp"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:textColor="#000"
android:text="值班时间"
/>
<TextView
android:id="@+id/duty_times"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2018-1-1"
android:layout_marginLeft="10dp"
android:textSize="16sp"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:textColor="#000"
android:text="值班人员"
/>
<TextView
android:id="@+id/person"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="张三 李四 王五"
android:layout_marginLeft="10dp"
android:textSize="16sp"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:textColor="#000"
android:text="值班变更"
/>
<TextView
android:id="@+id/change_person"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="张三换成赵四"
android:layout_marginLeft="10dp"
android:textColor="#f00"
android:textSize="16sp"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:textColor="#000"
android:text="原因"
/>
<TextView
android:id="@+id/reason"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="临时有事"
android:layout_marginTop="10dp"
android:textSize="16sp"
/>
</LinearLayout>
</LinearLayout>
<?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"
tools:context="cn.bsl.bxbg.zhiban.view.TiaobanRecordActivity">
<include layout="@layout/conn" />
<ListView
android:id="@+id/tbLv"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
tools:context="cn.bsl.bxbg.zhiban.view.ZhibanDetailsActivity">
<include
android:id="@+id/title_bar"
layout="@layout/conn" />
<LinearLayout
android:id="@+id/ll_zb_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/title_bar"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:text="值班时间"
android:textColor="#4a4a4a" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/zb_details_calendar" />
<TextView
android:id="@+id/duty_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text="2018-1-1"
android:textColor="#4a4a4a"
android:textSize="20sp" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:text="值班人员"
android:textColor="#4a4a4a" />
</LinearLayout>
<LinearLayout
android:id="@+id/tb"
android:layout_width="match_parent"
android:layout_height="48dp"
android:orientation="vertical"
android:gravity="center_vertical"
android:background="#00BF8B"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFF"
android:layout_gravity="center"
android:text="调班"
/>
</LinearLayout>
<ListView
android:id="@+id/zb_people"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@id/tb"
android:layout_below="@id/ll_zb_info" />
</RelativeLayout>
<?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"
tools:context="cn.bsl.bxbg.zhiban.view.ZhibanInfoActivity">
<include layout="@layout/conn" />
<ListView
android:id="@+id/zb_lv"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</LinearLayout>
<?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"
android:background="#fff"
tools:context="cn.bsl.bxbg.zhiban.view.ZhibanTableActivity">
<include layout="@layout/conn" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#E0E6ED"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#E2F5F0"
>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#E0E6ED"
/>
<TextView
android:layout_width="0dp"
android:layout_height="32dp"
android:text="带班"
android:layout_weight="1"
android:gravity="center"
/>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#E0E6ED"
/>
<TextView
android:layout_width="0dp"
android:layout_height="32dp"
android:text="时间"
android:layout_weight="1"
android:gravity="center"
/>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#E0E6ED"
/>
<TextView
android:layout_width="0dp"
android:layout_height="32dp"
android:layout_weight="1"
android:text="人员"
android:gravity="center"
/>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#E0E6ED"
/>
</LinearLayout>
<ListView
android:id="@+id/zb_table_lv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#E0E6ED"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
/>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFF"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center"
android:orientation="horizontal"
android:padding="7dp" >
<ImageView
android:id="@+id/back"
android:layout_width="30dp"
android:layout_height="25dp"
android:gravity="center_vertical"
android:src="@drawable/fanhui" />
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="30dp"
android:gravity="center"
android:text=""
android:textColor="#00BF8B"
android:textSize="17sp" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="#fff"
android:padding="10dp"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/change_people"
/>
<TextView
android:id="@+id/username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="张三"
android:textSize="18sp"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/iv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/zb_info"
/>
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="发布记录"
/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/zb_info_list_icon"
android:layout_gravity="center_vertical"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<TextView
android:id="@+id/tb_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="调班记录"
android:layout_marginLeft="10dp"
android:textSize="18sp"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="10dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="申请人:"
android:layout_marginLeft="10dp"
/>
<TextView
android:id="@+id/tb_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="xxx"
android:layout_marginLeft="10dp"
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/tb_time"
android:layout_marginLeft="10dp"
android:layout_gravity="center_vertical"
/>
<TextView
android:id="@+id/tb_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2018-1-1"
android:layout_marginLeft="10dp"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
</resources>
<resources>
<string name="app_name">值班管理</string>
</resources>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@android:color/black</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#Mon Mar 05 15:10:20 GMT+08:00 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
This diff is collapsed.
This diff is collapsed.
include ':app'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment