mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-19 18:45:03 +08:00
update 用户绑定车牌号接口
This commit is contained in:
@@ -12,19 +12,13 @@ import com.jsowell.common.exception.ServiceException;
|
||||
import com.jsowell.common.response.RestApiResponse;
|
||||
import com.jsowell.common.util.SMSUtil;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.dto.MemberRegisterAndLoginDTO;
|
||||
import com.jsowell.pile.dto.MemberRegisterDTO;
|
||||
import com.jsowell.pile.dto.UniAppQueryMemberBalanceDTO;
|
||||
import com.jsowell.pile.dto.WechatLoginDTO;
|
||||
import com.jsowell.pile.dto.WeixinPayDTO;
|
||||
import com.jsowell.pile.domain.MemberBasicInfo;
|
||||
import com.jsowell.pile.dto.*;
|
||||
import com.jsowell.pile.service.IMemberBasicInfoService;
|
||||
import com.jsowell.pile.vo.uniapp.MemberVO;
|
||||
import com.jsowell.service.MemberService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Map;
|
||||
@@ -41,6 +35,9 @@ public class MemberController extends BaseController {
|
||||
@Autowired
|
||||
private MemberService memberService;
|
||||
|
||||
@Autowired
|
||||
private IMemberBasicInfoService memberBasicInfoService;
|
||||
|
||||
/**
|
||||
* 下发短信接口 business
|
||||
* http://localhost:8080/uniapp/member/sendSMS
|
||||
@@ -196,4 +193,48 @@ public class MemberController extends BaseController {
|
||||
logger.info("查询用户账户余额变动信息 result:{}", response);
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过 memberId 查询用户个人基本信息
|
||||
* http://localhost:8080/uniapp/member/selectInfoByMemberId
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/selectInfoByMemberId")
|
||||
public RestApiResponse<?> selectInfoByMemberId(HttpServletRequest request){
|
||||
String memberId = getMemberIdByAuthorization(request);
|
||||
logger.info("通过 memberId 查询用户个人基本信息 param:{}", memberId);
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
MemberBasicInfo memberBasicInfo = memberBasicInfoService.selectInfoByMemberId(memberId);
|
||||
response = new RestApiResponse<>(memberBasicInfo);
|
||||
} catch (Exception e) {
|
||||
logger.error("通过 memberId 查询用户个人基本信息 error", e);
|
||||
response = new RestApiResponse<>(e);
|
||||
}
|
||||
logger.info("通过 memberId 查询用户个人基本信息 result:{}", response);
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用户绑定车牌号
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/memberBindingCarNo")
|
||||
public RestApiResponse<?> memberBindingCarNo(@RequestBody BindingCarNoDTO dto){
|
||||
logger.info("用户绑定车牌号 param:{}", JSONObject.toJSONString(dto));
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
memberService.memberBindingCarNo(dto);
|
||||
response = new RestApiResponse<>();
|
||||
}catch (Exception e){
|
||||
logger.error("用户绑定车牌号 error", e);
|
||||
response = new RestApiResponse<>(e);
|
||||
}
|
||||
logger.info("用户绑定车牌号 result:{}", response);
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,10 +14,7 @@ import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.common.util.id.IdUtils;
|
||||
import com.jsowell.pile.domain.MemberBasicInfo;
|
||||
import com.jsowell.pile.domain.MemberWalletInfo;
|
||||
import com.jsowell.pile.dto.MemberRegisterAndLoginDTO;
|
||||
import com.jsowell.pile.dto.MemberRegisterDTO;
|
||||
import com.jsowell.pile.dto.UniAppQueryMemberBalanceDTO;
|
||||
import com.jsowell.pile.dto.WechatLoginDTO;
|
||||
import com.jsowell.pile.dto.*;
|
||||
import com.jsowell.pile.service.IMemberBasicInfoService;
|
||||
import com.jsowell.pile.service.IPileMerchantInfoService;
|
||||
import com.jsowell.pile.transaction.dto.MemberTransactionDTO;
|
||||
@@ -231,4 +228,19 @@ public class MemberService {
|
||||
.build();
|
||||
return pageResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户绑定车牌号
|
||||
* @param dto
|
||||
*/
|
||||
public void memberBindingCarNo(BindingCarNoDTO dto){
|
||||
// 校验短信验证码
|
||||
MemberRegisterAndLoginDTO registerAndLoginDTO = MemberRegisterAndLoginDTO.builder()
|
||||
.mobileNumber(dto.getPhoneNumber())
|
||||
.verificationCode(dto.getVerificationCode())
|
||||
.build();
|
||||
checkVerificationCode(registerAndLoginDTO);
|
||||
|
||||
memberBasicInfoService.memberBindingCarNo(dto);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,16 +20,16 @@ public class Constants {
|
||||
public static final String SOCKET_IP = "127.0.0.1";
|
||||
public static final Integer SOCKET_PORT = 9011;
|
||||
|
||||
public static final String updateServerIP = "192.168.2.5";
|
||||
public static final int port = 0x15;
|
||||
public static final String updateServerIP = "192.168.2.2";
|
||||
public static final int port = 0x21;
|
||||
|
||||
public static final byte[] updateServerPort = new byte[]{port};
|
||||
|
||||
public static final String updateServerUserName = "ftpuser";
|
||||
public static final String updateServerUserName = "vuser";
|
||||
|
||||
public static final String updateServerPassword = "ftp123456";
|
||||
public static final String updateServerPassword = "123456";
|
||||
|
||||
public static final String filePath = "/pile/test.bin";
|
||||
public static final String filePath = "/test.bin";
|
||||
|
||||
public static final String partnerId = "1632405339"; // 商户号Id
|
||||
|
||||
|
||||
@@ -42,6 +42,11 @@ public class MemberBasicInfo extends BaseEntity {
|
||||
*/
|
||||
private String openId;
|
||||
|
||||
/**
|
||||
* 车牌号
|
||||
*/
|
||||
private String licensePlateNumber;
|
||||
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.jsowell.pile.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户绑定车牌号
|
||||
*
|
||||
* @author JS-ZZA
|
||||
* @date 2023/3/4 11:39
|
||||
*/
|
||||
@Data
|
||||
public class BindingCarNoDTO {
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
private String phoneNumber;
|
||||
|
||||
/**
|
||||
* 短信验证码
|
||||
*/
|
||||
private String verificationCode;
|
||||
|
||||
/**
|
||||
* 车牌号
|
||||
*/
|
||||
private String carNo;
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.jsowell.pile.service;
|
||||
|
||||
import com.jsowell.pile.domain.MemberBasicInfo;
|
||||
import com.jsowell.pile.dto.BindingCarNoDTO;
|
||||
import com.jsowell.pile.vo.uniapp.MemberVO;
|
||||
import com.jsowell.pile.vo.uniapp.MemberWalletLogVO;
|
||||
import com.jsowell.pile.vo.uniapp.PersonalPileInfoVO;
|
||||
@@ -115,4 +116,6 @@ public interface IMemberBasicInfoService {
|
||||
* @return
|
||||
*/
|
||||
List<PersonalPileInfoVO> getMemberPersonPileInfo(String memberId);
|
||||
|
||||
void memberBindingCarNo(BindingCarNoDTO dto);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.domain.MemberBasicInfo;
|
||||
import com.jsowell.pile.domain.MemberWalletInfo;
|
||||
import com.jsowell.pile.domain.MemberWalletLog;
|
||||
import com.jsowell.pile.dto.BindingCarNoDTO;
|
||||
import com.jsowell.pile.dto.MemberRegisterAndLoginDTO;
|
||||
import com.jsowell.pile.mapper.MemberBasicInfoMapper;
|
||||
import com.jsowell.pile.mapper.MemberWalletInfoMapper;
|
||||
import com.jsowell.pile.mapper.MemberWalletLogMapper;
|
||||
@@ -261,4 +263,17 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
|
||||
return pileBasicInfoService.getPileInfoByMemberId(memberId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户绑定车牌号
|
||||
* @param dto
|
||||
*/
|
||||
@Override
|
||||
public void memberBindingCarNo(BindingCarNoDTO dto) {
|
||||
MemberBasicInfo memberBasicInfo = MemberBasicInfo.builder()
|
||||
.mobileNumber(dto.getPhoneNumber())
|
||||
.licensePlateNumber(dto.getCarNo())
|
||||
.build();
|
||||
memberBasicInfoMapper.updateMemberBasicInfo(memberBasicInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<result property="id" column="id" />
|
||||
<result property="memberId" column="member_id"/>
|
||||
<result property="openId" column="open_id"/>
|
||||
<result property="licensePlateNumber" column="license_plate_number"/>
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="logicCard" column="logic_card"/>
|
||||
<result property="physicsCard" column="physics_card"/>
|
||||
@@ -31,7 +32,7 @@
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated PileBillingTemplate-->
|
||||
id, member_id, open_id, nick_name,logic_card, physics_card, status, avatar_url, mobile_number, merchant_id, remark,
|
||||
id, member_id, open_id, license_plate_number, nick_name,logic_card, physics_card, status, avatar_url, mobile_number, merchant_id, remark,
|
||||
create_time, create_by, update_time, update_by, del_flag
|
||||
</sql>
|
||||
|
||||
@@ -58,6 +59,7 @@
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="memberId != null">member_id,</if>
|
||||
<if test="openId != null">open_id,</if>
|
||||
<if test="licensePlateNumber != null">license_plate_number,</if>
|
||||
<if test="nickName != null">nick_name,</if>
|
||||
<if test="logicCard != null">logic_card,</if>
|
||||
<if test="physicsCard != null">physics_card,</if>
|
||||
@@ -74,6 +76,7 @@
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="memberId != null">#{memberId},</if>
|
||||
<if test="openId != null">#{openId},</if>
|
||||
<if test="licensePlateNumber != null">#{licensePlateNumber},</if>
|
||||
<if test="nickName != null">#{nickName},</if>
|
||||
<if test="logicCard != null">#{logicCard},</if>
|
||||
<if test="physicsCard != null">#{physicsCard},</if>
|
||||
@@ -94,6 +97,7 @@
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="memberId != null">member_id = #{memberId},</if>
|
||||
<if test="openId != null">open_id = #{openId},</if>
|
||||
<if test="licensePlateNumber != null">license_plate_number = #{licensePlateNumber},</if>
|
||||
<if test="nickName != null">nick_name = #{nickName},</if>
|
||||
<if test="logicCard != null">logic_card = #{logicCard},</if>
|
||||
<if test="physicsCard != null">physics_card = #{physicsCard},</if>
|
||||
|
||||
Reference in New Issue
Block a user