|
|
@@ -196,20 +196,20 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public boolean onCreateOptionsMenu(Menu menu) {
|
|
|
- getMenuInflater().inflate(R.menu.comdoc_list, menu);
|
|
|
- return super.onCreateOptionsMenu(menu);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public boolean onOptionsItemSelected(MenuItem item) {
|
|
|
- if (item.getItemId() == R.id.more_doc){
|
|
|
- startActivity(new Intent(mContext, FormListSelectActivity.class).putExtra("caller",mCaller));
|
|
|
- finish();
|
|
|
- }
|
|
|
- return super.onOptionsItemSelected(item);
|
|
|
- }
|
|
|
+// @Override
|
|
|
+// public boolean onCreateOptionsMenu(Menu menu) {
|
|
|
+// getMenuInflater().inflate(R.menu.comdoc_list, menu);
|
|
|
+// return super.onCreateOptionsMenu(menu);
|
|
|
+// }
|
|
|
+//
|
|
|
+// @Override
|
|
|
+// public boolean onOptionsItemSelected(MenuItem item) {
|
|
|
+// if (item.getItemId() == R.id.more_doc){
|
|
|
+// startActivity(new Intent(mContext,FormListSelectActivity.class)
|
|
|
+// .putExtra("caller", mCaller));
|
|
|
+// }
|
|
|
+// return super.onOptionsItemSelected(item);
|
|
|
+// }
|
|
|
|
|
|
public Handler mHandler = new Handler(){
|
|
|
@Override
|
|
|
@@ -286,7 +286,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
mEmptyLayput_applymsg.showEmpty();
|
|
|
} else {
|
|
|
|
|
|
- // ToDo 获取需要显示的主表单配置数据属性保存到mFormconfigsBean中
|
|
|
+ // 获取需要显示的主表单配置数据属性保存到mFormconfigsBean中
|
|
|
if (mCommonDocAMBean.getDatas().getFormdata() !=null && mCommonDocAMBean.getDatas().getFormconfigs() != null) {
|
|
|
int allFormdata_num = mCommonDocAMBean.getDatas().getFormdata().size();
|
|
|
int allFormconfigs_num = mCommonDocAMBean.getDatas().getFormconfigs().size();
|
|
|
@@ -303,18 +303,18 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
LogUtil.prinlnLongMsg("mFormconfigsBean", mFormconfigsBean.toString());
|
|
|
}
|
|
|
|
|
|
- // ToDo 获取需要显示的从表单配置数据属性保存到mGridconfigsBean中
|
|
|
+ // 获取需要显示的从表单配置数据属性保存到mGridconfigsBean中
|
|
|
if (mCommonDocAMBean.getDatas().getGriddata() != null && mCommonDocAMBean.getDatas().getGridconfigs()!= null){
|
|
|
int allGriddate_num = mCommonDocAMBean.getDatas().getGriddata().size();
|
|
|
int allGridconfigs_num = mCommonDocAMBean.getDatas().getGridconfigs().size();
|
|
|
- for (int i = 0; i < allGridconfigs_num; i++) {
|
|
|
- String dg_caption = mCommonDocAMBean.getDatas().getGridconfigs().get(i).getDG_CAPTION();
|
|
|
- String dg_field = mCommonDocAMBean.getDatas().getGridconfigs().get(i).getDG_FIELD();
|
|
|
- int mdg_isdefault = mCommonDocAMBean.getDatas().getGridconfigs().get(i).getMDG_ISDEFAULT();
|
|
|
- if (mdg_isdefault !=0 && dg_caption != null && dg_field !=null) {
|
|
|
- mGridconfigsBean.add(mCommonDocAMBean.getDatas().getGridconfigs().get(i));
|
|
|
- }
|
|
|
+ for (int i = 0; i < allGridconfigs_num; i++) {
|
|
|
+ String dg_caption = mCommonDocAMBean.getDatas().getGridconfigs().get(i).getDG_CAPTION();
|
|
|
+ String dg_field = mCommonDocAMBean.getDatas().getGridconfigs().get(i).getDG_FIELD();
|
|
|
+ int mdg_isdefault = mCommonDocAMBean.getDatas().getGridconfigs().get(i).getMDG_ISDEFAULT();
|
|
|
+ if (mdg_isdefault !=0 && dg_caption != null && dg_field !=null) {
|
|
|
+ mGridconfigsBean.add(mCommonDocAMBean.getDatas().getGridconfigs().get(i));
|
|
|
}
|
|
|
+ }
|
|
|
mComDocGriddataOutAdapter.setmGridconfigsBean(mGridconfigsBean);
|
|
|
second_msg_lv.setAdapter(mComDocGriddataOutAdapter);
|
|
|
LogUtil.prinlnLongMsg("mGridconfigsBean", mGridconfigsBean.toString());
|
|
|
@@ -344,45 +344,45 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
mEmptyLayput_approvalflow.showEmpty();
|
|
|
ToastMessage("单据审批流数据获取异常");
|
|
|
}else {
|
|
|
- //TODO 从im获取头像
|
|
|
+ // 从im获取头像
|
|
|
for (int i = 0; i < mCommonApprovalFlowBean.getData().size(); i++) {
|
|
|
if (manager == null) manager = new DBManager(mContext);
|
|
|
String whichsys = CommonUtil.getSharedPreferences(mContext, "erp_master");
|
|
|
String emCode = mCommonApprovalFlowBean.getData().get(i).getJP_NODEDEALMAN();
|
|
|
- try{
|
|
|
- if( emCode.contains(",")){
|
|
|
+ try{
|
|
|
+ if( emCode.contains(",")){
|
|
|
// im_ids.add("");
|
|
|
- String str[] = emCode.split(",");
|
|
|
- emCode = str[0];
|
|
|
- ToastMessage("多人审批,头像已显示为首个"); //该情况只有在测试账号情况下出现
|
|
|
- }
|
|
|
- }catch (Exception e){
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
+ String str[] = emCode.split(",");
|
|
|
+ emCode = str[0];
|
|
|
+ ToastMessage("多人审批,头像已显示为首个"); //该情况只有在测试账号情况下出现
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
|
|
|
String[] selectionArgs = {emCode, whichsys};
|
|
|
String selection = "em_code=? and whichsys=? ";
|
|
|
//获取数据库数据
|
|
|
- try {
|
|
|
- EmployeesEntity bean = manager.selectForEmployee(selectionArgs, selection);
|
|
|
- if (bean != null) {
|
|
|
- String imId = String.valueOf(bean.getEm_IMID());
|
|
|
- Log.i("todo", "imId=" + imId);
|
|
|
- im_ids.add(imId);
|
|
|
- } else {
|
|
|
- im_ids.add("");
|
|
|
+ try {
|
|
|
+ EmployeesEntity bean = manager.selectForEmployee(selectionArgs, selection);
|
|
|
+ if (bean != null) {
|
|
|
+ String imId = String.valueOf(bean.getEm_IMID());
|
|
|
+ Log.i("todo", "imId=" + imId);
|
|
|
+ im_ids.add(imId);
|
|
|
+ } else {
|
|
|
+ im_ids.add("");
|
|
|
// ToastMessage("审批流头像获取异常,已显示为默认");
|
|
|
- }
|
|
|
- mCommonDocApprovalFlowAdapter.setIm_ids(im_ids);
|
|
|
- Log.i("afimids", im_ids.toString());
|
|
|
- }catch (Exception e){
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
+ }
|
|
|
+ mCommonDocApprovalFlowAdapter.setIm_ids(im_ids);
|
|
|
+ Log.i("afimids", im_ids.toString());
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
- //TODO 设置数据之前先通过数据库获取到所有的imid保存到内存中
|
|
|
+ // 设置数据之前先通过数据库获取到所有的imid保存到内存中
|
|
|
mCommonDocApprovalFlowAdapter.setmCommonApprovalFlowBean(mCommonApprovalFlowBean);
|
|
|
appflow_lv.setAdapter(mCommonDocApprovalFlowAdapter);
|
|
|
}
|
|
|
@@ -396,68 +396,71 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
* 申请单据申请人姓名、头像、部门、职位获取显示
|
|
|
*/
|
|
|
public void ShowApplyPeoMsg() {
|
|
|
- // TODO 当单据是提交状态 触发审批流时获取
|
|
|
- if ( !ListUtils.isEmpty(mCommonApprovalFlowBean.getProcesss())) {
|
|
|
- String em_number = mCommonApprovalFlowBean.getProcesss().get(0).getJp_launcherId(); //申请人编号 从process获取
|
|
|
- name_tv.setText(mCommonApprovalFlowBean.getProcesss().get(0).getJp_launcherName()); //申请人姓名 从process获取
|
|
|
- if (!ListUtils.isEmpty(mCommonApprovalFlowBean.getNodes())){
|
|
|
- int data_num = mCommonApprovalFlowBean.getData().size();
|
|
|
- int nodes_num = mCommonApprovalFlowBean.getNodes().size();
|
|
|
- String app_status = mCommonApprovalFlowBean.getNodes().get(nodes_num - 1).getJn_dealResult();
|
|
|
- if ((nodes_num == data_num && nodes_num > 0) &&
|
|
|
- mCommonApprovalFlowBean.getNodes().get(data_num - 1).getJn_dealResult() != null &&
|
|
|
- mCommonApprovalFlowBean.getNodes().get(data_num - 1).getJn_dealResult().equals("同意")) {
|
|
|
- status_tv.setTextColor(getApplicationContext().getResources().getColor(R.color.approval));
|
|
|
- status_tv.setText("已审批");
|
|
|
- }
|
|
|
- }
|
|
|
- else {
|
|
|
+ // 当单据是提交状态 触发审批流时获取
|
|
|
+ if ( !ListUtils.isEmpty(mCommonApprovalFlowBean.getProcesss())) {
|
|
|
+ String em_number = mCommonApprovalFlowBean.getProcesss().get(0).getJp_launcherId(); //申请人编号 从process获取
|
|
|
+ name_tv.setText(mCommonApprovalFlowBean.getProcesss().get(0).getJp_launcherName()); //申请人姓名 从process获取
|
|
|
+ if (!ListUtils.isEmpty(mCommonApprovalFlowBean.getNodes())){
|
|
|
+ int data_num = mCommonApprovalFlowBean.getData().size();
|
|
|
+ int nodes_num = mCommonApprovalFlowBean.getNodes().size();
|
|
|
+ String app_status = mCommonApprovalFlowBean.getNodes().get(nodes_num - 1).getJn_dealResult();
|
|
|
+ if ((nodes_num == data_num && nodes_num > 0) &&
|
|
|
+ mCommonApprovalFlowBean.getNodes().get(data_num - 1).getJn_dealResult() != null &&
|
|
|
+ mCommonApprovalFlowBean.getNodes().get(data_num - 1).getJn_dealResult().equals("同意")) {
|
|
|
+ status_tv.setTextColor(getApplicationContext().getResources().getColor(R.color.approval));
|
|
|
+ status_tv.setText("已审批");
|
|
|
+ }else {
|
|
|
status_tv.setTextColor(getApplicationContext().getResources().getColor(R.color.no_approval));
|
|
|
status_tv.setText("待审批");
|
|
|
}
|
|
|
- if (!em_number.isEmpty() && em_number.length() > 0) {
|
|
|
- String whichsys = CommonUtil.getSharedPreferences(mContext, "erp_master");
|
|
|
- String[] selectionArgs = {em_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("todo", "imId=" + imId + "imName" + imName + "imDepartment" + imDepartment + "imPosition" + imPosition);
|
|
|
- } else {
|
|
|
- ToastMessage("单据申请人数据获取异常");
|
|
|
- }
|
|
|
- }catch (Exception e){
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
- } else if (ListUtils.isEmpty(mCommonApprovalFlowBean.getProcesss())
|
|
|
- && ListUtils.isEmpty(mCommonApprovalFlowBean.getNodes())
|
|
|
- && ListUtils.isEmpty(mCommonApprovalFlowBean.getData())){
|
|
|
-
|
|
|
- status_tv.setTextColor(getApplicationContext().getResources().getColor(R.color.titleBlue));
|
|
|
- status_tv.setText("未提交");
|
|
|
-
|
|
|
- }else {
|
|
|
+ }
|
|
|
+ else {
|
|
|
status_tv.setTextColor(getApplicationContext().getResources().getColor(R.color.no_approval));
|
|
|
status_tv.setText("待审批");
|
|
|
}
|
|
|
+ if (!em_number.isEmpty() && em_number.length() > 0) {
|
|
|
+ String whichsys = CommonUtil.getSharedPreferences(mContext, "erp_master");
|
|
|
+ String[] selectionArgs = {em_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("todo", "imId=" + imId + "imName" + imName + "imDepartment" + imDepartment + "imPosition" + imPosition);
|
|
|
+ } else {
|
|
|
+ ToastMessage("单据申请人数据获取异常");
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (ListUtils.isEmpty(mCommonApprovalFlowBean.getProcesss())
|
|
|
+ && ListUtils.isEmpty(mCommonApprovalFlowBean.getNodes())
|
|
|
+ && ListUtils.isEmpty(mCommonApprovalFlowBean.getData())){
|
|
|
+
|
|
|
+ status_tv.setTextColor(getApplicationContext().getResources().getColor(R.color.titleBlue));
|
|
|
+ status_tv.setText("未提交");
|
|
|
+
|
|
|
+ }else {
|
|
|
+ status_tv.setTextColor(getApplicationContext().getResources().getColor(R.color.no_approval));
|
|
|
+ status_tv.setText("待审批");
|
|
|
+ }
|
|
|
|
|
|
- // TODO 当单据未提交 未触发审批流时,默认静态显示申请人的信息
|
|
|
+ // 当单据未提交 未触发审批流时,默认静态显示申请人的信息
|
|
|
if(ListUtils.isEmpty(mCommonApprovalFlowBean.getProcesss())){
|
|
|
String en_code = CommonUtil.getSharedPreferences(ct,"erp_username");
|
|
|
manager = new DBManager(ct);
|
|
|
@@ -481,28 +484,43 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //ToDo 界面下面的按钮操作
|
|
|
- if (!ListUtils.isEmpty(mCommonApprovalFlowBean.getNodes()) && !ListUtils.isEmpty(mCommonApprovalFlowBean.getProcesss())){
|
|
|
- if (mCommonApprovalFlowBean.getData().size() == mCommonApprovalFlowBean.getNodes().size()
|
|
|
- && mCommonApprovalFlowBean.getNodes().get(mCommonApprovalFlowBean.getNodes().size() -1).getJn_dealResult().equals("同意")){
|
|
|
- resanddel_ll.setVisibility(View.GONE);
|
|
|
- approval_ll.setVisibility(View.GONE);
|
|
|
- }
|
|
|
- }else{
|
|
|
+ // 界面下面的按钮操作
|
|
|
+ if ((!ListUtils.isEmpty(mCommonApprovalFlowBean.getNodes()) && !ListUtils.isEmpty(mCommonApprovalFlowBean.getData()) &&
|
|
|
+ mCommonApprovalFlowBean.getData().size() == mCommonApprovalFlowBean.getNodes().size())
|
|
|
+ && mCommonApprovalFlowBean.getNodes().get(mCommonApprovalFlowBean.getNodes().size() -1).getJn_dealResult().equals("同意")){
|
|
|
+ resanddel_ll.setVisibility(View.GONE);
|
|
|
+ approval_ll.setVisibility(View.GONE);
|
|
|
+ }else {
|
|
|
approval_ll.setVisibility(View.GONE);
|
|
|
resanddel_ll.setVisibility(View.VISIBLE);
|
|
|
|
|
|
- // ToDo 重新提交
|
|
|
+ // 重新提交
|
|
|
resubmit_ll.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
- startActivity(new Intent(activity, DataFormDetailActivity.class)
|
|
|
- .putExtra("caller", mCaller)
|
|
|
- .putExtra("id", mkeyValue));
|
|
|
- //finish();
|
|
|
+ resubmit_ll.setOnClickListener(new View.OnClickListener() { // 重新提交
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ new AlertDialog
|
|
|
+ .Builder(mContext)
|
|
|
+ .setTitle("温馨提示")
|
|
|
+ .setMessage("\t\t确定反提交该条单据吗?")
|
|
|
+ .setNegativeButton("取消", null)
|
|
|
+ .setPositiveButton("确认", new DialogInterface.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(DialogInterface dialog, int which) {
|
|
|
+ startActivity(new Intent(CommonDocDetailsActivity.this, DataFormDetailActivity.class)
|
|
|
+ .putExtra("caller", mCaller)
|
|
|
+ .putExtra("id", mkeyValue));
|
|
|
+ //finish();
|
|
|
+ }
|
|
|
+ }).show();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
- //ToDO 删除
|
|
|
+ // // 删除
|
|
|
delete_ll.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
@@ -529,6 +547,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
|
|
if ((keyCode == KeyEvent.KEYCODE_BACK)) {
|