Commit d671885e authored by zjy's avatar zjy

user/role/tright 5.21

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