|
|
@@ -20,17 +20,21 @@ import android.widget.TextView;
|
|
|
import android.widget.Toast;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.lidroid.xutils.ViewUtils;
|
|
|
import com.lidroid.xutils.view.annotation.ViewInject;
|
|
|
import com.xzjmyk.pm.activity.MyApplication;
|
|
|
import com.xzjmyk.pm.activity.R;
|
|
|
import com.xzjmyk.pm.activity.adapter.DailyDetailsApprovalFlowAdapter;
|
|
|
+import com.xzjmyk.pm.activity.adapter.NodeAdapter;
|
|
|
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;
|
|
|
+import com.xzjmyk.pm.activity.ui.erp.model.oa.Approval;
|
|
|
import com.xzjmyk.pm.activity.ui.erp.net.ViewUtil;
|
|
|
+import com.xzjmyk.pm.activity.ui.erp.util.ApprovaNodeUtil;
|
|
|
import com.xzjmyk.pm.activity.ui.erp.util.CommonUtil;
|
|
|
import com.xzjmyk.pm.activity.ui.erp.util.Constants;
|
|
|
import com.xzjmyk.pm.activity.ui.erp.util.ListUtils;
|
|
|
@@ -41,9 +45,6 @@ import com.xzjmyk.pm.activity.ui.erp.view.EmptyLayout;
|
|
|
import com.xzjmyk.pm.activity.util.SystemUtil;
|
|
|
import com.xzjmyk.pm.activity.view.MyListView;
|
|
|
|
|
|
-import org.json.JSONException;
|
|
|
-import org.json.JSONObject;
|
|
|
-
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.LinkedHashMap;
|
|
|
@@ -86,7 +87,7 @@ public class DailydetailsActivity extends BaseActivity {
|
|
|
private EmptyLayout mEmptyLayput_approvalflow;
|
|
|
private int mkeyValue;
|
|
|
private String mCaller = "WorkDaily";
|
|
|
- private int mNoc = 1 ;
|
|
|
+ private int mNoc = 1;
|
|
|
private final static int APPROVAL_FLOW_NODE = 102;
|
|
|
private DBManager manager;
|
|
|
private List<String> im_ids;
|
|
|
@@ -134,6 +135,7 @@ public class DailydetailsActivity extends BaseActivity {
|
|
|
@ViewInject(R.id.common_docdata_rl)
|
|
|
private RelativeLayout common_docdata_rl;
|
|
|
private String em_name = CommonUtil.getSharedPreferences(MyApplication.getInstance(), "erp_emname");
|
|
|
+
|
|
|
@Override
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
super.onCreate(savedInstanceState);
|
|
|
@@ -149,7 +151,7 @@ public class DailydetailsActivity extends BaseActivity {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
|
|
|
- if (!TextUtils.isEmpty(submittype) && submittype.equals("unsubmit")){//未提交状态
|
|
|
+ if (!TextUtils.isEmpty(submittype) && submittype.equals("unsubmit")) {//未提交状态
|
|
|
startActivity(new Intent(activity, WorkDailyAddActivity.class)
|
|
|
.putExtra("caller", mCaller)
|
|
|
.putExtra("id", mkeyValue)
|
|
|
@@ -159,7 +161,7 @@ public class DailydetailsActivity extends BaseActivity {
|
|
|
.putExtra("resubmit", "resubmit"));
|
|
|
Log.i("dosubmit_id", mkeyValue + "");
|
|
|
finish();
|
|
|
- }else { //提交状态
|
|
|
+ } else { //提交状态
|
|
|
new AlertDialog
|
|
|
.Builder(mContext)
|
|
|
.setTitle(getString(R.string.common_notice))
|
|
|
@@ -180,20 +182,20 @@ public class DailydetailsActivity extends BaseActivity {
|
|
|
delete_ll.setOnClickListener(new View.OnClickListener() { //TODO 删除
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
- if (!TextUtils.isEmpty(submittype) && submittype.equals("unsubmit")){
|
|
|
+ if (!TextUtils.isEmpty(submittype) && submittype.equals("unsubmit")) {
|
|
|
new AlertDialog
|
|
|
.Builder(mContext)
|
|
|
.setTitle(getString(R.string.common_notice))
|
|
|
.setMessage(getString(R.string.delete_notice1))
|
|
|
.setNegativeButton(getString(R.string.common_cancel), null)
|
|
|
.setPositiveButton(getString(R.string.common_sure), new DialogInterface.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
- dodelete(mCaller, mkeyValue);
|
|
|
- }
|
|
|
- }).show();
|
|
|
+ @Override
|
|
|
+ public void onClick(DialogInterface dialog, int which) {
|
|
|
+ dodelete(mCaller, mkeyValue);
|
|
|
+ }
|
|
|
+ }).show();
|
|
|
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
new AlertDialog
|
|
|
.Builder(mContext)
|
|
|
.setTitle(getString(R.string.common_notice))
|
|
|
@@ -222,7 +224,7 @@ public class DailydetailsActivity extends BaseActivity {
|
|
|
wdd_plan.setOnLongClickListener(new View.OnLongClickListener() {
|
|
|
@Override
|
|
|
public boolean onLongClick(View v) {
|
|
|
- SystemUtil.copyText(getApplicationContext(),wdd_plan.getText().toString());
|
|
|
+ SystemUtil.copyText(getApplicationContext(), wdd_plan.getText().toString());
|
|
|
return true;
|
|
|
}
|
|
|
});
|
|
|
@@ -230,7 +232,7 @@ public class DailydetailsActivity extends BaseActivity {
|
|
|
wdd_experience.setOnLongClickListener(new View.OnLongClickListener() {
|
|
|
@Override
|
|
|
public boolean onLongClick(View v) {
|
|
|
- SystemUtil.copyText(getApplicationContext(),wdd_experience.getText().toString());
|
|
|
+ SystemUtil.copyText(getApplicationContext(), wdd_experience.getText().toString());
|
|
|
return true;
|
|
|
}
|
|
|
});
|
|
|
@@ -259,25 +261,27 @@ public class DailydetailsActivity extends BaseActivity {
|
|
|
mCommonApprovalFlowBean = new CommonApprovalFlowBean();
|
|
|
mDailyDetailsApprovalFlowAdapter = new DailyDetailsApprovalFlowAdapter(this);
|
|
|
|
|
|
- manager = new DBManager(this);
|
|
|
- im_ids =new ArrayList<>();
|
|
|
+ manager = new DBManager();
|
|
|
+ im_ids = new ArrayList<>();
|
|
|
afpeople_names = new ArrayList<>();
|
|
|
|
|
|
}
|
|
|
- private Handler handler = new Handler(){
|
|
|
+
|
|
|
+ private Handler handler = new Handler() {
|
|
|
@Override
|
|
|
public void handleMessage(Message msg) {
|
|
|
super.handleMessage(msg);
|
|
|
|
|
|
- switch (msg.what){
|
|
|
+ switch (msg.what) {
|
|
|
case APPROVAL_FLOW_NODE:
|
|
|
String wdaf_result = msg.getData().getString("result");
|
|
|
LogUtil.prinlnLongMsg("wdaf_result", wdaf_result);
|
|
|
- WDAFshow(wdaf_result);
|
|
|
+ handlerNode(wdaf_result);
|
|
|
+// WDAFshow(wdaf_result);
|
|
|
break;
|
|
|
case DAILY_REFORSUB_SUCCESSFULLY:
|
|
|
- if (msg.getData() != null){
|
|
|
- if (!StringUtils.isEmpty(msg.getData().getString("result"))){
|
|
|
+ if (msg.getData() != null) {
|
|
|
+ if (!StringUtils.isEmpty(msg.getData().getString("result"))) {
|
|
|
String resubmit_result = msg.getData().getString("result");
|
|
|
LogUtil.prinlnLongMsg("RESUBMITTED_message", resubmit_result);
|
|
|
Toast.makeText(ct, getString(R.string.daily_resumit_success), Toast.LENGTH_SHORT).show();
|
|
|
@@ -288,7 +292,7 @@ public class DailydetailsActivity extends BaseActivity {
|
|
|
.putExtra("rs_summary", summary)
|
|
|
.putExtra("rs_plan", plan)
|
|
|
.putExtra("rs_experience", experience)
|
|
|
- .putExtra("rs_donetask",donetask)
|
|
|
+ .putExtra("rs_donetask", donetask)
|
|
|
.putExtra("resubmit", "resubmit"));
|
|
|
Log.i("doresubmit_id", mkeyValue + "");
|
|
|
finish();
|
|
|
@@ -296,8 +300,8 @@ public class DailydetailsActivity extends BaseActivity {
|
|
|
}
|
|
|
break;
|
|
|
case DAILY_REFORDELETE_SUCCESSFULLY:
|
|
|
- if (msg.getData() != null){
|
|
|
- if (!StringUtils.isEmpty(msg.getData().getString("result"))){
|
|
|
+ if (msg.getData() != null) {
|
|
|
+ if (!StringUtils.isEmpty(msg.getData().getString("result"))) {
|
|
|
String resfordelete_result = msg.getData().getString("result");
|
|
|
LogUtil.prinlnLongMsg("RESUBMITTED_message", resfordelete_result);
|
|
|
dodelete(mCaller, mkeyValue);
|
|
|
@@ -305,32 +309,32 @@ public class DailydetailsActivity extends BaseActivity {
|
|
|
}
|
|
|
break;
|
|
|
case REFORDELETE_DOC_REQUEST_SUCCESSFULLY:
|
|
|
- if(msg.getData() != null){
|
|
|
- if (!StringUtils.isEmpty(msg.getData().getString("result"))){
|
|
|
+ if (msg.getData() != null) {
|
|
|
+ if (!StringUtils.isEmpty(msg.getData().getString("result"))) {
|
|
|
String delete_result = msg.getData().getString("result");
|
|
|
LogUtil.prinlnLongMsg("refordelete_result", delete_result);
|
|
|
if (JSON.parseObject(delete_result).containsKey("success") && JSON.parseObject(delete_result).getBoolean("success")) {
|
|
|
- dodelete(mCaller,mkeyValue);
|
|
|
+ dodelete(mCaller, mkeyValue);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
case DELETE_DOC_REQUEST_SUCCESSFULLY:
|
|
|
- if(msg.getData() != null){
|
|
|
- if (!StringUtils.isEmpty(msg.getData().getString("result"))){
|
|
|
+ if (msg.getData() != null) {
|
|
|
+ if (!StringUtils.isEmpty(msg.getData().getString("result"))) {
|
|
|
String delete_result = msg.getData().getString("result");
|
|
|
LogUtil.prinlnLongMsg("delete_result", delete_result);
|
|
|
if (JSON.parseObject(delete_result).containsKey("success") && JSON.parseObject(delete_result).getBoolean("success")) {
|
|
|
Toast.makeText(ct, getString(R.string.daily_delate_success), Toast.LENGTH_LONG).show();
|
|
|
// startActivity(new Intent(activity,WorkDailyShowActivity.class)
|
|
|
// .putExtra("fromwhere","delete_succeed"));
|
|
|
- if (!TextUtils.isEmpty(fromwhere) && "submitdaily".equals(fromwhere)){
|
|
|
- startActivity(new Intent(DailydetailsActivity.this,WorkDailyShowActivity.class));
|
|
|
+ if (!TextUtils.isEmpty(fromwhere) && "submitdaily".equals(fromwhere)) {
|
|
|
+ startActivity(new Intent(DailydetailsActivity.this, WorkDailyShowActivity.class));
|
|
|
finish();
|
|
|
- }else if (!TextUtils.isEmpty(fromwhere) && "dailylist".equals(fromwhere)){
|
|
|
+ } else if (!TextUtils.isEmpty(fromwhere) && "dailylist".equals(fromwhere)) {
|
|
|
Intent intent = new Intent();
|
|
|
- intent.putExtra("delete_succeed","delete_succeed");
|
|
|
- intent.putExtra("deleted_id",mkeyValue);
|
|
|
+ intent.putExtra("delete_succeed", "delete_succeed");
|
|
|
+ intent.putExtra("deleted_id", mkeyValue);
|
|
|
setResult(DELETE_SUCCEED, intent);
|
|
|
progressDialog.dismiss();
|
|
|
finish();
|
|
|
@@ -342,7 +346,7 @@ public class DailydetailsActivity extends BaseActivity {
|
|
|
break;
|
|
|
|
|
|
|
|
|
- case Constants.APP_SOCKETIMEOUTEXCEPTION:
|
|
|
+ case Constants.APP_SOCKETIMEOUTEXCEPTION:
|
|
|
if (msg.getData() != null) {
|
|
|
if (!StringUtils.isEmpty(msg.getData().getString("result"))) {
|
|
|
ToastMessage(msg.getData().getString("result"));
|
|
|
@@ -353,46 +357,57 @@ public class DailydetailsActivity extends BaseActivity {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ private void handlerNode(String message) {
|
|
|
+ List<Approval> approvals = ApprovaNodeUtil.handlerNode(manager, message);
|
|
|
+ if (!ListUtils.isEmpty(approvals)) {
|
|
|
+ NodeAdapter nodeAdapter = new NodeAdapter(this, approvals);
|
|
|
+ approval_flowlv.setAdapter(nodeAdapter);
|
|
|
+ } else {
|
|
|
+ //TODO 为空时候
|
|
|
+ }
|
|
|
+ progressDialog.dismiss();
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 日报审批流获取并处理
|
|
|
+ *
|
|
|
* @param wdaf_result
|
|
|
*/
|
|
|
private void WDAFshow(String wdaf_result) {
|
|
|
- try{
|
|
|
- JSONObject resultJsonObject = new JSONObject(wdaf_result);
|
|
|
+ try {
|
|
|
+ JSONObject resultJsonObject = JSON.parseObject(wdaf_result);
|
|
|
//JSONArray dailynodeArray = resultJsonObject.getJSONArray("nodes");
|
|
|
- if(resultJsonObject == null){
|
|
|
+ if (resultJsonObject == null) {
|
|
|
approval_flowlv.setVisibility(View.GONE);
|
|
|
hide_above_af.setVisibility(View.GONE);
|
|
|
- }else{
|
|
|
+ } 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 ||
|
|
|
- mCommonApprovalFlowBean.getData().size() == mCommonApprovalFlowBean.getNodes().size())){ // TODO 已审核直接从node里面取数据
|
|
|
- for (int i = 0; i <mCommonApprovalFlowBean.getNodes().size(); i++) {
|
|
|
+ if ("已审核".equals(wd_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);
|
|
|
@@ -400,31 +415,31 @@ public class DailydetailsActivity 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(wd_status)){
|
|
|
+ } else if ("已提交".equals(wd_status)) {
|
|
|
String whichsys = CommonUtil.getSharedPreferences(mContext, "erp_master");
|
|
|
|
|
|
// 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);
|
|
|
@@ -438,43 +453,43 @@ public class DailydetailsActivity 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) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
im_ids.add("");
|
|
|
}
|
|
|
|
|
|
//获取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());
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
afpeople_names.add("");
|
|
|
}
|
|
|
//取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 {
|
|
|
//获取数据库数据
|
|
|
@@ -483,42 +498,42 @@ public class DailydetailsActivity 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 {
|
|
|
+ } else {
|
|
|
im_ids.add("");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 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);
|
|
|
@@ -526,35 +541,36 @@ public class DailydetailsActivity 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(wd_status) && mCommonApprovalFlowBean.getData().size() != 0
|
|
|
- && mCommonApprovalFlowBean.getData().size() != mCommonApprovalFlowBean.getNodes().size()){
|
|
|
+ } else if ("已审核".equals(wd_status) && mCommonApprovalFlowBean.getData().size() != 0
|
|
|
+ && mCommonApprovalFlowBean.getData().size() != mCommonApprovalFlowBean.getNodes().size()) {
|
|
|
approval_flowlv.setVisibility(View.GONE);
|
|
|
}
|
|
|
- Log.i("last_afpeople_names", "空"+afpeople_names.toString());
|
|
|
+ Log.i("last_afpeople_names", "空" + afpeople_names.toString());
|
|
|
Log.i("last_imids", im_ids.toString());
|
|
|
+ afpeople_names.clear();
|
|
|
+ im_ids.clear();
|
|
|
+ handlerNode(wdaf_result);
|
|
|
mDailyDetailsApprovalFlowAdapter.setIm_ids(im_ids);
|
|
|
mDailyDetailsApprovalFlowAdapter.setAfpeople_names(afpeople_names);
|
|
|
// 设置数据之前先通过数据库获取到所有的imid保存到内存中
|
|
|
mDailyDetailsApprovalFlowAdapter.setmCommonApprovalFlowBean(mCommonApprovalFlowBean);
|
|
|
approval_flowlv.setAdapter(mDailyDetailsApprovalFlowAdapter);
|
|
|
|
|
|
- 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){
|
|
|
- e.printStackTrace();
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
@@ -573,7 +589,7 @@ public class DailydetailsActivity extends BaseActivity {
|
|
|
String applypeo_number = mCommonApprovalFlowBean.getProcesss().get(0).getJp_launcherId();
|
|
|
|
|
|
name_tv.setText(applypeo_name);
|
|
|
- if (!applypeo_number.isEmpty()){
|
|
|
+ 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=? ";
|
|
|
@@ -637,9 +653,9 @@ public class DailydetailsActivity extends BaseActivity {
|
|
|
LogUtil.d(JSON.toJSONString(params));
|
|
|
LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
- if (retype.equals("reforsub")){ //反提交之重新提交请求
|
|
|
+ if (retype.equals("reforsub")) { //反提交之重新提交请求
|
|
|
ViewUtil.httpSendRequest(this, resubmit_url, params, handler, headers, DAILY_REFORSUB_SUCCESSFULLY, null, null, "post");
|
|
|
- }else if (retype.equals("refordelete")){ //反提交之删除请求
|
|
|
+ } else if (retype.equals("refordelete")) { //反提交之删除请求
|
|
|
ViewUtil.httpSendRequest(this, resubmit_url, params, handler, headers, REFORDELETE_DOC_REQUEST_SUCCESSFULLY, null, null, "post");
|
|
|
}
|
|
|
}
|
|
|
@@ -649,10 +665,10 @@ public class DailydetailsActivity extends BaseActivity {
|
|
|
final Intent intent = getIntent();
|
|
|
date = intent.getStringExtra("Date");
|
|
|
summary = intent.getStringExtra("Content");
|
|
|
- if (!TextUtils.isEmpty(intent.getStringExtra("WD_Status"))){
|
|
|
+ if (!TextUtils.isEmpty(intent.getStringExtra("WD_Status"))) {
|
|
|
wd_status = intent.getStringExtra("WD_Status");
|
|
|
}
|
|
|
- mkeyValue = intent.getIntExtra("ID", -1); Log.i("first_mkeyValue",mkeyValue + "");
|
|
|
+ mkeyValue = intent.getIntExtra("ID", -1); Log.i("first_mkeyValue", mkeyValue + "");
|
|
|
fromwhere = intent.getStringExtra("fromwhere");
|
|
|
if (!TextUtils.isEmpty(intent.getStringExtra("Plan"))) {
|
|
|
plan = intent.getStringExtra("Plan");
|
|
|
@@ -665,33 +681,33 @@ public class DailydetailsActivity extends BaseActivity {
|
|
|
experience_ll.setVisibility(View.GONE);
|
|
|
}
|
|
|
if (!TextUtils.isEmpty(intent.getStringExtra("Donetask"))
|
|
|
- && !"null".equals(intent.getStringExtra("Donetask"))){
|
|
|
+ && !"null".equals(intent.getStringExtra("Donetask"))) {
|
|
|
donetask = intent.getStringExtra("Donetask");
|
|
|
// done_task_tv.setText(Html.fromHtml(donetask)); 将html格式转化为普通文本
|
|
|
- donetask_wv.loadDataWithBaseURL(null,donetask.toLowerCase(),"text/html","utf-8",null);
|
|
|
- Log.i("donetask",donetask);
|
|
|
- }else {
|
|
|
+ donetask_wv.loadDataWithBaseURL(null, donetask.toLowerCase(), "text/html", "utf-8", null);
|
|
|
+ Log.i("donetask", donetask);
|
|
|
+ } else {
|
|
|
done_task_ll.setVisibility(View.GONE);
|
|
|
}
|
|
|
|
|
|
if (!TextUtils.isEmpty(intent.getStringExtra("Undotask"))
|
|
|
- && !"null".equals(intent.getStringExtra("Undotask"))){
|
|
|
+ && !"null".equals(intent.getStringExtra("Undotask"))) {
|
|
|
undotask = intent.getStringExtra("Undotask");
|
|
|
- undotask_wv.loadDataWithBaseURL(null,undotask.toLowerCase(),"text/html","utf-8",null);
|
|
|
- }else {
|
|
|
+ undotask_wv.loadDataWithBaseURL(null, undotask.toLowerCase(), "text/html", "utf-8", null);
|
|
|
+ } else {
|
|
|
undo_task_ll.setVisibility(View.GONE);
|
|
|
}
|
|
|
wdd_data.setText(date + "");
|
|
|
wdd_summary.setText(summary);
|
|
|
- if("已审核".equals(wd_status)){
|
|
|
+ if ("已审核".equals(wd_status)) {
|
|
|
wdd_status.setTextColor(getResources().getColor(R.color.approval));
|
|
|
wdd_status.setText(getString(R.string.status_approved));
|
|
|
resanddel_ll.setVisibility(View.GONE);
|
|
|
- }else if (wd_status.equals("已提交")){
|
|
|
+ } else if (wd_status.equals("已提交")) {
|
|
|
wdd_status.setTextColor(getResources().getColor(R.color.no_approval));
|
|
|
wdd_status.setText(getString(R.string.status_pending));
|
|
|
resanddel_ll.setVisibility(View.VISIBLE);
|
|
|
- }else if (wd_status.equals("在录入")){
|
|
|
+ } else if (wd_status.equals("在录入")) {
|
|
|
wdd_status.setTextColor(getResources().getColor(R.color.done_approval));
|
|
|
wdd_status.setText(getString(R.string.status_unsubmit));
|
|
|
resanddel_ll.setVisibility(View.VISIBLE);
|
|
|
@@ -704,17 +720,17 @@ public class DailydetailsActivity extends BaseActivity {
|
|
|
|
|
|
|
|
|
// 当获取到正确的单据caller和单据id时 请求获取审批流数据
|
|
|
- if(!TextUtils.isEmpty(mCaller)&&mkeyValue!= -1){
|
|
|
- String url = Constants.getAppBaseUrl(getApplicationContext())+"common/getCurrentJnodes.action";
|
|
|
- Map<String,Object> param = new HashMap<>();
|
|
|
- param.put("caller", mCaller);
|
|
|
- param.put("keyValue",mkeyValue );
|
|
|
- Log.i("app_flowid", mkeyValue + "");
|
|
|
- param.put("_noc",mNoc);
|
|
|
- LinkedHashMap headers = new LinkedHashMap();
|
|
|
- headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(getApplicationContext(), "sessionId"));
|
|
|
- ViewUtil.httpSendRequest(getApplicationContext(), url, param, handler, headers, APPROVAL_FLOW_NODE, null, null, "post");
|
|
|
- }else{
|
|
|
+ if (!TextUtils.isEmpty(mCaller) && mkeyValue != -1) {
|
|
|
+ String url = Constants.getAppBaseUrl(getApplicationContext()) + "common/getCurrentJnodes.action";
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
+ param.put("caller", mCaller);
|
|
|
+ param.put("keyValue", mkeyValue);
|
|
|
+ Log.i("app_flowid", mkeyValue + "");
|
|
|
+ param.put("_noc", mNoc);
|
|
|
+ LinkedHashMap headers = new LinkedHashMap();
|
|
|
+ headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(getApplicationContext(), "sessionId"));
|
|
|
+ ViewUtil.httpSendRequest(getApplicationContext(), url, param, handler, headers, APPROVAL_FLOW_NODE, null, null, "post");
|
|
|
+ } else {
|
|
|
approval_flowlv.setVisibility(View.GONE);
|
|
|
hide_above_af.setVisibility(View.GONE);
|
|
|
}
|
|
|
@@ -729,33 +745,33 @@ public class DailydetailsActivity extends BaseActivity {
|
|
|
@Override
|
|
|
public boolean onOptionsItemSelected(MenuItem item) {
|
|
|
if (item.getItemId() == android.R.id.home) {
|
|
|
- if (!TextUtils.isEmpty(fromwhere) && fromwhere.equals("submitdaily"))
|
|
|
- {
|
|
|
+ if (!TextUtils.isEmpty(fromwhere) && fromwhere.equals("submitdaily")) {
|
|
|
startActivity(new Intent(activity, WorkDailyShowActivity.class)
|
|
|
.putExtra("fromwhere", "dodaily"));
|
|
|
finish();
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
finish();
|
|
|
}
|
|
|
- }return true;
|
|
|
+ } return true;
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
public void onBackPressed() {
|
|
|
- if (!TextUtils.isEmpty(fromwhere) && fromwhere.equals("submitdaily"))
|
|
|
- {
|
|
|
+ if (!TextUtils.isEmpty(fromwhere) && fromwhere.equals("submitdaily")) {
|
|
|
startActivity(new Intent(activity, WorkDailyShowActivity.class)
|
|
|
.putExtra("fromwhere", "dodaily"));
|
|
|
finish();
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
super.onBackPressed();
|
|
|
finish();
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
protected void onDestroy() {
|
|
|
super.onDestroy();
|
|
|
- if (manager!=null) {
|
|
|
+ if (manager != null) {
|
|
|
manager.closeDB();
|
|
|
}
|
|
|
}
|