|
|
@@ -21,6 +21,9 @@ import android.widget.ViewFlipper;
|
|
|
import com.webrain.baselibrary.widget.GridViewForScrollView;
|
|
|
import com.webrain.dailypay.R;
|
|
|
import com.webrain.dailypay.bean.BaseInformationBean;
|
|
|
+import com.webrain.dailypay.bean.PositionBean;
|
|
|
+import com.webrain.dailypay.bean.PositionListBean;
|
|
|
+import com.webrain.dailypay.bean.WorkAddressBean;
|
|
|
import com.webrain.dailypay.ui.activity.position.PositionReleaseActivity;
|
|
|
import com.webrain.dailypay.ui.adapter.gridview.PositionReleaseSelectAdapter;
|
|
|
import com.webrain.dailypay.ui.adapter.gridview.PositionTypeSelectAdapter;
|
|
|
@@ -34,6 +37,7 @@ import com.webrain.dailypay.ui.viewholder.EducationalRequirementHolder;
|
|
|
import com.webrain.dailypay.ui.viewholder.LengthOfServiceHolder;
|
|
|
import com.webrain.dailypay.ui.viewholder.WorkAddressHolderView;
|
|
|
import com.webrain.dailypay.ui.widget.ShrinkAnimationLayout;
|
|
|
+import com.webrain.dailypay.utils.BaseInformationUtils;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
@@ -129,6 +133,7 @@ public class PositionFullReleaseFragment extends BaseFragment<PositionFullReleas
|
|
|
DatePickerHolder deadlinePickHolder;
|
|
|
|
|
|
List<WorkAddressHolderView> mHolderViews;
|
|
|
+ PositionListBean positionListBean;
|
|
|
|
|
|
@Override
|
|
|
protected int getLayoutId() {
|
|
|
@@ -148,7 +153,8 @@ public class PositionFullReleaseFragment extends BaseFragment<PositionFullReleas
|
|
|
salAgeRequirement.initExpand(false);
|
|
|
salLengthOfServiceInterval.initExpand(false);
|
|
|
salDeadline.initExpand(false);
|
|
|
-
|
|
|
+ if (positionListBean != null)
|
|
|
+ mvpPresenter.iniPositionBean(positionListBean);
|
|
|
mvpPresenter.init();
|
|
|
return view;
|
|
|
}
|
|
|
@@ -200,12 +206,14 @@ public class PositionFullReleaseFragment extends BaseFragment<PositionFullReleas
|
|
|
}
|
|
|
break;
|
|
|
case R.id.tv_work_address:
|
|
|
- addWorkAddress();
|
|
|
+ addWorkAddress(null, false);
|
|
|
break;
|
|
|
case R.id.tv_salary_interval:
|
|
|
if (baseSalaryHolder == null) {
|
|
|
baseSalaryHolder = new BaseSalaryHolder(mContext, onSalarySelectListener);
|
|
|
baseSalaryHolder.setScrollView(svThree);
|
|
|
+ if (positionListBean != null && positionListBean.getPosition() != null)//回显基本薪资
|
|
|
+ baseSalaryHolder.initShowBack(positionListBean.getPosition().getBasicSalary());
|
|
|
salSalaryInterval.addView(baseSalaryHolder.getView());
|
|
|
}
|
|
|
salSalaryInterval.toggleExpand();
|
|
|
@@ -214,6 +222,8 @@ public class PositionFullReleaseFragment extends BaseFragment<PositionFullReleas
|
|
|
if (educationalRequirementHolder == null) {
|
|
|
educationalRequirementHolder = new EducationalRequirementHolder(mContext, onEducationalSelectListener);
|
|
|
educationalRequirementHolder.setScrollView(svFour);
|
|
|
+ if (positionListBean != null && positionListBean.getPosition() != null)//回显学历要求
|
|
|
+ educationalRequirementHolder.initShowBack(positionListBean.getPosition().getQualification());
|
|
|
salEducationalRequirement.addView(educationalRequirementHolder.getView());
|
|
|
}
|
|
|
salEducationalRequirement.toggleExpand();
|
|
|
@@ -222,6 +232,8 @@ public class PositionFullReleaseFragment extends BaseFragment<PositionFullReleas
|
|
|
if (ageIntervalHolder == null) {
|
|
|
ageIntervalHolder = new AgeIntervalHolder(mContext, onAgeIntervalSelectListener);
|
|
|
ageIntervalHolder.setScrollView(svFour);
|
|
|
+ if (positionListBean != null && positionListBean.getPosition() != null)//回显年龄要求
|
|
|
+ ageIntervalHolder.initShowBack(positionListBean.getPosition().getAgeRange());
|
|
|
salAgeRequirement.addView(ageIntervalHolder.getView());
|
|
|
}
|
|
|
salAgeRequirement.toggleExpand();
|
|
|
@@ -230,6 +242,8 @@ public class PositionFullReleaseFragment extends BaseFragment<PositionFullReleas
|
|
|
if (lengthOfServiceHolder == null) {
|
|
|
lengthOfServiceHolder = new LengthOfServiceHolder(mContext, onLengthOfServiceListener);
|
|
|
lengthOfServiceHolder.setScrollView(svFour);
|
|
|
+ if (positionListBean != null && positionListBean.getPosition() != null)//回显工龄要求
|
|
|
+ lengthOfServiceHolder.initShowBack(positionListBean.getPosition().getWorkExperience());
|
|
|
salLengthOfServiceInterval.addView(lengthOfServiceHolder.getView());
|
|
|
}
|
|
|
salLengthOfServiceInterval.toggleExpand();
|
|
|
@@ -238,6 +252,8 @@ public class PositionFullReleaseFragment extends BaseFragment<PositionFullReleas
|
|
|
if (deadlinePickHolder == null) {
|
|
|
deadlinePickHolder = new DatePickerHolder(mContext, onDeadLineSelectListener);
|
|
|
deadlinePickHolder.initSingleSelect();
|
|
|
+ if (positionListBean != null && positionListBean.getPosition() != null && !TextUtils.isEmpty(positionListBean.getPosition().getEndDate()))//回显控件截止日期
|
|
|
+ deadlinePickHolder.setSelectData(positionListBean.getPosition().getEndDate());
|
|
|
salDeadline.addView(deadlinePickHolder.getView());
|
|
|
}
|
|
|
salDeadline.toggleExpand();
|
|
|
@@ -347,10 +363,95 @@ public class PositionFullReleaseFragment extends BaseFragment<PositionFullReleas
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 初始化编辑岗位数据
|
|
|
+ *
|
|
|
+ * @param bean
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void iniPositionBean(PositionListBean bean) {
|
|
|
+ positionListBean = bean;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 当岗位需要编辑
|
|
|
+ *
|
|
|
+ * @param bean
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void onPositionEdit(PositionListBean bean) {
|
|
|
+ if (bean != null) {
|
|
|
+ List<WorkAddressBean> addressBeanList = bean.getAddress();
|
|
|
+ if (addressBeanList != null && !addressBeanList.isEmpty()) {
|
|
|
+ for (WorkAddressBean item : addressBeanList) {
|
|
|
+ addWorkAddress(item, false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ PositionBean positionBean = bean.getPosition();
|
|
|
+ if (positionBean != null) {
|
|
|
+ if (mAdapter != null)//回显岗位类别
|
|
|
+ mAdapter.initShowBack(positionBean.getFulltimePositionType());
|
|
|
+ if (!TextUtils.isEmpty(positionBean.getPositionName()))//回显岗位标题
|
|
|
+ etTitle.setText(positionBean.getPositionName());
|
|
|
+ if (!TextUtils.isEmpty(positionBean.getPositionDetail()))//回显岗位详情
|
|
|
+ etDesc.setText(positionBean.getPositionDetail());
|
|
|
+ if (!TextUtils.isEmpty(positionBean.getRecruitNumber()))//回显预计招聘人数
|
|
|
+ etNum.setText(positionBean.getRecruitNumber());
|
|
|
+ if (!TextUtils.isEmpty(positionBean.getBasicSalary()))//回显基本薪资
|
|
|
+ tvSalaryInterval.setText(BaseInformationUtils.getSalary(mContext, positionBean.getBasicSalary()));
|
|
|
+ if (!TextUtils.isEmpty(positionBean.getSalaryStructure()))//回显薪资结构
|
|
|
+ etSalaryStructure.setText(positionBean.getSalaryStructure());
|
|
|
+ if (mWelfareAdapter != null)//回显岗位福利
|
|
|
+ mWelfareAdapter.initShowBack(positionBean.getWelfare());
|
|
|
+ if (!TextUtils.isEmpty(positionBean.getHasRegularBus())) {//回显班车
|
|
|
+ switch (positionBean.getHasRegularBus()) {
|
|
|
+ case "0":
|
|
|
+ rbNo.setChecked(true);
|
|
|
+ break;
|
|
|
+ case "1":
|
|
|
+ rbHave.setChecked(true);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(positionBean.getGender())) {//回显性别
|
|
|
+ switch (positionBean.getGender()) {
|
|
|
+ case "0":
|
|
|
+ rbNormal.setChecked(true);
|
|
|
+ break;
|
|
|
+ case "1":
|
|
|
+ rbMale.setChecked(true);
|
|
|
+ break;
|
|
|
+ case "2":
|
|
|
+ rbFemale.setChecked(true);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(positionBean.getQualification()))//回显学历
|
|
|
+ tvEducationalRequirement.setText(BaseInformationUtils.getEducationBackground(mContext, positionBean.getQualification()));
|
|
|
+ if (!TextUtils.isEmpty(positionBean.getAgeRange()))//回显年龄
|
|
|
+ tvAgeRequirement.setText(positionBean.getAgeRange());
|
|
|
+ if (!TextUtils.isEmpty(positionBean.getWorkExperience()))//回显工龄
|
|
|
+ tvLengthOfServiceInterval.setText(BaseInformationUtils.getWorkExperience(mContext, positionBean.getWorkExperience()));
|
|
|
+ if (!TextUtils.isEmpty(positionBean.getEndDate()))//回显截止日期
|
|
|
+ tvDeadline.setText(positionBean.getEndDate());
|
|
|
+ if (!TextUtils.isEmpty(positionBean.getContactPerson()))//回显联系人
|
|
|
+ etContact.setText(positionBean.getContactPerson());
|
|
|
+ if (!TextUtils.isEmpty(positionBean.getContactPhone()))//回显联系人电话
|
|
|
+ etContactNumber.setText(positionBean.getContactPhone());
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 添加地址
|
|
|
*/
|
|
|
- private void addWorkAddress() {
|
|
|
+ private void addWorkAddress(WorkAddressBean bean, boolean isPublishNationwide) {
|
|
|
WorkAddressHolderView mHolder = new WorkAddressHolderView(mContext, svTwo);
|
|
|
+ if (bean != null)
|
|
|
+ mHolder.initShowBack(bean);
|
|
|
+ else if (isPublishNationwide)
|
|
|
+ mHolder.initShowBackCountry();
|
|
|
llWorkAddress.addView(mHolder.getView());
|
|
|
mHolderViews.add(mHolder);
|
|
|
tvWorkAddress.setHint(R.string.hint_click_add_select_address);
|