mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-09 20:40:03 +08:00
update 前端输入的手机号trim处理
This commit is contained in:
@@ -5,7 +5,9 @@ import com.jsowell.common.core.controller.BaseController;
|
|||||||
import com.jsowell.common.core.domain.AjaxResult;
|
import com.jsowell.common.core.domain.AjaxResult;
|
||||||
import com.jsowell.common.core.page.TableDataInfo;
|
import com.jsowell.common.core.page.TableDataInfo;
|
||||||
import com.jsowell.common.enums.BusinessType;
|
import com.jsowell.common.enums.BusinessType;
|
||||||
|
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||||
import com.jsowell.common.exception.BusinessException;
|
import com.jsowell.common.exception.BusinessException;
|
||||||
|
import com.jsowell.common.util.StringUtils;
|
||||||
import com.jsowell.common.util.poi.ExcelUtil;
|
import com.jsowell.common.util.poi.ExcelUtil;
|
||||||
import com.jsowell.pile.domain.PileStationWhitelist;
|
import com.jsowell.pile.domain.PileStationWhitelist;
|
||||||
import com.jsowell.pile.service.IPileStationWhitelistService;
|
import com.jsowell.pile.service.IPileStationWhitelistService;
|
||||||
@@ -76,6 +78,9 @@ public class PileStationWhitelistController extends BaseController {
|
|||||||
public AjaxResult add(@RequestBody PileStationWhitelist pileStationWhitelist) {
|
public AjaxResult add(@RequestBody PileStationWhitelist pileStationWhitelist) {
|
||||||
AjaxResult result;
|
AjaxResult result;
|
||||||
try {
|
try {
|
||||||
|
if (StringUtils.isBlank(pileStationWhitelist.getMobileNumber())) {
|
||||||
|
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||||
|
}
|
||||||
pileStationWhitelistService.insertPileStationWhitelist(pileStationWhitelist);
|
pileStationWhitelistService.insertPileStationWhitelist(pileStationWhitelist);
|
||||||
result = AjaxResult.success();
|
result = AjaxResult.success();
|
||||||
} catch (BusinessException e) {
|
} catch (BusinessException e) {
|
||||||
|
|||||||
@@ -68,16 +68,13 @@ public class PileStationWhitelistServiceImpl implements IPileStationWhitelistSer
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertPileStationWhitelist(PileStationWhitelist pileStationWhitelist) {
|
public int insertPileStationWhitelist(PileStationWhitelist pileStationWhitelist) {
|
||||||
// pileStationWhitelist.setCreateTime(DateUtils.getNowDate());
|
String mobileNumber = StringUtils.trim(pileStationWhitelist.getMobileNumber());
|
||||||
if (StringUtils.isBlank(pileStationWhitelist.getMobileNumber())) {
|
|
||||||
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
|
||||||
}
|
|
||||||
// 查询站点信息
|
// 查询站点信息
|
||||||
PileStationVO stationInfo = pileStationInfoService.getStationInfo(pileStationWhitelist.getStationId());
|
PileStationVO stationInfo = pileStationInfoService.getStationInfo(pileStationWhitelist.getStationId());
|
||||||
// 获取一级运营商id
|
// 获取一级运营商id
|
||||||
String firstLevelMerchantId = pileMerchantInfoService.getFirstLevelMerchantIdByMerchantId(stationInfo.getMerchantId());
|
String firstLevelMerchantId = pileMerchantInfoService.getFirstLevelMerchantIdByMerchantId(stationInfo.getMerchantId());
|
||||||
// 查询是否注册会员
|
// 查询是否注册会员
|
||||||
MemberBasicInfo memberInfo = memberBasicInfoService.selectInfoByMobileNumber(pileStationWhitelist.getMobileNumber(), firstLevelMerchantId);
|
MemberBasicInfo memberInfo = memberBasicInfoService.selectInfoByMobileNumber(mobileNumber, firstLevelMerchantId);
|
||||||
if (memberInfo == null) {
|
if (memberInfo == null) {
|
||||||
throw new BusinessException(ReturnCodeEnum.CODE_MEMBER_NOT_FOUND_ERROR);
|
throw new BusinessException(ReturnCodeEnum.CODE_MEMBER_NOT_FOUND_ERROR);
|
||||||
}
|
}
|
||||||
@@ -87,6 +84,7 @@ public class PileStationWhitelistServiceImpl implements IPileStationWhitelistSer
|
|||||||
if (CollectionUtils.isNotEmpty(list)) {
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
pileStationWhitelist.setCreateTime(DateUtils.getNowDate());
|
||||||
return pileStationWhitelistMapper.insertPileStationWhitelist(pileStationWhitelist);
|
return pileStationWhitelistMapper.insertPileStationWhitelist(pileStationWhitelist);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user