|
|
@@ -112,7 +112,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
@Override
|
|
|
protected void onResume() {
|
|
|
initDate();
|
|
|
- commondoc_sv.smoothScrollTo(0,0);
|
|
|
+ commondoc_sv.smoothScrollTo(0, 0);
|
|
|
super.onResume();
|
|
|
}
|
|
|
|
|
|
@@ -167,7 +167,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
String imageUri = "drawable://" + R.drawable.common_header_boy;
|
|
|
AvatarHelper.getInstance().display(imageUri, photo_im, true);
|
|
|
|
|
|
- im_ids =new ArrayList<>();
|
|
|
+ im_ids = new ArrayList<>();
|
|
|
afpeople_names = new ArrayList<>();
|
|
|
|
|
|
}
|
|
|
@@ -270,7 +270,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
String del_result = msg.getData().getString("result");
|
|
|
LogUtil.prinlnLongMsg("del_result", del_result);
|
|
|
Toast.makeText(getApplicationContext(), "单据删除成功", Toast.LENGTH_LONG).show();
|
|
|
- FormListSelectActivity.isdelete=true;
|
|
|
+ FormListSelectActivity.isdelete = true;
|
|
|
finish();
|
|
|
break;
|
|
|
case COM_DOC_RESUB_SUCCESSFUL: //已提交状态 重新提交操作前的反提交
|
|
|
@@ -297,10 +297,10 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
break;
|
|
|
case Constants.APP_SOCKETIMEOUTEXCEPTION:
|
|
|
Toast.makeText(CommonDocDetailsActivity.this, msg.getData().getString("result"), Toast.LENGTH_LONG).show();
|
|
|
- if(!TextUtils.isEmpty(real_status) && real_status.equals("已审核")){
|
|
|
+ if (!TextUtils.isEmpty(real_status) && real_status.equals("已审核")) {
|
|
|
commondoc_sv.setVisibility(View.VISIBLE);
|
|
|
resanddel_ll.setVisibility(View.GONE);
|
|
|
- }else if (!TextUtils.isEmpty(real_status) && real_status.equals("已提交")){
|
|
|
+ } else if (!TextUtils.isEmpty(real_status) && real_status.equals("已提交")) {
|
|
|
commondoc_sv.setVisibility(View.VISIBLE);
|
|
|
}
|
|
|
|
|
|
@@ -379,10 +379,10 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
if ((!TextUtils.isEmpty(fd_field) && fd_field.equals("va_emcode")) ||
|
|
|
(!TextUtils.isEmpty(fd_field) && fd_field.equals("wo_emcode")) ||
|
|
|
(!TextUtils.isEmpty(fd_field) && fd_field.equals("sa_appmancode")) ||
|
|
|
- (!TextUtils.isEmpty(fd_field) && fd_field.equals("FP_PEOPLE2"))){
|
|
|
- if (!fd_field.equals("null")){
|
|
|
+ (!TextUtils.isEmpty(fd_field) && fd_field.equals("FP_PEOPLE2"))) {
|
|
|
+ if (!fd_field.equals("null")) {
|
|
|
em_number = formdataArray.getJSONObject(0).getString(fd_field);
|
|
|
- Log.i("em_number",em_number);
|
|
|
+ Log.i("em_number", em_number);
|
|
|
}
|
|
|
}
|
|
|
getapplypeomsg(em_number);
|
|
|
@@ -430,16 +430,16 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
* 申请单据的审批,提交,录入状态
|
|
|
*/
|
|
|
private void SetComDocStatus(String real_status) {
|
|
|
- if (!TextUtils.isEmpty(real_status)){
|
|
|
- if (real_status.equals("已审核")){
|
|
|
+ if (!TextUtils.isEmpty(real_status)) {
|
|
|
+ if (real_status.equals("已审核")) {
|
|
|
status_tv.setTextColor(getApplicationContext().getResources().getColor(R.color.approval));
|
|
|
status_tv.setText("已审批");
|
|
|
resanddel_ll.setVisibility(View.GONE);
|
|
|
- }else if (real_status.equals("已提交")){
|
|
|
+ } else if (real_status.equals("已提交")) {
|
|
|
status_tv.setTextColor(getApplicationContext().getResources().getColor(R.color.no_approval));
|
|
|
status_tv.setText("待审批");
|
|
|
resanddel_ll.setVisibility(View.VISIBLE);
|
|
|
- }else if (real_status.equals("在录入")){
|
|
|
+ } else if (real_status.equals("在录入")) {
|
|
|
status_tv.setTextColor(getApplicationContext().getResources().getColor(R.color.titleBlue));
|
|
|
status_tv.setText("未提交");
|
|
|
resanddel_ll.setVisibility(View.VISIBLE);
|
|
|
@@ -457,38 +457,38 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
private String af_name;
|
|
|
|
|
|
public void AFshow(String af_result) {
|
|
|
- try{
|
|
|
+ try {
|
|
|
JSONObject resultJsonObject = new JSONObject(af_result);
|
|
|
//JSONArray dailynodeArray = resultJsonObject.getJSONArray("nodes");
|
|
|
- if(resultJsonObject == null){
|
|
|
+ if (resultJsonObject == null) {
|
|
|
appflow_lv.setVisibility(View.GONE);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
mCommonApprovalFlowBean = JSON.parseObject(resultJsonObject.toString(), CommonApprovalFlowBean.class);
|
|
|
em_code = new String();
|
|
|
if (manager == null) manager = new DBManager(mContext);
|
|
|
- if("已审核".equals(real_status) && (mCommonApprovalFlowBean.getData().size() == 0 ||
|
|
|
- mCommonApprovalFlowBean.getData().size() == mCommonApprovalFlowBean.getNodes().size())){ // TODO 已审核直接从node里面取数据
|
|
|
- for (int i = 0; i <mCommonApprovalFlowBean.getNodes().size(); i++) {
|
|
|
+ if ("已审核".equals(real_status) && (mCommonApprovalFlowBean.getData().size() == 0 ||
|
|
|
+ mCommonApprovalFlowBean.getData().size() == mCommonApprovalFlowBean.getNodes().size())) { // TODO 已审核直接从node里面取数据
|
|
|
+ for (int i = 0; i < mCommonApprovalFlowBean.getNodes().size(); i++) {
|
|
|
//取名字
|
|
|
- if (!TextUtils.isEmpty(mCommonApprovalFlowBean.getNodes().get(i).getJn_dealManName())){
|
|
|
+ if (!TextUtils.isEmpty(mCommonApprovalFlowBean.getNodes().get(i).getJn_dealManName())) {
|
|
|
afpeople_names.add(mCommonApprovalFlowBean.getNodes().get(i).getJn_dealManName());
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
afpeople_names.add("");
|
|
|
}
|
|
|
//取头像id
|
|
|
- if (!TextUtils.isEmpty(mCommonApprovalFlowBean.getNodes().get(i).getJn_dealManId())){
|
|
|
+ if (!TextUtils.isEmpty(mCommonApprovalFlowBean.getNodes().get(i).getJn_dealManId())) {
|
|
|
em_code = mCommonApprovalFlowBean.getNodes().get(i).getJn_dealManId();
|
|
|
- if( em_code.contains(",")){
|
|
|
+ if (em_code.contains(",")) {
|
|
|
String str[] = em_code.split(",");
|
|
|
em_code = str[0];
|
|
|
ToastMessage("多人审批,头像已显示为首个"); //该情况只有在测试账号情况下出现
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
em_code = " ";
|
|
|
}
|
|
|
try {
|
|
|
String whichsys = CommonUtil.getSharedPreferences(mContext, "erp_master");
|
|
|
- String[] selectionArgs = {em_code == null ? "": em_code, whichsys};
|
|
|
+ String[] selectionArgs = {em_code == null ? "" : em_code, whichsys};
|
|
|
String selection = "em_code=? and whichsys=? ";
|
|
|
//获取数据库数据
|
|
|
EmployeesEntity bean = manager.selectForEmployee(selectionArgs, selection);
|
|
|
@@ -496,31 +496,34 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
String imId = String.valueOf(bean.getEm_IMID());
|
|
|
Log.i("todo", "imId=" + imId);
|
|
|
im_ids.add(imId);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
im_ids.add("");
|
|
|
// ToastMessage("审批流头像获取异常,已显示为默认");
|
|
|
}
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- }else if ("已提交".equals(real_status)){
|
|
|
+ } else if ("已提交".equals(real_status)) {
|
|
|
String whichsys = CommonUtil.getSharedPreferences(mContext, "erp_master");
|
|
|
-
|
|
|
+ if (!ListUtils.isEmpty(afpeople_names))
|
|
|
+ afpeople_names.clear();
|
|
|
+ if (!ListUtils.isEmpty(im_ids))
|
|
|
+ im_ids.clear();
|
|
|
// TODO 已提交状态判断是否有变更处理人,所以得先去process中判断,好麻烦噢
|
|
|
- if (!ListUtils.isEmpty(mCommonApprovalFlowBean.getProcesss()) && !ListUtils.isEmpty(mCommonApprovalFlowBean.getData())){
|
|
|
+ if (!ListUtils.isEmpty(mCommonApprovalFlowBean.getProcesss()) && !ListUtils.isEmpty(mCommonApprovalFlowBean.getData())) {
|
|
|
int processnum = mCommonApprovalFlowBean.getProcesss().size();
|
|
|
//取process数据
|
|
|
for (int i = 0; i < processnum; i++) {
|
|
|
- if (!TextUtils.isEmpty(mCommonApprovalFlowBean.getProcesss().get(i).getJp_nodeDealMan())){
|
|
|
+ if (!TextUtils.isEmpty(mCommonApprovalFlowBean.getProcesss().get(i).getJp_nodeDealMan())) {
|
|
|
em_code = mCommonApprovalFlowBean.getProcesss().get(i).getJp_nodeDealMan();
|
|
|
- if( em_code.contains(",")) {
|
|
|
+ if (em_code.contains(",")) {
|
|
|
String str[] = em_code.split(",");
|
|
|
em_code = str[0];
|
|
|
ToastMessage("多人审批,头像已显示为首个"); //该情况只有在测试账号情况下出现
|
|
|
}
|
|
|
- String[] selectionArgs = {em_code == null ? "": em_code, whichsys};
|
|
|
+ String[] selectionArgs = {em_code == null ? "" : em_code, whichsys};
|
|
|
String selection = "em_code=? and whichsys=? ";
|
|
|
try {
|
|
|
EmployeesEntity bean = manager.selectForEmployee(selectionArgs, selection);
|
|
|
@@ -534,7 +537,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
String imId = String.valueOf(bean.getEm_IMID());
|
|
|
Log.i("todo", "imId=" + imId);
|
|
|
im_ids.add(imId);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
im_ids.add("");
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
@@ -543,30 +546,30 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
}
|
|
|
|
|
|
//获取process审批人姓名
|
|
|
- if (!TextUtils.isEmpty(mCommonApprovalFlowBean.getProcesss().get(i).getJp_nodeDealManName())){
|
|
|
+ if (!TextUtils.isEmpty(mCommonApprovalFlowBean.getProcesss().get(i).getJp_nodeDealManName())) {
|
|
|
afpeople_names.add(mCommonApprovalFlowBean.getProcesss().get(i).getJp_nodeDealManName());
|
|
|
- }else if (!TextUtils.isEmpty(af_name)){
|
|
|
+ } else if (!TextUtils.isEmpty(af_name)) {
|
|
|
afpeople_names.add(af_name);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
afpeople_names.add("");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//取data数据
|
|
|
- for (int j = processnum; j<mCommonApprovalFlowBean.getData().size();j++){
|
|
|
+ for (int j = processnum; j < mCommonApprovalFlowBean.getData().size(); j++) {
|
|
|
//取process之后的审批人名字
|
|
|
- if (!TextUtils.isEmpty(mCommonApprovalFlowBean.getData().get(j).getJP_NODEDEALMANNAME())){
|
|
|
+ if (!TextUtils.isEmpty(mCommonApprovalFlowBean.getData().get(j).getJP_NODEDEALMANNAME())) {
|
|
|
afpeople_names.add(mCommonApprovalFlowBean.getData().get(j).getJP_NODEDEALMANNAME());
|
|
|
}
|
|
|
//取process之后的imid
|
|
|
- if (!TextUtils.isEmpty(mCommonApprovalFlowBean.getData().get(j).getJP_NODEDEALMAN())){
|
|
|
+ if (!TextUtils.isEmpty(mCommonApprovalFlowBean.getData().get(j).getJP_NODEDEALMAN())) {
|
|
|
em_code = mCommonApprovalFlowBean.getData().get(j).getJP_NODEDEALMAN();
|
|
|
- if( em_code.contains(",")) {
|
|
|
+ if (em_code.contains(",")) {
|
|
|
String str[] = em_code.split(",");
|
|
|
em_code = str[0];
|
|
|
ToastMessage("多人审批,头像已显示为首个"); //该情况只有在测试账号情况下出现
|
|
|
}
|
|
|
- String[] selectionArgs = {em_code == null ? "": em_code, whichsys};
|
|
|
+ String[] selectionArgs = {em_code == null ? "" : em_code, whichsys};
|
|
|
String selection = "em_code=? and whichsys=? ";
|
|
|
try {
|
|
|
//获取数据库数据
|
|
|
@@ -575,11 +578,11 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
String imId = String.valueOf(bean.getEm_IMID());
|
|
|
Log.i("todo", "imId=" + imId);
|
|
|
im_ids.add(imId);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
im_ids.add("");
|
|
|
// ToastMessage("审批流头像获取异常,已显示为默认");
|
|
|
}
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
@@ -587,28 +590,28 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
}
|
|
|
|
|
|
// TODO 标准版刚刚提交时无变更时,全部取data数据
|
|
|
- if (ListUtils.isEmpty(mCommonApprovalFlowBean.getProcesss()) && !ListUtils.isEmpty(mCommonApprovalFlowBean.getData())){
|
|
|
- for (int i = 0; i <mCommonApprovalFlowBean.getData().size(); i++) {
|
|
|
+ if (ListUtils.isEmpty(mCommonApprovalFlowBean.getProcesss()) && !ListUtils.isEmpty(mCommonApprovalFlowBean.getData())) {
|
|
|
+ for (int i = 0; i < mCommonApprovalFlowBean.getData().size(); i++) {
|
|
|
//取名字
|
|
|
if (manager == null) manager = new DBManager(mContext);
|
|
|
- if (!TextUtils.isEmpty(mCommonApprovalFlowBean.getData().get(i).getJP_NODEDEALMANNAME())){
|
|
|
+ if (!TextUtils.isEmpty(mCommonApprovalFlowBean.getData().get(i).getJP_NODEDEALMANNAME())) {
|
|
|
afpeople_names.add(mCommonApprovalFlowBean.getData().get(i).getJP_NODEDEALMANNAME());
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
afpeople_names.add("");
|
|
|
}
|
|
|
//取头像id
|
|
|
- if (!TextUtils.isEmpty(mCommonApprovalFlowBean.getData().get(i).getJP_NODEDEALMAN())){
|
|
|
+ if (!TextUtils.isEmpty(mCommonApprovalFlowBean.getData().get(i).getJP_NODEDEALMAN())) {
|
|
|
em_code = mCommonApprovalFlowBean.getData().get(i).getJP_NODEDEALMAN();
|
|
|
- if( em_code.contains(",")){
|
|
|
+ if (em_code.contains(",")) {
|
|
|
String str[] = em_code.split(",");
|
|
|
em_code = str[0];
|
|
|
ToastMessage("多人审批,头像已显示为首个"); //该情况只有在测试账号情况下出现
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
em_code = " ";
|
|
|
}
|
|
|
try {
|
|
|
- String[] selectionArgs = {em_code == null ? "": em_code, whichsys};
|
|
|
+ String[] selectionArgs = {em_code == null ? "" : em_code, whichsys};
|
|
|
String selection = "em_code=? and whichsys=? ";
|
|
|
//获取数据库数据
|
|
|
EmployeesEntity bean = manager.selectForEmployee(selectionArgs, selection);
|
|
|
@@ -616,18 +619,18 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
String imId = String.valueOf(bean.getEm_IMID());
|
|
|
Log.i("todo", "imId=" + imId);
|
|
|
im_ids.add(imId);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
im_ids.add("");
|
|
|
// ToastMessage("审批流头像获取异常,已显示为默认");
|
|
|
}
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
- }else if ("已审核".equals(real_status) && mCommonApprovalFlowBean.getData().size() != 0
|
|
|
- && mCommonApprovalFlowBean.getData().size() != mCommonApprovalFlowBean.getNodes().size()){
|
|
|
+ } else if ("已审核".equals(real_status) && mCommonApprovalFlowBean.getData().size() != 0
|
|
|
+ && mCommonApprovalFlowBean.getData().size() != mCommonApprovalFlowBean.getNodes().size()) {
|
|
|
appflow_lv.setVisibility(View.GONE);
|
|
|
}
|
|
|
Log.i("last_afpeople_names", afpeople_names.toString());
|
|
|
@@ -638,15 +641,16 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
mCommonDocApprovalFlowAdapter.setmCommonApprovalFlowBean(mCommonApprovalFlowBean);
|
|
|
appflow_lv.setAdapter(mCommonDocApprovalFlowAdapter);
|
|
|
|
|
|
- if(ListUtils.isEmpty(mCommonApprovalFlowBean.getData()) && ListUtils.isEmpty(mCommonApprovalFlowBean.getNodes())){
|
|
|
+ if (ListUtils.isEmpty(mCommonApprovalFlowBean.getData()) && ListUtils.isEmpty(mCommonApprovalFlowBean.getNodes())) {
|
|
|
hide_above_af.setVisibility(View.GONE);
|
|
|
}
|
|
|
}
|
|
|
- }catch (JSONException e){
|
|
|
+ } catch (JSONException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
getemcodefromAF();
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 申请单据申请人emcode,从审批流数据获取
|
|
|
*/
|
|
|
@@ -654,7 +658,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
|
|
|
// 当单据是提交状态 触发审批流时获取
|
|
|
if (!ListUtils.isEmpty(mCommonApprovalFlowBean.getProcesss())) {
|
|
|
- if (TextUtils.isEmpty(em_number)){
|
|
|
+ if (TextUtils.isEmpty(em_number)) {
|
|
|
em_number = mCommonApprovalFlowBean.getProcesss().get(0).getJp_launcherId(); //申请人编号 从process获取
|
|
|
// name_tv.setText(mCommonApprovalFlowBean.getProcesss().get(0).getJp_launcherName()); //申请人姓名 从process获取
|
|
|
getapplypeomsg(em_number);
|
|
|
@@ -738,7 +742,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
|
|
|
- if (!TextUtils.isEmpty(real_status) && real_status.equals("在录入")){
|
|
|
+ if (!TextUtils.isEmpty(real_status) && real_status.equals("在录入")) {
|
|
|
new AlertDialog
|
|
|
.Builder(mContext)
|
|
|
.setTitle("温馨提示")
|
|
|
@@ -750,7 +754,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
DeleteComDocRequest(mCaller, mkeyValue);
|
|
|
}
|
|
|
}).show();
|
|
|
- }else if (!TextUtils.isEmpty(real_status) && real_status.equals("已提交")){
|
|
|
+ } else if (!TextUtils.isEmpty(real_status) && real_status.equals("已提交")) {
|
|
|
new AlertDialog
|
|
|
.Builder(mContext)
|
|
|
.setTitle("温馨提示")
|
|
|
@@ -776,7 +780,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
private void getapplypeomsg(String em_number) {
|
|
|
if (!em_number.isEmpty()) {
|
|
|
String whichsys = CommonUtil.getSharedPreferences(mContext, "erp_master");
|
|
|
- String[] selectionArgs = {em_number == null ? "":em_number, whichsys};
|
|
|
+ String[] selectionArgs = {em_number == null ? "" : em_number, whichsys};
|
|
|
String selection = "em_code=? and whichsys=? ";
|
|
|
try {
|
|
|
//获取数据库数据
|
|
|
@@ -809,7 +813,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
@Override
|
|
|
protected void onDestroy() {
|
|
|
super.onDestroy();
|
|
|
- if (manager!=null) {
|
|
|
+ if (manager != null) {
|
|
|
manager.closeDB();
|
|
|
}
|
|
|
}
|
|
|
@@ -818,16 +822,16 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
@Override
|
|
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
|
|
if ((keyCode == KeyEvent.KEYCODE_BACK)) {
|
|
|
- if (ActivityUtils.isExsitMianActivity(mContext,FormListSelectActivity.class)){
|
|
|
+ if (ActivityUtils.isExsitMianActivity(mContext, FormListSelectActivity.class)) {
|
|
|
LogUtil.d("正常返回...");
|
|
|
onBackPressed();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
LogUtil.d("非正常返回...");
|
|
|
- startActivity(new Intent(mContext, FormListSelectActivity.class).putExtra("caller",mCaller));
|
|
|
+ startActivity(new Intent(mContext, FormListSelectActivity.class).putExtra("caller", mCaller));
|
|
|
finish();
|
|
|
}
|
|
|
return false;
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
return super.onKeyDown(keyCode, event);
|
|
|
}
|
|
|
|