Commit 158ed33a authored by tangf's avatar tangf

添加公司常量

parent 2d6c3e88
...@@ -2,9 +2,7 @@ package com.pangding.web.authority.controller; ...@@ -2,9 +2,7 @@ package com.pangding.web.authority.controller;
import com.pangding.web.authority.service.RegisterService; import com.pangding.web.authority.service.RegisterService;
import com.pangding.web.authority.service.VerifyCodeService; import com.pangding.web.authority.service.VerifyCodeService;
import com.pangding.web.authority.util.LoginConstant;
import com.pangding.web.authority.vo.cloudvo.LoginResVo; import com.pangding.web.authority.vo.cloudvo.LoginResVo;
import com.pangding.web.authority.vo.reqvo.ComputerLoginReqVo;
import com.pangding.web.authority.vo.reqvo.LoginReqVo; import com.pangding.web.authority.vo.reqvo.LoginReqVo;
import com.yanzuoguang.util.helper.CheckerHelper; import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.vo.ResponseResult; import com.yanzuoguang.util.vo.ResponseResult;
...@@ -15,9 +13,6 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -15,9 +13,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException; import java.io.IOException;
/** /**
......
...@@ -5,6 +5,8 @@ import com.pangding.web.authority.vo.CompanyBankCardVo; ...@@ -5,6 +5,8 @@ import com.pangding.web.authority.vo.CompanyBankCardVo;
import com.pangding.web.authority.vo.CompanyVo; import com.pangding.web.authority.vo.CompanyVo;
import com.pangding.web.authority.vo.reqvo.*; import com.pangding.web.authority.vo.reqvo.*;
import com.pangding.web.authority.vo.resvo.CompanyResVo; import com.pangding.web.authority.vo.resvo.CompanyResVo;
import com.pangding.web.authority.vo.resvo.GetCompanyDivideResVo;
import com.pangding.web.authority.vo.resvo.GetCompanyResVo;
import com.pangding.web.authority.vo.resvo.SaveCompanyResVo; import com.pangding.web.authority.vo.resvo.SaveCompanyResVo;
import com.yanzuoguang.util.helper.CheckerHelper; import com.yanzuoguang.util.helper.CheckerHelper;
import com.yanzuoguang.util.vo.PageSizeData; import com.yanzuoguang.util.vo.PageSizeData;
...@@ -16,6 +18,8 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -16,6 +18,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/** /**
* 胖丁我的管理Controller * 胖丁我的管理Controller
* @Author zhangjinyao * @Author zhangjinyao
...@@ -280,11 +284,17 @@ public class PangdingManagementController { ...@@ -280,11 +284,17 @@ public class PangdingManagementController {
* @return * @return
*/ */
@RequestMapping(value = "/getCompanyByQrCode",method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "/getCompanyByQrCode",method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseResult<CompanyVo> getCompanyByQrCode(@RequestBody GetCompanyByQrCodeReqVo reqVo){ public ResponseResult<GetCompanyResVo> getCompanyByQrCode(@RequestBody GetCompanyByQrCodeReqVo reqVo){
CheckerHelper.newInstance() CheckerHelper.newInstance()
.notBlankCheck("qrCode",reqVo.getQrCode()) .notBlankCheck("qrCode",reqVo.getQrCode())
.checkException(); .checkException();
System.out.println("change"); System.out.println("change");
return ResponseResult.result(companyServiceImpl.getCompanyByQrCode(reqVo)); return ResponseResult.result(companyServiceImpl.getCompanyByQrCode(reqVo));
} }
@RequestMapping(value = "/findCompanyDivideInfo",method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseResult<List<GetCompanyDivideResVo>> findCompanyDivideInfo(@RequestBody CompanyDivideReqVo req){
CheckerHelper.newInstance().notBlankCheck("companyList", req.getCompanyIdList()).checkException();
return ResponseResult.result(companyServiceImpl.findCompanyDivideInfo(req));
}
} }
package com.pangding.web.authority.dao;
import com.pangding.web.authority.vo.reqvo.GetCompanyReqVo;
import com.pangding.web.authority.vo.resvo.GetCompanyDivideResVo;
import com.yanzuoguang.dao.BaseDao;
public interface CompanyDivideRuleDao extends BaseDao {
GetCompanyDivideResVo findCompanyDivideInfo(GetCompanyReqVo req);
}
package com.pangding.web.authority.dao;
import com.pangding.web.authority.vo.CompanyMsgVo;
import com.pangding.web.authority.vo.reqvo.CompanyMsgReqVo;
import com.pangding.web.authority.vo.resvo.GetCompanyMsgResVo;
import com.yanzuoguang.dao.BaseDao;
import java.util.List;
public interface CompanyMsgDao extends BaseDao{
List<GetCompanyMsgResVo> findCompanyMsgList(CompanyMsgReqVo req);
}
package com.pangding.web.authority.dao.impl;
import com.pangding.web.authority.dao.CompanyDivideRuleDao;
import com.pangding.web.authority.vo.CompanyDivideRuleVo;
import com.pangding.web.authority.vo.reqvo.GetCompanyReqVo;
import com.pangding.web.authority.vo.resvo.GetCompanyDivideResVo;
import com.yanzuoguang.dao.impl.BaseDaoImpl;
import org.springframework.stereotype.Component;
@Component
public class CompanyDivideRuleDaoImpl extends BaseDaoImpl implements CompanyDivideRuleDao {
private static final String QUERY_LIST = "QUERY_LIST";
@Override
protected void init() {
register(CompanyDivideRuleVo.class);
table.add(QUERY_LIST, "select cdr.*,ce.divide_status from pd_company_divide_rule cdr left join pd_company c on c.id = cdr.company_id " +
"left join pd_company_extend ce on c.id = ce.id where 1=1 ")
.add("companyId"," and cdr.company_id = ?");
}
@Override
public GetCompanyDivideResVo findCompanyDivideInfo(GetCompanyReqVo req){
return this.queryFirst(GetCompanyDivideResVo.class, QUERY_LIST, req);
}
}
package com.pangding.web.authority.dao.impl;
import com.pangding.web.authority.dao.CompanyMsgDao;
import com.pangding.web.authority.vo.CompanyMsgVo;
import com.pangding.web.authority.vo.reqvo.CompanyMsgReqVo;
import com.pangding.web.authority.vo.resvo.GetCompanyMsgResVo;
import com.yanzuoguang.dao.impl.BaseDaoImpl;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
public class CompanyMsgDaoImpl extends BaseDaoImpl implements CompanyMsgDao {
private static final String QUERY_LIST = "QUERY_LIST";
@Override
protected void init() {
register(CompanyMsgVo.class);
table.add(QUERY_LIST, "select m.*,cm.company_id,cm.type " +
"from pd_company_msg cm left join pd_msg m on cm.msg_id = m.id where 1=1 ")
.add("CompanyId", "and cm.company_id = ? ")
.add("type", "and cm.type = ? ");
}
@Override
public List<GetCompanyMsgResVo> findCompanyMsgList(CompanyMsgReqVo req) {
return this.query(GetCompanyMsgResVo.class, QUERY_LIST, req);
}
}
...@@ -5,6 +5,8 @@ import com.pangding.web.authority.vo.CompanyBankCardVo; ...@@ -5,6 +5,8 @@ import com.pangding.web.authority.vo.CompanyBankCardVo;
import com.pangding.web.authority.vo.CompanyVo; import com.pangding.web.authority.vo.CompanyVo;
import com.pangding.web.authority.vo.reqvo.*; import com.pangding.web.authority.vo.reqvo.*;
import com.pangding.web.authority.vo.resvo.CompanyResVo; import com.pangding.web.authority.vo.resvo.CompanyResVo;
import com.pangding.web.authority.vo.resvo.GetCompanyDivideResVo;
import com.pangding.web.authority.vo.resvo.GetCompanyResVo;
import com.pangding.web.authority.vo.resvo.SaveCompanyResVo; import com.pangding.web.authority.vo.resvo.SaveCompanyResVo;
import com.yanzuoguang.util.vo.PageSizeData; import com.yanzuoguang.util.vo.PageSizeData;
...@@ -155,5 +157,12 @@ public interface CompanyService{ ...@@ -155,5 +157,12 @@ public interface CompanyService{
* @param reqVo 封装了二维码源码的请求对象 * @param reqVo 封装了二维码源码的请求对象
* @return * @return
*/ */
CompanyVo getCompanyByQrCode(GetCompanyByQrCodeReqVo reqVo); GetCompanyResVo getCompanyByQrCode(GetCompanyByQrCodeReqVo reqVo);
/**
* 获得公司分润信息
* @param req
* @return
*/
List<GetCompanyDivideResVo> findCompanyDivideInfo(CompanyDivideReqVo req);
} }
package com.pangding.web.authority.service.impl; package com.pangding.web.authority.service.impl;
import com.pangding.login.feign.TokenFeign;
import com.pangding.web.authority.dao.*; import com.pangding.web.authority.dao.*;
import com.pangding.web.authority.feign.PayFeign; import com.pangding.web.authority.feign.PayFeign;
import com.pangding.web.authority.feign.StoreFeign; import com.pangding.web.authority.feign.StoreFeign;
...@@ -16,14 +17,13 @@ import com.yanzuoguang.token.TokenHelper; ...@@ -16,14 +17,13 @@ import com.yanzuoguang.token.TokenHelper;
import com.yanzuoguang.util.base.ObjectHelper; import com.yanzuoguang.util.base.ObjectHelper;
import com.yanzuoguang.util.exception.CodeException; import com.yanzuoguang.util.exception.CodeException;
import com.yanzuoguang.util.helper.DateHelper; import com.yanzuoguang.util.helper.DateHelper;
import com.yanzuoguang.util.helper.JsonHelper;
import com.yanzuoguang.util.helper.StringHelper; import com.yanzuoguang.util.helper.StringHelper;
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.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -62,6 +62,8 @@ public class RegisterServiceImpl implements RegisterService { ...@@ -62,6 +62,8 @@ public class RegisterServiceImpl implements RegisterService {
AuthorityService authorityServiceImpl; AuthorityService authorityServiceImpl;
@Autowired @Autowired
PayFeign payFeign; PayFeign payFeign;
@Autowired
private TokenService tokenService;
/** /**
* 判断注册编码是否存在 * 判断注册编码是否存在
...@@ -360,6 +362,13 @@ public class RegisterServiceImpl implements RegisterService { ...@@ -360,6 +362,13 @@ public class RegisterServiceImpl implements RegisterService {
LoginCompanyResVo loginCompanyResVo = new LoginCompanyResVo(); LoginCompanyResVo loginCompanyResVo = new LoginCompanyResVo();
loginCompanyResVo.setCompanyVo(companyVo); loginCompanyResVo.setCompanyVo(companyVo);
resVo.setCompanyResVo(loginCompanyResVo); resVo.setCompanyResVo(loginCompanyResVo);
reqVo.setToken(token);
LoginVo loginVo = new LoginVo();
loginVo.setToken(token);
loginVo.setData(JsonHelper.serialize(reqVo));
loginVo.setExpairTime(DateHelper.getNow());
tokenService.save(loginVo);
/*判断基本信息是否完善,及状态是否为2,且为个人用户,若不完善则跳转个人完善页面*/ /*判断基本信息是否完善,及状态是否为2,且为个人用户,若不完善则跳转个人完善页面*/
if (companyVo.getStatus()!=(LoginConstant.FINISHED_BASIC_INFO) && CompanyConstant.COMPANY_TYPE_PERSON==(companyVo.getCompanyType())){ if (companyVo.getStatus()!=(LoginConstant.FINISHED_BASIC_INFO) && CompanyConstant.COMPANY_TYPE_PERSON==(companyVo.getCompanyType())){
......
package com.pangding.web.authority.util; package com.pangding.web.authority.util;
import com.pangding.web.util.RSAUtils; import com.pangding.web.util.RSAUtils;
import com.yanzuoguang.util.helper.StringHelper;
public class TokenUtil { public class TokenUtil {
...@@ -12,6 +13,7 @@ public class TokenUtil { ...@@ -12,6 +13,7 @@ public class TokenUtil {
String token = ""; String token = "";
try{ try{
token = RSAUtils.encryptionByPublicKey(accountOrPhone, publicKey); token = RSAUtils.encryptionByPublicKey(accountOrPhone, publicKey);
token = StringHelper.md5(token);
}catch (Exception e){ }catch (Exception e){
} }
......
...@@ -3,7 +3,7 @@ package com.pangding.web.authority.vo; ...@@ -3,7 +3,7 @@ package com.pangding.web.authority.vo;
import com.yanzuoguang.dao.TableAnnotation; import com.yanzuoguang.dao.TableAnnotation;
@TableAnnotation("pd_company_divide_rule") @TableAnnotation("pd_company_divide_rule")
public class CompanyDivideRuleVo extends CompanyVo{ public class CompanyDivideRuleVo{
@TableAnnotation("id") @TableAnnotation("id")
private String companyDivideId; private String companyDivideId;
......
package com.pangding.web.authority.vo;
import com.yanzuoguang.dao.TableAnnotation;
import com.yanzuoguang.util.vo.BaseVo;
@TableAnnotation("pd_company_msg")
public class CompanyMsgVo extends BaseVo{
/**
* 主键id
*/
@TableAnnotation("id")
private String companyMsgId;
/**
* 消息id
*/
@TableAnnotation("msg_id")
private String msgId;
/**
* 消息位置
*/
@TableAnnotation("msg_location")
private int msgLocation;
/**
* 适用类型
*/
private int type;
/**
* 公司id
*/
@TableAnnotation("company_id")
private String companyId;
/**
* 公司名称
*/
@TableAnnotation("company_name")
private String companyName;
/**
* 商户编号
*/
@TableAnnotation("merchant_id")
private String merchantId;
/**
* 商户名称
*/
@TableAnnotation("merchant_name")
private String merchantName;
public String getCompanyMsgId() {
return companyMsgId;
}
public void setCompanyMsgId(String companyMsgId) {
this.companyMsgId = companyMsgId;
}
public int getMsgLocation() {
return msgLocation;
}
public void setMsgLocation(int msgLocation) {
this.msgLocation = msgLocation;
}
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 getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getMerchantId() {
return merchantId;
}
public void setMerchantId(String merchantId) {
this.merchantId = merchantId;
}
public String getMerchantName() {
return merchantName;
}
public void setMerchantName(String merchantName) {
this.merchantName = merchantName;
}
public String getMsgId() {
return msgId;
}
public void setMsgId(String msgId) {
this.msgId = msgId;
}
}
...@@ -8,6 +8,7 @@ import com.yanzuoguang.util.vo.InitDao; ...@@ -8,6 +8,7 @@ import com.yanzuoguang.util.vo.InitDao;
import java.io.Serializable; import java.io.Serializable;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.List;
/** /**
* @Author zhangjinyao * @Author zhangjinyao
......
package com.pangding.web.authority.vo;
import com.yanzuoguang.dao.TableAnnotation;
@TableAnnotation("pd_msg")
public class MsgVo {
/**
* 主键
*/
@TableAnnotation("id")
private String msgId;
@TableAnnotation("msg_title")
private String msgTitle;
@TableAnnotation("msg_content")
private String msgContent;
@TableAnnotation("msg_url")
private String msgUrl;
@TableAnnotation("msg_pic_url")
private String msgPicUrl;
@TableAnnotation("msg_type")
private int msgType;
@TableAnnotation("msg_status")
private int msgStatus;
@TableAnnotation("msg_sort")
private int msgSort;
public String getMsgId() {
return msgId;
}
public void setMsgId(String msgId) {
this.msgId = msgId;
}
public String getMsgTitle() {
return msgTitle;
}
public void setMsgTitle(String msgTitle) {
this.msgTitle = msgTitle;
}
public String getMsgUrl() {
return msgUrl;
}
public void setMsgUrl(String msgUrl) {
this.msgUrl = msgUrl;
}
public String getMsgPicUrl() {
return msgPicUrl;
}
public void setMsgPicUrl(String msgPicUrl) {
this.msgPicUrl = msgPicUrl;
}
public int getMsgType() {
return msgType;
}
public void setMsgType(int msgType) {
this.msgType = msgType;
}
public int getMsgStatus() {
return msgStatus;
}
public void setMsgStatus(int msgStatus) {
this.msgStatus = msgStatus;
}
public int getMsgSort() {
return msgSort;
}
public void setMsgSort(int msgSort) {
this.msgSort = msgSort;
}
public String getMsgContent() {
return msgContent;
}
public void setMsgContent(String msgContent) {
this.msgContent = msgContent;
}
}
...@@ -6,7 +6,7 @@ public class CompanyDivideReqVo { ...@@ -6,7 +6,7 @@ public class CompanyDivideReqVo {
public String companyId; public String companyId;
private List<String> companyIdList; private List<GetCompanyReqVo> companyIdList;
public String getCompanyId() { public String getCompanyId() {
return companyId; return companyId;
...@@ -16,13 +16,11 @@ public class CompanyDivideReqVo { ...@@ -16,13 +16,11 @@ public class CompanyDivideReqVo {
this.companyId = companyId; this.companyId = companyId;
} }
public List<String> getCompanyIdList() { public List<GetCompanyReqVo> getCompanyIdList() {
return companyIdList; return companyIdList;
} }
public void setCompanyIdList(List<String> companyIdList) { public void setCompanyIdList(List<GetCompanyReqVo> companyIdList) {
this.companyIdList = companyIdList; this.companyIdList = companyIdList;
} }
} }
package com.pangding.web.authority.vo.reqvo;
public class CompanyMsgReqVo {
private String companyId;
private int type;
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
}
package com.pangding.web.authority.vo.reqvo;
public class GetCompanyReqVo {
private String companyId;
private int companyChannelType;
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public int getCompanyChannelType() {
return companyChannelType;
}
public void setCompanyChannelType(int companyChannelType) {
this.companyChannelType = companyChannelType;
}
}
package com.pangding.web.authority.vo.reqvo; package com.pangding.web.authority.vo.reqvo;
import com.pangding.web.authority.vo.LoginVo; import com.pangding.web.authority.vo.LoginVo;
/** /**
* @Author zhangjinyao * @Author zhangjinyao
* @create 2019/5/14 11:46 * @create 2019/5/14 11:46
*/ */
public class LoginReqVo extends LoginVo{ public class LoginReqVo extends LoginVo {
private String reqId; private String reqId;
private String accountOrPhone; private String accountOrPhone;
...@@ -30,14 +32,6 @@ public class LoginReqVo extends LoginVo{ ...@@ -30,14 +32,6 @@ public class LoginReqVo extends LoginVo{
this.code = code; this.code = code;
} }
public String getReqId() {
return reqId;
}
public void setReqId(String reqId) {
this.reqId = reqId;
}
public String getAccountOrPhone() { public String getAccountOrPhone() {
return accountOrPhone; return accountOrPhone;
} }
...@@ -53,4 +47,12 @@ public class LoginReqVo extends LoginVo{ ...@@ -53,4 +47,12 @@ public class LoginReqVo extends LoginVo{
public void setPassword(String password) { public void setPassword(String password) {
this.password = password; this.password = password;
} }
public String getReqId() {
return reqId;
}
public void setReqId(String reqId) {
this.reqId = reqId;
}
} }
package com.pangding.web.authority.vo.reqvo; package com.pangding.web.authority.vo.reqvo;
import com.pangding.web.authority.vo.Merchant; import com.pangding.web.authority.vo.Merchant;
import com.sun.org.apache.xml.internal.security.Init;
import com.yanzuoguang.util.vo.InitDao;
/** /**
* @Author zhangjinyao * @Author zhangjinyao
......
package com.pangding.web.authority.vo.resvo;
import com.pangding.web.authority.vo.CompanyDivideRuleVo;
public class GetCompanyDivideResVo extends CompanyDivideRuleVo{
private int divideStatus;
private String companyName;
private String companyId;
private int companyChannelType;
public int getDivideStatus() {
return divideStatus;
}
public void setDivideStatus(int divideStatus) {
this.divideStatus = divideStatus;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
@Override
public String getCompanyId() {
return companyId;
}
@Override
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public int getCompanyChannelType() {
return companyChannelType;
}
public void setCompanyChannelType(int companyChannelType) {
this.companyChannelType = companyChannelType;
}
}
package com.pangding.web.authority.vo.resvo;
import com.pangding.web.authority.vo.MsgVo;
public class GetCompanyMsgResVo extends MsgVo{
private String companyId;
private String companyName;
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
}
package com.pangding.web.authority.vo.resvo;
import com.pangding.web.authority.vo.CompanyVo;
import java.util.List;
public class GetCompanyResVo extends CompanyVo {
private List<GetCompanyMsgResVo> msgList;
public List<GetCompanyMsgResVo> getMsgList() {
return msgList;
}
public void setMsgList(List<GetCompanyMsgResVo> msgList) {
this.msgList = msgList;
}
}
eureka:
client:
service-url:
defaultZone: http://register.pangdly.com/eureka/
yzg:
logAll: true
PrintSql: true
\ No newline at end of file
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