Commit d671885e authored by zjy's avatar zjy

user/role/tright 5.21

修改:邀请码的检查字段
修改:公司信息在注册页面第一页保存
parent 2764afa5
......@@ -32,8 +32,6 @@ public class AuthorityController {
@RequestMapping(value = "/save", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseResult saveAuthority(@RequestBody AuthorityVo authorityVo){
CheckerHelper.newInstance()
.notBlankCheck("authority",authorityVo)
.checkException()
.notBlankCheck("authorityName",authorityVo.getName())
.notBlankCheck("authorityUrl",authorityVo.getUrl())
.notBlankCheck("type",authorityVo.getType())
......@@ -53,8 +51,6 @@ public class AuthorityController {
@RequestMapping(value = "/update", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseResult updateAuthority(@RequestBody AuthorityVo authorityVo){
CheckerHelper.newInstance()
.notBlankCheck("authority",authorityVo)
.checkException()
.notBlankCheck("authorityName",authorityVo.getName())
.notBlankCheck("authorityUrl",authorityVo.getUrl())
.notBlankCheck("type",authorityVo.getType())
......@@ -93,8 +89,6 @@ public class AuthorityController {
@RequestMapping(value = "/role", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseResult<AuthorityVo> authority(@RequestBody WebAuthorityReqVo reqVo){
CheckerHelper.newInstance()
.notBlankCheck("reqVo",reqVo)
.checkException()
.notBlankCheck("anthorityId",reqVo.getId())
.checkException();
return ResponseResult.result(authorityServiceImpl.getAuthorityById(reqVo));
......@@ -108,8 +102,6 @@ public class AuthorityController {
@RequestMapping(value = "/delete", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseResult delete(@RequestBody WebAuthorityReqVo reqVo){
CheckerHelper.newInstance()
.notBlankCheck("reqVo",reqVo)
.checkException()
.notBlankCheck("anthorityId",reqVo.getId())
.checkException();
authorityServiceImpl.deleteAuthorityById(reqVo);
......
......@@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
*/
@RestController
@RequestMapping(value="/computer")
@RequestMapping(value="/computerRegister")
public class ComputerRegisterController {
@Autowired
RegisterService registerServiceImpl;
......@@ -38,8 +38,6 @@ public class ComputerRegisterController {
@RequestMapping(value = "/saveUser", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseResult<CompanyVo> saveUser(@RequestBody RegisterUserReqVo registerUserReqVo){
CheckerHelper.newInstance()
.notBlankCheck("reqVo",registerUserReqVo)
.checkException()
.notBlankCheck("account",registerUserReqVo.getAccount())
.notBlankCheck("password",registerUserReqVo.getPassword())
.notBlankCheck("confirmPassword",registerUserReqVo.getConfirmPassword())
......@@ -59,14 +57,11 @@ public class ComputerRegisterController {
@RequestMapping(value="/saveIndividual", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseResult saveIndividual(@RequestBody RegisterIndividualReqVo reqVo){
CheckerHelper.newInstance()
.notBlankCheck("reqVo",reqVo)
.checkException()
.notBlankCheck("contactName",reqVo.getContactName())
.notBlankCheck("contactCode",reqVo.getContactCode())
.checkIdCard("contactCode",reqVo.getContactCode())
.notBlankCheck("companyAttribute",reqVo.getCompanyAttribute())
.notBlankCheck("extraChoseOne",reqVo.getExtraChoseOne())
.notBlankCheck("extraChosetwo",reqVo.getExtraChoseTwo())
.notBlankCheck("companyName",reqVo.getCompanyName())
.notBlankCheck("contactPhone",reqVo.getContactPhone())
.checkPhoneNo("contactPhone",reqVo.getContactPhone())
.checkException();
......@@ -77,10 +72,8 @@ public class ComputerRegisterController {
@RequestMapping(value="/enterprise", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseResult saveEnterprise(@RequestBody RegisterEnterpriceReqVo reqVo){
CheckerHelper.newInstance()
.notBlankCheck("reqVo",reqVo)
.checkException()
.notBlankCheck("companyName",reqVo.getCompanyName())
.notBlankCheck("companyAddress",reqVo.getCompanyAddress())
.notBlankCheck("companyAddress",reqVo.getAddress())
.notBlankCheck("businessLicenseCode",reqVo.getBusinessLicenseCode())
.notNumberCheck("businessLicenseCode",reqVo.getBusinessLicenseCode())
.notBlankCheck("merchantName",reqVo.getMerchantName())
......@@ -107,8 +100,6 @@ public class ComputerRegisterController {
@RequestMapping(value = "/login", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseResult login(@RequestBody LoginReqVo reqVo){
CheckerHelper.newInstance()
.notBlankCheck("reqVo",reqVo)
.checkException()
.notBlankCheck("account or phone",reqVo.getAccountOrPhone())
.notBlankCheck("pass",reqVo.getPassword())
.checkException();
......
......@@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
* @create 2019/5/13 11:26
*/
@RestController
@RequestMapping(value="/mobile")
@RequestMapping(value="/mobileRegister")
public class MobileRegisterController {
@Autowired
......@@ -34,8 +34,6 @@ public class MobileRegisterController {
@RequestMapping(value = "/user", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseResult<CompanyVo> saveUser(@RequestBody RegisterUserReqVo registerUserReqVo){
CheckerHelper.newInstance()
.notBlankCheck("reqVo",registerUserReqVo)
.checkException()
.notBlankCheck("account",registerUserReqVo.getAccount())
.notBlankCheck("password",registerUserReqVo.getPassword())
.notBlankCheck("confirmPassword",registerUserReqVo.getConfirmPassword())
......@@ -54,14 +52,11 @@ public class MobileRegisterController {
@RequestMapping(value="/individual", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseResult saveIndividual(@RequestBody RegisterIndividualReqVo reqVo){
CheckerHelper.newInstance()
.notBlankCheck("reqVo",reqVo)
.checkException()
.notBlankCheck("contactName",reqVo.getContactName())
.notBlankCheck("contactCode",reqVo.getContactCode())
.checkIdCard("contactCode",reqVo.getContactCode())
.notBlankCheck("companyAttribute",reqVo.getCompanyAttribute())
.notBlankCheck("extraChoseOne",reqVo.getExtraChoseOne())
.notBlankCheck("extraChosetwo",reqVo.getExtraChoseTwo())
.notBlankCheck("companyName",reqVo.getCompanyName())
.notBlankCheck("contactPhone",reqVo.getContactPhone())
.checkPhoneNo("contactPhone",reqVo.getContactPhone())
.checkException();
......@@ -75,8 +70,6 @@ public class MobileRegisterController {
@RequestMapping(value = "/login", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseResult login(@RequestBody LoginReqVo reqVo){
CheckerHelper.newInstance()
.notBlankCheck("reqVo",reqVo)
.checkException()
.notBlankCheck("account or phone",reqVo.getAccountOrPhone())
.notBlankCheck("pass",reqVo.getPassword())
.checkException();
......
......@@ -31,8 +31,6 @@ public class RoleController {
@RequestMapping(value = "/save", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseResult saveRole(@RequestBody WebRoleReqVo webRoleReqVo){
CheckerHelper.newInstance()
.notBlankCheck("reqVo",webRoleReqVo)
.checkException()
.notBlankCheck("roleName",webRoleReqVo.getName())
.notBlankCheck("remark",webRoleReqVo.getRemark())
.checkException();
......@@ -48,8 +46,6 @@ public class RoleController {
@RequestMapping(value = "/update", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseResult updateRole(@RequestBody WebRoleReqVo webRoleReqVo){
CheckerHelper.newInstance()
.notBlankCheck("reqVo",webRoleReqVo)
.checkException()
.notBlankCheck("roleName",webRoleReqVo.getName())
.notBlankCheck("remark",webRoleReqVo.getRemark())
.checkException();
......@@ -74,8 +70,6 @@ public class RoleController {
@RequestMapping(value = "/role", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseResult<WebRoleResVo> getRoleById(@RequestBody WebRoleReqVo webRoleReqVo){
CheckerHelper.newInstance()
.notBlankCheck("reqVo",webRoleReqVo)
.checkException()
.notBlankCheck("roleId",webRoleReqVo.getId())
.checkException();
return ResponseResult.result(roleServiceImpl.getRoleById(webRoleReqVo));
......@@ -89,8 +83,6 @@ public class RoleController {
@RequestMapping(value = "/delete", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseResult delete(@RequestBody WebRoleReqVo webRoleReqVo){
CheckerHelper.newInstance()
.notBlankCheck("reqVo",webRoleReqVo)
.checkException()
.notBlankCheck("roleId",webRoleReqVo.getId())
.checkException();
roleServiceImpl.delete(webRoleReqVo);
......
......@@ -29,8 +29,6 @@ public class UserController {
@RequestMapping(value = "/save", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseResult saveUser(@RequestBody WebUserReqVo webUserReqVo){
CheckerHelper.newInstance()
.notBlankCheck("reqVo",webUserReqVo)
.checkException()
.notBlankCheck("account",webUserReqVo.getAccount())
.notBlankCheck("password",webUserReqVo.getPassword())
.checkPhoneNo("phone",webUserReqVo.getPhone())
......@@ -49,8 +47,6 @@ public class UserController {
@RequestMapping(value = "/update", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseResult updateUser(@RequestBody WebUserReqVo webUserReqVo){
CheckerHelper.newInstance()
.notBlankCheck("reqVo",webUserReqVo)
.checkException()
.notBlankCheck("account",webUserReqVo.getAccount())
.notBlankCheck("password",webUserReqVo.getPassword())
.checkPhoneNo("phone",webUserReqVo.getPhone())
......@@ -78,8 +74,6 @@ public class UserController {
@RequestMapping(value = "/user", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseResult<WebUserResVo> user(@RequestBody WebUserReqVo webUserReqVo){
CheckerHelper.newInstance()
.notBlankCheck("req",webUserReqVo)
.checkException()
.notBlankCheck("userId",webUserReqVo.getId())
.checkException();
return ResponseResult.result(userServiceImpl.getUserById(webUserReqVo.getId()));
......
......@@ -11,8 +11,4 @@ public interface CompanyService{
*/
public void updateCompayStatus(CompanyVo companyVo);
public CompanyVo saveCompany(CompanyVo companyVo);
public void updateCompany(CompanyVo companyVo);
}
package com.pangding.web.authority.service;
import com.pangding.web.authority.vo.CompanyExtendVo;
import com.pangding.web.authority.vo.reqvo.LoginReqVo;
import com.pangding.web.authority.vo.reqvo.RegisterEnterpriceReqVo;
import com.pangding.web.authority.vo.reqvo.RegisterIndividualReqVo;
......@@ -19,7 +20,7 @@ public interface RegisterService {
* @param merchantId 注册编码
* @return false:注册编码错误 true:注册编码正确
*/
CompanyVo checkMerchantId(String merchantId);
CompanyExtendVo checkInvitationCode(String merchantId);
/**
* 保存用户信息,并返回公司信息
......
......@@ -88,7 +88,7 @@ public class AuthorityServiceImpl implements AuthorityService {
PageSizeData<AuthorityVo> authorityVoPageSizeData = authorityDao.getAuthorityList(reqVo);
PageSizeData<WebAuthorityResVo> webAuthorityResVoPageSizeData = new PageSizeData();
List<AuthorityVo> authorityVoList = authorityVoPageSizeData.getList();
if (authorityVoList == null || authorityVoList.size() == 0){
if (authorityVoList == null || authorityVoList.isEmpty()){
throw new CodeException("没有更多权限");
}
List<WebAuthorityResVo> webAuthorityResVoList = new ArrayList(authorityVoList.size());
......
......@@ -20,21 +20,4 @@ public class CompanyServiceImpl implements CompanyService{
companyDao.update(company);
}
@Override
public CompanyVo saveCompany(CompanyVo company){
CompanyVo companyVo = companyDao.load(company.getId(), CompanyVo.class);
if(null != companyVo){
companyDao.update(company);
}else{
companyDao.save(company);
}
return companyDao.load(company.getId(), CompanyVo.class);
}
@Override
public void updateCompany(CompanyVo companyVo){
companyDao.update(companyVo);
}
}
......@@ -3,7 +3,7 @@ package com.pangding.web.authority.service.impl;
import com.pangding.web.authority.dao.*;
import com.pangding.web.authority.service.CompanyService;
import com.pangding.web.authority.util.CompanyConstant;
import com.pangding.web.authority.util.TokenUtil;
/*import com.pangding.web.authority.util.TokenUtil;*/
import com.pangding.web.authority.vo.*;
import com.pangding.web.authority.vo.cloudvo.LoginResVo;
import com.pangding.web.authority.vo.reqvo.*;
......@@ -12,6 +12,7 @@ import com.pangding.web.authority.service.RegisterService;
import com.pangding.web.authority.service.UserService;
/*import com.yanzuoguang.token.TokenHelper;*/
import com.yanzuoguang.token.TokenHelper;
import com.yanzuoguang.util.base.ObjectHelper;
import com.yanzuoguang.util.exception.CodeException;
import com.yanzuoguang.util.helper.StringHelper;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -41,32 +42,31 @@ public class RegisterServiceImpl implements RegisterService {
private CompanyService companyService;
@Override
public CompanyVo checkMerchantId(String invitationCode) {
CompanyGetReqVo reqVo = new CompanyGetReqVo();
reqVo.setId(invitationCode);
CompanyVo companyVo = companyDaoImpl.load(reqVo,CompanyVo.class);
return companyVo ;//== null ? false : true
public CompanyExtendVo checkInvitationCode(String invitationCode) {
CompanyExtendGetReqVo reqVo = new CompanyExtendGetReqVo();
reqVo.setInvitationCode(invitationCode);
CompanyExtendVo companyExtendVo = companyExtendDaoImpl.load(reqVo,CompanyExtendVo.class);
return companyExtendVo == null ? null : companyExtendVo;
}
@Override
@Transactional(rollbackFor = Exception.class)
public CompanyVo saveUser(RegisterUserReqVo registerUserReqVo) {
if (CompanyConstant.COMPANY_TYPE_PERSON != registerUserReqVo.getCompanyType()){
throw new CodeException("目前仅支持个体用户");
}
// 检查账户是否合法
userServiceImpl.isValid(registerUserReqVo.getAccount());
UserVo userVo = new UserVo();
userVo.setAccount(registerUserReqVo.getAccount());
userServiceImpl.checkAccount(userVo); // 检查用户名是否存在
// 检查用户名是否存在
userServiceImpl.checkAccount(userVo);
if (!registerUserReqVo.getPassword().equals(registerUserReqVo.getConfirmPassword())){
if (!StringHelper.compare( registerUserReqVo.getPassword(), registerUserReqVo.getConfirmPassword())){
throw new CodeException("确认密码错误");
}
CompanyVo invitationCompany = checkMerchantId(registerUserReqVo.getInvitationCode());
if (null == invitationCompany){
CompanyExtendVo companyExtendVo = checkInvitationCode(registerUserReqVo.getInvitationCode());
if (null == companyExtendVo){
throw new CodeException("注册编码错误");
}
......@@ -78,9 +78,9 @@ public class RegisterServiceImpl implements RegisterService {
userDaoImpl.create(userVo);
CompanyVo companyVo = new CompanyVo();
companyVo.setId(companyId);
companyVo.setInvitationCompanyId(invitationCompany.getId());
companyVo.setInvitationCompanyId(companyExtendVo.getId());
companyVo.setCompanyType(registerUserReqVo.getCompanyType());
companyService.saveCompany(companyVo);
companyDaoImpl.save(companyVo);
return companyVo;
}
......@@ -94,33 +94,20 @@ public class RegisterServiceImpl implements RegisterService {
@Override
@Transactional(rollbackFor = Exception.class)
public void saveIndividual(RegisterIndividualReqVo reqVo) {
CompanyVo companyVo = new CompanyVo();
CompanyBankCardVo companyBankCardVo = new CompanyBankCardVo();
CompanyExtendVo extendVo = new CompanyExtendVo();
this.checkPhone(reqVo.getContactPhone());
companyVo.setId(reqVo.getId());
companyVo.setInvitationCompanyId(reqVo.getMerchantId());
companyVo.setCompanyType(reqVo.getCompanyType());
companyVo.setContactName(reqVo.getContactName());
companyVo.setContactCode(reqVo.getContactCode());
companyVo.setCompanyAttribute(reqVo.getCompanyAttribute());
companyVo.setContactPhone(reqVo.getContactPhone());
companyVo.setCompanyName(reqVo.getExtraChoseOne());
CompanyVo companyVo = new CompanyVo();
ObjectHelper.writeWithFrom(companyVo,reqVo);
companyDaoImpl.update(companyVo);
CompanyExtendVo extendVo = new CompanyExtendVo();
extendVo.setId(reqVo.getId());
companyExtendDaoImpl.create(extendVo);
CompanyBankCardVo companyBankCardVo = new CompanyBankCardVo();
companyBankCardVo.setCompanyId(reqVo.getId());
companyBankCardVo.setId(StringHelper.getNewID());
int vehicle = 5;
if (reqVo.getCompanyAttribute() == vehicle){
companyVo.setBusinessLicenseCode(reqVo.getExtraChoseTwo());
}else {
companyVo.setAddress(reqVo.getExtraChoseTwo());
}
companyService.updateCompany(companyVo);
companyExtendDaoImpl.create(extendVo);
companyBankCardDaoImpl.create(companyBankCardVo);
UserVo userReqVo = new UserVo();
......@@ -128,30 +115,34 @@ public class RegisterServiceImpl implements RegisterService {
UserVo userVo = userDaoImpl.load(userReqVo,UserVo.class);
userVo.setPhone(reqVo.getContactPhone());
userDaoImpl.update(userVo);
// 此处需要保存部分数据到merchant表中
// 此处需要保存数据到merchant表中
MerchantVo merchantVo = new MerchantVo();
merchantVo.setId(StringHelper.getNewID());
merchantVo.setName(reqVo.getCompanyName());
merchantVo.setAddress(reqVo.getAddress());
merchantVo.setType(reqVo.getCompanyAttribute());
merchantVo.setProductCompanyId(reqVo.getId());
merchantVo.setUserId(userVo.getId());
merchantVo.setUserName(userVo.getAccount());
}
@Override
@Transactional(rollbackFor = Exception.class)
public void saveEnterprise(RegisterEnterpriceReqVo reqVo) {
CompanyVo companyVo = new CompanyVo();
CompanyExtendVo extendVo = new CompanyExtendVo();
CompanyBankCardVo companyBankCardVo = new CompanyBankCardVo();
this.checkPhone(reqVo.getContactPhone());
companyVo.setId(reqVo.getId());
companyVo.setInvitationCompanyId(reqVo.getMerchantId());
companyVo.setCompanyType(reqVo.getCompanyType());
companyVo.setCompanyName(reqVo.getCompanyName());
companyVo.setAddress(reqVo.getCompanyAddress());
companyVo.setBusinessLicenseCode(reqVo.getBusinessLicenseCode());
companyVo.setCompanyAttribute(reqVo.getCompanyAttribute());
companyVo.setContactName(reqVo.getContactName());
companyVo.setContactCode(reqVo.getContactCode());
companyVo.setContactPhone(reqVo.getContactPhone());
CompanyVo companyVo = new CompanyVo();
ObjectHelper.writeWithFrom(companyVo,reqVo);
companyDaoImpl.update(companyVo);
CompanyExtendVo extendVo = new CompanyExtendVo();
extendVo.setId(reqVo.getId());
companyExtendDaoImpl.create(extendVo);
CompanyBankCardVo companyBankCardVo = new CompanyBankCardVo();
companyBankCardVo.setId(StringHelper.getNewID());
companyBankCardVo.setCompanyId(reqVo.getId());
companyBankCardVo.setBankName(reqVo.getBankName());
......@@ -159,9 +150,6 @@ public class RegisterServiceImpl implements RegisterService {
companyBankCardVo.setBankAddress(reqVo.getBankAddress());
companyBankCardVo.setBankCode(reqVo.getBankCode());
companyBankCardVo.setReservedPhone(reqVo.getReservedPhone());
companyService.updateCompany(companyVo);
companyExtendDaoImpl.create(extendVo);
companyBankCardDaoImpl.create(companyBankCardVo);
UserVo userReqVo = new UserVo();
......@@ -169,7 +157,16 @@ public class RegisterServiceImpl implements RegisterService {
UserVo userVo = userDaoImpl.load(userReqVo,UserVo.class);
userVo.setPhone(reqVo.getContactPhone());
userDaoImpl.update(userVo);
// 此处需要保存部分数据到merchant表中
// 此处需要保存数据到merchant表中
MerchantVo merchantVo = new MerchantVo();
merchantVo.setId(StringHelper.getNewID());
merchantVo.setName(reqVo.getCompanyName());
merchantVo.setAddress(reqVo.getAddress());
merchantVo.setType(reqVo.getCompanyAttribute());
merchantVo.setProductCompanyId(reqVo.getId());
merchantVo.setUserId(userVo.getId());
merchantVo.setUserName(userVo.getAccount());
}
@Override
......@@ -207,7 +204,7 @@ public class RegisterServiceImpl implements RegisterService {
resVo.setCompanyBankCardVo(companyBankCardVo);
resVo.setCompanyExtendVo(companyExtendVo);
// 此处需要获取对应的merchant表数据
String token = TokenUtil.createToken(reqVo.getAccountOrPhone());
TokenHelper.write(token,resVo);
/*String token = TokenUtil.createToken(reqVo.getAccountOrPhone());
TokenHelper.write(token,resVo);*/
}
}
......@@ -44,7 +44,7 @@ public class RoleServiceImpl implements RoleService {
roleDao.create(roleVo);
List<String> authorityIds = webRoleReqVo.getAuthorityIds();
if (authorityIds != null && authorityIds.size() != 0){
if (authorityIds != null && !authorityIds.isEmpty()){
for (String authorityId : authorityIds) {
RoleAuthorityVo roleAuthorityRelation = new RoleAuthorityVo();
roleAuthorityRelation.setAuthorityId(authorityId);
......@@ -66,13 +66,13 @@ public class RoleServiceImpl implements RoleService {
RoleAuthorityGetReqVo reqVo = new RoleAuthorityGetReqVo();
reqVo.setRoleId(webRoleReqVo.getId());
List<RoleAuthorityVo> roleAuthorityList = roleAuthorityDaoImpl.getRoleAuthorityList(reqVo);
if (roleAuthorityList != null && roleAuthorityList.size() != 0){
if (roleAuthorityList != null && !roleAuthorityList.isEmpty()){
for (RoleAuthorityVo roleAuthorityRelation:roleAuthorityList) {
roleAuthorityDaoImpl.remove(roleAuthorityRelation);
}
}
List<String> authorityIds = webRoleReqVo.getAuthorityIds();
if (authorityIds != null && authorityIds.size() != 0){
if (authorityIds != null && !authorityIds.isEmpty()){
for (String authorityId : authorityIds) {
RoleAuthorityVo roleAuthorityRelation = new RoleAuthorityVo();
roleAuthorityRelation.setAuthorityId(authorityId);
......@@ -112,7 +112,7 @@ public class RoleServiceImpl implements RoleService {
public PageSizeData<RoleVo> getRoleVoList(ListRoleReqVo req) {
PageSizeData<RoleVo> roleVoPageSizeData = roleDao.getRoleVoList(req);
if (roleVoPageSizeData.getList() == null || roleVoPageSizeData.getList().size() == 0){
if (roleVoPageSizeData.getList() == null || roleVoPageSizeData.getList().isEmpty()){
throw new CodeException("没有更多权限");
}
return roleVoPageSizeData;
......@@ -149,7 +149,7 @@ public class RoleServiceImpl implements RoleService {
RoleAuthorityGetReqVo reqVo = new RoleAuthorityGetReqVo();
reqVo.setRoleId(roleId);
List<RoleAuthorityVo> roleAuthorityRelationList = roleAuthorityDaoImpl.getRoleAuthorityList(reqVo);
if (roleAuthorityRelationList != null && roleAuthorityRelationList.size() != 0){
if (roleAuthorityRelationList != null && !roleAuthorityRelationList.isEmpty()){
List<AuthorityVo> authorityList = new ArrayList(roleAuthorityRelationList.size());
for (RoleAuthorityVo roleAuthorityRelation:roleAuthorityRelationList) {
AuthorityGetReqVo authorityGetReqVo = new AuthorityGetReqVo();
......@@ -190,7 +190,7 @@ public class RoleServiceImpl implements RoleService {
UserRoleGetReqVo userRoleGetReqVo = new UserRoleGetReqVo();
userRoleGetReqVo.setRoleId(roleVo.getId());
List<UserRoleVo> userRoleList = userRoleDaoImpl.getUserRoleList(userRoleGetReqVo);
if (userRoleList != null && userRoleList.size() != 0){
if (userRoleList != null && !userRoleList.isEmpty()){
for (UserRoleVo userRoleRelation:userRoleList) {
userRoleDaoImpl.remove(userRoleRelation);
}
......@@ -199,7 +199,7 @@ public class RoleServiceImpl implements RoleService {
RoleAuthorityGetReqVo reqVo = new RoleAuthorityGetReqVo();
reqVo.setRoleId(roleVo.getId());
List<RoleAuthorityVo> roleAuthorityList = roleAuthorityDaoImpl.getRoleAuthorityList(reqVo);
if (roleAuthorityList != null && roleAuthorityList.size() != 0){
if (roleAuthorityList != null && !roleAuthorityList.isEmpty()){
for (RoleAuthorityVo roleAuthority:roleAuthorityList) {
roleAuthorityDaoImpl.remove(roleAuthority);
}
......@@ -214,6 +214,7 @@ public class RoleServiceImpl implements RoleService {
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(WebRoleReqVo webRoleReqVo) {
RoleVo roleVo = this.getRoleById(webRoleReqVo);
this.deleteRole(roleVo);
......
......@@ -44,7 +44,7 @@ public class UserServiceImpl implements UserService {
UserVo userVo = webUserReqVo;
userDao.create(userVo);
if (webUserReqVo.getRoleIds()!=null && webUserReqVo.getRoleIds().size()!=0){
if (webUserReqVo.getRoleIds()!=null && !webUserReqVo.getRoleIds().isEmpty()){
List<String> roleIds = webUserReqVo.getRoleIds();
for (String roleId : roleIds) {
UserRoleVo userRoleRelation = new UserRoleVo();
......@@ -70,12 +70,12 @@ public class UserServiceImpl implements UserService {
UserRoleGetReqVo reqVo = new UserRoleGetReqVo();
reqVo.setUserId(webUserReqVo.getId());
List<UserRoleVo> userRoleList = userRoleDao.getUserRoleList(reqVo);
if(userRoleList != null && userRoleList.size() != 0){
if(userRoleList != null && !userRoleList.isEmpty()){
List<String> userRoleIdList = new ArrayList(userRoleList.size());
for (UserRoleVo userRole:userRoleList) {
userRoleIdList.add(userRole.getId());
}
if (userRoleIdList != null && userRoleIdList.size() != 0){
if (userRoleIdList != null && !userRoleIdList.isEmpty()){
for (String userRoleId:userRoleIdList){
UserRoleRemoveReqVo userRole = new UserRoleRemoveReqVo();
userRole.setId(userRoleId);
......@@ -83,7 +83,7 @@ public class UserServiceImpl implements UserService {
}
}
}
if (webUserReqVo.getRoleIds()!=null && webUserReqVo.getRoleIds().size()!=0){
if (webUserReqVo.getRoleIds()!=null && webUserReqVo.getRoleIds().isEmpty()){
List<String> roleIds = webUserReqVo.getRoleIds();
for (String roleId : roleIds) {
UserRoleVo userRoleRelation = new UserRoleVo();
......@@ -125,7 +125,7 @@ public class UserServiceImpl implements UserService {
UserRoleGetReqVo reqVo = new UserRoleGetReqVo();
reqVo.setUserId(userVo.getId());
List<UserRoleVo> userRoleVoList = this.listUserRoleListByUserId(reqVo);
if (userRoleVoList != null && userRoleVoList.size() != 0){
if (userRoleVoList != null && !userRoleVoList.isEmpty()){
List<RoleVo> roleList = new ArrayList(userRoleVoList.size());
for (UserRoleVo userRoleRelation:userRoleVoList) {
String roleId = userRoleRelation.getRoleId();
......@@ -198,7 +198,7 @@ public class UserServiceImpl implements UserService {
@Override
public PageSizeData<UserVo> getUserVoList(ListUserReqVo reqVo) {
PageSizeData<UserVo> userVoPageSizeData = userDao.getUserVoList(reqVo);
if (userVoPageSizeData.getList() == null || userVoPageSizeData.getList().size() == 0){
if (userVoPageSizeData.getList() == null || userVoPageSizeData.getList().isEmpty()){
throw new CodeException("没有更多用户");
}
return userVoPageSizeData;
......@@ -238,7 +238,7 @@ public class UserServiceImpl implements UserService {
UserRoleGetReqVo reqVo = new UserRoleGetReqVo();
reqVo.setUserId(userId);
List<UserRoleVo> userRoleVoList = userRoleDao.getUserRoleList(reqVo);
if (userRoleVoList != null && userRoleVoList.size() != 0){
if (userRoleVoList != null && !userRoleVoList.isEmpty()){
List<RoleVo> roleVoList = new ArrayList(userRoleVoList.size());
for (UserRoleVo userRoleVo:userRoleVoList) {
RoleGetReqVo roleGetReqVo = new RoleGetReqVo();
......
......@@ -16,37 +16,44 @@ public class CompanyExtendVo implements Serializable {
private String qrCode;
@TableAnnotation("QR_code_type")
private String qrCodeType;
private int qrCodeType;
@TableAnnotation("QR_code_url")
private String qrCodeUrl;
private String money;
@TableAnnotation("is_sub_account")
private String isSubAccount;
private int isSubAccount;
@TableAnnotation("sub_account_rule")
private String subAccountRule;
@TableAnnotation("is_sub_profit")
private String isSubProfit;
private int isSubProfit;
@TableAnnotation("sub_profit_rule")
private String subProfitRule;
@TableAnnotation("is_withdraw")
private String isWithdraw;
private int isWithdraw;
@TableAnnotation("withdraw_rule")
private String withdrawRule;
@TableAnnotation("is_scan_code_pay")
private String isScanCodePay;
private int isScanCodePay;
@TableAnnotation("pay_rule")
private String payRule;
@TableAnnotation("is_invitate")
private int isInvitate;
@TableAnnotation("invitate_rule")
private String invitateRule;
@TableAnnotation("invitation_code")
private String invitationCode;
public String getId() {
return id;
}
......@@ -63,11 +70,11 @@ public class CompanyExtendVo implements Serializable {
this.qrCode = qrCode;
}
public String getQrCodeType() {
public int getQrCodeType() {
return qrCodeType;
}
public void setQrCodeType(String qrCodeType) {
public void setQrCodeType(int qrCodeType) {
this.qrCodeType = qrCodeType;
}
......@@ -79,19 +86,11 @@ public class CompanyExtendVo implements Serializable {
this.qrCodeUrl = qrCodeUrl;
}
public String getMoney() {
return money;
}
public void setMoney(String money) {
this.money = money;
}
public String getIsSubAccount() {
public int getIsSubAccount() {
return isSubAccount;
}
public void setIsSubAccount(String isSubAccount) {
public void setIsSubAccount(int isSubAccount) {
this.isSubAccount = isSubAccount;
}
......@@ -103,11 +102,11 @@ public class CompanyExtendVo implements Serializable {
this.subAccountRule = subAccountRule;
}
public String getIsSubProfit() {
public int getIsSubProfit() {
return isSubProfit;
}
public void setIsSubProfit(String isSubProfit) {
public void setIsSubProfit(int isSubProfit) {
this.isSubProfit = isSubProfit;
}
......@@ -119,11 +118,11 @@ public class CompanyExtendVo implements Serializable {
this.subProfitRule = subProfitRule;
}
public String getIsWithdraw() {
public int getIsWithdraw() {
return isWithdraw;
}
public void setIsWithdraw(String isWithdraw) {
public void setIsWithdraw(int isWithdraw) {
this.isWithdraw = isWithdraw;
}
......@@ -135,11 +134,11 @@ public class CompanyExtendVo implements Serializable {
this.withdrawRule = withdrawRule;
}
public String getIsScanCodePay() {
public int getIsScanCodePay() {
return isScanCodePay;
}
public void setIsScanCodePay(String isScanCodePay) {
public void setIsScanCodePay(int isScanCodePay) {
this.isScanCodePay = isScanCodePay;
}
......@@ -150,4 +149,28 @@ public class CompanyExtendVo implements Serializable {
public void setPayRule(String payRule) {
this.payRule = payRule;
}
public int getIsInvitate() {
return isInvitate;
}
public void setIsInvitate(int isInvitate) {
this.isInvitate = isInvitate;
}
public String getInvitateRule() {
return invitateRule;
}
public void setInvitateRule(String invitateRule) {
this.invitateRule = invitateRule;
}
public String getInvitationCode() {
return invitationCode;
}
public void setInvitationCode(String invitationCode) {
this.invitationCode = invitationCode;
}
}
......@@ -45,8 +45,8 @@ public class CompanyVo implements Serializable, InitDao {
@TableAnnotation("contact_code")
private String contactCode;
@TableAnnotation("electronic_agreement_code")
private String electronicAgreementCode;
@TableAnnotation("electromic_agreement_code")
private String electromicAgreementCode;
@TableAnnotation("signing_status")
private String signingStatus;
......@@ -149,12 +149,12 @@ public class CompanyVo implements Serializable, InitDao {
this.contactCode = contactCode;
}
public String getElectronicAgreementCode() {
return electronicAgreementCode;
public String getElectromicAgreementCode() {
return electromicAgreementCode;
}
public void setElectronicAgreementCode(String electronicAgreementCode) {
this.electronicAgreementCode = electronicAgreementCode;
public void setElectromicAgreementCode(String electromicAgreementCode) {
this.electromicAgreementCode = electromicAgreementCode;
}
public String getSigningStatus() {
......
package com.pangding.web.authority.vo;
import com.yanzuoguang.dao.TableAnnotation;
import com.yanzuoguang.util.helper.DateHelper;
import com.yanzuoguang.util.helper.StringHelper;
import com.yanzuoguang.util.vo.InitDao;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Author zhangjinyao
* @create 2019/5/21 11:31
*/
@TableAnnotation("pd_merchant")
public class MerchantVo implements Serializable, InitDao {
private String id;
private String code;
private String name;
private BigDecimal longitude;
private BigDecimal latitude;
private BigDecimal score;
@TableAnnotation("area_code")
private String areaCode;
@TableAnnotation("area_name")
private String areaName;
private String address;
private int type;
private String tag;
private String level;
private int status;
@TableAnnotation("time_spent")
private String timeSpent;
private String phone;
@TableAnnotation("product_company_id")
private String productCompanyId;
@TableAnnotation("interface_company_id")
private String interfaceCompanyId;
@TableAnnotation("business_start")
private String businessStart;
@TableAnnotation("business_end")
private String businessEnd;
@TableAnnotation("create_time")
private String createTime;
@TableAnnotation("user_id")
private String userId;
private String userName;
private String source;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public BigDecimal getLongitude() {
return longitude;
}
public void setLongitude(BigDecimal longitude) {
this.longitude = longitude;
}
public BigDecimal getLatitude() {
return latitude;
}
public void setLatitude(BigDecimal latitude) {
this.latitude = latitude;
}
public BigDecimal getScore() {
return score;
}
public void setScore(BigDecimal score) {
this.score = score;
}
public String getAreaCode() {
return areaCode;
}
public void setAreaCode(String areaCode) {
this.areaCode = areaCode;
}
public String getAreaName() {
return areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getTag() {
return tag;
}
public void setTag(String tag) {
this.tag = tag;
}
public String getLevel() {
return level;
}
public void setLevel(String level) {
this.level = level;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public String getTimeSpent() {
return timeSpent;
}
public void setTimeSpent(String timeSpent) {
this.timeSpent = timeSpent;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getProductCompanyId() {
return productCompanyId;
}
public void setProductCompanyId(String productCompanyId) {
this.productCompanyId = productCompanyId;
}
public String getInterfaceCompanyId() {
return interfaceCompanyId;
}
public void setInterfaceCompanyId(String interfaceCompanyId) {
this.interfaceCompanyId = interfaceCompanyId;
}
public String getBusinessStart() {
return businessStart;
}
public void setBusinessStart(String businessStart) {
this.businessStart = businessStart;
}
public String getBusinessEnd() {
return businessEnd;
}
public void setBusinessEnd(String businessEnd) {
this.businessEnd = businessEnd;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
@Override
public void init() {
this.createTime = StringHelper.getFirst(this.createTime, DateHelper.getNow());
}
}
package com.pangding.web.authority.vo.reqvo;
/**
* @Author zhangjinyao
* @create 2019/5/21 10:55
*/
public class CompanyExtendGetReqVo {
private String invitationCode;
public String getInvitationCode() {
return invitationCode;
}
public void setInvitationCode(String invitationCode) {
this.invitationCode = invitationCode;
}
}
......@@ -7,13 +7,13 @@ package com.pangding.web.authority.vo.reqvo;
public class RegisterEnterpriceReqVo {
private String id;
private String merchantId;
private String invitationCompanyId;
private int companyType;
private String companyName;
private String companyAddress;
private String address;
private String businessLicenseCode;
......@@ -45,12 +45,12 @@ public class RegisterEnterpriceReqVo {
this.id = id;
}
public String getMerchantId() {
return merchantId;
public String getInvitationCompanyId() {
return invitationCompanyId;
}
public void setMerchantId(String merchantId) {
this.merchantId = merchantId;
public void setInvitationCompanyId(String invitationCompanyId) {
this.invitationCompanyId = invitationCompanyId;
}
public int getCompanyType() {
......@@ -69,12 +69,12 @@ public class RegisterEnterpriceReqVo {
this.companyName = companyName;
}
public String getCompanyAddress() {
return companyAddress;
public String getAddress() {
return address;
}
public void setCompanyAddress(String companyAddress) {
this.companyAddress = companyAddress;
public void setAddress(String address) {
this.address = address;
}
public String getBusinessLicenseCode() {
......
......@@ -8,21 +8,23 @@ public class RegisterIndividualReqVo {
private String id;
private String merchantId;
private String invitationCompanyId;
private int companyType;
private String contactName;
private String companyName;
private String contactCode;
private String address;
private int companyAttribute;
private String contactPhone;
private String businessLicenseCode;
private String extraChoseOne;
private String contactName;
private String extraChoseTwo;
private String contactCode;
private String contactPhone;
public String getId() {
return id;
......@@ -32,12 +34,12 @@ public class RegisterIndividualReqVo {
this.id = id;
}
public String getMerchantId() {
return merchantId;
public String getInvitationCompanyId() {
return invitationCompanyId;
}
public void setMerchantId(String merchantId) {
this.merchantId = merchantId;
public void setInvitationCompanyId(String invitationCompanyId) {
this.invitationCompanyId = invitationCompanyId;
}
public int getCompanyType() {
......@@ -48,20 +50,36 @@ public class RegisterIndividualReqVo {
this.companyType = companyType;
}
public String getExtraChoseOne() {
return extraChoseOne;
public String getCompanyName() {
return companyName;
}
public void setExtraChoseOne(String extraChoseOne) {
this.extraChoseOne = extraChoseOne;
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getExtraChoseTwo() {
return extraChoseTwo;
public String getAddress() {
return address;
}
public void setExtraChoseTwo(String extraChoseTwo) {
this.extraChoseTwo = extraChoseTwo;
public void setAddress(String address) {
this.address = address;
}
public int getCompanyAttribute() {
return companyAttribute;
}
public void setCompanyAttribute(int companyAttribute) {
this.companyAttribute = companyAttribute;
}
public String getBusinessLicenseCode() {
return businessLicenseCode;
}
public void setBusinessLicenseCode(String businessLicenseCode) {
this.businessLicenseCode = businessLicenseCode;
}
public String getContactName() {
......@@ -80,14 +98,6 @@ public class RegisterIndividualReqVo {
this.contactCode = contactCode;
}
public int getCompanyAttribute() {
return companyAttribute;
}
public void setCompanyAttribute(int companyAttribute) {
this.companyAttribute = companyAttribute;
}
public String getContactPhone() {
return contactPhone;
}
......
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