Althars123 4 lat temu
rodzic
commit
753cfd836b

+ 18 - 4
zzjs-admin/src/main/java/com/miaxis/system/controller/gzpt/GzptUserInfoController.java

@@ -5,6 +5,8 @@ import com.miaxis.common.core.controller.BaseController;
 import com.miaxis.common.core.domain.Response;
 import com.miaxis.common.core.domain.entity.UserInfo;
 import com.miaxis.common.core.page.ResponsePageInfo;
+import com.miaxis.common.exception.CustomException;
+import com.miaxis.common.utils.SecurityUtils;
 import com.miaxis.newgzpt.domain.GzptUserInfo;
 import com.miaxis.newgzpt.dto.GzptUserInfoDTO;
 import com.miaxis.newgzpt.service.IGzptUserInfoService;
@@ -31,6 +33,10 @@ public class GzptUserInfoController extends BaseController {
     @Autowired
     private IGzptUserInfoService gzptUserInfoService;
 
+
+    @Autowired
+    private IUserInfoService userInfoService;
+
     /**
      * 查询用户信息列表
      */
@@ -61,12 +67,20 @@ public class GzptUserInfoController extends BaseController {
 
 
     /**
-     * 获取用户id获取详细信息
+     * 绑定学员账号
      */
-    @GetMapping(value = "/getUserWxlogin")
-    @ApiOperation("根据密码获取学员")
+    @GetMapping(value = "/")
+    @ApiOperation("绑定学员账号")
     public Response<GzptUserInfo> getUserWxlogin(@ModelAttribute GzptUserInfoDTO gzptUserInfoDTO){
-        return Response.success(gzptUserInfoService.getUserWxlogin(gzptUserInfoDTO));
+        GzptUserInfo gzptUserInfo = gzptUserInfoService.getUserWxlogin(gzptUserInfoDTO);
+        if (gzptUserInfo == null){
+            throw new CustomException("改学员账户不存在或者密码错误");
+        }
+        //绑定用户与学员关系
+        UserInfo student = SecurityUtils.getLoginUser().getStudent();
+        student.setGzptUserId(gzptUserInfo.getId());
+        userInfoService.updateById(student);
+        return Response.success();
     }
 }
 

+ 9 - 47
zzjs-common/src/main/java/com/miaxis/common/core/domain/entity/UserInfo.java

@@ -30,29 +30,17 @@ public class UserInfo extends BaseBusinessEntity{
     @ApiModelProperty(value = "主键")
     private Long id;
 
-    /** 驾校全国统一编号 */
-    @Excel(name = "驾校全国统一编号")
-    @TableField("inscode")
-    @ApiModelProperty(value = "驾校全国统一编号")
-    private String inscode;
-
-    /** 姓名 */
-    @Excel(name = "姓名")
-    @TableField("name")
-    @ApiModelProperty(value = "姓名")
-    private String name;
-
     /** 性别 1:男性 2:女性 */
     @Excel(name = "性别 1:男性 2:女性")
     @TableField("sex")
     @ApiModelProperty(value = "性别 1:男性 2:女性")
-    private Long sex;
+    private Integer sex;
 
     /** 身份证明号码 1:身份证号,2:护照,3:军官证,4:其他 */
     @Excel(name = "身份证明号码 1:身份证号,2:护照,3:军官证,4:其他")
     @TableField("cardtype")
     @ApiModelProperty(value = "身份证明号码 1:身份证号,2:护照,3:军官证,4:其他")
-    private Long cardtype;
+    private Integer cardtype;
 
     /** 身份证明号码 */
     @Excel(name = "身份证明号码")
@@ -73,11 +61,6 @@ public class UserInfo extends BaseBusinessEntity{
     @ApiModelProperty(value = "手机号码")
     private String phone;
 
-    /** 登录密码 MD5加密 */
-    @Excel(name = "登录密码 MD5加密")
-    @TableField("password")
-    @ApiModelProperty(value = "登录密码 MD5加密")
-    private String password;
 
     /** 微信号码 */
     @Excel(name = "微信号码")
@@ -108,25 +91,8 @@ public class UserInfo extends BaseBusinessEntity{
     @Excel(name = "业务类型  0:初领 1:增领 9:其他")
     @TableField("busitype")
     @ApiModelProperty(value = "业务类型  0:初领 1:增领 9:其他")
-    private String busitype;
-
-    /** 原准驾车型 */
-    @Excel(name = "原准驾车型")
-    @TableField("perdritype")
-    @ApiModelProperty(value = "原准驾车型")
-    private String perdritype;
-
-    /** 培训车型 */
-    @Excel(name = "培训车型")
-    @TableField("traintype")
-    @ApiModelProperty(value = "培训车型")
-    private String traintype;
-
-    /** 教练全国统一编号 */
-    @Excel(name = "教练全国统一编号")
-    @TableField("coachnum")
-    @ApiModelProperty(value = "教练全国统一编号")
-    private String coachnum;
+    private Integer busitype;
+
 
     /** 0 启用 1禁用 */
     @Excel(name = "0 启用 1禁用")
@@ -134,17 +100,13 @@ public class UserInfo extends BaseBusinessEntity{
     @ApiModelProperty(value = "0 启用 1禁用")
     private String status;
 
-    /** 全国平台照片ID */
-    @Excel(name = "全国平台照片ID")
-    @TableField("photo")
-    @ApiModelProperty(value = "全国平台照片ID")
-    private Long photo;
 
     /** 驾校班型Id */
-    @Excel(name = "驾校班型Id")
-    @TableField("school_class_type_id")
-    @ApiModelProperty(value = "驾校班型Id")
-    private Long schoolClassTypeId;
+    @Excel(name = "公众平台用户Id")
+    @TableField("gzpt_user_id")
+    @ApiModelProperty(value = "公众平台用户Id")
+    private Integer gzptUserId;
+
 
 
 }

+ 1 - 1
zzjs-common/src/main/java/com/miaxis/common/core/domain/model/LoginUser.java

@@ -116,7 +116,7 @@ public class LoginUser implements UserDetails
         if (user != null){
             return user.getPassword();
         }else{
-            return student.getPassword();
+            return null;
         }
 
     }

+ 1 - 1
zzjs-generator/src/main/resources/vm/java/controller.java.vm

@@ -35,7 +35,7 @@ import com.miaxis.common.core.page.ResponsePageInfo;
  */
 @RestController
 @RequestMapping("/${moduleName}/${businessName}")
-@Api(tags={"【app-${functionName}】"})
+@Api(tags={"【小程序-${functionName}】"})
 public class ${ClassName}Controller extends BaseController{
     @Autowired
     private I${ClassName}Service ${className}Service;

+ 1 - 1
zzjs-service/src/main/java/com/miaxis/newgzpt/domain/GzptUserInfo.java

@@ -29,7 +29,7 @@ public class GzptUserInfo implements Serializable {
     private static final long serialVersionUID = 1L;
 
     @TableId("ID")
-    private BigDecimal id;
+    private Integer id;
 
     @ApiModelProperty(value = "姓名")
     @TableField("USER_NAME")

+ 0 - 1
zzjs-service/src/main/java/com/miaxis/user/service/impl/UserInfoServiceImpl.java

@@ -163,7 +163,6 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> i
         //用户信息表
         UserInfo userInfo = new UserInfo();
         BeanUtils.copyProperties(userDto,userInfo);
-        userInfo.setCardtype(1l);
         userInfoMapper.insert(userInfo);