Browse Source

Merge branch 'dev' of ssh://10.10.100.21/source/saas-platform into dev

zhuth 7 years ago
parent
commit
85012afc42

+ 42 - 14
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/ExcelServiceImpl.java

@@ -14,6 +14,7 @@ import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.utils.CollectionUtils;
 import com.usoftchina.saas.utils.DateUtils;
+import com.usoftchina.saas.utils.RegexpUtils;
 import com.usoftchina.saas.utils.StringUtils;
 import org.apache.poi.hssf.util.HSSFColor;
 import org.apache.poi.ss.usermodel.*;
@@ -163,27 +164,28 @@ public class ExcelServiceImpl implements ExcelService{
                        List<TempletSet> main = columns.get(position);
                        for (TempletSet set : main) {
                            //取excel值
-                           if ("true".equals(set.getNecessary())) {
+                           value = data.get(set.getDescription());
+                          /* if ("true".equals(set.getNecessary())) {
                                value = data.get("*" + set.getDescription());
                            } else {
                                value = data.get(set.getDescription());
-                           }
+                           }*/
                            //取编号字段
-                           if (set.isCodefield() && !data.get("*" + set.getDescription()).equals("")) {
+                           if (set.isCodefield() && !"".equals(value)) {
                                mainData = new JSONObject();
                                codeValue = value;
                                difference = true;
                                validateCode.add(codeValue);
                            }
                            //检查是否是同一单
-                           if (set.isCodefield() && data.get("*" + set.getDescription()).equals("")) {
+                           if (set.isCodefield() && "".equals(value)) {
                                difference = false;
                                break;
                            }
                            //检查主表必填字段是否完整
                            if (difference) {
                                dd.setDd_codevalue(codeValue);
-                               if ("true".equals(set.getNecessary()) && data.get("*" + set.getDescription()).equals("")) {
+                               if ("true".equals(set.getNecessary()) && "".equals(value)) {
                                    err.append("第" + (i + 3) + "行 " + set.getDescription() + " 必填字段未填写!<br/> ");
                                    break;
                                }
@@ -196,9 +198,18 @@ public class ExcelServiceImpl implements ExcelService{
                                    break;
                                }
                            }
-                           //如果为数字类型且为空默认赋值0
-                           if ("number".equals(set.getType()) && StringUtils.isEmpty(value)) {
-                                value = "0";
+                           //如果为数字类型且为空默认赋值0,检测是否为数字类型
+                           if ("number".equals(set.getType())) {
+                               if (StringUtils.isEmpty(value)) {
+                                   value = "0";
+                               } else {
+                                   Boolean numner = isNumner(value);
+                                   if (!numner) {
+                                       err.append("第" + (i + 3) + "行 " + set.getDescription() + " 数字格式不正确!<br/> ");
+                                       break;
+                                   }
+                               }
+
                            }
                            //插入主表数据
                            if (null != mainData) {
@@ -216,11 +227,12 @@ public class ExcelServiceImpl implements ExcelService{
                        detailData = new JSONObject();
                        for (TempletSet set : detail) {
                            //取excel值
-                           if ("true".equals(set.getNecessary())) {
+                           value = data.get(set.getDescription());
+                          /* if ("true".equals(set.getNecessary())) {
                                value = data.get("*" + set.getDescription());
                            } else {
                                value = data.get(set.getDescription());
-                           }
+                           }*/
                            if ("true".equals(set.getNecessary()) && value.equals("")) {
                                detailData = null;
                                //err.append("第" + (i + 3) + "行 " + set.getDescription() + " 必填字段未填写!<br/> ");
@@ -284,6 +296,19 @@ public class ExcelServiceImpl implements ExcelService{
     }
 
 
+    private Boolean isNumner(String str) {
+        for(int i=str.length() - 1; i>=0; i--){
+            int chr=str.charAt(i);
+            if(chr < 48 || chr >  57) {
+                if (chr == 46) {
+                    continue;
+                }
+                return false;
+            }
+
+        }
+        return true;
+    }
 
 
     private boolean validateDateFormat(String date) {
@@ -333,6 +358,7 @@ public class ExcelServiceImpl implements ExcelService{
             switch(cell.getCellType()){
                 case Cell.CELL_TYPE_NUMERIC:{
                     cellValue = String.valueOf(cell.getNumericCellValue());
+                    cellValue = RegexpUtils.replaceSpecialCharacter(cellValue);
                     //判断是否为INT类型
                     if (Double.valueOf(cellValue.toString()).intValue() - Double.valueOf(cellValue.toString()) == 0) {
                         return cellValue.toString().substring(0, cellValue.toString().indexOf("."));
@@ -344,14 +370,17 @@ public class ExcelServiceImpl implements ExcelService{
                     if(DateUtil.isCellDateFormatted(cell)){
                         //转换为日期格式YYYY-mm-dd
                         cellValue = cell.getDateCellValue();
+                        cellValue = RegexpUtils.replaceSpecialCharacter(cellValue);
                     }else{
                         //数字
                         cellValue = String.valueOf(cell.getNumericCellValue());
+                        cellValue = RegexpUtils.replaceSpecialCharacter(cellValue);
                     }
                     break;
                 }
                 case Cell.CELL_TYPE_STRING:{
                     cellValue = cell.getRichStringCellValue().getString();
+                    cellValue = RegexpUtils.replaceSpecialCharacter(cellValue);
                     break;
                 }
                 default:
@@ -464,16 +493,15 @@ public class ExcelServiceImpl implements ExcelService{
 
     private CellStyle getCellStyle(SXSSFWorkbook workbook, boolean main) {
         CellStyle style = workbook.createCellStyle();
-        style.setFillBackgroundColor((short) 18);
-        style.setFillPattern(FillPatternType.LEAST_DOTS);
         Font font = workbook.createFont();
         font.setFontName("仿宋_GB2312");// 字体
         font.setFontHeightInPoints((short) 12);// 字号
+        font.setBold(true);
         font.setColor((short)64);// 颜色
         style.setFont(font);
+        style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
         style.setAlignment(HorizontalAlignment.CENTER);
-        style.setFillForegroundColor(HSSFColor.GREEN.index);
-        style.setFillBackgroundColor(main ? HSSFColor.LIGHT_YELLOW.index : HSSFColor.PALE_BLUE.index);
+        style.setFillForegroundColor(main ? HSSFColor.LIGHT_YELLOW.index : HSSFColor.PALE_BLUE.index);
         style.setBorderBottom(BorderStyle.MEDIUM);
         style.setBorderLeft(BorderStyle.MEDIUM);
         style.setBorderRight(BorderStyle.MEDIUM);

+ 3 - 3
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/VerificationServiceImpl.java

@@ -291,8 +291,6 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
             subledger.setSl_custid(verification.getVc_custid());
             subledger.setSl_vendid(0);
         }
-        kind = transferKind(kind);
-        subledger.setSl_kind(kind);
         Double amount1 = verification.getVc_amount1()==null?new Double(0):verification.getVc_amount1();
         Double amount2 = verification.getVc_amount2()==null?new Double(0):verification.getVc_amount2();
         subledger.setSl_date(verification.getVc_date());
@@ -306,8 +304,10 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
         if(kind.equals("receipts_offset_receivable") || kind.equals("prepaid_offset_payable")){
             subledger.setSl_preamount(-amount1);
         }else{
-            subledger.setSl_preamount(amount1);
+            subledger.setSl_preamount(new Double(0));
         }
+        kind = transferKind(kind);
+        subledger.setSl_kind(kind);
         return subledger;
     }
     /**

+ 17 - 2
framework/core/src/main/java/com/usoftchina/saas/utils/RegexpUtils.java

@@ -12,7 +12,7 @@ public class RegexpUtils {
     private static final String HK_MOBILE_EXP = "^(5|6|8|9)\\d{7}$";
     private static final String EMAIL_EXP = "^\\w+([-.]\\w+)*@\\w+([-]\\w+)*\\.(\\w+([-]\\w+)*\\.)*[a-z]{2,4}$";
     private static final String SPECCHARACTER_EXP = "[\\\\s~·`!!@#¥$%^……&*(())\\\\-——\\\\-_=+【\\\\[\\\\]】{{}}\\\\|、\\\\\\\\;;::‘'“”\\\",,《<。.》>、/??]";
-
+    private static final String SPECIALCHARACTER_EXP = "[`~!@#$%^&*()+=|{}':;',\\[\\]<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?]";
     /**
      * 匹配手机号码
      *
@@ -57,7 +57,7 @@ public class RegexpUtils {
     }
 
     /**
-     * 特殊字符替换
+     * 特殊字符替换含小写字母
      * @param str
      * @return
      */
@@ -66,4 +66,19 @@ public class RegexpUtils {
         Matcher m = p.matcher(str);
         return m.replaceAll("");
     }
+
+
+    /**
+     * 特殊字符替换
+     * @param obj
+     * @return
+     */
+    public static String replaceSpecialCharacter(Object obj){
+        if (StringUtils.isEmpty(obj)) {
+            return "";
+        }
+        Pattern p = Pattern.compile(SPECIALCHARACTER_EXP);
+        Matcher m = p.matcher(obj.toString());
+        return m.replaceAll("");
+    }
 }

+ 2 - 1
frontend/saas-portal-web/src/components/conenter/addenterprise.vue

@@ -48,7 +48,7 @@
                             <span class="qy-biaoti left"><span class="xingxing">*</span>公司地址</span>
                             <div class="addbiaoqian">
                                 <!-- <v-distpicker @province= 'qyprovince' @city= 'qycity' @area= 'qyarea'></v-distpicker> -->
-                                <v-distpicker @selected= 'selected'></v-distpicker>
+                                <v-distpicker @selected= 'selected' province="广东省" city="广州市" area="荔湾区" placeholders= '{}'></v-distpicker>
                                 <input ref="address" @change="address" :disabled="disabled" class="qy-xiangxi" type="text" placeholder="输入企业详细地址">
                                 
                             </div>
@@ -104,6 +104,7 @@ import { setTimeout } from 'timers';
                 isemail: true,//验证邮箱
                 disabled: true,
                 isadd: false,//添加成功弹窗
+                placeholder:{province:"省", city:"市", area:"区"}
             }
         },
         components:{

+ 1 - 1
frontend/saas-portal-web/src/components/conenter/company.vue

@@ -73,7 +73,7 @@
                     </div>
                     <div>
                         <span v-if = "d.default_" class="gs-btn2 gs-btn3">默认企业</span>
-                        <span v-if="d.saas_" @click="showDefaultWin(i)" class="gs-btn2 xs">设为默认</span>
+                        <span v-else @click="showDefaultWin(i)" class="gs-btn2 xs">设为默认</span>
                     </div>
                 </div>
             </div>

+ 2 - 4
frontend/saas-portal-web/src/components/conenter/details.vue

@@ -87,7 +87,7 @@
                         <li>
                             <span class="qy-biaoti">邮箱</span>
                             <input @change="email" ref="email" type="text" value="">
-                            <dir class="qy-Tips"><span style="color:red">{{Email}}</span></dir>
+                            <div class="qy-Tips"><span style="color:red">{{Email}}</span></div>
                         </li>
                     </ul>
                 </div>
@@ -233,9 +233,7 @@
     height: 20px;
 }
 .qy-Tips {
-    margin: 0;
-    text-align: left;
     height: 26px;
-    margin-left: 16%;
+    margin-left: 21%;
 }
 </style>

+ 5 - 3
frontend/saas-portal-web/src/components/conenter/enterprise.vue

@@ -55,7 +55,9 @@
                         <div class="left gr-right">
                             <ul>
                                 <li>
-                                    <span>姓名</span><span>{{mytoken.realname}}</span>
+                                    <span>姓名</span>
+                                    <span>{{mytoken.realname}}</span>
+                                    <!-- <input type="text" :value="mytoken.realname"> -->
                                 </li>
                                 <li>
                                     <span>UU号</span><span>{{mytoken.uu}}</span>
@@ -135,11 +137,11 @@ import { setTimeout } from 'timers';
             },
             //修改密码
             changpasd(){
-                window.location.href = 'https://sso.ubtob.com/reset/forgetPasswordValidationAccount?returnURL='+this.$url.web+'&appId=sp'
+                window.location.href = this.$url.sso+'/reset/forgetPasswordValidationAccount?returnURL='+this.$url.web+'&appId=sp'
             },
             //修改手机号
             changphone(){
-                window.location.href = 'https://sso.ubtob.com/validation/phoneValidation?returnURL='+this.$url.web+'&appId=sp'
+                window.location.href = this.$url.sso+'/validation/phoneValidation?returnURL='+this.$url.web+'&appId=sp'
             }
         },
     }

+ 8 - 0
frontend/saas-portal-web/src/pages/index/index.js

@@ -6,6 +6,14 @@ import Axios from 'axios'
 import store from '../../store'
 
 Axios.defaults.withCredentials=true;
+Axios.interceptors.request.use(function (config) {
+  store.state.isloading = true
+  return config;
+})
+Axios.interceptors.response.use(function (config) {
+  store.state.isloading = false
+  return config;
+})
 Vue.prototype.$ajax = Axios;
 Vue.config.productionTip = false
 

+ 28 - 2
frontend/saas-portal-web/src/pages/index/index.vue

@@ -1,20 +1,46 @@
 <template>
   <div id="app">
+    <div v-if="isloading" class="loading">
+      <div class="loadingtxt">加载中...</div>
+    </div>
     <router-view/>
     <footers></footers>
   </div>
 </template>
 <script>
-// import footers from './components/footer/footer.vue';
 import footers from '../../components/footer/footer.vue';
 export default {
   name: 'App',
+  data(){
+    return {
+
+    }
+  },
   components: {
       footers
   },
+  computed:{
+    isloading:function(){
+      return this.$store.state.isloading
+    }
+  }
 }
 </script>
 
 <style>
-
+.loading {
+  position: fixed;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  background: rgba(0, 0, 0, 0.7);
+  text-align: center;
+}
+.loadingtxt {
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+}
 </style>

+ 1 - 1
frontend/saas-portal-web/src/store/index.js

@@ -4,10 +4,10 @@ Vue.use(Vuex)
 
 export default new Vuex.Store({
     state:{
-        data: [],
         email:'',
         isAutoLogin: false,
         isproblem: '',//常见问题
+        isloading:false,
     },
     mutations:{
          Logintrue(state) {

+ 2 - 1
frontend/saas-web/app/view/core/base/ImportWindow.js

@@ -115,6 +115,7 @@ Ext.define('saas.view.core.base.ImportWindow', {
                         form.dockedItems.items[1].down('[name=over]').setDisabled(true);
                         var res = Ext.decode(response.responseText);
                         saas.util.BaseUtil.showErrorToast('导入数据失败: ' + res.message);
+                        
                     }
                 });
             }else{
@@ -167,7 +168,7 @@ Ext.define('saas.view.core.base.ImportWindow', {
                     width: 240,
                     labelWidth:160,
                     buttonOnly:true,
-                    fieldLabel:'客户导入模板下载',
+                    fieldLabel:'导入模板下载',
                     name:'download',
                     xtype: 'filefield',
                     buttonText: '下载模板',