浏览代码

Merge remote-tracking branch 'origin/V1' into V1

jz.kai 5 年之前
父节点
当前提交
824fc7d2b9
共有 4 个文件被更改,包括 35 次插入15 次删除
  1. 12 0
      lapi/pom.xml
  2. 0 8
      pom.xml
  3. 12 0
      web/pom.xml
  4. 11 7
      web/src/main/java/com/jpsoft/smart/modules/mobile/controller/PersonInfoApiController.java

+ 12 - 0
lapi/pom.xml

@@ -28,4 +28,16 @@
             <artifactId>spring-context</artifactId>
         </dependency>
     </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <fork>true</fork>
+                    <addResources>true</addResources>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>

+ 0 - 8
pom.xml

@@ -66,14 +66,6 @@
     </dependencies>
     <build>
         <plugins>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-                <configuration>
-                    <fork>true</fork>
-                    <addResources>true</addResources>
-                </configuration>
-            </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>

+ 12 - 0
web/pom.xml

@@ -98,6 +98,18 @@
         </dependency>
         <!--支付相关 end-->
     </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <fork>true</fork>
+                    <addResources>true</addResources>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
     <profiles>
         <profile>
             <id>dev</id>

+ 11 - 7
web/src/main/java/com/jpsoft/smart/modules/mobile/controller/PersonInfoApiController.java

@@ -1,10 +1,12 @@
 package com.jpsoft.smart.modules.mobile.controller;
 
+import com.alibaba.fastjson.JSONObject;
 import com.jpsoft.smart.config.OSSConfig;
 import com.jpsoft.smart.modules.base.entity.PersonInfo;
 import com.jpsoft.smart.modules.base.service.PersonInfoService;
 import com.jpsoft.smart.modules.common.dto.MessageResult;
 import com.jpsoft.smart.modules.common.utils.OSSUtil;
+import com.jpsoft.smart.modules.common.utils.SMSUtil;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
@@ -82,8 +84,9 @@ public class PersonInfoApiController {
     }
 
 
+
     @PostMapping("getVerifyCode")
-    @ApiOperation(value="获取验证码")
+    @ApiOperation(value="获取短信验证码")
     @ApiImplicitParams({
             @ApiImplicitParam(name="personId",value = "人员编号",required = true,paramType = "form")
     })
@@ -91,16 +94,17 @@ public class PersonInfoApiController {
         MessageResult<String> messageResult = new MessageResult<>();
 
         try {
-            if(!personInfoService.exist(personId)){
+             PersonInfo personInfo = personInfoService.get(personId);
 
+            if(personInfo!=null){
+                throw new Exception("人员编号不存在@");
             }
 
-            String code = "";
-
+            String verifyCode = SMSUtil.generateNumberString(6);
+            JSONObject verifyCodeJSON = new JSONObject();
+            verifyCodeJSON.put("code", verifyCode);
 
-
-            messageResult.setData(code);
-            messageResult.setResult(true);
+            messageResult = SMSUtil.send(personInfo.getPhone(), "SMS_49390047", verifyCodeJSON.toString());
         }
         catch (Exception ex){
             messageResult.setResult(false);