|
|
@@ -33,6 +33,8 @@ import com.modular.apputils.presenter.imp.IBill;
|
|
|
import java.io.File;
|
|
|
import java.io.Serializable;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.Comparator;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.LinkedHashMap;
|
|
|
import java.util.List;
|
|
|
@@ -74,7 +76,7 @@ public class BillPresenter extends BaseNetPresenter implements OnSmartHttpListen
|
|
|
public int getFormId() {
|
|
|
return mId;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public void setmId(int mId) {
|
|
|
this.mId = mId;
|
|
|
}
|
|
|
@@ -439,6 +441,12 @@ public class BillPresenter extends BaseNetPresenter implements OnSmartHttpListen
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private final Comparator<BillGroupModel> mComparator=new Comparator<BillGroupModel>() {
|
|
|
+ @Override
|
|
|
+ public int compare(BillGroupModel billGroupModel, BillGroupModel t1) {
|
|
|
+ return billGroupModel.getMinDetno()-t1.getMinDetno();
|
|
|
+ }
|
|
|
+ };
|
|
|
//处理表单返回配置
|
|
|
protected void handlerBill(JSONObject object) {
|
|
|
LogUtil.i("gong", "object=" + object);
|
|
|
@@ -456,6 +464,9 @@ public class BillPresenter extends BaseNetPresenter implements OnSmartHttpListen
|
|
|
for (Map.Entry<String, BillGroupModel> entry : formdeMap.entrySet()) {
|
|
|
showBillModels.add(entry.getValue());
|
|
|
}
|
|
|
+ if (!ListUtils.isEmpty(showBillModels)){
|
|
|
+ Collections.sort(showBillModels,mComparator);
|
|
|
+ }
|
|
|
}
|
|
|
JSONArray gridetail = JSONUtil.getJSONArray(data, "gridetail");
|
|
|
BillGroupModel mGridetailModel = handlerGridetail(showBillModels.size(), gridetail);
|
|
|
@@ -491,6 +502,11 @@ public class BillPresenter extends BaseNetPresenter implements OnSmartHttpListen
|
|
|
modelMap.put(group, mapBillGroupModel);
|
|
|
}
|
|
|
mBillModel.setGroupIndex(mapBillGroupModel.getGroupIndex());
|
|
|
+ int minDetno = mapBillGroupModel.getMinDetno();
|
|
|
+ if (minDetno > mBillModel.getDetno()) {
|
|
|
+ minDetno = mBillModel.getDetno();
|
|
|
+ }
|
|
|
+ mapBillGroupModel.setMinDetno(minDetno);
|
|
|
if (isShow(mBillModel)) {
|
|
|
mapBillGroupModel.addShow(mBillModel);
|
|
|
} else {
|
|
|
@@ -553,6 +569,7 @@ public class BillPresenter extends BaseNetPresenter implements OnSmartHttpListen
|
|
|
BillGroupModel.BillModel mBillModel = new BillGroupModel.BillModel();
|
|
|
String caption = JSONUtil.getText(object, "fd_caption", "dg_caption");//字段名称
|
|
|
String value = JSONUtil.getText(object, "fd_value", "dg_value");//字段名称
|
|
|
+ int fd_detno = JSONUtil.getInt(object, "fd_detno");//序号
|
|
|
int id = JSONUtil.getInt(object, "fd_id", "gd_id");//id
|
|
|
int length = JSONUtil.getInt(object, "fd_maxlength", "dg_maxlength");//字符长度
|
|
|
int appwidth = JSONUtil.getInt(object, "fd_appwidth", "dg_appwidth");//宽度
|
|
|
@@ -592,6 +609,7 @@ public class BillPresenter extends BaseNetPresenter implements OnSmartHttpListen
|
|
|
}
|
|
|
}
|
|
|
mBillModel.setFindFunctionName(findFunctionName);
|
|
|
+ mBillModel.setDetno(fd_detno);
|
|
|
mBillModel.setCaption(caption);
|
|
|
mBillModel.setId(id);
|
|
|
mBillModel.setValue(value);
|