提交 ceec7bdb authored 作者: lgd's avatar lgd

1.审批

2.//TODO erp用户是否选择新部门为空,质检接口数据无对应问题,内部交易订单审核,审核规则,领用申请列表/退件列表/参数,产品下单还差附件测试,mes,刷新token
上级 41d8d460
...@@ -52,6 +52,14 @@ public interface ApiService { ...@@ -52,6 +52,14 @@ public interface ApiService {
@POST("/login") @POST("/login")
Call<BaseBean> login(@Query("grant_type") String type, @Body RequestBody requestBody); Call<BaseBean> login(@Query("grant_type") String type, @Body RequestBody requestBody);
/**
*
*
* @return
*/
@POST("/oauth/token?grant_type=refresh_token")
Call<JSONObject> refreshToken( @QueryMap Map<String, Object> param);
/** /**
* 退出登录 * 退出登录
* *
...@@ -120,16 +128,9 @@ public interface ApiService { ...@@ -120,16 +128,9 @@ public interface ApiService {
* *
* @return * @return
*/ */
@POST("/open/activation-user") @PUT("/open/activation-user")
Observable<BaseBean> activation(@QueryMap Map<String, Object> param); Observable<BaseBean> activation(@Body RequestBody requestBody);
/**
* 激活用户
*
* @return
*/
@POST("/oauth/token?grant_type=refresh_token")
Observable<BaseBean> refreshToken(@QueryMap Map<String, Object> param);
/** /**
* 部门列表 * 部门列表
......
...@@ -21,6 +21,7 @@ import com.wd.workoffice.ui.fg.MainFragment; ...@@ -21,6 +21,7 @@ import com.wd.workoffice.ui.fg.MainFragment;
import com.wd.workoffice.ui.fg.MsgFragment; import com.wd.workoffice.ui.fg.MsgFragment;
import com.wd.workoffice.ui.fg.MyFragment; import com.wd.workoffice.ui.fg.MyFragment;
import com.wd.workoffice.util.UserKeeper; import com.wd.workoffice.util.UserKeeper;
import com.wd.workoffice.util.WorkUtils;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
...@@ -57,6 +58,7 @@ public class MainActivity extends WorkBaseActivity implements BottomNavigationBa ...@@ -57,6 +58,7 @@ public class MainActivity extends WorkBaseActivity implements BottomNavigationBa
startActivity(LoginActivity.class); startActivity(LoginActivity.class);
return; return;
} }
// WorkUtils.refreshToken();
ButterKnife.bind(this); ButterKnife.bind(this);
QMUIStatusBarHelper.translucent(this); QMUIStatusBarHelper.translucent(this);
QMUIStatusBarHelper.setStatusBarLightMode(this); QMUIStatusBarHelper.setStatusBarLightMode(this);
......
...@@ -131,6 +131,7 @@ public class ErpActivationOneActivity extends WorkToolBarActivity implements Erp ...@@ -131,6 +131,7 @@ public class ErpActivationOneActivity extends WorkToolBarActivity implements Erp
toast("请输入验证码"); toast("请输入验证码");
return; return;
} }
// verifySuccess();
erpActivationPresenter.verifyCode(etPhone.getText().toString(), code, CodeType.REGISTER.getName()); erpActivationPresenter.verifyCode(etPhone.getText().toString(), code, CodeType.REGISTER.getName());
break; break;
} }
......
...@@ -15,6 +15,7 @@ import com.wd.workoffice.bean.ActivationUserBean; ...@@ -15,6 +15,7 @@ import com.wd.workoffice.bean.ActivationUserBean;
import com.wd.workoffice.bean.FlowBean; import com.wd.workoffice.bean.FlowBean;
import com.wd.workoffice.retrofit.RtfUtils; import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver; import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.util.WorkUtils;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -45,6 +46,7 @@ public class ErpActivationTwoActivity extends WorkToolBarActivity { ...@@ -45,6 +46,7 @@ public class ErpActivationTwoActivity extends WorkToolBarActivity {
@Override @Override
protected void initView() { protected void initView() {
ButterKnife.bind(this); ButterKnife.bind(this);
btnNext.setEnabled(false);
param = new HashMap<>(); param = new HashMap<>();
} }
...@@ -157,7 +159,7 @@ public class ErpActivationTwoActivity extends WorkToolBarActivity { ...@@ -157,7 +159,7 @@ public class ErpActivationTwoActivity extends WorkToolBarActivity {
} }
private void submit() { private void submit() {
RtfUtils.getRtf().activation(param).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseBean>() { RtfUtils.getRtf().activation(WorkUtils.convertMapToBody(param)).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseBean>() {
@Override @Override
public void doOnSubscribe(Disposable d) { public void doOnSubscribe(Disposable d) {
} }
......
...@@ -38,6 +38,7 @@ import com.wd.workoffice.ui.activity.bat.work.WorkProActivity; ...@@ -38,6 +38,7 @@ import com.wd.workoffice.ui.activity.bat.work.WorkProActivity;
import com.wd.workoffice.ui.activity.bat.work.WorkWarehouseActivity; import com.wd.workoffice.ui.activity.bat.work.WorkWarehouseActivity;
import com.wd.workoffice.ui.adapter.BatLayoutAdapter; import com.wd.workoffice.ui.adapter.BatLayoutAdapter;
import com.wd.workoffice.util.UserKeeper; import com.wd.workoffice.util.UserKeeper;
import com.wd.workoffice.util.WorkUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
......
...@@ -46,7 +46,6 @@ public class UserKeeper { ...@@ -46,7 +46,6 @@ public class UserKeeper {
} }
public String getToken() { public String getToken() {
if (TextUtils.isEmpty(sp.getString(LOGIN_INFO))) { if (TextUtils.isEmpty(sp.getString(LOGIN_INFO))) {
return ""; return "";
} }
...@@ -56,7 +55,16 @@ public class UserKeeper { ...@@ -56,7 +55,16 @@ public class UserKeeper {
} }
return tokenBean.getAccess_token(); return tokenBean.getAccess_token();
} }
public String getRefrshToken() {
if (TextUtils.isEmpty(sp.getString(LOGIN_INFO))) {
return "";
}
TokenBean tokenBean = JSON.parseObject(sp.getString(LOGIN_INFO), TokenBean.class);
if (tokenBean == null || TextUtils.isEmpty(tokenBean.getRefresh_token())) {
return "";
}
return tokenBean.getRefresh_token();
}
public String getUserId() { public String getUserId() {
if (TextUtils.isEmpty(sp.getString(LOGIN_INFO))) { if (TextUtils.isEmpty(sp.getString(LOGIN_INFO))) {
return ""; return "";
......
...@@ -10,7 +10,9 @@ import android.text.TextUtils; ...@@ -10,7 +10,9 @@ import android.text.TextUtils;
import android.widget.TextView; import android.widget.TextView;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.wd.workoffice.R; import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.Config; import com.wd.workoffice.app.Config;
import com.wd.workoffice.app.WorkApp; import com.wd.workoffice.app.WorkApp;
import com.wd.workoffice.bean.workEnum.OrderType; import com.wd.workoffice.bean.workEnum.OrderType;
...@@ -18,11 +20,16 @@ import com.wd.workoffice.bean.workEnum.PermissionType; ...@@ -18,11 +20,16 @@ import com.wd.workoffice.bean.workEnum.PermissionType;
import com.wd.workoffice.retrofit.RtfUtils; import com.wd.workoffice.retrofit.RtfUtils;
import java.io.File; import java.io.File;
import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import okhttp3.MediaType; import okhttp3.MediaType;
import okhttp3.RequestBody; import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
/** /**
* author : flexible * author : flexible
...@@ -105,6 +112,7 @@ public class WorkUtils { ...@@ -105,6 +112,7 @@ public class WorkUtils {
return "场外库"; return "场外库";
} }
} }
/** /**
* code: "1":中转入库 * code: "1":中转入库
* "2":直接入库 * "2":直接入库
...@@ -129,14 +137,15 @@ public class WorkUtils { ...@@ -129,14 +137,15 @@ public class WorkUtils {
* @return * @return
*/ */
public static String getOrderCode(String name) { public static String getOrderCode(String name) {
String code =""; String code = "";
for (OrderType value : OrderType.values()) { for (OrderType value : OrderType.values()) {
if (TextUtils.equals(value.getName(),name)){ if (TextUtils.equals(value.getName(), name)) {
code=value.getCode(); code = value.getCode();
} }
} }
return code; return code;
} }
/** /**
* name:订单code * name:订单code
* *
...@@ -144,10 +153,10 @@ public class WorkUtils { ...@@ -144,10 +153,10 @@ public class WorkUtils {
* @return * @return
*/ */
public static String getOrderName(String code) { public static String getOrderName(String code) {
String name =""; String name = "";
for (OrderType value : OrderType.values()) { for (OrderType value : OrderType.values()) {
if (TextUtils.equals(value.getCode(),code)){ if (TextUtils.equals(value.getCode(), code)) {
name=value.getName(); name = value.getName();
} }
} }
return name; return name;
...@@ -160,10 +169,10 @@ public class WorkUtils { ...@@ -160,10 +169,10 @@ public class WorkUtils {
* @return * @return
*/ */
public static String getPermissionName(String code) { public static String getPermissionName(String code) {
String name =""; String name = "";
for (PermissionType value : PermissionType.values()) { for (PermissionType value : PermissionType.values()) {
if (TextUtils.equals(value.getCode(),code)){ if (TextUtils.equals(value.getCode(), code)) {
name=value.getName(); name = value.getName();
} }
} }
return name; return name;
...@@ -171,22 +180,25 @@ public class WorkUtils { ...@@ -171,22 +180,25 @@ public class WorkUtils {
/** /**
* name:订单来源 * name:订单来源
*:PDS-拆分生产订单 TRS-库存已有转单 * :PDS-拆分生产订单 TRS-库存已有转单
*
* @param code * @param code
* @return * @return
*/ */
public static String getOrderFrom(String code) { public static String getOrderFrom(String code) {
String name =""; String name = "";
if(TextUtils.equals(code,"PDS")){ if (TextUtils.equals(code, "PDS")) {
name="拆分生产订单"; name = "拆分生产订单";
}else if (TextUtils.equals(code,"TRS")){ } else if (TextUtils.equals(code, "TRS")) {
name="库存已有转单"; name = "库存已有转单";
} }
return name; return name;
} }
/** /**
* 财务状态 * 财务状态
* 0未审核 1已通过 2不通过 * 0未审核 1已通过 2不通过
*
* @param code * @param code
* @return * @return
*/ */
...@@ -205,21 +217,22 @@ public class WorkUtils { ...@@ -205,21 +217,22 @@ public class WorkUtils {
} }
return name; return name;
} }
/** /**
* 财务状态 * 财务状态
* 10未审核 11 12 13 14已通过 21 22 23 24不通过(尾号1部门管理员 2业务部 3财务部 4集团,首数字1:通过,2:驳回) * 10未审核 11 12 13 14已通过 21 22 23 24不通过(尾号1部门管理员 2业务部 3财务部 4集团,首数字1:通过,2:驳回)
*
* @param code * @param code
* @return * @return
*/ */
public static String getReturnStatus(Integer code) { public static String getReturnStatus(Integer code) {
String name = ""; String name = "";
if (code ==10){ if (code == 10) {
name="未审核"; name = "未审核";
}else if (code.toString().startsWith("1")){ } else if (code.toString().startsWith("1")) {
name="已通过"; name = "已通过";
} } else if (code.toString().startsWith("2")) {
else if (code.toString().startsWith("2")){ name = "已驳回";
name="已驳回";
} }
return name; return name;
} }
...@@ -230,7 +243,25 @@ public class WorkUtils { ...@@ -230,7 +243,25 @@ public class WorkUtils {
* @return * @return
*/ */
public static void refreshToken() { public static void refreshToken() {
// RtfUtils.getRtf().refreshToken() Map<String, Object> param = WorkUtils.simpleParam();
param.put("client_id", "android");
param.put("client_secret", "android");
param.put("refresh_token", UserKeeper.getInstance().getRefrshToken());
RtfUtils.getRtf().refreshToken(param).enqueue(new Callback<JSONObject>() {
@Override
public void onResponse(Call<JSONObject> call, Response<JSONObject> response) {
if (response.isSuccessful()) {
JSONObject data = response.body();
UserKeeper.getInstance().keepLoginInfo(data.toJSONString());
} else {
}
}
@Override
public void onFailure(Call<JSONObject> call, Throwable t) {
}
});
} }
public static File uriToFile(Uri uri, Context context) { public static File uriToFile(Uri uri, Context context) {
......
...@@ -79,6 +79,7 @@ ...@@ -79,6 +79,7 @@
android:layout_marginLeft="10mm" android:layout_marginLeft="10mm"
android:layout_weight="1" android:layout_weight="1"
android:background="@null" android:background="@null"
android:inputType="textPassword"
android:hint="设置密码数字或字母6- 16位" android:hint="设置密码数字或字母6- 16位"
android:textSize="12sp" /> android:textSize="12sp" />
...@@ -105,6 +106,7 @@ ...@@ -105,6 +106,7 @@
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginLeft="10mm" android:layout_marginLeft="10mm"
android:layout_weight="1" android:layout_weight="1"
android:inputType="textPassword"
android:background="@null" android:background="@null"
android:hint="再次确认密码" android:hint="再次确认密码"
android:textSize="12sp" /> android:textSize="12sp" />
......
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
android:layout_marginHorizontal="58mm" android:layout_marginHorizontal="58mm"
android:layout_marginTop="80mm" android:layout_marginTop="80mm"
android:background="@drawable/selector_btn" android:background="@drawable/selector_btn"
android:text="注册" android:text="下一步"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="20sp" /> android:textSize="20sp" />
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginLeft="10mm" android:layout_marginLeft="10mm"
android:layout_weight="1" android:layout_weight="1"
android:inputType="textPassword"
android:background="@null" android:background="@null"
android:hint="设置账号密码" android:hint="设置账号密码"
android:textSize="12sp" /> android:textSize="12sp" />
......
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:paddingVertical="10mm"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingHorizontal="20mm"> android:paddingHorizontal="20mm"
android:paddingVertical="10mm">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
android:layout_marginLeft="10mm" android:layout_marginLeft="10mm"
android:background="@null" android:background="@null"
android:hint="输入旧密码" android:hint="输入旧密码"
android:inputType="textPassword"
android:padding="4mm" android:padding="4mm"
android:textSize="14sp" /> android:textSize="14sp" />
</LinearLayout> </LinearLayout>
...@@ -32,8 +33,8 @@ ...@@ -32,8 +33,8 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingVertical="10mm" android:paddingHorizontal="20mm"
android:paddingHorizontal="20mm"> android:paddingVertical="10mm">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -47,6 +48,7 @@ ...@@ -47,6 +48,7 @@
android:layout_marginLeft="10mm" android:layout_marginLeft="10mm"
android:background="@null" android:background="@null"
android:hint="输入新密码" android:hint="输入新密码"
android:inputType="textPassword"
android:padding="4mm" android:padding="4mm"
android:textSize="14sp" /> android:textSize="14sp" />
</LinearLayout> </LinearLayout>
...@@ -56,8 +58,8 @@ ...@@ -56,8 +58,8 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingVertical="10mm" android:paddingHorizontal="20mm"
android:paddingHorizontal="20mm"> android:paddingVertical="10mm">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -71,16 +73,19 @@ ...@@ -71,16 +73,19 @@
android:layout_marginLeft="10mm" android:layout_marginLeft="10mm"
android:background="@null" android:background="@null"
android:hint="确认信密码" android:hint="确认信密码"
android:inputType="textPassword"
android:padding="4mm" android:padding="4mm"
android:textSize="14sp" /> android:textSize="14sp" />
</LinearLayout> </LinearLayout>
<View style="@style/dividerX" /> <View style="@style/dividerX" />
<Button <Button
android:id="@+id/btn_ok" android:id="@+id/btn_ok"
android:text="确认"
android:background="@color/input_background"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50mm" android:layout_height="50mm"
android:layout_marginHorizontal="40mm" android:layout_marginHorizontal="40mm"
android:layout_marginTop="20mm" /> android:layout_marginTop="20mm"
android:background="@color/input_background"
android:text="确认" />
</LinearLayout> </LinearLayout>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论