Bitliker 7 жил өмнө
parent
commit
c24bcc8a37

+ 34 - 7
app_core/common/src/main/java/com/core/model/Approval.java

@@ -134,8 +134,8 @@ public class Approval {
             String v2 = null;
             if (values.contains(".")) {
                 int fas = values.indexOf(".");
-                v1 = values.substring(0, fas);
-                v2 = values.substring(fas, values.length());
+                v1 = values.substring(0, fas);//整数部分
+                v2 = values.substring(fas, values.length());//小数部分
             } else {
                 v1 = values;
                 v2 = "";
@@ -143,15 +143,30 @@ public class Approval {
             for (int i = v1.length() - 1; i >= 0; i--) {
                 char c = v1.charAt(i);
                 builder.insert(0, c);
-                if (i > 0 && num == 3) {
+                if (i > 0 && num == 3 && c != '.') {
                     num = 0;
                     builder.insert(0, ',');
                 }
-
                 num++;
             }
-            if (v2 != null)
-                builder.append(v2);
+            if (!StringUtil.isEmail(v2)) {
+                int floatcolumn = floatcolumn();//保留小数后几位
+                if (floatcolumn == 0) {
+
+                    if (v2.length() - 1 > 2) {
+                        builder.append(v2.substring(0, 2));
+                    } else {
+                        builder.append(v2);
+                    }
+                } else {
+                    //计算小数点后几位
+                    if ((v2.length() - 1) > floatcolumn) {
+                        builder.append(v2.substring(0, floatcolumn));
+                    } else {
+                        builder.append(v2);
+                    }
+                }
+            }
             return builder.toString();
         } catch (Exception e) {
             return getValues();
@@ -325,9 +340,21 @@ public class Approval {
     }
 
     public boolean isNumber() {
-        return isDftypeEQ("N", "floatcolumn8", "SN");
+        return isDftypeEQ("N", "floatcolumn8", "SN") || getDfType().contains("floatcolumn");
     }
 
+    public int floatcolumn() {
+        if (getDfType().contains("floatcolumn")) {
+            String number = getDfType().replace("floatcolumn", "");
+            try {
+                return Integer.valueOf(number);
+            } catch (Exception e) {
+
+            }
+            return 0;
+        }
+        return 0;
+    }
 
     public static class Data {
         public String value = "";

+ 3 - 0
app_core/common/src/main/java/com/core/net/http/ViewUtil.java

@@ -1169,6 +1169,9 @@ public class ViewUtil {
 ////            url=CommonUtil.getAppBaseUrl(MyApplication.getInstance());
 ////        }
         String loginToken = CommonUtil.getSharedPreferences(ct, Constants.CACHE.ACCOUNT_CENTER_TOKEN);
+        LogUtil.i("gong","url="+url+"mobile/login.action");
+        LogUtil.i("gong","token="+loginToken);
+        LogUtil.i("gong","enuu="+enuu);
         HttpRequest.getInstance().sendRequest(url,
                 new HttpParams.Builder()
                         .url("mobile/login.action")

+ 1 - 1
app_modular/appmessages/src/main/java/com/modular/appmessages/model/ApprovalRecord.java

@@ -35,7 +35,7 @@ public class ApprovalRecord {
         map.put("id", id);
         map.put("nodeId", nodeId);
         map.put("status", status);
-        map.put("nodeName", nodeName);
+    map.put("nodeName", nodeName);
         map.put("needInputKeys", needInputKeys);
         map.put("showNeedMessage", showNeedMessage);
         map.put("processInstanceId", processInstanceId);

+ 6 - 4
app_modular/appmessages/src/main/java/com/modular/appmessages/presenter/ApprovaPresenter.java

@@ -883,10 +883,12 @@ public class ApprovaPresenter implements OnHttpResultListener {
                         if (renderer.contains("字段需要设置为app显示")) {
                             newValues = renderer;
                         } else {
-                            double val = MathUtil.eval(renderer);
-                            if (val != Double.NEGATIVE_INFINITY && val != Double.POSITIVE_INFINITY) {
-                                newValues = getDecimalFormat(val);
-                            }
+                            newValues=renderer;
+                            //先不格式化
+//                            double val = MathUtil.eval(renderer);
+//                            if (val != Double.NEGATIVE_INFINITY && val != Double.POSITIVE_INFINITY) {
+//                                newValues = getDecimalFormat(val);
+//                            }
                         }
 
                     } catch (Exception e) {

+ 23 - 11
app_modular/appworks/src/main/java/com/uas/appworks/OA/erp/activity/MissionActivity.java

@@ -40,7 +40,10 @@ import com.core.widget.view.Activity.SelectActivity;
 import com.core.widget.view.model.SelectAimModel;
 import com.lidroid.xutils.ViewUtils;
 import com.modular.apputils.utils.PopupWindowHelper;
+import com.uas.applocation.Interface.OnLocationListener;
 import com.uas.applocation.UasLocationHelper;
+import com.uas.applocation.base.UASLocationManager;
+import com.uas.applocation.model.UASLocation;
 import com.uas.applocation.utils.LocationDistanceUtils;
 import com.uas.appworks.OA.erp.adapter.MissionAdapter;
 import com.uas.appworks.OA.erp.model.IMission;
@@ -72,20 +75,23 @@ public class MissionActivity extends OABaseActivity implements View.OnClickListe
         @Override
         public void onReceive(Context context, Intent intent) {
             if (System.currentTimeMillis() - time < (3 * 60 * 1000)) return;
-            time = System.currentTimeMillis();
-            locationOk = UasLocationHelper.getInstance().getUASLocation().isLocationOk();
-            if (locationOk && adapter != null && !ListUtils.isEmpty(adapter.getModels())) {
-                for (int i = 0; i < adapter.getModels().size(); i++) {
-                    if (adapter.getModels().get(i).getStatus() != 1) {
-                        adapter.getModels().get(i).setRecorddate(TimeUtils.f_long_2_str(System.currentTimeMillis()));
-                        adapter.getModels().get(i).setLocation(UasLocationHelper.getInstance().getUASLocation().getName());
-                        adapter.notifyItemChanged(i);
-                    }
-                }
-            }
+            updateLocation();
         }
     };
 
+    private void updateLocation(){
+        time = System.currentTimeMillis();
+        locationOk = UasLocationHelper.getInstance().getUASLocation().isLocationOk();
+        if (locationOk && adapter != null && !ListUtils.isEmpty(adapter.getModels())) {
+            for (int i = 0; i < adapter.getModels().size(); i++) {
+                if (adapter.getModels().get(i).getStatus() != 1) {
+                    adapter.getModels().get(i).setRecorddate(TimeUtils.f_long_2_str(System.currentTimeMillis()));
+                    adapter.getModels().get(i).setLocation(UasLocationHelper.getInstance().getUASLocation().getName());
+                    adapter.notifyItemChanged(i);
+                }
+            }
+        }
+    }
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -96,6 +102,12 @@ public class MissionActivity extends OABaseActivity implements View.OnClickListe
         LocalBroadcastManager.getInstance(ct).registerReceiver(receiver, filter);
         initView();
         initEvent();
+        UasLocationHelper.getInstance().requestLocation(new OnLocationListener() {
+            @Override
+            public void onReceiveLocation(UASLocation mUASLocation) {
+                updateLocation();
+            }
+        });
     }
 
     @Override

+ 3 - 6
build.gradle

@@ -6,7 +6,7 @@ buildscript {
         maven { url "https://jcenter.bintray.com" }
         maven { url "https://jitpack.io" }
         mavenCentral()
-    
+
     }
     dependencies {
         classpath 'com.android.tools.build:gradle:2.3.2'
@@ -18,14 +18,11 @@ buildscript {
 
 allprojects {
     repositories {
+        maven { url 'https://maven.google.com' }
         jcenter()
         mavenCentral()
         maven { url "https://jitpack.io" }
-        maven {
-            url 'https://maven.google.com'
-        }
-        
-  
+
     }
 }
 

+ 1 - 1
version.gradle

@@ -41,7 +41,7 @@ ext {
             analyticsVersion                    : 'latest.integration',
             tagGroupVersion                     : '1.4@aar',
             jodatimeVersion                     : '2.9.4',
-            gifVersion                          : '1.2.8',
+            gifVersion                          : '1.2.15',
             recyclerLib                         : 'v1.0',
             vlayoutVersion                      : '1.2.1',
             BaseRecyclerViewAdapterHelperVersion: '2.9.30',