Kaynağa Gözat

Merge branch 'feature' of https://gitlab.com/Arisono/SkWeiChat-Baidu into feature_bitliker

# Conflicts:
#	WeiChat/version.properties
Bitliker 8 yıl önce
ebeveyn
işleme
8aceb9c579

+ 3 - 3
WeiChat/version.properties

@@ -1,5 +1,5 @@
-#Mon Jan 08 09:42:50 CST 2018
-debugName=389
+#Mon Jan 08 13:45:32 CST 2018
+debugName=391
 versionName=624
-debugCode=389
+debugCode=391
 versionCode=163

+ 195 - 185
app_core/common/src/main/res/layout/activity_holidays.xml

@@ -1,200 +1,210 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
     android:id="@+id/activity_holidays"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:background="@color/oa_bg"
-    android:orientation="vertical"
-    tools:context="com.xzjmyk.pm.activity.ui.erp.activity.oa.HolidaysActivity">
+    android:orientation="vertical">
 
     <ImageView
         android:layout_width="match_parent"
         android:layout_height="70dp"
         android:src="@drawable/holiday_bg" />
 
-    <LinearLayout
+    <ScrollView
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:background="@color/white"
-        android:orientation="vertical"
-        android:paddingBottom="6dp"
-        android:paddingLeft="5dp"
-        android:paddingTop="10dp">
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/MyAttendanceRules_newYearsDay"
-            android:textColor="@color/titleBlue"
-            android:textSize="@dimen/text_main" />
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="5dp"
-            android:text="@string/holiday_date1"
-            android:textColor="@color/text_hine"
-            android:textSize="@dimen/text_hine" />
-    </LinearLayout>
-
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="2px"
-        android:background="@color/white"
-        android:orientation="vertical"
-        android:paddingBottom="6dp"
-        android:paddingLeft="5dp"
-        android:paddingTop="10dp">
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/MyAttendanceRules_SpringFestival"
-            android:textColor="@color/titleBlue"
-            android:textSize="@dimen/text_main" />
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="5dp"
-            android:text="@string/holiday_date2"
-            android:textColor="@color/text_hine"
-            android:textSize="@dimen/text_hine" />
-    </LinearLayout>
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="2px"
-        android:background="@color/white"
-        android:orientation="vertical"
-        android:paddingBottom="6dp"
-        android:paddingLeft="5dp"
-        android:paddingTop="10dp">
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/MyAttendanceRules_QingmingFestival"
-            android:textColor="@color/titleBlue"
-            android:textSize="@dimen/text_main" />
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="5dp"
-            android:text="@string/holiday_date3"
-            android:textColor="@color/text_hine"
-            android:textSize="@dimen/text_hine" />
-    </LinearLayout>
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="2px"
-        android:background="@color/white"
-        android:orientation="vertical"
-        android:paddingBottom="6dp"
-        android:paddingLeft="5dp"
-        android:paddingTop="10dp">
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/MyAttendanceRules_LaborDay"
-            android:textColor="@color/titleBlue"
-            android:textSize="@dimen/text_main" />
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="5dp"
-            android:text="@string/holiday_date4"
-            android:textColor="@color/text_hine"
-            android:textSize="@dimen/text_hine" />
-    </LinearLayout>
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="2px"
-        android:background="@color/white"
-        android:orientation="vertical"
-        android:paddingBottom="6dp"
-        android:paddingLeft="5dp"
-        android:paddingTop="10dp">
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/MyAttendanceRules_TheDragonBoatFestival"
-            android:textColor="@color/titleBlue"
-            android:textSize="@dimen/text_main" />
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="5dp"
-            android:text="@string/holiday_date5"
-            android:textColor="@color/text_hine"
-            android:textSize="@dimen/text_hine" />
-    </LinearLayout>
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="2px"
-        android:background="@color/white"
-        android:orientation="vertical"
-        android:paddingBottom="6dp"
-        android:paddingLeft="5dp"
-        android:paddingTop="10dp">
-
-        <TextView
-            android:id="@+id/zq_and_gq1"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/MyAttendanceRules_MidAutumnFestival"
-            android:textColor="@color/titleBlue"
-            android:textSize="@dimen/text_main" />
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="5dp"
-            android:text="@string/holiday_date6"
-            android:textColor="@color/text_hine"
-            android:textSize="@dimen/text_hine" />
-    </LinearLayout>
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="2px"
-        android:background="@color/white"
-        android:orientation="vertical"
-        android:paddingBottom="6dp"
-        android:paddingLeft="5dp"
-        android:paddingTop="10dp">
-
-        <TextView
-            android:id="@+id/zq_and_gq"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/MyAttendanceRules_nationalDay"
-            android:textColor="@color/titleBlue"
-            android:textSize="@dimen/text_main" />
-
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="5dp"
-            android:text="@string/holiday_date7"
-            android:textColor="@color/text_hine"
-            android:textSize="@dimen/text_hine" />
-    </LinearLayout>
+        android:layout_height="match_parent">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:orientation="vertical">
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:background="@color/white"
+                android:orientation="vertical"
+                android:paddingBottom="6dp"
+                android:paddingLeft="5dp"
+                android:paddingTop="10dp">
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="@string/MyAttendanceRules_newYearsDay"
+                    android:textColor="@color/titleBlue"
+                    android:textSize="@dimen/text_main" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="5dp"
+                    android:text="@string/holiday_date1"
+                    android:textColor="@color/text_hine"
+                    android:textSize="@dimen/text_hine" />
+            </LinearLayout>
+
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="2px"
+                android:background="@color/white"
+                android:orientation="vertical"
+                android:paddingBottom="6dp"
+                android:paddingLeft="5dp"
+                android:paddingTop="10dp">
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="@string/MyAttendanceRules_SpringFestival"
+                    android:textColor="@color/titleBlue"
+                    android:textSize="@dimen/text_main" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="5dp"
+                    android:text="@string/holiday_date2"
+                    android:textColor="@color/text_hine"
+                    android:textSize="@dimen/text_hine" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="2px"
+                android:background="@color/white"
+                android:orientation="vertical"
+                android:paddingBottom="6dp"
+                android:paddingLeft="5dp"
+                android:paddingTop="10dp">
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="@string/MyAttendanceRules_QingmingFestival"
+                    android:textColor="@color/titleBlue"
+                    android:textSize="@dimen/text_main" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="5dp"
+                    android:text="@string/holiday_date3"
+                    android:textColor="@color/text_hine"
+                    android:textSize="@dimen/text_hine" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="2px"
+                android:background="@color/white"
+                android:orientation="vertical"
+                android:paddingBottom="6dp"
+                android:paddingLeft="5dp"
+                android:paddingTop="10dp">
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="@string/MyAttendanceRules_LaborDay"
+                    android:textColor="@color/titleBlue"
+                    android:textSize="@dimen/text_main" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="5dp"
+                    android:text="@string/holiday_date4"
+                    android:textColor="@color/text_hine"
+                    android:textSize="@dimen/text_hine" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="2px"
+                android:background="@color/white"
+                android:orientation="vertical"
+                android:paddingBottom="6dp"
+                android:paddingLeft="5dp"
+                android:paddingTop="10dp">
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="@string/MyAttendanceRules_TheDragonBoatFestival"
+                    android:textColor="@color/titleBlue"
+                    android:textSize="@dimen/text_main" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="5dp"
+                    android:text="@string/holiday_date5"
+                    android:textColor="@color/text_hine"
+                    android:textSize="@dimen/text_hine" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="2px"
+                android:background="@color/white"
+                android:orientation="vertical"
+                android:paddingBottom="6dp"
+                android:paddingLeft="5dp"
+                android:paddingTop="10dp">
+
+                <TextView
+                    android:id="@+id/zq_and_gq1"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="@string/MyAttendanceRules_MidAutumnFestival"
+                    android:textColor="@color/titleBlue"
+                    android:textSize="@dimen/text_main" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="5dp"
+                    android:text="@string/holiday_date6"
+                    android:textColor="@color/text_hine"
+                    android:textSize="@dimen/text_hine" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="2px"
+                android:background="@color/white"
+                android:orientation="vertical"
+                android:paddingBottom="6dp"
+                android:paddingLeft="5dp"
+                android:paddingTop="10dp">
+
+                <TextView
+                    android:id="@+id/zq_and_gq"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="@string/MyAttendanceRules_nationalDay"
+                    android:textColor="@color/titleBlue"
+                    android:textSize="@dimen/text_main" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="5dp"
+                    android:text="@string/holiday_date7"
+                    android:textColor="@color/text_hine"
+                    android:textSize="@dimen/text_hine" />
+            </LinearLayout>
+
+        </LinearLayout>
+    </ScrollView>
 
 </LinearLayout>

+ 65 - 13
app_modular/appmessages/src/main/java/com/modular/appmessages/presenter/ApprovaPresenter.java

@@ -32,6 +32,7 @@ import com.modular.appmessages.presenter.imp.IApproval;
 import com.uas.appworks.OA.erp.activity.form.DataFormFieldActivity;
 import com.core.widget.view.selectcalendar.bean.Data;
 
+import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -824,7 +825,6 @@ public class ApprovaPresenter implements OnHttpResultListener {
             iApproval.showToast(R.string.not_data_from_formandgrid);
         }
     }
-
     private List<Approval> formandGriddata(final JSONObject changeData,
                                            final JSONObject data,
                                            final JSONArray configs,
@@ -844,16 +844,6 @@ public class ApprovaPresenter implements OnHttpResultListener {
             JSONArray combostore = JSONUtil.getJSONArray(config, "COMBOSTORE");
             String type = JSONUtil.getText(config, "FD_TYPE", "DG_TYPE");
             String dbFind = JSONUtil.getText(config, "FD_DBFIND", "DG_TYPE");
-            if (!isMain) {
-                String findTionName = JSONUtil.getText(config, "DG_FINDFUNCTIONNAME");
-                if (!StringUtil.isEmpty(findTionName)) {
-                    int hhitem = findTionName.indexOf('|');
-                    String gCaller = findTionName.substring(0, hhitem);
-                    String coreKey = findTionName.substring(hhitem+1, findTionName.length());
-                    approval.setgCaller(gCaller);
-                    approval.setCoreKey(coreKey);
-                }
-            }
             //添加类型
             approval.setDbFind(dbFind);
             approval.setDfType(type);
@@ -869,6 +859,53 @@ public class ApprovaPresenter implements OnHttpResultListener {
             } else {
                 newValues = values;
             }
+            if (!isMain) {
+                String findTionName = JSONUtil.getText(config, "DG_FINDFUNCTIONNAME");
+                String renderer = JSONUtil.getText(config, "DG_RENDERER");
+                if (!StringUtil.isEmpty(findTionName)) {
+                    int hhitem = findTionName.indexOf('|');
+                    String gCaller = findTionName.substring(0, hhitem);
+                    String coreKey = findTionName.substring(hhitem + 1, findTionName.length());
+                    approval.setgCaller(gCaller);
+                    approval.setCoreKey(coreKey);
+                }
+                if (!StringUtil.isEmpty(renderer) && renderer.contains("formula:")) {
+                    renderer = renderer.substring("formula:".length(), renderer.length());
+                    String operator = getOperator(renderer);
+//                    String regex = "\\" + operator;
+//                    String sAgeFormat = StringUtil.getMessage(R.string.regx_operator);
+//                    String sFinalAge = String.format(sAgeFormat, operator);
+                    if (!StringUtil.isEmpty(operator)){
+                        String[] renderers = renderer.split(operator);
+                        if (renderers != null && renderers.length > 1) {
+                            String keyRenderer1 = renderers[0];
+                            String keyRenderer2 = renderers[1];
+                            String renderer1 = JSONUtil.getText(data, keyRenderer1);
+                            String renderer2 = JSONUtil.getText(data, keyRenderer2);
+                            if (!StringUtil.isEmpty(renderer1) && !StringUtil.isEmpty(renderer2)) {
+                                BigDecimal b1 = new BigDecimal(renderer1);
+                                BigDecimal b2 = new BigDecimal(renderer2);
+                                String number = "";
+                                switch (operator) {
+                                    case "\\/":
+                                        number = b1.divide(b2).toString();
+                                        break;
+                                    case "\\*":
+                                        number = b1.multiply(b2).toString();
+                                        break;
+                                    case "\\+":
+                                        number = b1.add(b2).toString();
+                                        break;
+                                    case "\\-":
+                                        number = b1.subtract(b2).toString();
+                                        break;
+                                }
+                                newValues = number;
+                            }
+                        }
+                    }
+                }
+            }
             if (approval.isDftypeEQ("FF") || (record.title.contains("公章用印申请流程") && "附件".equals(caption))) {
                 if (isMain) {
                     final String fb_attach = newValues;
@@ -975,6 +1012,21 @@ public class ApprovaPresenter implements OnHttpResultListener {
         return approvals;
     }
 
+    private String getOperator(String renderer) {
+        if (renderer.contains("/")) {
+            return "\\/";
+        } else if (renderer.contains("%")) {
+            return "\\%";
+        } else if (renderer.contains("*")) {
+            return "\\*";
+        } else if (renderer.contains("+")) {
+            return "\\+";
+        } else if (renderer.contains("-")) {
+            return "\\-";
+        }
+        return "";
+    }
+
     private synchronized void addEnclosure(List<Approval> enclosureList) {
         if (enclosureList != null) {
             if (this.enclosureList.size() <= 0) {
@@ -1043,7 +1095,7 @@ public class ApprovaPresenter implements OnHttpResultListener {
             resultBuilder.append(result);
         }
         if (!StringUtil.isEmpty(description)) {
-            resultBuilder.append("(" + description.replace("\\n","\n") + ")");
+            resultBuilder.append("(" + description.replace("\\n", "\n") + ")");
         }
         approval.setIdKey(resultBuilder.toString());
         approval.setValuesKey(nodeName);
@@ -1398,7 +1450,7 @@ public class ApprovaPresenter implements OnHttpResultListener {
                         }
                     }
                     if (!StringUtil.isEmpty(neer)) {
-                            approval.setMustInput(neer.startsWith("Y"));
+                        approval.setMustInput(neer.startsWith("Y"));
                         if (neer.contains("@A")) {
                             approval.setDfType("@A");
                         }

+ 1 - 0
app_modular/appworks/src/main/res/values/strings.xml

@@ -71,6 +71,7 @@
     <string name="not_more_pay">金额不能大于99999</string>
     <string name="not_pay_num_can">支付金额不符合标准</string>
     <string name="find_num_project">查到<b>%1$d</b>个相关项目</string>
+    <string name="regx_operator">\\%1$s</string>
 
 
     //设备管理项目