dzx před 1 rokem
rodič
revize
18e4cdc55c

+ 17 - 0
src/main/java/com/xjrsoft/module/organization/controller/UserController.java

@@ -46,6 +46,7 @@ import com.xjrsoft.module.organization.dto.ResetPasswordDto;
 import com.xjrsoft.module.organization.dto.UpdateInfoDto;
 import com.xjrsoft.module.organization.dto.UpdatePasswordDto;
 import com.xjrsoft.module.organization.dto.UpdateUserDto;
+import com.xjrsoft.module.organization.dto.UploadMobileDto;
 import com.xjrsoft.module.organization.dto.UploadSignDto;
 import com.xjrsoft.module.organization.dto.UserChangeStatusDto;
 import com.xjrsoft.module.organization.dto.UserPageDto;
@@ -851,4 +852,20 @@ public class UserController {
         }
         return RT.ok(true);
     }
+
+    @PostMapping("/upload-mobile")
+    @ApiOperation(value = "修改手机号")
+    public R uploadMobile(@Valid @RequestBody UploadMobileDto dto) {
+        // 验证验证码
+        if (!smsCtcc.captchaVerify(dto.getMobile(), dto.getSmsCode())) {
+            return R.error("验证码不正确!");
+        }
+        if(dto.getUserId() == null){
+            dto.setUserId(StpUtil.getLoginIdAsLong());
+        }
+        User user = userService.getById(dto.getUserId());
+        user.setMobile(dto.getMobile());
+
+        return R.ok(userService.updateById(user));
+    }
 }

+ 17 - 0
src/main/java/com/xjrsoft/module/organization/dto/UploadMobileDto.java

@@ -0,0 +1,17 @@
+package com.xjrsoft.module.organization.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class UploadMobileDto {
+
+    @ApiModelProperty("用户id")
+    private Long userId;
+
+    @ApiModelProperty("手机号")
+    private String mobile;
+
+    @ApiModelProperty("验证码")
+    private String smsCode;
+}

+ 3 - 1
src/main/java/com/xjrsoft/module/student/controller/BaseNewStudentController.java

@@ -62,6 +62,7 @@ import javax.validation.Valid;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.LinkedHashMap;
@@ -357,7 +358,7 @@ public class BaseNewStudentController {
     public ResponseEntity<byte[]> exportData(@Valid BaseNewStudentPageDto dto) {
         List<BaseNewStudentPageVo> reportList = baseNewStudentService.getReportList(dto);
         List<BaseNewStudentExportVo> exportVos = new ArrayList<>();
-
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         for (BaseNewStudentPageVo el : reportList) {
             BaseNewStudentExportVo vo = BeanUtil.toBean(el, BaseNewStudentExportVo.class);
             if(el.getIsAdjust() == 1){
@@ -365,6 +366,7 @@ public class BaseNewStudentController {
             }else if(el.getIsAdjust() == 0){
                 vo.setReportStatus("否");
             }
+            vo.setReportTime(el.getReportTime().format(formatter));
             exportVos.add(vo);
         }
         ByteArrayOutputStream bot = new ByteArrayOutputStream();

+ 1 - 1
src/main/java/com/xjrsoft/module/student/vo/BaseNewStudentExportVo.java

@@ -64,6 +64,6 @@ public class BaseNewStudentExportVo {
 
     @ExcelProperty("报到时间")
     @ApiModelProperty("报到时间")
-    private LocalDate reportTime;
+    private String reportTime;
 
 }