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