From c41f8c8a75c4475831e3c7e9cde7467d2fb39950 Mon Sep 17 00:00:00 2001 From: jiangping <jp@doumee.com> Date: 星期五, 28 六月 2024 10:38:17 +0800 Subject: [PATCH] 提交一把 --- server/service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java | 33 ++++++++++++++++++++++++--------- 1 files changed, 24 insertions(+), 9 deletions(-) diff --git a/server/service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java b/server/service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java index b79089e..5d9c136 100644 --- a/server/service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java +++ b/server/service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java @@ -194,6 +194,12 @@ .eq(SystemUser::getUsername,company.getUsername()))>0){ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"瀵逛笉璧凤紝璇ョ櫥褰曡处鍙峰凡瀛樺湪锛岃鏇存柊閲嶈瘯~"); } + if(systemUserMapper.selectCount(new QueryWrapper<SystemUser>().lambda() + .eq(SystemUser::getDeleted,Boolean.TRUE) + .eq(SystemUser::getMobile,company.getPhone()))>0){ + throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"瀵逛笉璧凤紝璇ユ墜鏈哄彿宸插瓨鍦紝璇锋洿鎹㈤噸璇晘"); + } + SystemUser user = new SystemUser(); user.setUsername(company.getUsername()); // 鐢熸垚瀵嗙爜鐩� @@ -218,6 +224,12 @@ .eq(SystemUser::getUsername,company.getUsername()))>0){ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"瀵逛笉璧凤紝璇ョ櫥褰曡处鍙峰凡瀛樺湪锛岃鏇存柊閲嶈瘯~"); } + if(systemUserMapper.selectCount(new QueryWrapper<SystemUser>().lambda() + .eq(SystemUser::getDeleted,Boolean.TRUE) + .ne(SystemUser::getUsername,company.getUsername()) + .eq(SystemUser::getMobile,company.getPhone()))>0){ + throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"瀵逛笉璧凤紝璇ユ墜鏈哄彿宸插瓨鍦紝璇锋洿鏂伴噸璇晘"); + } SystemUser model = systemUserMapper.selectOne(new QueryWrapper<SystemUser>().lambda() .eq(SystemUser::getDeleted,Boolean.TRUE) .eq(SystemUser::getUsername,oldUserName).last("limit 1")); @@ -240,6 +252,7 @@ user.setStatus(Constants.ZERO); systemUserMapper.insert(user);//鎻掑叆鏂扮殑绠$悊鍛樿处鍙� }else{ + model.setMobile(company.getPhone()); model.setUsername(company.getUsername()); model.setCreateUser(company.getCreator()); model.setCreateTime(company.getCreateDate()); @@ -352,8 +365,8 @@ ||StringUtils.isBlank(company.getEmail())){ throw new BusinessException(ResponseStatus.BAD_REQUEST); } - - if(!debugModel){ + String phoneAtuh = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.COMPANY_PHONE_AUTH).getCode(); + if(!debugModel && !StringUtils.equals(phoneAtuh,Constants.ONE+"")){ //鎵嬫満楠岃瘉鐮佹牎楠� SmsEmailServiceImpl.isCaptcheValide(smsEmailMapper,company.getPhone(),company.getCaptche()); } @@ -368,14 +381,14 @@ }else { throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"璇蜂笂浼犺惀涓氭墽鐓э紒"); } - if(company.getSignImg()!=null && StringUtils.isNotBlank(company.getSignImg().getFileurl())){ - multifileList.add(initMultiFileByCompay(company,company.getSignImg(),Constants.MultiFile.COM_SING_IMG.getKey())); - }else { +// if(company.getSignImg()!=null && StringUtils.isNotBlank(company.getSignImg().getFileurl())){ +// multifileList.add(initMultiFileByCompay(company,company.getSignImg(),Constants.MultiFile.COM_SING_IMG.getKey())); +// }else { // throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"璇蜂笂浼犵數瀛愮绔狅紒"); - } +// } if(company.getIdcardImgList()!=null && company.getIdcardImgList()!=null&& company.getIdcardImgList().size()>0){ for(Multifile f : company.getIdcardImgList()){ - multifileList.add(initMultiFileByCompay(company,f,Constants.MultiFile.COM_IDCARD_IMG.getKey())); + multifileList.add(initMultiFileByCompay(company,f,Constants.MultiFile.COM_IDCARD_IMG.getKey())); } }else { throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"璇蜂笂浼犺韩浠借瘉鎵弿浠讹紒"); @@ -472,7 +485,8 @@ || StringUtils.isBlank(company.getCaptche())){ throw new BusinessException(ResponseStatus.BAD_REQUEST ); } - if(!debugModel){ + String phoneAtuh = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.COMPANY_PHONE_AUTH).getCode(); + if(!debugModel && !StringUtils.equals(phoneAtuh,Constants.ONE+"")){ SmsEmailServiceImpl.isCaptcheValide(smsEmailMapper,company.getPhone(),company.getCaptche()); } Company model = companyMapper.selectById(company.getId()); @@ -536,9 +550,10 @@ if(companyMapper.selectCount(new QueryWrapper<Company>().lambda() .ne(Company::getId,company.getId()) + .eq(Company::getIsdeleted,Constants.ZERO) .and(w->w.eq(Company::getCode,company.getCode()) .or().eq(Company::getEmail,company.getEmail()) - .or().eq(Company::getUsername,company.getUsername()) +// .or().eq(Company::getUsername,company.getUsername()) .or().eq(Company::getName,company.getName())) )>0){ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"瀵逛笉璧凤紝璇ヤ紒涓氥�愬悕绉般�戙�愮粺涓�淇$敤浠g爜銆戙�愰偖绠便�戞垨鑰呫�愪紒涓氳处鍙枫�戝凡瀛樺湪锛岃纭鍚庨噸鏂版彁浜わ紒"); -- Gitblit v1.9.3