Pārlūkot izejas kodu

加入手机合规性校验

wuxw 1 gadu atpakaļ
vecāks
revīzija
35b7b48dcc

+ 6 - 0
java110-utils/src/main/java/com/java110/utils/util/ValidatorUtil.java

@@ -9,6 +9,8 @@ package com.java110.utils.util;
  * add by wuxw 2020/2/10
  **/
 
+import com.java110.utils.cache.MappingCache;
+
 import java.util.regex.Pattern;
 
 /**
@@ -94,6 +96,10 @@ public class ValidatorUtil {
         if (StringUtil.isEmpty(mobile)) {
             return false;
         }
+        String telValidate = MappingCache.getValue("SYSTEM_SWITCH","TEL_VALIDATE");
+        if("OFF".equals(telValidate)){
+            return true;
+        }
         return Pattern.matches(REGEX_MOBILE, mobile);
     }
 

+ 5 - 0
service-acct/src/main/java/com/java110/acct/payment/business/oweFee/OweFeePaymentBusiness.java

@@ -74,9 +74,14 @@ public class OweFeePaymentBusiness implements IPaymentBusiness {
     public PaymentOrderDto unified(ICmdDataFlowContext context, JSONObject reqJson) {
         String userId = context.getReqHeaders().get("user-id");
 
+
         String ownerId = reqJson.getString("ownerId");
         String roomId = reqJson.getString("roomId");
 
+        if (StringUtil.isEmpty(ownerId) && StringUtil.isEmpty(roomId)) {
+            throw new IllegalArgumentException("参数错误未包含业主或者房屋编号");
+        }
+
         String payObjType = "3333";
         if (reqJson.containsKey("payObjType")) {
             payObjType = reqJson.getString("payObjType");

+ 10 - 9
service-user/src/main/java/com/java110/user/cmd/privilege/DeletePrivilegeGroupInfoCmd.java

@@ -17,13 +17,14 @@ import com.java110.po.privilege.PrivilegeRelPo;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
+import com.java110.utils.util.ListUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import java.text.ParseException;
 import java.util.List;
 
 @Java110Cmd(serviceCode = "delete.privilegeGroup.info")
-public class DeletePrivilegeGroupInfoCmd extends Cmd{
+public class DeletePrivilegeGroupInfoCmd extends Cmd {
 
     @Autowired
     private IStoreV1InnerServiceSMO storeV1InnerServiceSMOImpl;
@@ -42,7 +43,7 @@ public class DeletePrivilegeGroupInfoCmd extends Cmd{
 
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
-        Assert.hasKeyAndValue(reqJson,"pgId","角色不存在");
+        Assert.hasKeyAndValue(reqJson, "pgId", "角色不存在");
     }
 
     @Override
@@ -50,26 +51,26 @@ public class DeletePrivilegeGroupInfoCmd extends Cmd{
         PrivilegeUserDto privilegeUserDto = new PrivilegeUserDto();
         privilegeUserDto.setpId(reqJson.getString("pgId"));
         List<PrivilegeUserDto> privilegeUserDtos = privilegeUserV1InnerServiceSMOImpl.queryPrivilegeUsers(privilegeUserDto);
-        if(privilegeUserDtos != null && privilegeUserDtos.size() > 0){
+        if (!ListUtil.isNull(privilegeUserDtos)) {
             throw new IllegalArgumentException("该角色下有关联员工,请先删除关联员工!");
         }
-        PrivilegeGroupPo privilegeGroupPo = BeanConvertUtil.covertBean(reqJson,PrivilegeGroupPo.class);
+        PrivilegeGroupPo privilegeGroupPo = BeanConvertUtil.covertBean(reqJson, PrivilegeGroupPo.class);
         int flag = privilegeGroupV1InnerServiceSMOImpl.deletePrivilegeGroup(privilegeGroupPo);
-        if(flag  < 1){
+        if (flag < 1) {
             throw new CmdException("删除失败");
         }
         PrivilegeRelDto privilegeRelDto = new PrivilegeRelDto();
         privilegeRelDto.setPgId(reqJson.getString("pgId"));
         List<PrivilegeRelDto> privilegeRelDtos = privilegeRelV1InnerServiceSMOImpl.queryPrivilegeRels(privilegeRelDto);
-        if(privilegeRelDtos == null || privilegeRelDtos.size()<1){
-            return ;
+        if (privilegeRelDtos == null || privilegeRelDtos.size() < 1) {
+            return;
         }
         PrivilegeRelPo privilegeRelPo = null;
-        for(PrivilegeRelDto tmpPrivilegeDto: privilegeRelDtos){
+        for (PrivilegeRelDto tmpPrivilegeDto : privilegeRelDtos) {
             privilegeRelPo = new PrivilegeRelPo();
             privilegeRelPo.setRelId(tmpPrivilegeDto.getRelId());
             flag = privilegeRelV1InnerServiceSMOImpl.deletePrivilegeRel(privilegeRelPo);
-            if(flag <1){
+            if (flag < 1) {
                 throw new CmdException("删除失败");
             }
         }

+ 1 - 1
springboot/src/main/resources/application-debug.yml

@@ -29,7 +29,7 @@ spring:
   activiti:
     database-schema-update: false
   datasource:
-    url: jdbc:mysql://192.168.100.108:3306/TT?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8&useSSL=false
+    url: jdbc:mysql://wuye.elephxi.com:3306/TT?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8&useSSL=false
     username: TT
     password: hc12345678
     type: com.alibaba.druid.pool.DruidDataSource