|
|
@@ -22,6 +22,7 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.xzjmyk.pm.activity.R;
|
|
|
import com.xzjmyk.pm.activity.adapter.DailyDetailsApprovalFlowAdapter;
|
|
|
import com.xzjmyk.pm.activity.bean.oa.CommonApprovalFlowBean;
|
|
|
+import com.xzjmyk.pm.activity.helper.AvatarHelper;
|
|
|
import com.xzjmyk.pm.activity.ui.base.BaseActivity;
|
|
|
import com.xzjmyk.pm.activity.ui.erp.db.DBManager;
|
|
|
import com.xzjmyk.pm.activity.ui.erp.entity.EmployeesEntity;
|
|
|
@@ -31,6 +32,7 @@ import com.xzjmyk.pm.activity.ui.erp.util.Constants;
|
|
|
import com.xzjmyk.pm.activity.ui.erp.util.ListUtils;
|
|
|
import com.xzjmyk.pm.activity.ui.erp.util.LogUtil;
|
|
|
import com.xzjmyk.pm.activity.ui.erp.util.StringUtils;
|
|
|
+import com.xzjmyk.pm.activity.ui.erp.view.CustomerScrollView;
|
|
|
import com.xzjmyk.pm.activity.ui.erp.view.EmptyLayout;
|
|
|
import com.xzjmyk.pm.activity.view.MyListView;
|
|
|
|
|
|
@@ -98,6 +100,138 @@ public class DailydetailsActivity extends BaseActivity {
|
|
|
private String undotask;
|
|
|
private WebSettings undo_settings;
|
|
|
private View hide_above_af;
|
|
|
+ private ImageView photo_im;
|
|
|
+ private TextView name_tv;
|
|
|
+ private TextView section_tv;
|
|
|
+ private CustomerScrollView csv_hide;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void onCreate(Bundle savedInstanceState) {
|
|
|
+ super.onCreate(savedInstanceState);
|
|
|
+ progressDialog.show();
|
|
|
+ initView();
|
|
|
+ initData();
|
|
|
+ initClickEvent();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void initClickEvent() {
|
|
|
+
|
|
|
+ resubmit_ll.setOnClickListener(new View.OnClickListener() { //TODO 重新提交
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+
|
|
|
+ if (!TextUtils.isEmpty(submittype) && submittype.equals("unsubmit")){//未提交状态
|
|
|
+ startActivity(new Intent(activity, WorkDailyAddActivity.class)
|
|
|
+ .putExtra("caller", mCaller)
|
|
|
+ .putExtra("id", mkeyValue)
|
|
|
+ .putExtra("rs_summary", summary)
|
|
|
+ .putExtra("rs_plan", plan)
|
|
|
+ .putExtra("rs_experience", experience)
|
|
|
+ .putExtra("resubmit", "resubmit"));
|
|
|
+ Log.i("dosubmit_id", mkeyValue + "");
|
|
|
+ finish();
|
|
|
+ }else { //提交状态
|
|
|
+ new AlertDialog
|
|
|
+ .Builder(mContext)
|
|
|
+ .setTitle("温馨提示")
|
|
|
+ .setMessage("\t\t确认反提交该条单据?")
|
|
|
+ .setNegativeButton("取消",null)
|
|
|
+ .setPositiveButton("确认", new DialogInterface.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(DialogInterface dialog, int which) {
|
|
|
+ String retype = "reforsub";
|
|
|
+ doresubmit(retype);
|
|
|
+ }
|
|
|
+ }).show();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ delete_ll.setOnClickListener(new View.OnClickListener() { //TODO 删除
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ if (!TextUtils.isEmpty(submittype) && submittype.equals("unsubmit")){
|
|
|
+ new AlertDialog
|
|
|
+ .Builder(mContext)
|
|
|
+ .setTitle("温馨提示")
|
|
|
+ .setMessage("\t\t确认删除该条已保存单据?")
|
|
|
+ .setNegativeButton("取消", null)
|
|
|
+ .setPositiveButton("确认", new DialogInterface.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(DialogInterface dialog, int which) {
|
|
|
+ dodelete(mCaller, mkeyValue);
|
|
|
+ }
|
|
|
+ }).show();
|
|
|
+
|
|
|
+ }else {
|
|
|
+ new AlertDialog
|
|
|
+ .Builder(mContext)
|
|
|
+ .setTitle("温馨提示")
|
|
|
+ .setMessage("\t\t确认删除该条已提交单据?")
|
|
|
+ .setNegativeButton("取消", null)
|
|
|
+ .setPositiveButton("确认", new DialogInterface.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(DialogInterface dialog, int which) {
|
|
|
+ String retype = "refordelete";
|
|
|
+ doresubmit(retype);
|
|
|
+ }
|
|
|
+ }).show();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public void initView() {
|
|
|
+
|
|
|
+ setContentView(R.layout.activity_workdaily_detail);
|
|
|
+ getSupportActionBar().setTitle("日报详情");
|
|
|
+
|
|
|
+ csv_hide = (CustomerScrollView) findViewById(R.id.csv_hide);
|
|
|
+ photo_im = (ImageView) findViewById(R.id.common_docui_photo_img);
|
|
|
+ name_tv = (TextView) findViewById(R.id.common_docui_name_tv);
|
|
|
+ section_tv = (TextView) findViewById(R.id.common_docui_Section_tv);
|
|
|
+ wdd_data = (TextView) findViewById(R.id.work_daily_detail_time_tv);
|
|
|
+ wdd_summary = (TextView) findViewById(R.id.work_daily_detail_summary_tv);
|
|
|
+ wdd_plan = (TextView) findViewById(R.id.work_daily_detail_plan_tv);
|
|
|
+ wdd_experience = (TextView) findViewById(R.id.work_daily_detail_experience_tv);
|
|
|
+ wdd_status = (TextView) findViewById(R.id.work_daily_detail_status_tv);
|
|
|
+ plan_ll = (LinearLayout) findViewById(R.id.work_daily_detail_plan_ll);
|
|
|
+ experience_ll = (LinearLayout) findViewById(R.id.work_daily_detail_experience_ll);
|
|
|
+ approval_flowlv = (MyListView) findViewById(R.id.work_daily_detail_approval_flow_lv);
|
|
|
+ unsubmit_iv = (ImageView) findViewById(R.id.work_daily_unsubmit_iv);
|
|
|
+ resanddel_ll = (LinearLayout) findViewById(R.id.item_common_docui_res_and_del_ll);
|
|
|
+ resubmit_ll = (LinearLayout) findViewById(R.id.common_docui_resubmit_ll);
|
|
|
+ delete_ll = (LinearLayout) findViewById(R.id.common_docui_delete_ll);
|
|
|
+ resubmit_tv = (TextView) findViewById(R.id.common_docui_resubmit_tv);
|
|
|
+ done_task_ll = (LinearLayout) findViewById(R.id.work_daily_detail_donetask_ll);
|
|
|
+ donetask_wv = (WebView) findViewById(R.id.donetask_wv);
|
|
|
+ undo_task_ll = (LinearLayout) findViewById(R.id.work_daily_detail_undotask_ll);
|
|
|
+ undotask_wv = (WebView) findViewById(R.id.undotask_wv);
|
|
|
+ hide_above_af = findViewById(R.id.hide_above_af);
|
|
|
+
|
|
|
+ done_settings = donetask_wv.getSettings();
|
|
|
+ done_settings.setSupportZoom(true);
|
|
|
+ done_settings.setTextSize(WebSettings.TextSize.SMALLER);//已完成任务设置web字体大小
|
|
|
+
|
|
|
+ undo_settings = undotask_wv.getSettings();
|
|
|
+ undo_settings.setSupportZoom(true);
|
|
|
+ undo_settings.setTextSize(WebSettings.TextSize.SMALLER); //未完成任务设置web字体大小
|
|
|
+
|
|
|
+ mEmptyLayput_approvalflow = new EmptyLayout(this, approval_flowlv);
|
|
|
+ mEmptyLayput_approvalflow.setShowEmptyButton(false);
|
|
|
+ mEmptyLayput_approvalflow.setShowErrorButton(false);
|
|
|
+ mEmptyLayput_approvalflow.setShowLoadingButton(false);
|
|
|
+ //加载审批流的适配器
|
|
|
+ mCommonApprovalFlowBean = new CommonApprovalFlowBean();
|
|
|
+ mDailyDetailsApprovalFlowAdapter = new DailyDetailsApprovalFlowAdapter(this);
|
|
|
+
|
|
|
+ manager = new DBManager(this);
|
|
|
+ im_ids =new ArrayList<>();
|
|
|
+ afpeople_names = new ArrayList<>();
|
|
|
+ }
|
|
|
private Handler handler = new Handler(){
|
|
|
@Override
|
|
|
public void handleMessage(Message msg) {
|
|
|
@@ -176,7 +310,7 @@ public class DailydetailsActivity extends BaseActivity {
|
|
|
break;
|
|
|
|
|
|
|
|
|
- default:
|
|
|
+ case Constants.APP_SOCKETIMEOUTEXCEPTION:
|
|
|
if (msg.getData() != null) {
|
|
|
if (!StringUtils.isEmpty(msg.getData().getString("result"))) {
|
|
|
ToastMessage(msg.getData().getString("result"));
|
|
|
@@ -201,6 +335,7 @@ public class DailydetailsActivity extends BaseActivity {
|
|
|
hide_above_af.setVisibility(View.GONE);
|
|
|
}else{
|
|
|
mCommonApprovalFlowBean = JSON.parseObject(resultJsonObject.toString(), CommonApprovalFlowBean.class);
|
|
|
+ getapplypeomsg(mCommonApprovalFlowBean);
|
|
|
em_code = new String();
|
|
|
if (manager == null) manager = new DBManager(mContext);
|
|
|
if("已审核".equals(wd_status) && (mCommonApprovalFlowBean.getData().size() == 0 ||
|
|
|
@@ -394,126 +529,46 @@ public class DailydetailsActivity extends BaseActivity {
|
|
|
progressDialog.dismiss();
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- protected void onCreate(Bundle savedInstanceState) {
|
|
|
- super.onCreate(savedInstanceState);
|
|
|
- progressDialog.show();
|
|
|
- initView();
|
|
|
- initData();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public void initView() {
|
|
|
-
|
|
|
- setContentView(R.layout.activity_workdaily_detail);
|
|
|
- getSupportActionBar().setTitle("日报详情");
|
|
|
-
|
|
|
- wdd_data = (TextView) findViewById(R.id.work_daily_detail_time_tv);
|
|
|
- wdd_summary = (TextView) findViewById(R.id.work_daily_detail_summary_tv);
|
|
|
- wdd_plan = (TextView) findViewById(R.id.work_daily_detail_plan_tv);
|
|
|
- wdd_experience = (TextView) findViewById(R.id.work_daily_detail_experience_tv);
|
|
|
- wdd_status = (TextView) findViewById(R.id.work_daily_detail_status_tv);
|
|
|
- plan_ll = (LinearLayout) findViewById(R.id.work_daily_detail_plan_ll);
|
|
|
- experience_ll = (LinearLayout) findViewById(R.id.work_daily_detail_experience_ll);
|
|
|
- approval_flowlv = (MyListView) findViewById(R.id.work_daily_detail_approval_flow_lv);
|
|
|
- unsubmit_iv = (ImageView) findViewById(R.id.work_daily_unsubmit_iv);
|
|
|
- resanddel_ll = (LinearLayout) findViewById(R.id.item_common_docui_res_and_del_ll);
|
|
|
- resubmit_ll = (LinearLayout) findViewById(R.id.common_docui_resubmit_ll);
|
|
|
- delete_ll = (LinearLayout) findViewById(R.id.common_docui_delete_ll);
|
|
|
- resubmit_tv = (TextView) findViewById(R.id.common_docui_resubmit_tv);
|
|
|
- done_task_ll = (LinearLayout) findViewById(R.id.work_daily_detail_donetask_ll);
|
|
|
- donetask_wv = (WebView) findViewById(R.id.donetask_wv);
|
|
|
- undo_task_ll = (LinearLayout) findViewById(R.id.work_daily_detail_undotask_ll);
|
|
|
- undotask_wv = (WebView) findViewById(R.id.undotask_wv);
|
|
|
- hide_above_af = findViewById(R.id.hide_above_af);
|
|
|
-
|
|
|
- done_settings = donetask_wv.getSettings();
|
|
|
- done_settings.setSupportZoom(true);
|
|
|
- done_settings.setTextSize(WebSettings.TextSize.SMALLER);//已完成任务设置web字体大小
|
|
|
-
|
|
|
- undo_settings = undotask_wv.getSettings();
|
|
|
- undo_settings.setSupportZoom(true);
|
|
|
- undo_settings.setTextSize(WebSettings.TextSize.SMALLER); //未完成任务设置web字体大小
|
|
|
-
|
|
|
- mEmptyLayput_approvalflow = new EmptyLayout(this, approval_flowlv);
|
|
|
- mEmptyLayput_approvalflow.setShowEmptyButton(false);
|
|
|
- mEmptyLayput_approvalflow.setShowErrorButton(false);
|
|
|
- mEmptyLayput_approvalflow.setShowLoadingButton(false);
|
|
|
- //加载审批流的适配器
|
|
|
- mCommonApprovalFlowBean = new CommonApprovalFlowBean();
|
|
|
- mDailyDetailsApprovalFlowAdapter = new DailyDetailsApprovalFlowAdapter(this);
|
|
|
-
|
|
|
- manager = new DBManager(this);
|
|
|
- im_ids =new ArrayList<>();
|
|
|
- afpeople_names = new ArrayList<>();
|
|
|
-
|
|
|
- resubmit_ll.setOnClickListener(new View.OnClickListener() { //TODO 重新提交
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
-
|
|
|
- if (!TextUtils.isEmpty(submittype) && submittype.equals("unsubmit")){//未提交状态
|
|
|
- startActivity(new Intent(activity, WorkDailyAddActivity.class)
|
|
|
- .putExtra("caller", mCaller)
|
|
|
- .putExtra("id", mkeyValue)
|
|
|
- .putExtra("rs_summary", summary)
|
|
|
- .putExtra("rs_plan", plan)
|
|
|
- .putExtra("rs_experience", experience)
|
|
|
- .putExtra("resubmit", "resubmit"));
|
|
|
- Log.i("dosubmit_id", mkeyValue + "");
|
|
|
- finish();
|
|
|
- }else { //提交状态
|
|
|
- new AlertDialog
|
|
|
- .Builder(mContext)
|
|
|
- .setTitle("温馨提示")
|
|
|
- .setMessage("\t\t确认反提交该条单据?")
|
|
|
- .setNegativeButton("取消",null)
|
|
|
- .setPositiveButton("确认", new DialogInterface.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
- String retype = "reforsub";
|
|
|
- doresubmit(retype);
|
|
|
- }
|
|
|
- }).show();
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- delete_ll.setOnClickListener(new View.OnClickListener() { //TODO 删除
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- if (!TextUtils.isEmpty(submittype) && submittype.equals("unsubmit")){
|
|
|
- new AlertDialog
|
|
|
- .Builder(mContext)
|
|
|
- .setTitle("温馨提示")
|
|
|
- .setMessage("\t\t确认删除该条已保存单据?")
|
|
|
- .setNegativeButton("取消", null)
|
|
|
- .setPositiveButton("确认", new DialogInterface.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
- dodelete(mCaller, mkeyValue);
|
|
|
- }
|
|
|
- }).show();
|
|
|
-
|
|
|
- }else {
|
|
|
- new AlertDialog
|
|
|
- .Builder(mContext)
|
|
|
- .setTitle("温馨提示")
|
|
|
- .setMessage("\t\t确认删除该条已提交单据?")
|
|
|
- .setNegativeButton("取消", null)
|
|
|
- .setPositiveButton("确认", new DialogInterface.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
- String retype = "refordelete";
|
|
|
- doresubmit(retype);
|
|
|
- }
|
|
|
- }).show();
|
|
|
+ private void getapplypeomsg(CommonApprovalFlowBean mCommonApprovalFlowBean) {
|
|
|
+ if (ListUtils.isEmpty(mCommonApprovalFlowBean.getProcesss())) return;
|
|
|
+ String applypeo_name = mCommonApprovalFlowBean.getProcesss().get(0).getJp_launcherName();
|
|
|
+ String applypeo_number = mCommonApprovalFlowBean.getProcesss().get(0).getJp_launcherId();
|
|
|
+
|
|
|
+ name_tv.setText(applypeo_name);
|
|
|
+ if (!applypeo_number.isEmpty()){
|
|
|
+ String whichsys = CommonUtil.getSharedPreferences(mContext, "erp_master");
|
|
|
+ String[] selectionArgs = {applypeo_number == null ? "" : applypeo_number, whichsys};
|
|
|
+ String selection = "em_code=? and whichsys=? ";
|
|
|
+
|
|
|
+ try {
|
|
|
+ //获取数据库数据
|
|
|
+ EmployeesEntity bean = manager.selectForEmployee(selectionArgs, selection);
|
|
|
+ if (bean != null) {
|
|
|
+ String imId = String.valueOf(bean.getEm_IMID());
|
|
|
+ String imName = String.valueOf(bean.getEM_NAME());
|
|
|
+ String imDepartment = String.valueOf(bean.getEM_DEFAULTORNAME());
|
|
|
+ String imPosition = String.valueOf(bean.getEM_POSITION());
|
|
|
+
|
|
|
+ name_tv.setText(imName);
|
|
|
+ if (!StringUtils.isEmpty(imId)) {
|
|
|
+ AvatarHelper.getInstance().display(imId, photo_im, true, false);
|
|
|
+ } else {
|
|
|
+ String imageUri = "drawable://" + R.drawable.common_header_boy;
|
|
|
+ AvatarHelper.getInstance().display(imageUri, photo_im, true);
|
|
|
+ }//显示圆角图片
|
|
|
+ section_tv.setText(imDepartment + ">" + imPosition);
|
|
|
+
|
|
|
+ Log.i("aptodo", "imId=" + imId + "imName" + imName + "imDepartment" + imDepartment + "imPosition" + imPosition);
|
|
|
+ } else {
|
|
|
+ ToastMessage("单据申请人数据获取异常");
|
|
|
}
|
|
|
-
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
// 删除
|
|
|
private void dodelete(String mCaller, int mkeyValue) {
|
|
|
String url = CommonUtil.getSharedPreferences(ct, "erp_baseurl") + "/mobile/commondelete.action";
|
|
|
@@ -595,7 +650,7 @@ public class DailydetailsActivity extends BaseActivity {
|
|
|
resanddel_ll.setVisibility(View.VISIBLE);
|
|
|
}else if (wd_status.equals("在录入")){
|
|
|
wdd_status.setTextColor(mContext.getResources().getColor(R.color.done_approval));
|
|
|
- wdd_status.setText("未提交");
|
|
|
+ wdd_status.setText("在录入");
|
|
|
resanddel_ll.setVisibility(View.VISIBLE);
|
|
|
submittype = "unsubmit";
|
|
|
resubmit_tv.setText("提交");
|
|
|
@@ -620,7 +675,7 @@ public class DailydetailsActivity extends BaseActivity {
|
|
|
approval_flowlv.setVisibility(View.GONE);
|
|
|
hide_above_af.setVisibility(View.GONE);
|
|
|
}
|
|
|
-
|
|
|
+ csv_hide.setVisibility(View.VISIBLE);
|
|
|
}
|
|
|
|
|
|
@Override
|