提交 89e10ae6 authored 作者: lgd's avatar lgd

1.部门账户

2.//TODO erp用户激活,忘记密码测试,上下架需要在调试,产品下单还缺几个参数,bat,mes,消息,我的,刷新token
上级 01b1e0f4
......@@ -329,6 +329,14 @@
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.bat.work.WorkAccountActivity"
android:configChanges="keyboardHidden|orientation"
android:label="部门账户"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.wd.workoffice.fileprovider"
......
package com.wd.workoffice.bean;
/**
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class AccountBean {
/**
* createdBy : 143
* createdByName : null
* createdTime : 2019-09-26 15:43:13
* updatedBy : 675
* updatedByName : null
* updatedTime : 2019-11-22 16:01:29
* id : 4
* ofSys : 1
* name : 技术中心部门账户
* code : TECHNIQUE
* deptId : 119
* balance : 1.0421169824E7
* frozenAmount : 999.0
* status : 1
* version : 14
* amount : null
* action : 0
* deptName : null
* createdUser : null
* remark : null
* deptRulers : null
*/
private int createdBy;
private Object createdByName;
private String createdTime;
private int updatedBy;
private Object updatedByName;
private String updatedTime;
private int id;
private String ofSys;
private String name;
private String code;
private int deptId;
private String balance;
private double frozenAmount;
private String status;
private int version;
private Object amount;
private int action;
private Object deptName;
private Object createdUser;
private Object remark;
private Object deptRulers;
public int getCreatedBy() {
return createdBy;
}
public void setCreatedBy(int createdBy) {
this.createdBy = createdBy;
}
public Object getCreatedByName() {
return createdByName;
}
public void setCreatedByName(Object createdByName) {
this.createdByName = createdByName;
}
public String getCreatedTime() {
return createdTime;
}
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
public int getUpdatedBy() {
return updatedBy;
}
public void setUpdatedBy(int updatedBy) {
this.updatedBy = updatedBy;
}
public Object getUpdatedByName() {
return updatedByName;
}
public void setUpdatedByName(Object updatedByName) {
this.updatedByName = updatedByName;
}
public String getUpdatedTime() {
return updatedTime;
}
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getOfSys() {
return ofSys;
}
public void setOfSys(String ofSys) {
this.ofSys = ofSys;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public int getDeptId() {
return deptId;
}
public void setDeptId(int deptId) {
this.deptId = deptId;
}
public String getBalance() {
return balance;
}
public void setBalance(String balance) {
this.balance = balance;
}
public double getFrozenAmount() {
return frozenAmount;
}
public void setFrozenAmount(double frozenAmount) {
this.frozenAmount = frozenAmount;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public int getVersion() {
return version;
}
public void setVersion(int version) {
this.version = version;
}
public Object getAmount() {
return amount;
}
public void setAmount(Object amount) {
this.amount = amount;
}
public int getAction() {
return action;
}
public void setAction(int action) {
this.action = action;
}
public Object getDeptName() {
return deptName;
}
public void setDeptName(Object deptName) {
this.deptName = deptName;
}
public Object getCreatedUser() {
return createdUser;
}
public void setCreatedUser(Object createdUser) {
this.createdUser = createdUser;
}
public Object getRemark() {
return remark;
}
public void setRemark(Object remark) {
this.remark = remark;
}
public Object getDeptRulers() {
return deptRulers;
}
public void setDeptRulers(Object deptRulers) {
this.deptRulers = deptRulers;
}
}
......@@ -440,4 +440,12 @@ public interface ApiService {
@GET("/transitpart/app/page/list")
Observable<BaseBean> getContacts(@QueryMap Map<String, Object> param);
/**
* 部门信息
* @return
*/
@GET("/dept-account-balance/app/account-balance-info")
Observable<BaseBean> getAccount();
}
package com.wd.workoffice.ui.activity.bat.work;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.AccountBean;
import com.wd.workoffice.bean.DepBean;
import com.wd.workoffice.bean.ProPriceBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.util.MathUtils;
import com.wd.workoffice.util.WorkUtils;
import java.math.BigDecimal;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import flexible.xd.android_base.network.rtfhttp.Transformer;
import io.reactivex.disposables.Disposable;
/**
* 工作台 - 产品
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class WorkAccountActivity extends WorkToolBarActivity {
@BindView(R.id.tv_name)
TextView tvName;
@BindView(R.id.tv_dep_name)
TextView tvDpeName;
@BindView(R.id.tv_dep_price)
TextView tvDpePrice;
@BindView(R.id.tv_dep_freeze_price)
TextView tvDpeFreezePrice;
@BindView(R.id.tv_see_flow)
TextView tvSeeFlow;
@Override
protected void initView() {
ButterKnife.bind(this);
}
@Override
protected void initData() {
getData();
}
private void getData() {
RtfUtils.getRtf().getAccount().compose(Transformer.schedule()).subscribe(new WorkObserver<BaseBean>() {
@Override
public void doOnSubscribe(Disposable d) {
}
@Override
public void onFail(String errorMsg) {
hideLoading();
toast(errorMsg);
}
@Override
public void onSuccess(BaseBean data) {
hideLoading();
if (data.getCode() != 0) {
toast(data.getMessage());
return;
}
AccountBean dataBean = JSON.parseObject(data.getData().toString(), AccountBean.class);
tvName.setText(dataBean.getName());
tvDpeName.setText(dataBean.getName());
tvDpePrice.setText(MathUtils.converData(dataBean.getBalance(),2));
tvDpeFreezePrice.setText(String.valueOf(dataBean.getFrozenAmount()));
}
});
}
@Override
protected void initEvent() {
}
@Override
protected int layoutId() {
return R.layout.activity_work_account;
}
@OnClick(R.id.tv_see_flow)
public void onViewClicked() {
}
}
......@@ -24,6 +24,7 @@ import com.wd.workoffice.ui.activity.bat.sale.SaleInsideOrderActivity;
import com.wd.workoffice.ui.activity.bat.sale.SaleOutOrderActivity;
import com.wd.workoffice.ui.activity.bat.sale.SaleSaleOrderActivity;
import com.wd.workoffice.ui.activity.bat.sale.SaleSupplierOrderActivity;
import com.wd.workoffice.ui.activity.bat.work.WorkAccountActivity;
import com.wd.workoffice.ui.activity.bat.work.WorkContactsActivity;
import com.wd.workoffice.ui.activity.bat.work.WorkProActivity;
import com.wd.workoffice.ui.adapter.BatLayoutAdapter;
......@@ -248,6 +249,7 @@ public class MainFragment extends WorkBaseFg {
startActivity(WorkContactsActivity.class);
break;
case 2:
startActivity(WorkAccountActivity.class);
break;
case 3:
break;
......
package com.wd.workoffice.util;
import android.content.Context;
import android.text.TextUtils;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import android.util.Log;
import java.math.BigDecimal;
......@@ -13,6 +11,14 @@ import java.math.BigDecimal;
* github: https://github.com/FlexibleXd
**/
public class MathUtils {
public static String converData(String value,Integer scale){
if (TextUtils.isEmpty(value)) {
value = "0";
}
BigDecimal bg = new BigDecimal(value);
return bg.setScale(scale).toString();
}
public static String multiply(String v1, String v2, Integer scale) {
if (TextUtils.isEmpty(v1)) {
v1 = "0";
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#359486"/>
<corners android:radius="10dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginHorizontal="20mm"
android:orientation="vertical">
<TextView
android:id="@+id/tv_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
android:background="@drawable/shape_client_search"
android:paddingHorizontal="10mm"
android:paddingVertical="15mm"
android:text="销售二公司" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
android:background="@drawable/shape_account"
android:orientation="vertical"
android:paddingHorizontal="10mm"
android:paddingVertical="15mm">
<TextView
android:id="@+id/tv_dep_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="销售一部"
android:textColor="@color/white"
android:textSize="16sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30mm"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="账户余额"
android:textColor="#b3ffffff"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_dep_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4mm"
android:textColor="@color/white"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="可用余额"
android:textColor="#b3ffffff"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_dep_freeze_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4mm"
android:textColor="@color/white"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/tv_see_flow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="查看流水>"
android:textColor="@color/white" />
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -91,7 +91,7 @@
android:layout_height="6mm"
android:layout_centerVertical="true"
android:layout_marginLeft="20mm"
android:background="@drawable/shap_circle" />
android:background="@drawable/shape_circle" />
<TextView
android:layout_width="wrap_content"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论