Commit f569a745 authored by suhuiguang's avatar suhuiguang

1.非空校验

2.单位注销时删除掉机场单位
parent 1012265f
...@@ -65,6 +65,9 @@ public class RegUnitInfoController extends BaseController { ...@@ -65,6 +65,9 @@ public class RegUnitInfoController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "单位注册校验", notes = "单位注册校验") @ApiOperation(httpMethod = "GET", value = "单位注册校验", notes = "单位注册校验")
public ResponseModel<RegUnitInfoDto> unitCheck(@PathVariable String unitCode, public ResponseModel<RegUnitInfoDto> unitCheck(@PathVariable String unitCode,
@RequestParam String unitType) { @RequestParam String unitType) {
if(ValidationUtil.isEmpty(unitCode)){
throw new BadRequest("单位编码不能为空");
}
RegUnitInfoDto regUnitInfoDto = iRegUnitInfoService.unitCheck(unitCode, unitType); RegUnitInfoDto regUnitInfoDto = iRegUnitInfoService.unitCheck(unitCode, unitType);
return ResponseHelper.buildResponse(regUnitInfoDto); return ResponseHelper.buildResponse(regUnitInfoDto);
} }
...@@ -91,7 +94,10 @@ public class RegUnitInfoController extends BaseController { ...@@ -91,7 +94,10 @@ public class RegUnitInfoController extends BaseController {
@GetMapping(value = "/{tel}/sendTelCode") @GetMapping(value = "/{tel}/sendTelCode")
@ApiOperation(httpMethod = "GET", value = "发送手机号验证码", notes = "发送手机号验证码") @ApiOperation(httpMethod = "GET", value = "发送手机号验证码", notes = "发送手机号验证码")
public ResponseModel<Boolean> sendTelCode(@PathVariable(value = "tel") String tel) { public ResponseModel<Boolean> sendTelCode(@PathVariable(value = "tel") String tel) {
Boolean flag = false; if (ValidationUtil.isEmpty(tel)) {
throw new BadRequest("手机号不能为空");
}
Boolean flag;
HashMap<String, String> params = new HashMap<>(); HashMap<String, String> params = new HashMap<>();
String code = this.getRandomCode(); String code = this.getRandomCode();
params.put("code", code); params.put("code", code);
...@@ -133,6 +139,7 @@ public class RegUnitInfoController extends BaseController { ...@@ -133,6 +139,7 @@ public class RegUnitInfoController extends BaseController {
String redisCode = redisUtils.get(RedisKey.FLC_USER_TEL + tel).toString(); String redisCode = redisUtils.get(RedisKey.FLC_USER_TEL + tel).toString();
if (code.equals(redisCode)) { if (code.equals(redisCode)) {
flag = true; flag = true;
redisUtils.del(RedisKey.FLC_USER_TEL + tel);
} }
} }
return ResponseHelper.buildResponse(flag); return ResponseHelper.buildResponse(flag);
...@@ -142,9 +149,9 @@ public class RegUnitInfoController extends BaseController { ...@@ -142,9 +149,9 @@ public class RegUnitInfoController extends BaseController {
@GetMapping(value = "/{userName}/hasExistUser") @GetMapping(value = "/{userName}/hasExistUser")
@ApiOperation(httpMethod = "GET", value = "判断用户是否存在", notes = "判断用户是否存在") @ApiOperation(httpMethod = "GET", value = "判断用户是否存在", notes = "判断用户是否存在")
public ResponseModel<Boolean> hasExistUser(@PathVariable(value = "userName") String userName) { public ResponseModel<Boolean> hasExistUser(@PathVariable(value = "userName") String userName) {
Boolean flag = false; boolean flag = false;
AgencyUserModel user = Privilege.agencyUserClient.queryByUserName(userName).getResult(); AgencyUserModel user = Privilege.agencyUserClient.queryByUserName(userName).getResult();
if (user != null) { if (user != null) {
flag = true; flag = true;
} }
return ResponseHelper.buildResponse(flag); return ResponseHelper.buildResponse(flag);
......
...@@ -207,8 +207,10 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI ...@@ -207,8 +207,10 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
regUnitIcService.remove(new LambdaQueryWrapper<RegUnitIc>().eq(RegUnitIc::getUnitCode, unitCode)); regUnitIcService.remove(new LambdaQueryWrapper<RegUnitIc>().eq(RegUnitIc::getUnitCode, unitCode));
// 5.许可信息删除 // 5.许可信息删除
baseUnitLicenceService.remove(new LambdaQueryWrapper<BaseUnitLicence>().eq(BaseUnitLicence::getUnitCode, unitCode)); baseUnitLicenceService.remove(new LambdaQueryWrapper<BaseUnitLicence>().eq(BaseUnitLicence::getUnitCode, unitCode));
// 6.企业数据信息 删除 // 6.企业数据信息删除
tzBaseEnterpriseInfoService.remove(new LambdaQueryWrapper<TzBaseEnterpriseInfo>().eq(TzBaseEnterpriseInfo::getUseCode, unitCode)); tzBaseEnterpriseInfoService.remove(new LambdaQueryWrapper<TzBaseEnterpriseInfo>().eq(TzBaseEnterpriseInfo::getUseCode, unitCode));
// 7.机场单位表信息删除
iOrgUsrService.remove(new LambdaQueryWrapper<OrgUsr>().eq(OrgUsr::getAmosOrgId, companyId));
return Boolean.TRUE; return Boolean.TRUE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment