Commit 2a32cba1 authored by zjy's avatar zjy

user/role/tright 5.16

个体用户还需要增加Token
代码写完
准备测试
parent 65d90702
package com.pangding.web.authority.cloudvo;
/**
* @Author zhangjinyao
* @create 2019/5/13 16:15
*/
public class MobileRegisterUserReturnVo {
private String companyId;
private String merchantId;
private int companyType;
public int getCompanyType() {
return companyType;
}
public void setCompanyType(int companyType) {
this.companyType = companyType;
}
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public String getMerchantId() {
return merchantId;
}
public void setMerchantId(String merchantId) {
this.merchantId = merchantId;
}
}
package com.pangding.web.authority.controller; package com.pangding.web.authority.controller;
import com.pangding.web.authority.currency.Result;
import com.pangding.web.authority.service.AuthorityService; import com.pangding.web.authority.service.AuthorityService;
import com.pangding.web.authority.vo.AuthorityVo; import com.pangding.web.authority.vo.AuthorityVo;
import com.pangding.web.authority.vo.reqvo.ListAuthorityReqVo; import com.pangding.web.authority.vo.reqvo.ListAuthorityReqVo;
import com.pangding.web.authority.vo.reqvo.WebAuthorityReqVo; import com.pangding.web.authority.vo.reqvo.WebAuthorityReqVo;
import com.pangding.web.authority.vo.reqvo.WebAuthorityResVo; import com.pangding.web.authority.vo.reqvo.WebAuthorityResVo;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.vo.PageSizeData; import com.yanzuoguang.util.vo.PageSizeData;
import com.yanzuoguang.util.vo.ResponseResult; import com.yanzuoguang.util.vo.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List;
/** /**
* @author zhangjinyao * @author zhangjinyao
...@@ -32,6 +31,12 @@ public class AuthorityController { ...@@ -32,6 +31,12 @@ 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()
.notBlankCheck("authority",authorityVo)
.checkException()
.notBlankCheck("authorityName",authorityVo.getName())
.notBlankCheck("authorityUrl",authorityVo.getUrl())
.checkException();
authorityServiceImpl.save(authorityVo); authorityServiceImpl.save(authorityVo);
return new ResponseResult(); return new ResponseResult();
} }
...@@ -43,6 +48,12 @@ public class AuthorityController { ...@@ -43,6 +48,12 @@ 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()
.notBlankCheck("authority",authorityVo)
.checkException()
.notBlankCheck("authorityName",authorityVo.getName())
.notBlankCheck("authorityUrl",authorityVo.getUrl())
.checkException();
authorityServiceImpl.update(authorityVo); authorityServiceImpl.update(authorityVo);
return new ResponseResult(); return new ResponseResult();
} }
...@@ -72,6 +83,11 @@ public class AuthorityController { ...@@ -72,6 +83,11 @@ public class AuthorityController {
*/ */
@RequestMapping(value = "/role", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "/role", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseResult<AuthorityVo> authority(@RequestBody WebAuthorityReqVo reqVo){ public ResponseResult<AuthorityVo> authority(@RequestBody WebAuthorityReqVo reqVo){
CheckerHelper.newInstance()
.notBlankCheck("reqVo",reqVo)
.checkException()
.notBlankCheck("anthorityId",reqVo.getId())
.checkException();
return ResponseResult.result(authorityServiceImpl.getAuthorityById(reqVo)); return ResponseResult.result(authorityServiceImpl.getAuthorityById(reqVo));
} }
...@@ -82,6 +98,11 @@ public class AuthorityController { ...@@ -82,6 +98,11 @@ 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()
.notBlankCheck("reqVo",reqVo)
.checkException()
.notBlankCheck("anthorityId",reqVo.getId())
.checkException();
authorityServiceImpl.deleteAuthorityById(reqVo); authorityServiceImpl.deleteAuthorityById(reqVo);
return new ResponseResult(); return new ResponseResult();
......
package com.pangding.web.authority.controller; package com.pangding.web.authority.controller;
import com.pangding.web.authority.currency.Result; import com.pangding.web.authority.vo.reqvo.RegisterIndividualReqVo;
import com.pangding.web.authority.dto.RegisterIndividualDto; import com.pangding.web.authority.vo.reqvo.RegisterUserReqVo;
import com.pangding.web.authority.dto.RegisterUserDto; import com.pangding.web.authority.service.RegisterService;
import com.pangding.web.authority.cloudvo.MobileRegisterUserReturnVo;
import com.pangding.web.authority.service.MobileRegisterService;
import com.pangding.web.authority.service.UserService;
import com.pangding.web.authority.vo.CompanyVo; import com.pangding.web.authority.vo.CompanyVo;
import com.pangding.web.authority.vo.MobileLoginInfo; import com.pangding.web.authority.vo.reqvo.LoginReqVo;
import com.pangding.web.authority.vo.UserVo; import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.token.TokenHelper; import com.yanzuoguang.util.vo.ResponseResult;
import com.yanzuoguang.util.helper.StringHelper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -27,114 +23,64 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -27,114 +23,64 @@ import org.springframework.web.bind.annotation.RestController;
public class MobileRegisterController { public class MobileRegisterController {
@Autowired @Autowired
MobileRegisterService mobileRegisterServiceImpl; RegisterService registerServiceImpl;
@Autowired
UserService userServiceImpl;
/** /**
* 验证注册第一页数据的合法性并保存 * 验证注册第一页数据的合法性并保存
* *
* @param registerUserDto * @param registerUserReqVo
* @return * @return
*/ */
@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 Object saveUser(@RequestBody RegisterUserDto registerUserDto){ public ResponseResult<CompanyVo> saveUser(@RequestBody RegisterUserReqVo registerUserReqVo){
CheckerHelper.newInstance()
if (registerUserDto.getCompanyType() != 0){ .notBlankCheck("reqVo",registerUserReqVo)
return new Result(4001,"目前仅支持个体用户",registerUserDto); .checkException()
} .notBlankCheck("account",registerUserReqVo.getAccount())
.notBlankCheck("password",registerUserReqVo.getPassword())
if (!userServiceImpl.isValid(registerUserDto.getAccount())){ .notBlankCheck("confirmPassword",registerUserReqVo.getConfirmPassword())
return new Result(4001,"用户名由字母与数字组成,且不能为纯数字",registerUserDto); .notBlankCheck("companyType",registerUserReqVo.getCompanyType())
} .notBlankCheck("merchantId",registerUserReqVo.getMerchantId())
.checkException();
UserVo userVo = new UserVo(); return ResponseResult.result(registerServiceImpl.saveUser(registerUserReqVo));
userVo.setAccount(registerUserDto.getAccount());
userServiceImpl.checkAccount(userVo);
String merchantId = registerUserDto.getMerchantId();
if (!mobileRegisterServiceImpl.checkMerchantId(merchantId)){
return new Result(4001,"注册编码错误",registerUserDto);
}
String companyId = StringHelper.getNewID();
userVo.setPassword(Md5AndSalt.generate(registerUserDto.getPassword()));
userVo.setId(StringHelper.getNewID());
userVo.setRemark(registerUserDto.getPassword());
userVo.setCompanyId(companyId);
mobileRegisterServiceImpl.saveUser(userVo);
MobileRegisterUserReturnVo returnVo = new MobileRegisterUserReturnVo();
returnVo.setCompanyId(companyId);
returnVo.setMerchantId(merchantId);
returnVo.setCompanyType(registerUserDto.getCompanyType());
/*token内容暂时不能用,以后要改动,需要存入用户及企业信息*/
String token = StringHelper.getNewID();
TokenHelper.write(token,returnVo);
return new Result(0,"SUCCESS",null);
} }
/** /**
* 验证注册第二页数据的合法性并保存 * 验证注册第二页数据的合法性并保存
* *
* @param individualDto * @param reqVo
* @return * @return
*/ */
@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 Object saveIndividual(@RequestBody RegisterIndividualDto individualDto){ public ResponseResult saveIndividual(@RequestBody RegisterIndividualReqVo reqVo){
CheckerHelper.newInstance()
mobileRegisterServiceImpl.checkPhone(individualDto); .notBlankCheck("reqVo",reqVo)
.checkException()
CompanyVo companyVo = new CompanyVo(); .notBlankCheck("contactName",reqVo.getContactName())
.notBlankCheck("contactCode",reqVo.getContactCode())
/*token内容暂时不能用,以后要改动*/ .checkIdCard("contactCode",reqVo.getContactCode())
MobileRegisterUserReturnVo returnVo = TokenHelper.get(MobileRegisterUserReturnVo.class); .notBlankCheck("companyAttribute",reqVo.getCompanyAttribute())
.notBlankCheck("extraChoseOne",reqVo.getExtraChoseOne())
companyVo.setId(returnVo.getCompanyId()); .notBlankCheck("extraChosetwo",reqVo.getExtraChoseTwo())
companyVo.setCompanyType(returnVo.getCompanyType()); .notBlankCheck("contactPhone",reqVo.getContactPhone())
companyVo.setMerchantId(returnVo.getMerchantId()); .checkPhoneNo("contactPhone",reqVo.getContactPhone())
companyVo.setContactName(individualDto.getContactName()); .checkException();
companyVo.setContactCode(individualDto.getContactCode()); registerServiceImpl.saveIndividual(reqVo);
companyVo.setCompanyAttribute(individualDto.getCompanyAttribute()); return new ResponseResult();
companyVo.setContactPhone(individualDto.getContactPhone());
if (individualDto.getCompanyAttribute().equals("5")){
companyVo.setCompanyName(individualDto.getExtraChoseOne());
companyVo.setBusinessLicenseCode(individualDto.getExtraChoseTwo());
}else{
companyVo.setCompanyName(individualDto.getExtraChoseOne());
companyVo.setAddress(individualDto.getExtraChoseTwo());
}
mobileRegisterServiceImpl.saveCompany(companyVo);
return new Result(0,"SUCCESS",null);
} }
@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 Object login(@RequestBody MobileLoginInfo info){ public ResponseResult login(@RequestBody LoginReqVo reqVo){
CheckerHelper.newInstance()
String accountOrPhone = info.getAccountOrPhone(); .notBlankCheck("reqVo",reqVo)
UserVo userVo; .checkException()
if (userServiceImpl.isNumeric(accountOrPhone)){ .notBlankCheck("account or phone",reqVo.getAccountOrPhone())
userVo = userServiceImpl.getUserByPhone(accountOrPhone); .notBlankCheck("pass",reqVo.getPassword())
}else { .checkException();
userVo = userServiceImpl.getUserByAccount(accountOrPhone); registerServiceImpl.login(reqVo);
} return new ResponseResult();
if (userVo == null){
return new Result(4001,"没有此用户",info);
}
if (!Md5AndSalt.verify(info.getPassword(),userVo.getPassword())){
return new Result(4001,"用户名或密码错误",info);
}
/*token内容暂时不能用,以后要改动*/
String token = StringHelper.getNewID();
TokenHelper.write(token,userVo);
return new Result(0,"SUCCESS",null);
} }
} }
...@@ -5,6 +5,7 @@ import com.pangding.web.authority.vo.reqvo.ListRoleReqVo; ...@@ -5,6 +5,7 @@ import com.pangding.web.authority.vo.reqvo.ListRoleReqVo;
import com.pangding.web.authority.vo.reqvo.WebRoleReqVo; import com.pangding.web.authority.vo.reqvo.WebRoleReqVo;
import com.pangding.web.authority.service.RoleService; import com.pangding.web.authority.service.RoleService;
import com.pangding.web.authority.vo.reqvo.WebRoleResVo; import com.pangding.web.authority.vo.reqvo.WebRoleResVo;
import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.vo.PageSizeData; import com.yanzuoguang.util.vo.PageSizeData;
import com.yanzuoguang.util.vo.ResponseResult; import com.yanzuoguang.util.vo.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -29,6 +30,11 @@ public class RoleController { ...@@ -29,6 +30,11 @@ 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()
.notBlankCheck("reqVo",webRoleReqVo)
.checkException()
.notBlankCheck("roleName",webRoleReqVo.getName())
.checkException();
roleServiceImpl.saveRole(webRoleReqVo); roleServiceImpl.saveRole(webRoleReqVo);
return new ResponseResult(); return new ResponseResult();
} }
...@@ -40,6 +46,11 @@ public class RoleController { ...@@ -40,6 +46,11 @@ 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()
.notBlankCheck("reqVo",webRoleReqVo)
.checkException()
.notBlankCheck("roleName",webRoleReqVo.getName())
.checkException();
roleServiceImpl.updateRole(webRoleReqVo); roleServiceImpl.updateRole(webRoleReqVo);
return new ResponseResult(); return new ResponseResult();
} }
...@@ -60,6 +71,11 @@ public class RoleController { ...@@ -60,6 +71,11 @@ 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()
.notBlankCheck("reqVo",webRoleReqVo)
.checkException()
.notBlankCheck("roleId",webRoleReqVo.getId())
.checkException();
return ResponseResult.result(roleServiceImpl.getRoleById(webRoleReqVo)); return ResponseResult.result(roleServiceImpl.getRoleById(webRoleReqVo));
} }
...@@ -70,6 +86,11 @@ public class RoleController { ...@@ -70,6 +86,11 @@ 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()
.notBlankCheck("reqVo",webRoleReqVo)
.checkException()
.notBlankCheck("roleId",webRoleReqVo.getId())
.checkException();
roleServiceImpl.delete(webRoleReqVo); roleServiceImpl.delete(webRoleReqVo);
return new ResponseResult(); return new ResponseResult();
} }
......
package com.pangding.web.authority.controller; package com.pangding.web.authority.controller;
import com.pangding.web.authority.currency.Result;
import com.pangding.web.authority.vo.reqvo.*; import com.pangding.web.authority.vo.reqvo.*;
import com.pangding.web.authority.service.UserService; import com.pangding.web.authority.service.UserService;
import com.pangding.web.authority.vo.*; import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.helper.StringHelper;
import com.yanzuoguang.util.vo.PageSizeData; import com.yanzuoguang.util.vo.PageSizeData;
import com.yanzuoguang.util.vo.ResponseResult; import com.yanzuoguang.util.vo.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
/** /**
* @author zhangjinyao * @author zhangjinyao
...@@ -32,6 +28,14 @@ public class UserController { ...@@ -32,6 +28,14 @@ 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()
.notBlankCheck("reqVo",webUserReqVo)
.checkException()
.notBlankCheck("account",webUserReqVo.getAccount())
.notBlankCheck("password",webUserReqVo.getPassword())
.checkPhoneNo("phone",webUserReqVo.getPhone())
.notBlankCheck("companyId",webUserReqVo.getCompanyId())
.checkException();
userServiceImpl.saveUser(webUserReqVo); userServiceImpl.saveUser(webUserReqVo);
return new ResponseResult(); return new ResponseResult();
} }
...@@ -43,8 +47,14 @@ public class UserController { ...@@ -43,8 +47,14 @@ 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()
.notBlankCheck("reqVo",webUserReqVo)
.checkException()
.notBlankCheck("account",webUserReqVo.getAccount())
.notBlankCheck("password",webUserReqVo.getPassword())
.checkPhoneNo("phone",webUserReqVo.getPhone())
.notBlankCheck("companyId",webUserReqVo.getCompanyId())
.checkException();
userServiceImpl.updateUser(webUserReqVo); userServiceImpl.updateUser(webUserReqVo);
return new ResponseResult(); return new ResponseResult();
} }
...@@ -65,6 +75,11 @@ public class UserController { ...@@ -65,6 +75,11 @@ 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()
.notBlankCheck("req",webUserReqVo)
.checkException()
.notBlankCheck("userId",webUserReqVo.getId())
.checkException();
return ResponseResult.result(userServiceImpl.getUserById(webUserReqVo.getId())); return ResponseResult.result(userServiceImpl.getUserById(webUserReqVo.getId()));
} }
......
package com.pangding.web.authority.dao; package com.pangding.web.authority.dao;
import com.pangding.web.authority.vo.reqvo.AuthorityGetReqVo; import com.pangding.web.authority.vo.reqvo.AuthorityGetReqVo;
import com.pangding.web.authority.reqvo.ListLevel1ReqVo;
import com.pangding.web.authority.vo.AuthorityVo; import com.pangding.web.authority.vo.AuthorityVo;
import com.pangding.web.authority.vo.reqvo.ListAuthorityReqVo; import com.pangding.web.authority.vo.reqvo.ListAuthorityReqVo;
import com.yanzuoguang.dao.BaseDao; import com.yanzuoguang.dao.BaseDao;
...@@ -32,19 +31,5 @@ public interface AuthorityDao extends BaseDao { ...@@ -32,19 +31,5 @@ public interface AuthorityDao extends BaseDao {
PageSizeData<AuthorityVo> getAuthorityList(ListAuthorityReqVo reqVo); PageSizeData<AuthorityVo> getAuthorityList(ListAuthorityReqVo reqVo);
List<AuthorityVo> getAuthoritys(AuthorityGetReqVo reqVo); List<AuthorityVo> getAuthoritys(AuthorityGetReqVo reqVo);
/**
* 获取authorityVo对象列表
*
* @return authorityVo对象列表
*/
List<AuthorityVo> listAll();
/**
* 获取一级权限对象列表
*
* @param listLevel1ReqVo ListLevel1ReqVo对象,仅用于拼接sql语句查询条件,无实际意义
* @return 权限对象列表
*/
List<AuthorityVo> listLevel1(ListLevel1ReqVo listLevel1ReqVo);
} }
...@@ -4,7 +4,7 @@ import com.yanzuoguang.dao.BaseDao; ...@@ -4,7 +4,7 @@ import com.yanzuoguang.dao.BaseDao;
/** /**
* @Author zhangjinyao * @Author zhangjinyao
* @create 2019/5/14 16:32 * @create 2019/5/16 19:17
*/ */
public interface ComputerRegisterDao extends BaseDao { public interface CompanyBankCardDao extends BaseDao {
} }
...@@ -7,7 +7,7 @@ import com.yanzuoguang.dao.BaseDao; ...@@ -7,7 +7,7 @@ import com.yanzuoguang.dao.BaseDao;
* @Author zhangjinyao * @Author zhangjinyao
* @create 2019/5/13 14:24 * @create 2019/5/13 14:24
*/ */
public interface MobileRegisterDao extends BaseDao { public interface CompanyDao extends BaseDao {
/** /**
* 检查电话号码是否已存在 * 检查电话号码是否已存在
* *
......
package com.pangding.web.authority.dao;
import com.yanzuoguang.dao.BaseDao;
/**
* @Author zhangjinyao
* @create 2019/5/16 17:20
*/
public interface CompanyExtendDao extends BaseDao {
}
package com.pangding.web.authority.dao;
import com.yanzuoguang.dao.BaseDao;
/**
* @Author zhangjinyao
* @create 2019/5/16 17:17
*/
public interface MerchantDao extends BaseDao {
}
...@@ -2,7 +2,6 @@ package com.pangding.web.authority.dao.impl; ...@@ -2,7 +2,6 @@ package com.pangding.web.authority.dao.impl;
import com.pangding.web.authority.dao.AuthorityDao; import com.pangding.web.authority.dao.AuthorityDao;
import com.pangding.web.authority.vo.reqvo.AuthorityGetReqVo; import com.pangding.web.authority.vo.reqvo.AuthorityGetReqVo;
import com.pangding.web.authority.reqvo.ListLevel1ReqVo;
import com.pangding.web.authority.vo.AuthorityVo; import com.pangding.web.authority.vo.AuthorityVo;
import com.pangding.web.authority.vo.reqvo.ListAuthorityReqVo; import com.pangding.web.authority.vo.reqvo.ListAuthorityReqVo;
import com.yanzuoguang.dao.impl.BaseDaoImpl; import com.yanzuoguang.dao.impl.BaseDaoImpl;
...@@ -52,15 +51,4 @@ public class AuthorityDaoImpl extends BaseDaoImpl implements AuthorityDao { ...@@ -52,15 +51,4 @@ public class AuthorityDaoImpl extends BaseDaoImpl implements AuthorityDao {
return this.query(AuthorityVo.class,SELECT,reqVo); return this.query(AuthorityVo.class,SELECT,reqVo);
} }
@Override
public List<AuthorityVo> listAll() {
return this.query(AuthorityVo.class,SELECT,null);
}
@Override
public List<AuthorityVo> listLevel1(ListLevel1ReqVo listLevel1ReqVo) {
return this.query(AuthorityVo.class,SELECT,listLevel1ReqVo);
}
} }
package com.pangding.web.authority.dao.impl;
import com.pangding.web.authority.dao.CompanyBankCardDao;
import com.pangding.web.authority.vo.CompanyBankCardVo;
import com.yanzuoguang.dao.impl.BaseDaoImpl;
import org.springframework.stereotype.Component;
/**
* @Author zhangjinyao
* @create 2019/5/16 19:17
*/
@Component
public class CompanyBankCardDaoImpl extends BaseDaoImpl implements CompanyBankCardDao {
@Override
protected void init() {
register(CompanyBankCardVo.class);
}
}
package com.pangding.web.authority.dao.impl; package com.pangding.web.authority.dao.impl;
import com.pangding.web.authority.dao.MobileRegisterDao; import com.pangding.web.authority.dao.CompanyDao;
import com.pangding.web.authority.vo.CompanyVo; import com.pangding.web.authority.vo.CompanyVo;
import com.yanzuoguang.dao.impl.BaseDaoImpl; import com.yanzuoguang.dao.impl.BaseDaoImpl;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -10,7 +10,7 @@ import org.springframework.stereotype.Component; ...@@ -10,7 +10,7 @@ import org.springframework.stereotype.Component;
* @create 2019/5/13 14:25 * @create 2019/5/13 14:25
*/ */
@Component @Component
public class MobileRegisterDaoImpl extends BaseDaoImpl implements MobileRegisterDao { public class CompanyDaoImpl extends BaseDaoImpl implements CompanyDao {
private static final String CHECK_PHONE = "CHECK_PHONE"; private static final String CHECK_PHONE = "CHECK_PHONE";
......
package com.pangding.web.authority.dao.impl;
import com.pangding.web.authority.dao.CompanyExtendDao;
import com.pangding.web.authority.vo.CompanyExtendVo;
import com.yanzuoguang.dao.impl.BaseDaoImpl;
import org.springframework.stereotype.Component;
/**
* @Author zhangjinyao
* @create 2019/5/16 17:22
*/
@Component
public class CompanyExtendDaoImpl extends BaseDaoImpl implements CompanyExtendDao {
@Override
protected void init() {
register(CompanyExtendVo.class);
}
}
package com.pangding.web.authority.dao.impl; package com.pangding.web.authority.dao.impl;
import com.pangding.web.authority.dao.ComputerRegisterDao; import com.pangding.web.authority.dao.MerchantDao;
import com.pangding.web.authority.vo.MerchantVo;
import com.yanzuoguang.dao.impl.BaseDaoImpl; import com.yanzuoguang.dao.impl.BaseDaoImpl;
import org.springframework.stereotype.Component;
/** /**
* @Author zhangjinyao * @Author zhangjinyao
* @create 2019/5/14 16:33 * @create 2019/5/16 17:20
*/ */
public class ComputerRegisterDaoImpl extends BaseDaoImpl implements ComputerRegisterDao { @Component
public class MerchantDaoImpl extends BaseDaoImpl implements MerchantDao {
@Override @Override
protected void init() { protected void init() {
register(MerchantVo.class);
} }
} }
package com.pangding.web.authority.dto;
/**
* @Author zhangjinyao
* @create 2019/5/14 18:30
*/
public class RegisterEnterpriceDto {
private String enterpriceName;
private String enterpriceAddress;
private String businessLicenseCode;
private String merchantName;
private String companyAttribute;
private String enterpricePhone;
private String contactName;
private String contactCode;
private String contactPhone;
private String depositBank;
private String depositAccount;
private String depositAddress;
public String getEnterpriceName() {
return enterpriceName;
}
public void setEnterpriceName(String enterpriceName) {
this.enterpriceName = enterpriceName;
}
public String getCompanyAttribute() {
return companyAttribute;
}
public void setCompanyAttribute(String companyAttribute) {
this.companyAttribute = companyAttribute;
}
public String getExtraChoseOne() {
return extraChoseOne;
}
public void setExtraChoseOne(String extraChoseOne) {
this.extraChoseOne = extraChoseOne;
}
public String getExtraChoseTwo() {
return extraChoseTwo;
}
public void setExtraChoseTwo(String extraChoseTwo) {
this.extraChoseTwo = extraChoseTwo;
}
public String getEnterpricePhone() {
return enterpricePhone;
}
public void setEnterpricePhone(String enterpricePhone) {
this.enterpricePhone = enterpricePhone;
}
public String getContactName() {
return contactName;
}
public void setContactName(String contactName) {
this.contactName = contactName;
}
public String getContactCode() {
return contactCode;
}
public void setContactCode(String contactCode) {
this.contactCode = contactCode;
}
public String getContactPhone() {
return contactPhone;
}
public void setContactPhone(String contactPhone) {
this.contactPhone = contactPhone;
}
public String getDepositBank() {
return depositBank;
}
public void setDepositBank(String depositBank) {
this.depositBank = depositBank;
}
public String getDepositAccount() {
return depositAccount;
}
public void setDepositAccount(String depositAccount) {
this.depositAccount = depositAccount;
}
public String getDepositAddress() {
return depositAddress;
}
public void setDepositAddress(String depositAddress) {
this.depositAddress = depositAddress;
}
}
package com.pangding.web.authority.reqvo;
/**
* @Author zhangjinyao
* @create 2019/5/11 16:34
*/
public class ListLevel1ReqVo {
private String exist;
public String getExist() {
return exist;
}
public void setExist(String exist) {
this.exist = exist;
}
}
package com.pangding.web.authority.service;
/**
* @Author zhangjinyao
* @create 2019/5/14 16:30
*/
public interface ComputerRegisterService {
}
package com.pangding.web.authority.service; package com.pangding.web.authority.service;
import com.pangding.web.authority.dto.RegisterIndividualDto; import com.pangding.web.authority.vo.reqvo.LoginReqVo;
import com.pangding.web.authority.vo.reqvo.RegisterEnterpriceReqVo;
import com.pangding.web.authority.vo.reqvo.RegisterIndividualReqVo;
import com.pangding.web.authority.vo.reqvo.RegisterUserReqVo;
import com.pangding.web.authority.vo.CompanyVo; import com.pangding.web.authority.vo.CompanyVo;
import com.pangding.web.authority.vo.UserVo;
/** /**
* @Author zhangjinyao * @Author zhangjinyao
* @create 2019/5/13 14:21 * @create 2019/5/13 14:21
*/ */
public interface MobileRegisterService { public interface RegisterService {
/** /**
* 判断注册编码是否正确 * 判断注册编码是否正确
...@@ -22,16 +24,9 @@ public interface MobileRegisterService { ...@@ -22,16 +24,9 @@ public interface MobileRegisterService {
/** /**
* 保存用户信息 * 保存用户信息
* *
* @param userVo UserVo对象 * @param registerUserReqVo UserVo对象
*/ */
void saveUser(UserVo userVo); CompanyVo saveUser(RegisterUserReqVo registerUserReqVo);
/**
* 保存公司信息
*
* @param companyVo CompanyVo对象
*/
void saveCompany(CompanyVo companyVo);
/** /**
* 检查电话号码是否已存在 * 检查电话号码是否已存在
...@@ -39,4 +34,10 @@ public interface MobileRegisterService { ...@@ -39,4 +34,10 @@ public interface MobileRegisterService {
* @param contactPhone 联系电话 * @param contactPhone 联系电话
*/ */
void checkPhone(String contactPhone); void checkPhone(String contactPhone);
void saveIndividual(RegisterIndividualReqVo reqVo);
void saveEnterprise(RegisterEnterpriceReqVo reqVo);
void login(LoginReqVo reqVo);
} }
...@@ -3,7 +3,6 @@ package com.pangding.web.authority.service.impl; ...@@ -3,7 +3,6 @@ package com.pangding.web.authority.service.impl;
import com.pangding.web.authority.dao.RoleAuthorityDao; import com.pangding.web.authority.dao.RoleAuthorityDao;
import com.pangding.web.authority.dao.AuthorityDao; import com.pangding.web.authority.dao.AuthorityDao;
import com.pangding.web.authority.vo.reqvo.*; import com.pangding.web.authority.vo.reqvo.*;
import com.pangding.web.authority.reqvo.ListLevel1ReqVo;
import com.pangding.web.authority.service.AuthorityService; import com.pangding.web.authority.service.AuthorityService;
import com.pangding.web.authority.vo.*; import com.pangding.web.authority.vo.*;
import com.yanzuoguang.util.exception.CodeException; import com.yanzuoguang.util.exception.CodeException;
......
package com.pangding.web.authority.service.impl;
import com.pangding.web.authority.service.ComputerRegisterService;
import org.springframework.stereotype.Service;
/**
* @Author zhangjinyao
* @create 2019/5/14 16:31
*/
@Service
public class ComputerRegisterServiceImpl implements ComputerRegisterService {
}
package com.pangding.web.authority.service.impl;
import com.pangding.web.authority.dao.MobileRegisterDao;
import com.pangding.web.authority.dao.UserDao;
import com.pangding.web.authority.reqvo.CheckMerchantIdReqVo;
import com.pangding.web.authority.service.MobileRegisterService;
import com.pangding.web.authority.vo.CompanyVo;
import com.pangding.web.authority.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* @Author zhangjinyao
* @create 2019/5/13 14:23
*/
@Service
public class MobileRegisterServiceImpl implements MobileRegisterService {
@Autowired
MobileRegisterDao mobileRegisterDaoImpl;
@Autowired
UserDao userDaoImpl;
@Override
public Boolean checkMerchantId(String merchantId) {
CheckMerchantIdReqVo idReqVo = new CheckMerchantIdReqVo();
idReqVo.setId(merchantId);
CompanyVo companyVo = mobileRegisterDaoImpl.load(idReqVo,CompanyVo.class);
return companyVo == null ? false : true;
}
@Override
public void saveUser(UserVo userVo) {
userDaoImpl.create(userVo);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void saveCompany(CompanyVo companyVo) {
mobileRegisterDaoImpl.create(companyVo);
GetUserByCompanyIdReqVo companyId = new GetUserByCompanyIdReqVo();
companyId.setCompanyId(companyVo.getId());
UserVo userVo = userDaoImpl.getUserByCompanyId(companyId);
userVo.setPhone(companyVo.getContactPhone());
userDaoImpl.update(userVo);
}
@Override
public void checkPhone(String contactPhone) {
CompanyVo companyVo = new CompanyVo();
companyVo.setContactPhone(contactPhone);
mobileRegisterDaoImpl.checkPhone(companyVo);
}
}
package com.pangding.web.authority.service.impl;
import com.pangding.web.authority.dao.*;
import com.pangding.web.authority.vo.*;
import com.pangding.web.authority.vo.reqvo.*;
import com.pangding.web.authority.reqvo.CheckMerchantIdReqVo;
import com.pangding.web.authority.service.RegisterService;
import com.pangding.web.authority.service.UserService;
import com.yanzuoguang.token.TokenHelper;
import com.yanzuoguang.util.exception.CodeException;
import com.yanzuoguang.util.helper.StringHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* @Author zhangjinyao
* @create 2019/5/13 14:23
*/
@Service
public class RegisterServiceImpl implements RegisterService {
@Autowired
CompanyDao companyDaoImpl;
@Autowired
UserDao userDaoImpl;
@Autowired
UserService userServiceImpl;
@Autowired
MerchantDao merchantDaoImpl;
@Autowired
CompanyExtendDao companyExtendDaoImpl;
@Autowired
CompanyBankCardDao companyBankCardDaoImpl;
@Override
public Boolean checkMerchantId(String merchantId) {
CheckMerchantIdReqVo idReqVo = new CheckMerchantIdReqVo();
idReqVo.setId(merchantId);
CompanyVo companyVo = companyDaoImpl.load(idReqVo,CompanyVo.class);
return companyVo == null ? false : true;
}
@Override
@Transactional(rollbackFor = Exception.class)
public CompanyVo saveUser(RegisterUserReqVo registerUserReqVo) {
if (registerUserReqVo.getCompanyType() != 0){
throw new CodeException("目前仅支持个体用户");
}
userServiceImpl.isValid(registerUserReqVo.getAccount());
UserVo userVo = new UserVo();
userVo.setAccount(registerUserReqVo.getAccount());
userServiceImpl.checkAccount(userVo);
if (!registerUserReqVo.getPassword().equals(registerUserReqVo.getConfirmPassword())){
throw new CodeException("确认密码错误");
}
String merchantId = registerUserReqVo.getMerchantId();
if (!this.checkMerchantId(merchantId)){
throw new CodeException("注册编码错误");
}
String companyId = StringHelper.getNewID();
userVo.setPassword(StringHelper.md5(registerUserReqVo.getPassword()));
userVo.setId(StringHelper.getNewID());
userVo.setRemark(registerUserReqVo.getPassword());
userVo.setCompanyId(companyId);
userDaoImpl.create(userVo);
CompanyVo companyVo = new CompanyVo();
companyVo.setId(companyId);
companyVo.setMerchantId(merchantId);
companyVo.setCompanyType(registerUserReqVo.getCompanyType());
companyDaoImpl.create(companyVo);
return companyVo;
}
@Override
public void checkPhone(String contactPhone) {
CompanyVo companyVo = new CompanyVo();
companyVo.setContactPhone(contactPhone);
companyDaoImpl.checkPhone(companyVo);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void saveIndividual(RegisterIndividualReqVo reqVo) {
CompanyVo companyVo = new CompanyVo();
MerchantVo merchantVo = new MerchantVo();
CompanyExtendVo extendVo = new CompanyExtendVo();
this.checkPhone(reqVo.getContactPhone());
companyVo.setId(reqVo.getId());
companyVo.setMerchantId(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());
merchantVo.setId(StringHelper.getNewID());
merchantVo.setName(reqVo.getExtraChoseOne());
merchantVo.setAttribute(reqVo.getCompanyAttribute());
merchantVo.setTheProvider(reqVo.getId());
merchantVo.setPhone(reqVo.getContactPhone());
extendVo.setId(reqVo.getId());
if (reqVo.getCompanyAttribute() == 5){
companyVo.setBusinessLicenseCode(reqVo.getExtraChoseTwo());
}else {
companyVo.setAddress(reqVo.getExtraChoseTwo());
merchantVo.setAddress(reqVo.getExtraChoseTwo());
}
companyDaoImpl.update(companyVo);
merchantDaoImpl.create(merchantVo);
companyExtendDaoImpl.create(merchantVo);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void saveEnterprise(RegisterEnterpriceReqVo reqVo) {
CompanyVo companyVo = new CompanyVo();
MerchantVo merchantVo = new MerchantVo();
CompanyExtendVo extendVo = new CompanyExtendVo();
CompanyBankCardVo companyBankCardVo = new CompanyBankCardVo();
this.checkPhone(reqVo.getContactPhone());
companyVo.setId(reqVo.getId());
companyVo.setMerchantId(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());
merchantVo.setId(StringHelper.getNewID());
merchantVo.setName(reqVo.getMerchantName());
merchantVo.setTheProvider(reqVo.getId());
merchantVo.setAttribute(reqVo.getCompanyAttribute());
merchantVo.setPhone(reqVo.getContactPhone());
extendVo.setId(reqVo.getId());
companyBankCardVo.setId(reqVo.getId());
companyBankCardVo.setBankName(reqVo.getBankName());
companyBankCardVo.setBankCardCode(reqVo.getBankCardCode());
companyBankCardVo.setBankAddress(reqVo.getBankAddress());
companyBankCardVo.setBankCode(reqVo.getBankCode());
companyBankCardVo.setReservedPhone(reqVo.getReservedPhone());
companyDaoImpl.update(companyVo);
merchantDaoImpl.create(merchantVo);
companyExtendDaoImpl.create(merchantVo);
companyBankCardDaoImpl.create(companyBankCardVo);
}
@Override
public void login(LoginReqVo reqVo) {
String accountOrPhone = reqVo.getAccountOrPhone();
UserVo userVo;
if (userServiceImpl.isNumeric(accountOrPhone)){
userVo = userServiceImpl.getUserByPhone(accountOrPhone);
}else {
userVo = userServiceImpl.getUserByAccount(accountOrPhone);
}
if (userVo == null){
throw new CodeException("没有此用户");
}
if (!StringHelper.md5(reqVo.getPassword()).equals(userVo.getPassword())){
throw new CodeException("用户名或密码错误");
}
CompanyVo companyReqVo = new CompanyVo();
companyReqVo.setId(userVo.getCompanyId());
CompanyVo companyVo = companyDaoImpl.load(companyReqVo,CompanyVo.class);
LoginResVo resVo = new LoginResVo();
resVo.setUserVo(userVo);
resVo.setCompanyVo(companyVo);
/*token内容暂时不能用,以后要改动*/
String token = StringHelper.getNewID();
TokenHelper.write(token,resVo);
}
}
...@@ -34,7 +34,7 @@ public class AuthorityVo implements Serializable, InitDao { ...@@ -34,7 +34,7 @@ public class AuthorityVo implements Serializable, InitDao {
@TableAnnotation("create_time") @TableAnnotation("create_time")
private Timestamp createTime; private String createTime;
public String getId() { public String getId() {
return id; return id;
...@@ -100,17 +100,16 @@ public class AuthorityVo implements Serializable, InitDao { ...@@ -100,17 +100,16 @@ public class AuthorityVo implements Serializable, InitDao {
this.remark = remark; this.remark = remark;
} }
public Timestamp getCreateTime() { public String getCreateTime() {
return createTime; return createTime;
} }
public void setCreateTime(Timestamp createTime) { public void setCreateTime(String createTime) {
this.createTime = createTime; this.createTime = createTime;
} }
@Override @Override
public void init() { public void init() {
String createTimeString = StringHelper.getFirst(DateHelper.getDateTimeString(this.createTime), DateHelper.getNow()); this.createTime = StringHelper.getFirst(this.createTime, DateHelper.getNow());
this.createTime = Timestamp.valueOf(createTimeString);
} }
} }
package com.pangding.web.authority.vo;
import com.yanzuoguang.dao.TableAnnotation;
import java.io.Serializable;
/**
* @Author zhangjinyao
* @create 2019/5/16 14:17
*/
@TableAnnotation("pd_company_bank_card")
public class CompanyBankCardVo implements Serializable {
private String id;
@TableAnnotation("bank_card_code")
private String bankCardCode;
@TableAnnotation("bank_name")
private String bankName;
@TableAnnotation("bank_address")
private String bankAddress;
@TableAnnotation("bank_code")
private String bankCode;
private int type;
@TableAnnotation("company_id")
private String companyId;
private String name;
@TableAnnotation("ID_card")
private String IDCard;
@TableAnnotation("reserved_phone")
private String reservedPhone;
private String status;
@TableAnnotation("binding_code")
private String bindingCode;
@TableAnnotation("binding_time")
private String bindingTime;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getBankCardCode() {
return bankCardCode;
}
public void setBankCardCode(String bankCardCode) {
this.bankCardCode = bankCardCode;
}
public String getBankName() {
return bankName;
}
public void setBankName(String bankName) {
this.bankName = bankName;
}
public String getBankAddress() {
return bankAddress;
}
public void setBankAddress(String bankAddress) {
this.bankAddress = bankAddress;
}
public String getBankCode() {
return bankCode;
}
public void setBankCode(String bankCode) {
this.bankCode = bankCode;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getIDCard() {
return IDCard;
}
public void setIDCard(String IDCard) {
this.IDCard = IDCard;
}
public String getReservedPhone() {
return reservedPhone;
}
public void setReservedPhone(String reservedPhone) {
this.reservedPhone = reservedPhone;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getBindingCode() {
return bindingCode;
}
public void setBindingCode(String bindingCode) {
this.bindingCode = bindingCode;
}
public String getBindingTime() {
return bindingTime;
}
public void setBindingTime(String bindingTime) {
this.bindingTime = bindingTime;
}
}
package com.pangding.web.authority.vo;
import com.yanzuoguang.dao.TableAnnotation;
import java.io.Serializable;
/**
* @Author zhangjinyao
* @create 2019/5/16 15:35
*/
@TableAnnotation("pd_company_extend")
public class CompanyExtendVo implements Serializable {
private String id;
@TableAnnotation("QR_code")
private String QRCode;
@TableAnnotation("QR_code_type")
private String QRCodeType;
@TableAnnotation("QR_code_url")
private String QRCodeUrl;
private String money;
@TableAnnotation("is_sub_account")
private String isSubAccount;
@TableAnnotation("sub_account_rule")
private String subAccountRule;
@TableAnnotation("is_sub_profit")
private String isSubProfit;
@TableAnnotation("sub_profit_rule")
private String subProfitRule;
@TableAnnotation("is_withdraw")
private String isWithdraw;
@TableAnnotation("withdraw_rule")
private String withdrawRule;
@TableAnnotation("is_scan_code_pay")
private String isScanCodePay;
@TableAnnotation("pay_rule")
private String payRule;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getQRCode() {
return QRCode;
}
public void setQRCode(String QRCode) {
this.QRCode = QRCode;
}
public String getQRCodeType() {
return QRCodeType;
}
public void setQRCodeType(String QRCodeType) {
this.QRCodeType = QRCodeType;
}
public String getQRCodeUrl() {
return QRCodeUrl;
}
public void setQRCodeUrl(String QRCodeUrl) {
this.QRCodeUrl = QRCodeUrl;
}
public String getMoney() {
return money;
}
public void setMoney(String money) {
this.money = money;
}
public String getIsSubAccount() {
return isSubAccount;
}
public void setIsSubAccount(String isSubAccount) {
this.isSubAccount = isSubAccount;
}
public String getSubAccountRule() {
return subAccountRule;
}
public void setSubAccountRule(String subAccountRule) {
this.subAccountRule = subAccountRule;
}
public String getIsSubProfit() {
return isSubProfit;
}
public void setIsSubProfit(String isSubProfit) {
this.isSubProfit = isSubProfit;
}
public String getSubProfitRule() {
return subProfitRule;
}
public void setSubProfitRule(String subProfitRule) {
this.subProfitRule = subProfitRule;
}
public String getIsWithdraw() {
return isWithdraw;
}
public void setIsWithdraw(String isWithdraw) {
this.isWithdraw = isWithdraw;
}
public String getWithdrawRule() {
return withdrawRule;
}
public void setWithdrawRule(String withdrawRule) {
this.withdrawRule = withdrawRule;
}
public String getIsScanCodePay() {
return isScanCodePay;
}
public void setIsScanCodePay(String isScanCodePay) {
this.isScanCodePay = isScanCodePay;
}
public String getPayRule() {
return payRule;
}
public void setPayRule(String payRule) {
this.payRule = payRule;
}
}
...@@ -34,7 +34,7 @@ public class CompanyVo implements Serializable, InitDao { ...@@ -34,7 +34,7 @@ public class CompanyVo implements Serializable, InitDao {
private String address; private String address;
@TableAnnotation("company_attribute") @TableAnnotation("company_attribute")
private String companyAttribute; private int companyAttribute;
@TableAnnotation("contact_name") @TableAnnotation("contact_name")
private String contactName; private String contactName;
...@@ -54,10 +54,10 @@ public class CompanyVo implements Serializable, InitDao { ...@@ -54,10 +54,10 @@ public class CompanyVo implements Serializable, InitDao {
private String status; private String status;
@TableAnnotation("create_time") @TableAnnotation("create_time")
private Timestamp createTime; private String createTime;
@TableAnnotation("update_time") @TableAnnotation("update_time")
private Timestamp updateTime; private String updateTime;
private int nature; private int nature;
...@@ -117,11 +117,11 @@ public class CompanyVo implements Serializable, InitDao { ...@@ -117,11 +117,11 @@ public class CompanyVo implements Serializable, InitDao {
this.address = address; this.address = address;
} }
public String getCompanyAttribute() { public int getCompanyAttribute() {
return companyAttribute; return companyAttribute;
} }
public void setCompanyAttribute(String companyAttribute) { public void setCompanyAttribute(int companyAttribute) {
this.companyAttribute = companyAttribute; this.companyAttribute = companyAttribute;
} }
...@@ -173,19 +173,19 @@ public class CompanyVo implements Serializable, InitDao { ...@@ -173,19 +173,19 @@ public class CompanyVo implements Serializable, InitDao {
this.status = status; this.status = status;
} }
public Timestamp getCreateTime() { public String getCreateTime() {
return createTime; return createTime;
} }
public void setCreateTime(Timestamp createTime) { public void setCreateTime(String createTime) {
this.createTime = createTime; this.createTime = createTime;
} }
public Timestamp getUpdateTime() { public String getUpdateTime() {
return updateTime; return updateTime;
} }
public void setUpdateTime(Timestamp updateTime) { public void setUpdateTime(String updateTime) {
this.updateTime = updateTime; this.updateTime = updateTime;
} }
...@@ -199,7 +199,6 @@ public class CompanyVo implements Serializable, InitDao { ...@@ -199,7 +199,6 @@ public class CompanyVo implements Serializable, InitDao {
@Override @Override
public void init() { public void init() {
String createTimeString = StringHelper.getFirst(DateHelper.getDateTimeString(this.createTime), DateHelper.getNow()); this.createTime = StringHelper.getFirst(this.createTime, DateHelper.getNow());
this.createTime = Timestamp.valueOf(createTimeString);
} }
} }
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;
/**
* @Author zhangjinyao
* @create 2019/5/16 14:35
*/
@TableAnnotation("pd_merchant")
public class MerchantVo implements Serializable, InitDao {
private String id;
private String code;
private String name;
private String longitude;
private String latitude;
private String score;
@TableAnnotation("area_code")
private String areaCode;
@TableAnnotation("area_name")
private String areaName;
private String address;
private int attribute;
private String tag;
private String level;
private int status;
@TableAnnotation("time_spent")
private String timeSpent;
private String phone;
@TableAnnotation("the_provider")
private String theProvider;
@TableAnnotation("the_interface")
private String theInterface;
@TableAnnotation("business_start")
private String businessStart;
@TableAnnotation("business_end")
private String businessEnd;
@TableAnnotation("create_time")
private String createTime;
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 String getLongitude() {
return longitude;
}
public void setLongitude(String longitude) {
this.longitude = longitude;
}
public String getLatitude() {
return latitude;
}
public void setLatitude(String latitude) {
this.latitude = latitude;
}
public String getScore() {
return score;
}
public void setScore(String 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 getAttribute() {
return attribute;
}
public void setAttribute(int attribute) {
this.attribute = attribute;
}
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 getTheProvider() {
return theProvider;
}
public void setTheProvider(String theProvider) {
this.theProvider = theProvider;
}
public String getTheInterface() {
return theInterface;
}
public void setTheInterface(String theInterface) {
this.theInterface = theInterface;
}
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;
}
@Override
public void init() {
this.createTime = StringHelper.getFirst(this.createTime, DateHelper.getNow());
}
}
...@@ -28,7 +28,7 @@ public class UserVo implements Serializable, InitDao { ...@@ -28,7 +28,7 @@ public class UserVo implements Serializable, InitDao {
private String remark; private String remark;
@TableAnnotation("create_time") @TableAnnotation("create_time")
private Timestamp createTime; private String createTime;
private String creator; private String creator;
...@@ -83,11 +83,11 @@ public class UserVo implements Serializable, InitDao { ...@@ -83,11 +83,11 @@ public class UserVo implements Serializable, InitDao {
this.remark = remark; this.remark = remark;
} }
public Timestamp getCreateTime() { public String getCreateTime() {
return createTime; return createTime;
} }
public void setCreateTime(Timestamp createTime) { public void setCreateTime(String createTime) {
this.createTime = createTime; this.createTime = createTime;
} }
...@@ -109,7 +109,6 @@ public class UserVo implements Serializable, InitDao { ...@@ -109,7 +109,6 @@ public class UserVo implements Serializable, InitDao {
@Override @Override
public void init() { public void init() {
String createTimeString = StringHelper.getFirst(DateHelper.getDateTimeString(this.createTime), DateHelper.getNow()); this.createTime = StringHelper.getFirst(this.createTime, DateHelper.getNow());
this.createTime = Timestamp.valueOf(createTimeString);
} }
} }
package com.pangding.web.authority.vo; package com.pangding.web.authority.vo.reqvo;
/** /**
* @Author zhangjinyao * @Author zhangjinyao
* @create 2019/5/14 11:46 * @create 2019/5/14 11:46
*/ */
public class MobileLoginInfo { public class LoginReqVo {
private String accountOrPhone; private String accountOrPhone;
......
package com.pangding.web.authority.vo.reqvo;
import com.pangding.web.authority.vo.CompanyVo;
import com.pangding.web.authority.vo.UserVo;
/**
* @Author zhangjinyao
* @create 2019/5/16 17:50
*/
public class LoginResVo {
UserVo userVo;
CompanyVo companyVo;
public UserVo getUserVo() {
return userVo;
}
public void setUserVo(UserVo userVo) {
this.userVo = userVo;
}
public CompanyVo getCompanyVo() {
return companyVo;
}
public void setCompanyVo(CompanyVo companyVo) {
this.companyVo = companyVo;
}
}
package com.pangding.web.authority.vo.reqvo;
/**
* @Author zhangjinyao
* @create 2019/5/14 18:30
*/
public class RegisterEnterpriceReqVo {
private String id;
private String merchantId;
private int companyType;
private String companyName;
private String companyAddress;
private String businessLicenseCode;
private String merchantName;
private int companyAttribute;
private String contactName;
private String contactCode;
private String contactPhone;
private String bankName;
private String bankCardCode;
private String bankAddress;
private String bankCode;
private String reservedPhone;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getMerchantId() {
return merchantId;
}
public void setMerchantId(String merchantId) {
this.merchantId = merchantId;
}
public int getCompanyType() {
return companyType;
}
public void setCompanyType(int companyType) {
this.companyType = companyType;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getCompanyAddress() {
return companyAddress;
}
public void setCompanyAddress(String companyAddress) {
this.companyAddress = companyAddress;
}
public String getBusinessLicenseCode() {
return businessLicenseCode;
}
public void setBusinessLicenseCode(String businessLicenseCode) {
this.businessLicenseCode = businessLicenseCode;
}
public String getMerchantName() {
return merchantName;
}
public void setMerchantName(String merchantName) {
this.merchantName = merchantName;
}
public int getCompanyAttribute() {
return companyAttribute;
}
public void setCompanyAttribute(int companyAttribute) {
this.companyAttribute = companyAttribute;
}
public String getContactName() {
return contactName;
}
public void setContactName(String contactName) {
this.contactName = contactName;
}
public String getContactCode() {
return contactCode;
}
public void setContactCode(String contactCode) {
this.contactCode = contactCode;
}
public String getContactPhone() {
return contactPhone;
}
public void setContactPhone(String contactPhone) {
this.contactPhone = contactPhone;
}
public String getBankName() {
return bankName;
}
public void setBankName(String bankName) {
this.bankName = bankName;
}
public String getBankCardCode() {
return bankCardCode;
}
public void setBankCardCode(String bankCardCode) {
this.bankCardCode = bankCardCode;
}
public String getBankAddress() {
return bankAddress;
}
public void setBankAddress(String bankAddress) {
this.bankAddress = bankAddress;
}
public String getBankCode() {
return bankCode;
}
public void setBankCode(String bankCode) {
this.bankCode = bankCode;
}
public String getReservedPhone() {
return reservedPhone;
}
public void setReservedPhone(String reservedPhone) {
this.reservedPhone = reservedPhone;
}
}
package com.pangding.web.authority.dto; package com.pangding.web.authority.vo.reqvo;
/** /**
* @Author zhangjinyao * @Author zhangjinyao
* @create 2019/5/13 17:32 * @create 2019/5/13 17:32
*/ */
public class RegisterIndividualDto { public class RegisterIndividualReqVo {
private String id;
private String merchantId;
private int companyType;
private String contactName; private String contactName;
private String contactCode; private String contactCode;
private String companyAttribute; private int companyAttribute;
private String contactPhone; private String contactPhone;
...@@ -18,6 +24,30 @@ public class RegisterIndividualDto { ...@@ -18,6 +24,30 @@ public class RegisterIndividualDto {
private String extraChoseTwo; private String extraChoseTwo;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getMerchantId() {
return merchantId;
}
public void setMerchantId(String merchantId) {
this.merchantId = merchantId;
}
public int getCompanyType() {
return companyType;
}
public void setCompanyType(int companyType) {
this.companyType = companyType;
}
public String getExtraChoseOne() { public String getExtraChoseOne() {
return extraChoseOne; return extraChoseOne;
} }
...@@ -50,11 +80,11 @@ public class RegisterIndividualDto { ...@@ -50,11 +80,11 @@ public class RegisterIndividualDto {
this.contactCode = contactCode; this.contactCode = contactCode;
} }
public String getCompanyAttribute() { public int getCompanyAttribute() {
return companyAttribute; return companyAttribute;
} }
public void setCompanyAttribute(String companyAttribute) { public void setCompanyAttribute(int companyAttribute) {
this.companyAttribute = companyAttribute; this.companyAttribute = companyAttribute;
} }
......
package com.pangding.web.authority.dto; package com.pangding.web.authority.vo.reqvo;
import com.pangding.web.authority.vo.UserVo; import com.pangding.web.authority.vo.UserVo;
...@@ -6,16 +6,26 @@ import com.pangding.web.authority.vo.UserVo; ...@@ -6,16 +6,26 @@ import com.pangding.web.authority.vo.UserVo;
* @Author zhangjinyao * @Author zhangjinyao
* @create 2019/5/13 15:17 * @create 2019/5/13 15:17
*/ */
public class RegisterUserDto { public class RegisterUserReqVo {
private String account; private String account;
private String password; private String password;
private String confirmPassword;
private int companyType; private int companyType;
private String merchantId; private String merchantId;
public String getConfirmPassword() {
return confirmPassword;
}
public void setConfirmPassword(String confirmPassword) {
this.confirmPassword = confirmPassword;
}
public String getAccount() { public String getAccount() {
return account; return account;
} }
......
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