Commit 711e66e6 authored by youjj's avatar youjj

Merge branch 'base-modify' of http://10.5.52.3/youjj/cloud-platform into base-modify

# Conflicts:
#	xx-tour/xx-tour-api/pom.xml
#	xx-tour/xx-tour-server/src/main/java/com/xxfc/platform/tour/common/TourBaseController.java
#	xx-tour/xx-tour-server/src/main/java/com/xxfc/platform/tour/rest/TourGoodSpeController.java
#	xx-tour/xx-tour-server/src/main/resources/bootstrap.yml
#	xx-tour/xx-tour-server/src/main/resources/mapper/TourGoodMapper.xml
#	xx-tour/xx-tour-server/src/main/resources/mapper/TourGoodSpePriceMapper.xml
parents 87879a7c 1c48c5c5
......@@ -9,7 +9,7 @@ REDIS_TOKEN_TIME=604800
#session有效期
SESSION_TIME=3600
#默认头像
USER_HEADER_URL_DEFAULT=https://retail.xiaochengxucms.com/images/12/2018/11/fDK7kkrmkMReK50l4r1Le740Kmra8.jpg
USER_HEADER_URL_DEFAULT=https://xxtest.upyuns.com/image/app/default_%20avatar.png
#默认昵称
USER_NIKENAME_DEFAULT=XX_
#短信机
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.xxfc.common</groupId>
<artifactId>xx-common-platform</artifactId>
<version>2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.wxiaoqi</groupId>
<artifactId>ace-admin-api</artifactId>
</project>
\ No newline at end of file
package com.github.wxiaoqi.security.admin.constant;
/**
* ${DESCRIPTION}
*
* @author wanghaobin
* @create 2017-06-17 14:41
*/
public class AdminCommonConstant {
public final static int ROOT = -1;
public final static int DEFAULT_GROUP_TYPE = 0;
/**
* 权限关联类型
*/
public final static String AUTHORITY_TYPE_GROUP = "group";
/**
* 权限资源类型
*/
public final static String RESOURCE_TYPE_MENU = "menu";
public final static String RESOURCE_TYPE_BTN = "button";
public final static String RESOURCE_REQUEST_METHOD_GET = "GET";
public final static String RESOURCE_REQUEST_METHOD_PUT = "PUT";
public final static String RESOURCE_REQUEST_METHOD_DELETE = "DELETE";
public final static String RESOURCE_REQUEST_METHOD_POST = "POST";
public final static String RESOURCE_ACTION_VISIT = "访问";
public final static String BOOLEAN_NUMBER_FALSE = "0";
public final static String BOOLEAN_NUMBER_TRUE = "1";
}
package com.github.wxiaoqi.security.admin.constant;
public class RedisKey {
/**
*验证码key前缀
*/
public static final String CONSTANT_CODE_PREFIX ="cache:mobilecode:";
}
package com.github.wxiaoqi.security.admin.entity;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
/**
* @author keliii
*/
@Table(name = "app_user")
public class AppUser {
@Id
@GeneratedValue(generator = "JDBC")//此处加上注解
private Integer id;
private String username;
private String password;
private String name;
private String birthday;
private String address;
@Column(name = "mobile_phone")
private String mobilePhone;
@Column(name = "tel_phone")
private String telPhone;
private String email;
private String sex;
private String type;
@Column(name = "status")
private Integer status;
@Column(name = "zone_id")
private Integer zoneId;
@Column(name = "company_id")
private Integer companyId;
private String description;
@Column(name = "crt_time")
private Date crtTime;
@Column(name = "crt_user")
private String crtUser;
@Column(name = "crt_name")
private String crtName;
@Column(name = "crt_host")
private String crtHost;
@Column(name = "upd_time")
private Date updTime;
@Column(name = "upd_user")
private String updUser;
@Column(name = "upd_name")
private String updName;
@Column(name = "upd_host")
private String updHost;
@Column(name = "data_all")
private Integer dataAll;
@Column(name = "data_zone")
private String dataZone;
@Column(name = "data_company")
private String dataCompany;
private String attr1;
private String attr2;
private String attr3;
private String attr4;
private String attr5;
private String attr6;
private String attr7;
private String attr8;
/**
* @return id
*/
public Integer getId() {
return id;
}
/**
* @param id
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return username
*/
public String getUsername() {
return username;
}
/**
* @param username
*/
public void setUsername(String username) {
this.username = username;
}
/**
* @return password
*/
public String getPassword() {
return password;
}
/**
* @param password
*/
public void setPassword(String password) {
this.password = password;
}
/**
* @return name
*/
public String getName() {
return name;
}
/**
* @param name
*/
public void setName(String name) {
this.name = name;
}
/**
* @return birthday
*/
public String getBirthday() {
return birthday;
}
/**
* @param birthday
*/
public void setBirthday(String birthday) {
this.birthday = birthday;
}
/**
* @return address
*/
public String getAddress() {
return address;
}
/**
* @param address
*/
public void setAddress(String address) {
this.address = address;
}
/**
* @return mobile_phone
*/
public String getMobilePhone() {
return mobilePhone;
}
/**
* @param mobilePhone
*/
public void setMobilePhone(String mobilePhone) {
this.mobilePhone = mobilePhone;
}
/**
* @return tel_phone
*/
public String getTelPhone() {
return telPhone;
}
/**
* @param telPhone
*/
public void setTelPhone(String telPhone) {
this.telPhone = telPhone;
}
/**
* @return email
*/
public String getEmail() {
return email;
}
/**
* @param email
*/
public void setEmail(String email) {
this.email = email;
}
/**
* @return sex
*/
public String getSex() {
return sex;
}
/**
* @param sex
*/
public void setSex(String sex) {
this.sex = sex;
}
/**
* @return type
*/
public String getType() {
return type;
}
/**
* @param type
*/
public void setType(String type) {
this.type = type;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getZoneId() {
return zoneId;
}
public void setZoneId(Integer zoneId) {
this.zoneId = zoneId;
}
public Integer getCompanyId() {
return companyId;
}
public void setCompanyId(Integer companyId) {
this.companyId = companyId;
}
/**
* @return description
*/
public String getDescription() {
return description;
}
/**
* @param description
*/
public void setDescription(String description) {
this.description = description;
}
/**
* @return crt_time
*/
public Date getCrtTime() {
return crtTime;
}
/**
* @param crtTime
*/
public void setCrtTime(Date crtTime) {
this.crtTime = crtTime;
}
/**
* @return crt_user
*/
public String getCrtUser() {
return crtUser;
}
/**
* @param crtUser
*/
public void setCrtUser(String crtUser) {
this.crtUser = crtUser;
}
/**
* @return crt_name
*/
public String getCrtName() {
return crtName;
}
/**
* @param crtName
*/
public void setCrtName(String crtName) {
this.crtName = crtName;
}
/**
* @return crt_host
*/
public String getCrtHost() {
return crtHost;
}
/**
* @param crtHost
*/
public void setCrtHost(String crtHost) {
this.crtHost = crtHost;
}
/**
* @return upd_time
*/
public Date getUpdTime() {
return updTime;
}
/**
* @param updTime
*/
public void setUpdTime(Date updTime) {
this.updTime = updTime;
}
/**
* @return upd_user
*/
public String getUpdUser() {
return updUser;
}
/**
* @param updUser
*/
public void setUpdUser(String updUser) {
this.updUser = updUser;
}
/**
* @return upd_name
*/
public String getUpdName() {
return updName;
}
/**
* @param updName
*/
public void setUpdName(String updName) {
this.updName = updName;
}
/**
* @return upd_host
*/
public String getUpdHost() {
return updHost;
}
/**
* @param updHost
*/
public void setUpdHost(String updHost) {
this.updHost = updHost;
}
public Integer getDataAll() {
return dataAll;
}
public void setDataAll(Integer dataAll) {
this.dataAll = dataAll;
}
public String getDataZone() {
return dataZone;
}
public void setDataZone(String dataZone) {
this.dataZone = dataZone;
}
public String getDataCompany() {
return dataCompany;
}
public void setDataCompany(String dataCompany) {
this.dataCompany = dataCompany;
}
/**
* @return attr1
*/
public String getAttr1() {
return attr1;
}
/**
* @param attr1
*/
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
/**
* @return attr2
*/
public String getAttr2() {
return attr2;
}
/**
* @param attr2
*/
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
/**
* @return attr3
*/
public String getAttr3() {
return attr3;
}
/**
* @param attr3
*/
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
/**
* @return attr4
*/
public String getAttr4() {
return attr4;
}
/**
* @param attr4
*/
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
/**
* @return attr5
*/
public String getAttr5() {
return attr5;
}
/**
* @param attr5
*/
public void setAttr5(String attr5) {
this.attr5 = attr5;
}
/**
* @return attr6
*/
public String getAttr6() {
return attr6;
}
/**
* @param attr6
*/
public void setAttr6(String attr6) {
this.attr6 = attr6;
}
/**
* @return attr7
*/
public String getAttr7() {
return attr7;
}
/**
* @param attr7
*/
public void setAttr7(String attr7) {
this.attr7 = attr7;
}
/**
* @return attr8
*/
public String getAttr8() {
return attr8;
}
/**
* @param attr8
*/
public void setAttr8(String attr8) {
this.attr8 = attr8;
}
}
\ No newline at end of file
package com.github.wxiaoqi.security.admin.entity;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* 用户详情信息表
*/
@Table(name = "app_user_detail")
@Data
public class AppUserDetail {
@Id
@GeneratedValue(generator = "JDBC")
private int id;
private Integer userid;
@Column(name = "is_member")
private Integer isMember;
private String nickname;
private String realname;
private String headimgurl;
private String email;
private Integer sex;
private String birthday;
@Column(name = "person_sign")
private String personSign;
private String remark;
private Long createtime;
private Long updatetime;
private Integer isdel;
}
package com.github.wxiaoqi.security.admin.entity;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* 用户登录信息表
*/
@Table(name = "app_user_login")
@Data
public class AppUserLogin {
@Id
@GeneratedValue(generator = "JDBC")
private int id;
@Column(name = "im_userid")
private Integer imUserid;
private String username;
private String password;
@Column(name = "wx_openid")
private String wxOpenid;
private String unionid;
private String openid;
private Long createtime;
private Long updatetime;
private Integer isdel;
private Integer status;
@Column(name = "id_number")
private String idNumber;
@Column(name = "certification_status")
private Integer certificationStatus;
}
package com.github.wxiaoqi.security.admin.entity;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Table(name = "base_element")
public class Element {
@Id
private Integer id;
private String code;
private String type;
private String name;
private String uri;
@Column(name = "menu_id")
private String menuId;
@Column(name = "parent_id")
private String parentId;
private String path;
private String method;
private String description;
@Column(name = "crt_time")
private Date crtTime;
@Column(name = "crt_user")
private String crtUser;
@Column(name = "crt_name")
private String crtName;
@Column(name = "crt_host")
private String crtHost;
private String attr1;
private String attr2;
private String attr3;
private String attr4;
private String attr5;
private String attr6;
private String attr7;
private String attr8;
/**
* @return id
*/
public Integer getId() {
return id;
}
/**
* @param id
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return code
*/
public String getCode() {
return code;
}
/**
* @param code
*/
public void setCode(String code) {
this.code = code;
}
/**
* @return type
*/
public String getType() {
return type;
}
/**
* @param type
*/
public void setType(String type) {
this.type = type;
}
/**
* @return name
*/
public String getName() {
return name;
}
/**
* @param name
*/
public void setName(String name) {
this.name = name;
}
/**
* @return uri
*/
public String getUri() {
return uri;
}
/**
* @param uri
*/
public void setUri(String uri) {
this.uri = uri;
}
/**
* @return menu_id
*/
public String getMenuId() {
return menuId;
}
/**
* @param menuId
*/
public void setMenuId(String menuId) {
this.menuId = menuId;
}
/**
* @return parent_id
*/
public String getParentId() {
return parentId;
}
/**
* @param parentId
*/
public void setParentId(String parentId) {
this.parentId = parentId;
}
/**
* @return path
*/
public String getPath() {
return path;
}
/**
* @param path
*/
public void setPath(String path) {
this.path = path;
}
/**
* @return method
*/
public String getMethod() {
return method;
}
/**
* @param method
*/
public void setMethod(String method) {
this.method = method;
}
/**
* @return description
*/
public String getDescription() {
return description;
}
/**
* @param description
*/
public void setDescription(String description) {
this.description = description;
}
/**
* @return crt_time
*/
public Date getCrtTime() {
return crtTime;
}
/**
* @param crtTime
*/
public void setCrtTime(Date crtTime) {
this.crtTime = crtTime;
}
/**
* @return crt_user
*/
public String getCrtUser() {
return crtUser;
}
/**
* @param crtUser
*/
public void setCrtUser(String crtUser) {
this.crtUser = crtUser;
}
/**
* @return crt_name
*/
public String getCrtName() {
return crtName;
}
/**
* @param crtName
*/
public void setCrtName(String crtName) {
this.crtName = crtName;
}
/**
* @return crt_host
*/
public String getCrtHost() {
return crtHost;
}
/**
* @param crtHost
*/
public void setCrtHost(String crtHost) {
this.crtHost = crtHost;
}
/**
* @return attr1
*/
public String getAttr1() {
return attr1;
}
/**
* @param attr1
*/
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
/**
* @return attr2
*/
public String getAttr2() {
return attr2;
}
/**
* @param attr2
*/
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
/**
* @return attr3
*/
public String getAttr3() {
return attr3;
}
/**
* @param attr3
*/
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
/**
* @return attr4
*/
public String getAttr4() {
return attr4;
}
/**
* @param attr4
*/
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
/**
* @return attr5
*/
public String getAttr5() {
return attr5;
}
/**
* @param attr5
*/
public void setAttr5(String attr5) {
this.attr5 = attr5;
}
/**
* @return attr6
*/
public String getAttr6() {
return attr6;
}
/**
* @param attr6
*/
public void setAttr6(String attr6) {
this.attr6 = attr6;
}
/**
* @return attr7
*/
public String getAttr7() {
return attr7;
}
/**
* @param attr7
*/
public void setAttr7(String attr7) {
this.attr7 = attr7;
}
/**
* @return attr8
*/
public String getAttr8() {
return attr8;
}
/**
* @param attr8
*/
public void setAttr8(String attr8) {
this.attr8 = attr8;
}
}
\ No newline at end of file
package com.github.wxiaoqi.security.admin.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Table(name = "gate_log")
public class GateLog {
@Id
private Integer id;
private String menu;
private String opt;
private String uri;
private String body;
@Column(name = "crt_time")
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
private Date crtTime;
@Column(name = "crt_user")
private String crtUser;
@Column(name = "crt_name")
private String crtName;
@Column(name = "crt_host")
private String crtHost;
/**
* @return id
*/
public Integer getId() {
return id;
}
/**
* @param id
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return menu
*/
public String getMenu() {
return menu;
}
/**
* @param menu
*/
public void setMenu(String menu) {
this.menu = menu;
}
/**
* @return uri
*/
public String getUri() {
return uri;
}
/**
* @param uri
*/
public void setUri(String uri) {
this.uri = uri;
}
/**
* @return crt_time
*/
public Date getCrtTime() {
return crtTime;
}
/**
* @param crtTime
*/
public void setCrtTime(Date crtTime) {
this.crtTime = crtTime;
}
/**
* @return crt_user
*/
public String getCrtUser() {
return crtUser;
}
/**
* @param crtUser
*/
public void setCrtUser(String crtUser) {
this.crtUser = crtUser;
}
/**
* @return crt_name
*/
public String getCrtName() {
return crtName;
}
/**
* @param crtName
*/
public void setCrtName(String crtName) {
this.crtName = crtName;
}
/**
* @return crt_host
*/
public String getCrtHost() {
return crtHost;
}
/**
* @param crtHost
*/
public void setCrtHost(String crtHost) {
this.crtHost = crtHost;
}
public String getOpt() {
return opt;
}
public void setOpt(String opt) {
this.opt = opt;
}
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
}
\ No newline at end of file
package com.github.wxiaoqi.security.admin.entity;
import com.github.wxiaoqi.security.admin.constant.AdminCommonConstant;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Table(name = "base_group")
public class Group {
@Id
private Integer id;
private String code;
private String name;
@Column(name = "parent_id")
private Integer parentId;
private String path;
private String type;
@Column(name = "group_type")
private Integer groupType = AdminCommonConstant.DEFAULT_GROUP_TYPE;
private String description;
@Column(name = "crt_time")
private Date crtTime;
@Column(name = "crt_user")
private String crtUser;
@Column(name = "crt_name")
private String crtName;
@Column(name = "crt_host")
private String crtHost;
@Column(name = "upd_time")
private Date updTime;
@Column(name = "upd_user")
private String updUser;
@Column(name = "upd_name")
private String updName;
@Column(name = "upd_host")
private String updHost;
private String attr1;
private String attr2;
private String attr3;
private String attr4;
private String attr5;
private String attr6;
private String attr7;
private String attr8;
/**
* @return id
*/
public Integer getId() {
return id;
}
/**
* @param id
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return code
*/
public String getCode() {
return code;
}
/**
* @param code
*/
public void setCode(String code) {
this.code = code;
}
/**
* @return name
*/
public String getName() {
return name;
}
/**
* @param name
*/
public void setName(String name) {
this.name = name;
}
/**
* @return parent_id
*/
public Integer getParentId() {
return parentId;
}
/**
* @param parentId
*/
public void setParentId(Integer parentId) {
this.parentId = parentId;
}
/**
* @return path
*/
public String getPath() {
return path;
}
/**
* @param path
*/
public void setPath(String path) {
this.path = path;
}
/**
* @return type
*/
public String getType() {
return type;
}
/**
* @param type
*/
public void setType(String type) {
this.type = type;
}
/**
* @return group_type
*/
public Integer getGroupType() {
return groupType;
}
/**
* @param groupType
*/
public void setGroupType(Integer groupType) {
this.groupType = groupType;
}
/**
* @return description
*/
public String getDescription() {
return description;
}
/**
* @param description
*/
public void setDescription(String description) {
this.description = description;
}
/**
* @return crt_time
*/
public Date getCrtTime() {
return crtTime;
}
/**
* @param crtTime
*/
public void setCrtTime(Date crtTime) {
this.crtTime = crtTime;
}
/**
* @return crt_user
*/
public String getCrtUser() {
return crtUser;
}
/**
* @param crtUser
*/
public void setCrtUser(String crtUser) {
this.crtUser = crtUser;
}
/**
* @return crt_name
*/
public String getCrtName() {
return crtName;
}
/**
* @param crtName
*/
public void setCrtName(String crtName) {
this.crtName = crtName;
}
/**
* @return crt_host
*/
public String getCrtHost() {
return crtHost;
}
/**
* @param crtHost
*/
public void setCrtHost(String crtHost) {
this.crtHost = crtHost;
}
/**
* @return upd_time
*/
public Date getUpdTime() {
return updTime;
}
/**
* @param updTime
*/
public void setUpdTime(Date updTime) {
this.updTime = updTime;
}
/**
* @return upd_user
*/
public String getUpdUser() {
return updUser;
}
/**
* @param updUser
*/
public void setUpdUser(String updUser) {
this.updUser = updUser;
}
/**
* @return upd_name
*/
public String getUpdName() {
return updName;
}
/**
* @param updName
*/
public void setUpdName(String updName) {
this.updName = updName;
}
/**
* @return upd_host
*/
public String getUpdHost() {
return updHost;
}
/**
* @param updHost
*/
public void setUpdHost(String updHost) {
this.updHost = updHost;
}
/**
* @return attr1
*/
public String getAttr1() {
return attr1;
}
/**
* @param attr1
*/
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
/**
* @return attr2
*/
public String getAttr2() {
return attr2;
}
/**
* @param attr2
*/
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
/**
* @return attr3
*/
public String getAttr3() {
return attr3;
}
/**
* @param attr3
*/
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
/**
* @return attr4
*/
public String getAttr4() {
return attr4;
}
/**
* @param attr4
*/
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
/**
* @return attr5
*/
public String getAttr5() {
return attr5;
}
/**
* @param attr5
*/
public void setAttr5(String attr5) {
this.attr5 = attr5;
}
/**
* @return attr6
*/
public String getAttr6() {
return attr6;
}
/**
* @param attr6
*/
public void setAttr6(String attr6) {
this.attr6 = attr6;
}
/**
* @return attr7
*/
public String getAttr7() {
return attr7;
}
/**
* @param attr7
*/
public void setAttr7(String attr7) {
this.attr7 = attr7;
}
/**
* @return attr8
*/
public String getAttr8() {
return attr8;
}
/**
* @param attr8
*/
public void setAttr8(String attr8) {
this.attr8 = attr8;
}
}
\ No newline at end of file
package com.github.wxiaoqi.security.admin.entity;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Table(name = "base_group_type")
public class GroupType {
@Id
private Integer id;
private String code;
private String name;
private String description;
@Column(name = "crt_time")
private Date crtTime;
@Column(name = "crt_user")
private String crtUser;
@Column(name = "crt_name")
private String crtName;
@Column(name = "crt_host")
private String crtHost;
@Column(name = "upd_time")
private Date updTime;
@Column(name = "upd_user")
private String updUser;
@Column(name = "upd_name")
private String updName;
@Column(name = "upd_host")
private String updHost;
private String attr1;
private String attr2;
private String attr3;
private String attr4;
private String attr5;
private String attr6;
private String attr7;
private String attr8;
/**
* @return id
*/
public Integer getId() {
return id;
}
/**
* @param id
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return code
*/
public String getCode() {
return code;
}
/**
* @param code
*/
public void setCode(String code) {
this.code = code;
}
/**
* @return name
*/
public String getName() {
return name;
}
/**
* @param name
*/
public void setName(String name) {
this.name = name;
}
/**
* @return description
*/
public String getDescription() {
return description;
}
/**
* @param description
*/
public void setDescription(String description) {
this.description = description;
}
/**
* @return crt_time
*/
public Date getCrtTime() {
return crtTime;
}
/**
* @param crtTime
*/
public void setCrtTime(Date crtTime) {
this.crtTime = crtTime;
}
/**
* @return crt_user
*/
public String getCrtUser() {
return crtUser;
}
/**
* @param crtUser
*/
public void setCrtUser(String crtUser) {
this.crtUser = crtUser;
}
/**
* @return crt_name
*/
public String getCrtName() {
return crtName;
}
/**
* @param crtName
*/
public void setCrtName(String crtName) {
this.crtName = crtName;
}
/**
* @return crt_host
*/
public String getCrtHost() {
return crtHost;
}
/**
* @param crtHost
*/
public void setCrtHost(String crtHost) {
this.crtHost = crtHost;
}
/**
* @return upd_time
*/
public Date getUpdTime() {
return updTime;
}
/**
* @param updTime
*/
public void setUpdTime(Date updTime) {
this.updTime = updTime;
}
/**
* @return upd_user
*/
public String getUpdUser() {
return updUser;
}
/**
* @param updUser
*/
public void setUpdUser(String updUser) {
this.updUser = updUser;
}
/**
* @return upd_name
*/
public String getUpdName() {
return updName;
}
/**
* @param updName
*/
public void setUpdName(String updName) {
this.updName = updName;
}
/**
* @return upd_host
*/
public String getUpdHost() {
return updHost;
}
/**
* @param updHost
*/
public void setUpdHost(String updHost) {
this.updHost = updHost;
}
/**
* @return attr1
*/
public String getAttr1() {
return attr1;
}
/**
* @param attr1
*/
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
/**
* @return attr2
*/
public String getAttr2() {
return attr2;
}
/**
* @param attr2
*/
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
/**
* @return attr3
*/
public String getAttr3() {
return attr3;
}
/**
* @param attr3
*/
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
/**
* @return attr4
*/
public String getAttr4() {
return attr4;
}
/**
* @param attr4
*/
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
/**
* @return attr5
*/
public String getAttr5() {
return attr5;
}
/**
* @param attr5
*/
public void setAttr5(String attr5) {
this.attr5 = attr5;
}
/**
* @return attr6
*/
public String getAttr6() {
return attr6;
}
/**
* @param attr6
*/
public void setAttr6(String attr6) {
this.attr6 = attr6;
}
/**
* @return attr7
*/
public String getAttr7() {
return attr7;
}
/**
* @param attr7
*/
public void setAttr7(String attr7) {
this.attr7 = attr7;
}
/**
* @return attr8
*/
public String getAttr8() {
return attr8;
}
/**
* @param attr8
*/
public void setAttr8(String attr8) {
this.attr8 = attr8;
}
}
\ No newline at end of file
package com.github.wxiaoqi.security.admin.entity;
import com.github.wxiaoqi.security.admin.constant.AdminCommonConstant;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Table(name = "base_menu")
public class Menu {
@Id
private Integer id;
private String code;
private String title;
@Column(name = "parent_id")
private Integer parentId = AdminCommonConstant.ROOT;
private String href;
private String icon;
private String type;
private String description;
@Column(name = "crt_time")
private Date crtTime;
@Column(name = "crt_user")
private String crtUser;
@Column(name = "crt_name")
private String crtName;
@Column(name = "crt_host")
private String crtHost;
@Column(name = "upd_time")
private Date updTime;
@Column(name = "upd_user")
private String updUser;
@Column(name = "upd_name")
private String updName;
@Column(name = "upd_host")
private String updHost;
private String attr1;
private String attr2;
private String attr3;
private String attr4;
private String attr5;
private String attr6;
private String attr7;
private String attr8;
private String path;
/**
* @return id
*/
public Integer getId() {
return id;
}
/**
* @param id
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return code
*/
public String getCode() {
return code;
}
/**
* @param code
*/
public void setCode(String code) {
this.code = code;
}
/**
* @return title
*/
public String getTitle() {
return title;
}
/**
* @param title
*/
public void setTitle(String title) {
this.title = title;
}
/**
* @return parent_id
*/
public Integer getParentId() {
return parentId;
}
/**
* @param parentId
*/
public void setParentId(Integer parentId) {
this.parentId = parentId;
}
/**
* @return href
*/
public String getHref() {
return href;
}
/**
* @param href
*/
public void setHref(String href) {
this.href = href;
}
/**
* @return icon
*/
public String getIcon() {
return icon;
}
/**
* @param icon
*/
public void setIcon(String icon) {
this.icon = icon;
}
/**
* @return type
*/
public String getType() {
return type;
}
/**
* @param type
*/
public void setType(String type) {
this.type = type;
}
/**
* @return description
*/
public String getDescription() {
return description;
}
/**
* @param description
*/
public void setDescription(String description) {
this.description = description;
}
/**
* @return crt_time
*/
public Date getCrtTime() {
return crtTime;
}
/**
* @param crtTime
*/
public void setCrtTime(Date crtTime) {
this.crtTime = crtTime;
}
/**
* @return crt_user
*/
public String getCrtUser() {
return crtUser;
}
/**
* @param crtUser
*/
public void setCrtUser(String crtUser) {
this.crtUser = crtUser;
}
/**
* @return crt_name
*/
public String getCrtName() {
return crtName;
}
/**
* @param crtName
*/
public void setCrtName(String crtName) {
this.crtName = crtName;
}
/**
* @return crt_host
*/
public String getCrtHost() {
return crtHost;
}
/**
* @param crtHost
*/
public void setCrtHost(String crtHost) {
this.crtHost = crtHost;
}
/**
* @return upd_time
*/
public Date getUpdTime() {
return updTime;
}
/**
* @param updTime
*/
public void setUpdTime(Date updTime) {
this.updTime = updTime;
}
/**
* @return upd_user
*/
public String getUpdUser() {
return updUser;
}
/**
* @param updUser
*/
public void setUpdUser(String updUser) {
this.updUser = updUser;
}
/**
* @return upd_name
*/
public String getUpdName() {
return updName;
}
/**
* @param updName
*/
public void setUpdName(String updName) {
this.updName = updName;
}
/**
* @return upd_host
*/
public String getUpdHost() {
return updHost;
}
/**
* @param updHost
*/
public void setUpdHost(String updHost) {
this.updHost = updHost;
}
/**
* @return attr1
*/
public String getAttr1() {
return attr1;
}
/**
* @param attr1
*/
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
/**
* @return attr2
*/
public String getAttr2() {
return attr2;
}
/**
* @param attr2
*/
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
/**
* @return attr3
*/
public String getAttr3() {
return attr3;
}
/**
* @param attr3
*/
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
/**
* @return attr4
*/
public String getAttr4() {
return attr4;
}
/**
* @param attr4
*/
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
/**
* @return attr5
*/
public String getAttr5() {
return attr5;
}
/**
* @param attr5
*/
public void setAttr5(String attr5) {
this.attr5 = attr5;
}
/**
* @return attr6
*/
public String getAttr6() {
return attr6;
}
/**
* @param attr6
*/
public void setAttr6(String attr6) {
this.attr6 = attr6;
}
/**
* @return attr7
*/
public String getAttr7() {
return attr7;
}
/**
* @param attr7
*/
public void setAttr7(String attr7) {
this.attr7 = attr7;
}
/**
* @return attr8
*/
public String getAttr8() {
return attr8;
}
/**
* @param attr8
*/
public void setAttr8(String attr8) {
this.attr8 = attr8;
}
/**
* @return path
*/
public String getPath() {
return path;
}
/**
* @param path
*/
public void setPath(String path) {
this.path = path;
}
}
\ No newline at end of file
package com.github.wxiaoqi.security.admin.entity;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Table(name = "base_resource_authority")
public class ResourceAuthority {
@Id
private Integer id;
@Column(name = "authority_id")
private String authorityId;
@Column(name = "authority_type")
private String authorityType;
@Column(name = "resource_id")
private String resourceId;
@Column(name = "resource_type")
private String resourceType;
@Column(name = "parent_id")
private String parentId;
private String path;
private String description;
@Column(name = "crt_time")
private Date crtTime;
@Column(name = "crt_user")
private String crtUser;
@Column(name = "crt_name")
private String crtName;
@Column(name = "crt_host")
private String crtHost;
private String attr1;
private String attr2;
private String attr3;
private String attr4;
private String attr5;
private String attr6;
private String attr7;
private String attr8;
public ResourceAuthority(String authorityType, String resourceType) {
this.authorityType = authorityType;
this.resourceType = resourceType;
}
public ResourceAuthority() {
}
/**
* @return id
*/
public Integer getId() {
return id;
}
/**
* @param id
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return authority_id
*/
public String getAuthorityId() {
return authorityId;
}
/**
* @param authorityId
*/
public void setAuthorityId(String authorityId) {
this.authorityId = authorityId;
}
/**
* @return authority_type
*/
public String getAuthorityType() {
return authorityType;
}
/**
* @param authorityType
*/
public void setAuthorityType(String authorityType) {
this.authorityType = authorityType;
}
/**
* @return resource_id
*/
public String getResourceId() {
return resourceId;
}
/**
* @param resourceId
*/
public void setResourceId(String resourceId) {
this.resourceId = resourceId;
}
/**
* @return resource_type
*/
public String getResourceType() {
return resourceType;
}
/**
* @param resourceType
*/
public void setResourceType(String resourceType) {
this.resourceType = resourceType;
}
/**
* @return parent_id
*/
public String getParentId() {
return parentId;
}
/**
* @param parentId
*/
public void setParentId(String parentId) {
this.parentId = parentId;
}
/**
* @return path
*/
public String getPath() {
return path;
}
/**
* @param path
*/
public void setPath(String path) {
this.path = path;
}
/**
* @return description
*/
public String getDescription() {
return description;
}
/**
* @param description
*/
public void setDescription(String description) {
this.description = description;
}
/**
* @return crt_time
*/
public Date getCrtTime() {
return crtTime;
}
/**
* @param crtTime
*/
public void setCrtTime(Date crtTime) {
this.crtTime = crtTime;
}
/**
* @return crt_user
*/
public String getCrtUser() {
return crtUser;
}
/**
* @param crtUser
*/
public void setCrtUser(String crtUser) {
this.crtUser = crtUser;
}
/**
* @return crt_name
*/
public String getCrtName() {
return crtName;
}
/**
* @param crtName
*/
public void setCrtName(String crtName) {
this.crtName = crtName;
}
/**
* @return crt_host
*/
public String getCrtHost() {
return crtHost;
}
/**
* @param crtHost
*/
public void setCrtHost(String crtHost) {
this.crtHost = crtHost;
}
/**
* @return attr1
*/
public String getAttr1() {
return attr1;
}
/**
* @param attr1
*/
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
/**
* @return attr2
*/
public String getAttr2() {
return attr2;
}
/**
* @param attr2
*/
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
/**
* @return attr3
*/
public String getAttr3() {
return attr3;
}
/**
* @param attr3
*/
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
/**
* @return attr4
*/
public String getAttr4() {
return attr4;
}
/**
* @param attr4
*/
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
/**
* @return attr5
*/
public String getAttr5() {
return attr5;
}
/**
* @param attr5
*/
public void setAttr5(String attr5) {
this.attr5 = attr5;
}
/**
* @return attr6
*/
public String getAttr6() {
return attr6;
}
/**
* @param attr6
*/
public void setAttr6(String attr6) {
this.attr6 = attr6;
}
/**
* @return attr7
*/
public String getAttr7() {
return attr7;
}
/**
* @param attr7
*/
public void setAttr7(String attr7) {
this.attr7 = attr7;
}
/**
* @return attr8
*/
public String getAttr8() {
return attr8;
}
/**
* @param attr8
*/
public void setAttr8(String attr8) {
this.attr8 = attr8;
}
}
\ No newline at end of file
package com.github.wxiaoqi.security.admin.entity;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Table(name = "base_user")
public class User {
@Id
@GeneratedValue(generator = "JDBC")//此处加上注解
private Integer id;
private String username;
private String password;
private String name;
private String birthday;
private String address;
@Column(name = "mobile_phone")
private String mobilePhone;
@Column(name = "tel_phone")
private String telPhone;
private String email;
private String sex;
private String type;
@Column(name = "status")
private Integer status;
@Column(name = "zone_id")
private Integer zoneId;
@Column(name = "company_id")
private Integer companyId;
private String description;
@Column(name = "crt_time")
private Date crtTime;
@Column(name = "crt_user")
private String crtUser;
@Column(name = "crt_name")
private String crtName;
@Column(name = "crt_host")
private String crtHost;
@Column(name = "upd_time")
private Date updTime;
@Column(name = "upd_user")
private String updUser;
@Column(name = "upd_name")
private String updName;
@Column(name = "upd_host")
private String updHost;
@Column(name = "data_all")
private Integer dataAll;
@Column(name = "data_zone")
private String dataZone;
@Column(name = "data_company")
private String dataCompany;
private String attr1;
private String attr2;
private String attr3;
private String attr4;
private String attr5;
private String attr6;
private String attr7;
private String attr8;
/**
* @return id
*/
public Integer getId() {
return id;
}
/**
* @param id
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return username
*/
public String getUsername() {
return username;
}
/**
* @param username
*/
public void setUsername(String username) {
this.username = username;
}
/**
* @return password
*/
public String getPassword() {
return password;
}
/**
* @param password
*/
public void setPassword(String password) {
this.password = password;
}
/**
* @return name
*/
public String getName() {
return name;
}
/**
* @param name
*/
public void setName(String name) {
this.name = name;
}
/**
* @return birthday
*/
public String getBirthday() {
return birthday;
}
/**
* @param birthday
*/
public void setBirthday(String birthday) {
this.birthday = birthday;
}
/**
* @return address
*/
public String getAddress() {
return address;
}
/**
* @param address
*/
public void setAddress(String address) {
this.address = address;
}
/**
* @return mobile_phone
*/
public String getMobilePhone() {
return mobilePhone;
}
/**
* @param mobilePhone
*/
public void setMobilePhone(String mobilePhone) {
this.mobilePhone = mobilePhone;
}
/**
* @return tel_phone
*/
public String getTelPhone() {
return telPhone;
}
/**
* @param telPhone
*/
public void setTelPhone(String telPhone) {
this.telPhone = telPhone;
}
/**
* @return email
*/
public String getEmail() {
return email;
}
/**
* @param email
*/
public void setEmail(String email) {
this.email = email;
}
/**
* @return sex
*/
public String getSex() {
return sex;
}
/**
* @param sex
*/
public void setSex(String sex) {
this.sex = sex;
}
/**
* @return type
*/
public String getType() {
return type;
}
/**
* @param type
*/
public void setType(String type) {
this.type = type;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getZoneId() {
return zoneId;
}
public void setZoneId(Integer zoneId) {
this.zoneId = zoneId;
}
public Integer getCompanyId() {
return companyId;
}
public void setCompanyId(Integer companyId) {
this.companyId = companyId;
}
/**
* @return description
*/
public String getDescription() {
return description;
}
/**
* @param description
*/
public void setDescription(String description) {
this.description = description;
}
/**
* @return crt_time
*/
public Date getCrtTime() {
return crtTime;
}
/**
* @param crtTime
*/
public void setCrtTime(Date crtTime) {
this.crtTime = crtTime;
}
/**
* @return crt_user
*/
public String getCrtUser() {
return crtUser;
}
/**
* @param crtUser
*/
public void setCrtUser(String crtUser) {
this.crtUser = crtUser;
}
/**
* @return crt_name
*/
public String getCrtName() {
return crtName;
}
/**
* @param crtName
*/
public void setCrtName(String crtName) {
this.crtName = crtName;
}
/**
* @return crt_host
*/
public String getCrtHost() {
return crtHost;
}
/**
* @param crtHost
*/
public void setCrtHost(String crtHost) {
this.crtHost = crtHost;
}
/**
* @return upd_time
*/
public Date getUpdTime() {
return updTime;
}
/**
* @param updTime
*/
public void setUpdTime(Date updTime) {
this.updTime = updTime;
}
/**
* @return upd_user
*/
public String getUpdUser() {
return updUser;
}
/**
* @param updUser
*/
public void setUpdUser(String updUser) {
this.updUser = updUser;
}
/**
* @return upd_name
*/
public String getUpdName() {
return updName;
}
/**
* @param updName
*/
public void setUpdName(String updName) {
this.updName = updName;
}
/**
* @return upd_host
*/
public String getUpdHost() {
return updHost;
}
/**
* @param updHost
*/
public void setUpdHost(String updHost) {
this.updHost = updHost;
}
public Integer getDataAll() {
return dataAll;
}
public void setDataAll(Integer dataAll) {
this.dataAll = dataAll;
}
public String getDataZone() {
return dataZone;
}
public void setDataZone(String dataZone) {
this.dataZone = dataZone;
}
public String getDataCompany() {
return dataCompany;
}
public void setDataCompany(String dataCompany) {
this.dataCompany = dataCompany;
}
/**
* @return attr1
*/
public String getAttr1() {
return attr1;
}
/**
* @param attr1
*/
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
/**
* @return attr2
*/
public String getAttr2() {
return attr2;
}
/**
* @param attr2
*/
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
/**
* @return attr3
*/
public String getAttr3() {
return attr3;
}
/**
* @param attr3
*/
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
/**
* @return attr4
*/
public String getAttr4() {
return attr4;
}
/**
* @param attr4
*/
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
/**
* @return attr5
*/
public String getAttr5() {
return attr5;
}
/**
* @param attr5
*/
public void setAttr5(String attr5) {
this.attr5 = attr5;
}
/**
* @return attr6
*/
public String getAttr6() {
return attr6;
}
/**
* @param attr6
*/
public void setAttr6(String attr6) {
this.attr6 = attr6;
}
/**
* @return attr7
*/
public String getAttr7() {
return attr7;
}
/**
* @param attr7
*/
public void setAttr7(String attr7) {
this.attr7 = attr7;
}
/**
* @return attr8
*/
public String getAttr8() {
return attr8;
}
/**
* @param attr8
*/
public void setAttr8(String attr8) {
this.attr8 = attr8;
}
}
\ No newline at end of file
package com.github.wxiaoqi.security.admin.feign;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* ${DESCRIPTION}
*
* @author wanghaobin
* @create 2017-06-21 8:11
*/
@FeignClient(value = "ace-admin")
public interface UserFeign {
@RequestMapping(value = "/public/app/userinfo-by-token")
public ObjectRestResponse<AppUserDTO> userDetailByToken(@RequestParam("token") String token);
}
package com.github.wxiaoqi.security.admin.feign.dto;
import lombok.Data;
/**
* 用户详情信息表
*/
@Data
public class AppUserDTO {
private Integer id;
private Integer userid;
private Integer isMember;
private String nickname;
private String realname;
private String headimgurl;
private String email;
private Integer sex;
private String birthday;
private String personSign;
private String remark;
private Long createtime;
private Long updatetime;
private Integer isdel;
}
......@@ -30,6 +30,10 @@
<pagehelper.version>4.1.1</pagehelper.version>
</properties>
<dependencies>
<!-- <dependency>-->
<!-- <groupId>com.github.wxiaoqi</groupId>-->
<!-- <artifactId>ace-admin-api</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>com.github.wxiaoqi</groupId>
<artifactId>ace-common</artifactId>
......
......@@ -16,5 +16,6 @@
<module>ace-interface</module>
<module>ace-generator</module>
<module>ace-tool</module>
<module>ace-admin-api</module>
</modules>
</project>
\ No newline at end of file
package com.github.wxiaoqi.security.admin.entity;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Table(name = "base_user")
public class User {
@Id
@GeneratedValue(generator = "JDBC")//此处加上注解
private Integer id;
private String username;
private String password;
private String name;
private String birthday;
private String address;
@Column(name = "mobile_phone")
private String mobilePhone;
@Column(name = "tel_phone")
private String telPhone;
private String email;
private String sex;
private String type;
@Column(name = "status")
private Integer status;
@Column(name = "zone_id")
private Integer zoneId;
@Column(name = "company_id")
private Integer companyId;
private String description;
@Column(name = "crt_time")
private Date crtTime;
@Column(name = "crt_user")
private String crtUser;
@Column(name = "crt_name")
private String crtName;
@Column(name = "crt_host")
private String crtHost;
@Column(name = "upd_time")
private Date updTime;
@Column(name = "upd_user")
private String updUser;
@Column(name = "upd_name")
private String updName;
@Column(name = "upd_host")
private String updHost;
@Column(name = "data_all")
private Integer dataAll;
@Column(name = "data_zone")
private String dataZone;
@Column(name = "data_company")
private String dataCompany;
private String attr1;
private String attr2;
private String attr3;
private String attr4;
private String attr5;
private String attr6;
private String attr7;
private String attr8;
/**
* @return id
*/
public Integer getId() {
return id;
}
/**
* @param id
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return username
*/
public String getUsername() {
return username;
}
/**
* @param username
*/
public void setUsername(String username) {
this.username = username;
}
/**
* @return password
*/
public String getPassword() {
return password;
}
/**
* @param password
*/
public void setPassword(String password) {
this.password = password;
}
/**
* @return name
*/
public String getName() {
return name;
}
/**
* @param name
*/
public void setName(String name) {
this.name = name;
}
/**
* @return birthday
*/
public String getBirthday() {
return birthday;
}
/**
* @param birthday
*/
public void setBirthday(String birthday) {
this.birthday = birthday;
}
/**
* @return address
*/
public String getAddress() {
return address;
}
/**
* @param address
*/
public void setAddress(String address) {
this.address = address;
}
/**
* @return mobile_phone
*/
public String getMobilePhone() {
return mobilePhone;
}
/**
* @param mobilePhone
*/
public void setMobilePhone(String mobilePhone) {
this.mobilePhone = mobilePhone;
}
/**
* @return tel_phone
*/
public String getTelPhone() {
return telPhone;
}
/**
* @param telPhone
*/
public void setTelPhone(String telPhone) {
this.telPhone = telPhone;
}
/**
* @return email
*/
public String getEmail() {
return email;
}
/**
* @param email
*/
public void setEmail(String email) {
this.email = email;
}
/**
* @return sex
*/
public String getSex() {
return sex;
}
/**
* @param sex
*/
public void setSex(String sex) {
this.sex = sex;
}
/**
* @return type
*/
public String getType() {
return type;
}
/**
* @param type
*/
public void setType(String type) {
this.type = type;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getZoneId() {
return zoneId;
}
public void setZoneId(Integer zoneId) {
this.zoneId = zoneId;
}
public Integer getCompanyId() {
return companyId;
}
public void setCompanyId(Integer companyId) {
this.companyId = companyId;
}
/**
* @return description
*/
public String getDescription() {
return description;
}
/**
* @param description
*/
public void setDescription(String description) {
this.description = description;
}
/**
* @return crt_time
*/
public Date getCrtTime() {
return crtTime;
}
/**
* @param crtTime
*/
public void setCrtTime(Date crtTime) {
this.crtTime = crtTime;
}
/**
* @return crt_user
*/
public String getCrtUser() {
return crtUser;
}
/**
* @param crtUser
*/
public void setCrtUser(String crtUser) {
this.crtUser = crtUser;
}
/**
* @return crt_name
*/
public String getCrtName() {
return crtName;
}
/**
* @param crtName
*/
public void setCrtName(String crtName) {
this.crtName = crtName;
}
/**
* @return crt_host
*/
public String getCrtHost() {
return crtHost;
}
/**
* @param crtHost
*/
public void setCrtHost(String crtHost) {
this.crtHost = crtHost;
}
/**
* @return upd_time
*/
public Date getUpdTime() {
return updTime;
}
/**
* @param updTime
*/
public void setUpdTime(Date updTime) {
this.updTime = updTime;
}
/**
* @return upd_user
*/
public String getUpdUser() {
return updUser;
}
/**
* @param updUser
*/
public void setUpdUser(String updUser) {
this.updUser = updUser;
}
/**
* @return upd_name
*/
public String getUpdName() {
return updName;
}
/**
* @param updName
*/
public void setUpdName(String updName) {
this.updName = updName;
}
/**
* @return upd_host
*/
public String getUpdHost() {
return updHost;
}
/**
* @param updHost
*/
public void setUpdHost(String updHost) {
this.updHost = updHost;
}
public Integer getDataAll() {
return dataAll;
}
public void setDataAll(Integer dataAll) {
this.dataAll = dataAll;
}
public String getDataZone() {
return dataZone;
}
public void setDataZone(String dataZone) {
this.dataZone = dataZone;
}
public String getDataCompany() {
return dataCompany;
}
public void setDataCompany(String dataCompany) {
this.dataCompany = dataCompany;
}
/**
* @return attr1
*/
public String getAttr1() {
return attr1;
}
/**
* @param attr1
*/
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
/**
* @return attr2
*/
public String getAttr2() {
return attr2;
}
/**
* @param attr2
*/
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
/**
* @return attr3
*/
public String getAttr3() {
return attr3;
}
/**
* @param attr3
*/
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
/**
* @return attr4
*/
public String getAttr4() {
return attr4;
}
/**
* @param attr4
*/
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
/**
* @return attr5
*/
public String getAttr5() {
return attr5;
}
/**
* @param attr5
*/
public void setAttr5(String attr5) {
this.attr5 = attr5;
}
/**
* @return attr6
*/
public String getAttr6() {
return attr6;
}
/**
* @param attr6
*/
public void setAttr6(String attr6) {
this.attr6 = attr6;
}
/**
* @return attr7
*/
public String getAttr7() {
return attr7;
}
/**
* @param attr7
*/
public void setAttr7(String attr7) {
this.attr7 = attr7;
}
/**
* @return attr8
*/
public String getAttr8() {
return attr8;
}
/**
* @param attr8
*/
public void setAttr8(String attr8) {
this.attr8 = attr8;
}
}
\ No newline at end of file
......@@ -118,5 +118,5 @@ public class OrderTourDetail implements Serializable {
//具体商品(商品项)id
@Column(name = "spe_price_id")
@ApiModelProperty(value = "具体商品(商品项)id")
private String spePriceId;
private Integer spePriceId;
}
......@@ -12,4 +12,5 @@ public class RentVehicleBO extends OrderRentVehicleDetail implements OrderDetail
private BaseOrder order;
private VehicleModel vehicleModel;
private BookVehicleVO bookVehicleVO;
private Integer damageSafe;
}
package com.xxfc.platform.order.pojo.order;
import com.github.wxiaoqi.security.admin.entity.User;
import com.xxfc.platform.order.entity.BaseOrder;
import com.xxfc.platform.order.entity.OrderRentVehicleDetail;
import com.xxfc.platform.order.entity.OrderTourDetail;
import com.xxfc.platform.order.entity.inter.OrderDetail;
import com.xxfc.platform.tour.entity.TourGood;
import com.xxfc.platform.tour.entity.TourUser;
import com.xxfc.platform.vehicle.entity.VehicleModel;
import lombok.Data;
......@@ -13,7 +15,9 @@ import java.util.List;
@Data
public class TourBO extends OrderTourDetail implements OrderDetail {
private BaseOrder order;
TourGood tourGood;
List<TourUser> tourUsers;
Integer number;
Integer childNumber;
User user;
}
......@@ -11,6 +11,8 @@ public class RentVehiclePriceVO extends OrderPriceVO{
BigDecimal vehicleAmount;
@ApiModelProperty(value = "司机价格")
BigDecimal driverAmount;
@ApiModelProperty(value = "免赔付价格")
BigDecimal damageSafeAmount;
@ApiModelProperty(value = "押金价格")
BigDecimal deposit;
@ApiModelProperty(value = "天数")
......@@ -25,6 +27,8 @@ public class RentVehiclePriceVO extends OrderPriceVO{
BigDecimal modelAmount;
@ApiModelProperty(value = "司机单价")
BigDecimal driverPrice;
@ApiModelProperty(value = "免赔付单价")
BigDecimal damageSafePrice;
@ApiModelProperty(value = "费用详情")
private String costDetail;
}
......@@ -7,24 +7,34 @@ import java.math.BigDecimal;
@Data
public class TourPriceVO extends OrderPriceVO{
@ApiModelProperty(value = "车辆价格")
BigDecimal vehicleAmount;
@ApiModelProperty(value = "司机价格")
BigDecimal driverAmount;
@ApiModelProperty(value = "押金价格")
BigDecimal deposit;
@ApiModelProperty(value = "天数")
Integer dayNum;
@ApiModelProperty(value = "车辆个数")
Integer vehicleNum;
@ApiModelProperty(value = "司机个数")
Integer driverNum;
@ApiModelProperty(value = "车型名称")
String modelName;
@ApiModelProperty(value = "车型价格")
BigDecimal modelAmount;
@ApiModelProperty(value = "司机单价")
BigDecimal driverPrice;
@ApiModelProperty(value = "费用详情")
private String costDetail;
@ApiModelProperty(value = "成人人数")
private Integer number;
@ApiModelProperty(value = "儿童人数")
private Integer childNumber;
//大人单价"
@ApiModelProperty(value = "大人单价")
private BigDecimal price;
//大人总价
@ApiModelProperty(value = "大人总价")
private BigDecimal totalPrice;
//大人真实总价(优惠后的价格)
@ApiModelProperty(value = "大人真实总价(优惠后的价格)")
private BigDecimal realPrice;
//儿童单价
@ApiModelProperty(value = "儿童单价")
private BigDecimal childPrice;
//儿童总价
@ApiModelProperty(value = "儿童总价")
private BigDecimal totalChildPrice;
//儿童真实总价(优惠后的价格)
@ApiModelProperty(value = "儿童真实总价(优惠后的价格)")
private BigDecimal realChildPrice;
}
......@@ -25,30 +25,36 @@ import java.util.stream.Collectors;
public class OrderTemplateBiz extends BaseBiz<OrderTemplateMapper,OrderTemplate> {
public String result (OrderTemplate orderTemplate, Dict dict) {
// TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig());
// OrderCostDetail orderCostDetail = orderCostDetailBiz.selectById(OrderCostEnum.RentVehicle.getCode());
// Template template = engine.getTemplate(orderCostDetail.getTemplate());
// String result = template.render(Dict.parse(pojo));
// pojo.setCostDetail(result);
TemplateEngine engine = TemplateUtil.createEngine();
String result = "";
Template template;
// //预处理
// template = engine.getTemplate(orderTemplate.getTemplate());
// result = template.render(new Dict(preprocessMap));
//获取所有模板
List<OrderTemplate> all = this.selectListAll();
Map<String, Object> allCodeMap = all.parallelStream().collect(Collectors.toMap(item -> "tem_"+ item.getCode(), OrderTemplate::getTemplate));
List<String> codes = all.parallelStream().map(OrderTemplate::getCode).collect(Collectors.toList());
String result = "";
TemplateEngine engine = TemplateUtil.createEngine();
//匹配模板 ParamKey() 判断是否存在别的模板
List<String> list = Arrays.asList(orderTemplate.getParamKey().split(",")).parallelStream().filter(item -> codes.contains(item)).collect(Collectors.toList());
if(list.size() > 0) {
allCodeMap.remove("tem_0101");
Template template = engine.getTemplate(orderTemplate.getTemplate());
template = engine.getTemplate(orderTemplate.getTemplate());
result = template.render(new Dict(allCodeMap));
}
//匹配参数 填充参数
template = engine.getTemplate(result);
result = template.render(dict);
return result;
}
// public Map<String, OrderTemplate> allCodeMap() {
// return this.selectListAll().parallelStream().collect(Collectors.toMap(OrderTemplate::getCode, template -> template));
// }
public String result (String templateStr, Map map) {
TemplateEngine engine = TemplateUtil.createEngine();
Template template = engine.getTemplate(templateStr);
return template.render(map);
}
}
\ No newline at end of file
......@@ -84,5 +84,10 @@ public class OrderRentVehicleController extends CommonBaseController {
@ApiModelProperty(value = "天数")
private Integer dayNum;
//是否购买免赔
@ApiModelProperty(value = "是否购买免赔 1--是")
private Integer damageSafe;
}
}
\ No newline at end of file
......@@ -15,6 +15,7 @@ import com.xxfc.platform.order.pojo.order.TourBO;
import com.xxfc.platform.order.pojo.price.RentVehiclePriceVO;
import com.xxfc.platform.order.pojo.price.TourPriceVO;
import com.xxfc.platform.order.service.OrderTourService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
......@@ -29,6 +30,7 @@ import javax.persistence.Column;
@Controller
@RequestMapping("orderTour")
@Api(value="旅游订单",tags={"旅游订单"})
public class OrderTourController extends BaseController<OrderTourDetailBiz,OrderTourDetail> {
@Autowired
......
......@@ -6,6 +6,7 @@ import cn.hutool.extra.template.Template;
import cn.hutool.extra.template.TemplateConfig;
import cn.hutool.extra.template.TemplateEngine;
import cn.hutool.extra.template.TemplateUtil;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.order.biz.OrderCostDetailBiz;
import com.xxfc.platform.order.biz.OrderRentVehicleBiz;
import com.xxfc.platform.order.biz.OrderTemplateBiz;
......@@ -13,6 +14,7 @@ import com.xxfc.platform.order.contant.enumerate.OrderCostEnum;
import com.xxfc.platform.order.contant.enumerate.OrderStatusEnum;
import com.xxfc.platform.order.contant.enumerate.OrderTypeEnum;
import com.xxfc.platform.order.entity.OrderCostDetail;
import com.xxfc.platform.order.entity.OrderTemplate;
import com.xxfc.platform.order.pojo.order.RentVehicleBO;
import com.xxfc.platform.order.pojo.price.RentVehiclePriceVO;
import com.xxfc.platform.vehicle.entity.VehicleModel;
......@@ -24,6 +26,9 @@ import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@Service
@Log4j
......@@ -32,6 +37,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
private static BigDecimal DRIVER_PRICE = new BigDecimal("600.00");
private static BigDecimal DAMAGE_SAFE = new BigDecimal("100.00"); //车损免赔
private static Integer DRIVER_TYPE_COMPANY = 1;
private static Integer DRIVER_TYPE_DAMAGE_SAFE = 1;
// private static BigDecimal DEPOSIT = new BigDecimal("20000.00");
@Autowired
......@@ -83,6 +89,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
BigDecimal goodsAmount = BigDecimal.ZERO;
BigDecimal vehicleAmount = BigDecimal.ZERO;
BigDecimal driverAmount = BigDecimal.ZERO;
BigDecimal damageSafeAmount = BigDecimal.ZERO;
//计算价格
//计算车辆费用
......@@ -92,6 +99,12 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
//计算司机费用
driverAmount = driverAmount.add(DRIVER_PRICE.multiply(BigDecimal.valueOf(detail.getDayNum())));
}
if(DRIVER_TYPE_DAMAGE_SAFE.equals(detail.getDamageSafe())) {
//免赔费用
damageSafeAmount = damageSafeAmount.add(DAMAGE_SAFE.multiply(BigDecimal.valueOf(detail.getDayNum())));
}
//商品价格
goodsAmount = goodsAmount.add(vehicleAmount).add(driverAmount);
//总价格(包含押金)
......@@ -103,42 +116,52 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
rvp.setGoodsAmount(goodsAmount);
rvp.setDriverAmount(driverAmount);
rvp.setVehicleAmount(vehicleAmount);
rvp.setDamageSafeAmount(damageSafeAmount);
rvp.setRealAmount(orderAmount);
rvp.setDeposit(vehicleModel.getDeposit());
rvp.setModelAmount(vehicleModel.getPrice());
rvp.setDriverPrice(DRIVER_PRICE);
rvp.setDamageSafePrice(DAMAGE_SAFE);
rvp.setModelName(vehicleModel.getName());
rvp.setDayNum(detail.getDayNum());
rvp.setVehicleNum(1);
rvp.setDriverNum(1);
detail.setCostDetail(costDetail(rvp));
//设置收费明细
costDetail(rvp, handlechildren(detail));
return rvp;
}
private String handlechildren(RentVehicleBO detail) {
StringBuffer childrenStr = new StringBuffer("${tem_0101}");
if(DRIVER_TYPE_COMPANY.equals(detail.getDriverType())) {
childrenStr.append(",${tem_0102}");
}
childrenStr.append(",${tem_0103}");
if(DRIVER_TYPE_DAMAGE_SAFE.equals(detail.getDamageSafe())) {
childrenStr.append(",${tem_0104}");
}
return childrenStr.toString();
}
/**
* 计算费用明细
* @param vo
* @return
*/
private String costDetail(RentVehiclePriceVO vo) {
//orderTemplateBiz.result(orderTemplateBiz.selectById(OrderCostEnum.RentVehicle.getCode()), Dict.parse(pojo));
TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig());
OrderCostDetail orderCostDetail = orderCostDetailBiz.selectById(OrderCostEnum.RentVehicle.getCode());
Template template = engine.getTemplate(orderCostDetail.getTemplate());
String result = template.render(Dict.parse(vo));
private void costDetail(RentVehiclePriceVO vo, String children) {
OrderTemplate template = orderTemplateBiz.selectById(OrderCostEnum.RentVehicle.getCode());
template.setTemplate(orderTemplateBiz.result(template.getTemplate(), new HashMap(){{
put("children", children);
}}));
String result = orderTemplateBiz.result(template, Dict.parse(vo));
vo.setCostDetail(result);
return result;
}
private String acquireVehicle(RentVehicleBO detail) {
private void acquireVehicle(RentVehicleBO detail) {
//根据车型、时间、距离,门店,预定车辆
BookVehicleVO bookVehicleVO = new BookVehicleVO(){{
// setBookStartDate(detail.getS);
}};
// vehicleFeign.rentApplyVehicle()
String vehicleId = "0e9a88db-cb1b-48a4-b307-40f89eed906f";
detail.setVehicleId(vehicleId);
return vehicleId;
BookVehicleVO bookVehicleVO = detail.getBookVehicleVO();
ObjectRestResponse<String> orr = vehicleFeign.rentApplyVehicle(bookVehicleVO);
detail.setVehicleId(orr.getData());
}
}
......@@ -2,10 +2,12 @@ package com.xxfc.platform.order.service;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.template.Template;
import cn.hutool.extra.template.TemplateConfig;
import cn.hutool.extra.template.TemplateEngine;
import cn.hutool.extra.template.TemplateUtil;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.order.biz.OrderCostDetailBiz;
import com.xxfc.platform.order.biz.OrderRentVehicleBiz;
import com.xxfc.platform.order.biz.OrderTemplateBiz;
......@@ -13,11 +15,15 @@ import com.xxfc.platform.order.contant.enumerate.OrderCostEnum;
import com.xxfc.platform.order.contant.enumerate.OrderStatusEnum;
import com.xxfc.platform.order.contant.enumerate.OrderTypeEnum;
import com.xxfc.platform.order.entity.OrderCostDetail;
import com.xxfc.platform.order.entity.OrderTemplate;
import com.xxfc.platform.order.pojo.order.RentVehicleBO;
import com.xxfc.platform.order.pojo.order.TourBO;
import com.xxfc.platform.order.pojo.price.RentVehiclePriceVO;
import com.xxfc.platform.order.pojo.price.TourPriceVO;
import com.xxfc.platform.tour.dto.TourSpePriceDTO;
import com.xxfc.platform.tour.entity.TourGood;
import com.xxfc.platform.tour.feign.TourFeign;
import com.xxfc.platform.tour.vo.TourSpePriceVo;
import com.xxfc.platform.vehicle.entity.VehicleModel;
import com.xxfc.platform.vehicle.feign.VehicleFeign;
import lombok.extern.log4j.Log4j;
......@@ -26,6 +32,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.math.BigDecimal;
import java.util.HashMap;
@Service
@Log4j
......@@ -34,12 +41,11 @@ public class OrderTourService extends AbstractOrderHandle<OrderRentVehicleBiz, T
@Autowired
TourFeign tourFeign;
private static BigDecimal DRIVER_PRICE = new BigDecimal("600.00");
private static BigDecimal DAMAGE_SAFE = new BigDecimal("100.00"); //车损免赔
// private static BigDecimal DEPOSIT = new BigDecimal("20000.00");
@Autowired
VehicleFeign vehicleFeign;
// private static BigDecimal DRIVER_PRICE = new BigDecimal("600.00");
// private static BigDecimal DAMAGE_SAFE = new BigDecimal("100.00"); //车损免赔
private static Integer LEVEL_DEFAULT = 0;
private static Integer NUMBER_ZERO = 0;
// private static BigDecimal DEPOSIT = new BigDecimal("20000.00");-
@Autowired
OrderCostDetailBiz orderCostDetailBiz;
......@@ -56,8 +62,8 @@ public class OrderTourService extends AbstractOrderHandle<OrderRentVehicleBiz, T
@Override
public void initDetail(TourBO bo) {
super.initDetail(bo);
//VehicleModel vehicleModel = vehicleFeign.get(bo.getModelId()).getData();
//bo.setVehicleModel(vehicleModel);
TourGood tourGood = tourFeign.get(bo.getGoodId()).getData();
bo.setTourGood(tourGood);
}
@Override
......@@ -65,62 +71,74 @@ public class OrderTourService extends AbstractOrderHandle<OrderRentVehicleBiz, T
//设置订单状态为3
bo.getOrder().setStatus(OrderStatusEnum.ORDER_UNPAY.getCode());
//设置订单图片
//bo.getOrder().setPicture(bo.getVehicleModel().getPicture());
bo.getOrder().setPicture(bo.getTourGood().getCover());
//设置订单名称
//bo.getOrder().setName(bo.getVehicleModel().getName());
bo.getOrder().setName(bo.getTourGood().getName());
super.handleDetail(bo);
}
@Override
public void handleCalculate(TourBO bo) {
RentVehiclePriceVO rvpv = calculatePrice(bo);
BeanUtil.copyProperties(rvpv, bo.getOrder());
BeanUtil.copyProperties(rvpv, bo);
TourPriceVO tpv = calculatePrice(bo);
BeanUtil.copyProperties(tpv, bo.getOrder());
BeanUtil.copyProperties(tpv, bo);
}
@Override
public RentVehiclePriceVO calculatePrice(TourBO detail) {
public TourPriceVO calculatePrice(TourBO detail) {
BigDecimal orderAmount = BigDecimal.ZERO;
BigDecimal goodsAmount = BigDecimal.ZERO;
BigDecimal tourAmount = BigDecimal.ZERO;
BigDecimal realAmount = BigDecimal.ZERO;
//计算旅游价格
tourFeign.refund(new TourSpePriceDTO(){{
setChildNumber(detail.getChildNumber());
ObjectRestResponse<TourSpePriceVo> objectRestResponse = tourFeign.refund(new TourSpePriceDTO(){{
setChildNumber(detail.getChildNumber());
setNumber(detail.getNumber());
setLevel(LEVEL_DEFAULT);
setSpeId(detail.getSpePriceId());
//setUserId(detail.getUser().getId());
}});
TourSpePriceVo tourSpePriceVo = objectRestResponse.getData();
//总价
tourAmount = tourAmount.add(tourSpePriceVo.getTotalPrice()).add(tourSpePriceVo.getChildPrice());
//计算价格
//计算车辆费用
// VehicleModel vehicleModel = vehicleFeign.get(detail.getModelId()).getData();
// vehicleAmount = vehicleAmount.add(vehicleModel.getPrice().multiply(BigDecimal.valueOf(detail.getDayNum())));
// if(DRIVER_TYPE_COMPANY.equals(detail.getDriverType())) {
// //计算司机费用
// driverAmount = driverAmount.add(DRIVER_PRICE.multiply(BigDecimal.valueOf(detail.getDayNum())));
// }
//商品价格
// goodsAmount = goodsAmount.add(vehicleAmount).add(driverAmount);
//总价格(包含押金)
// orderAmount = orderAmount.add(goodsAmount).add(DEPOSIT);
//生成订单明细
RentVehiclePriceVO rvp = new RentVehiclePriceVO();
rvp.setOrderAmount(orderAmount);
rvp.setGoodsAmount(goodsAmount);
// rvp.setDriverAmount(driverAmount);
// rvp.setVehicleAmount(vehicleAmount);
rvp.setRealAmount(orderAmount);
// rvp.setDeposit(DEPOSIT);
// rvp.setModelAmount(vehicleModel.getPrice());
rvp.setDriverPrice(DRIVER_PRICE);
// rvp.setModelName(vehicleModel.getName());
rvp.setDayNum(detail.getDayNum());
rvp.setVehicleNum(1);
rvp.setDriverNum(1);
//detail.setCostDetail(costDetail(rvp));
return rvp;
goodsAmount = goodsAmount.add(tourAmount);
//总价格
orderAmount = orderAmount.add(goodsAmount);
//真实价格
realAmount = realAmount.add(tourSpePriceVo.getRealPrice()).add(tourSpePriceVo.getRealChildPrice());
//生成订单明细
TourPriceVO tpv = BeanUtil.toBean(tourSpePriceVo, TourPriceVO.class);
tpv.setOrderAmount(orderAmount);
tpv.setGoodsAmount(goodsAmount);
tpv.setRealAmount(realAmount);
tpv.setNumber(detail.getNumber());
tpv.setChildNumber(detail.getChildNumber());
//设置收费明细
costDetail(tpv, handlechildren(detail));
return tpv;
}
private String handlechildren(TourBO detail) {
StringBuffer childrenStr = new StringBuffer("");
if(NUMBER_ZERO < detail.getNumber()) {
childrenStr.append(",${tem_0201}");
}
if(NUMBER_ZERO < detail.getChildNumber()) {
childrenStr.append(",${tem_0202}");
}
String str = childrenStr.toString();
if(str.length() > 0) {
str = str.substring(1, str.length());
}
return str;
}
/**
......@@ -128,13 +146,12 @@ public class OrderTourService extends AbstractOrderHandle<OrderRentVehicleBiz, T
* @param vo
* @return
*/
private String costDetail(RentVehiclePriceVO vo) {
//orderTemplateBiz.result(orderTemplateBiz.selectById(OrderCostEnum.RentVehicle.getCode()), Dict.parse(pojo));
TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig());
OrderCostDetail orderCostDetail = orderCostDetailBiz.selectById(OrderCostEnum.RentVehicle.getCode());
Template template = engine.getTemplate(orderCostDetail.getTemplate());
String result = template.render(Dict.parse(vo));
private void costDetail(TourPriceVO vo, String children) {
OrderTemplate template = orderTemplateBiz.selectById(OrderCostEnum.RentVehicle.getCode());
template.setTemplate(orderTemplateBiz.result(template.getTemplate(), new HashMap(){{
put("children", children);
}}));
String result = orderTemplateBiz.result(template, Dict.parse(vo));
vo.setCostDetail(result);
return result;
}
}
......@@ -10,6 +10,8 @@ import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.util.HashMap;
@Slf4j
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes={OrderApplication.class})
......@@ -24,11 +26,19 @@ public class RegionTest {
TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig());
//假设我们引入的是Beetl引擎,则:
Template template = engine.getTemplate("{\"key\":\"费用明细\",\"val\":\"\",\"children\":[{\"key\":\"车辆租赁费\",\"val\":\"¥${vehicleAmount}\",\"children\":[{\"key\":\"${modelName}\",\"val\":\"¥${modelAmount}/天\"},{\"key\":\"租用天数\",\"val\":\"${dayNum}天\"},{\"key\":\"房车数量\",\"val\":\"${vehicleNum}辆\"}]},{\"key\":\"服务费(司机)\",\"val\":\"¥${driverAmount}\",\"children\":[{\"key\":\"欣新司机\",\"val\":\"¥${driverPrice}/天\"},{\"key\":\"司机数量\",\"val\":\"{driverNum}个\"},{\"key\":\"房车数量\",\"val\":\"${dayNum}天\"}]},{\"key\":\"用车押金\",\"val\":\"¥${deposit}\"}]}");
//Template template = engine.getTemplate("{\"key\":\"费用明细\",\"val\":\"\",\"children\":[{\"key\":\"车辆租赁费\",\"val\":\"¥${vehicleAmount}\",\"children\":[{\"key\":\"${modelName}\",\"val\":\"¥${modelAmount}/天\"},{\"key\":\"租用天数\",\"val\":\"${dayNum}天\"},{\"key\":\"房车数量\",\"val\":\"${vehicleNum}辆\"}]},{\"key\":\"服务费(司机)\",\"val\":\"¥${driverAmount}\",\"children\":[{\"key\":\"欣新司机\",\"val\":\"¥${driverPrice}/天\"},{\"key\":\"司机数量\",\"val\":\"{driverNum}个\"},{\"key\":\"房车数量\",\"val\":\"${dayNum}天\"}]},{\"key\":\"用车押金\",\"val\":\"¥${deposit}\"}]}");
Template template = engine.getTemplate("${[a,b,c]}");
//Dict本质上为Map,此处可用Map
// String result = template.render(Dict.create().set("name", "Hutool").set("name2", "Hutool2"));
String result = "";
result = template.render(new HashMap<String, Object>(){{
put("a", 123);
put("b", 456);
put("c", 789);
}});
//template.render(
//Dict.parse(new RentVehiclePriceVO(new BigDecimal("126800.03"), new BigDecimal("106800.03"), new BigDecimal("105000.03"), new BigDecimal("1800"), new BigDecimal("20000"))));
......
......@@ -11,6 +11,18 @@
<groupId>com.xxfc.platform</groupId>
<artifactId>xx-tour-api</artifactId>
<dependencies>
</dependencies>
<dependency>
<groupId>com.xxfc.platform</groupId>
<artifactId>xx-vehicle-api</artifactId>
<version>2.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.wxiaoqi</groupId>
<artifactId>ace-admin-api</artifactId>
<version>2.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -3,11 +3,10 @@ package com.xxfc.platform.tour.feign;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.tour.dto.TourSpePriceDTO;
import com.xxfc.platform.tour.entity.TourGood;
import com.xxfc.platform.tour.vo.TourSpePriceVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.*;
/**
......@@ -28,6 +27,10 @@ public interface TourFeign {
public ObjectRestResponse<TourSpePriceVo> refund(@RequestBody TourSpePriceDTO spePriceDto);
@RequestMapping(value = "/spe/stock", method = RequestMethod.GET)
public ObjectRestResponse<TourSpePriceVo> stock(Integer speId,Integer number);
public ObjectRestResponse<TourSpePriceVo> stock(@RequestParam Integer speId, @RequestParam Integer number);
@RequestMapping(value = "/tourGood/{id}", method = RequestMethod.GET)
public ObjectRestResponse<TourGood> get(@PathVariable int id);
}
......@@ -26,21 +26,37 @@ public class TourSpePriceVo {
@ApiModelProperty(value = "等级")
private Integer level;
//大人单价"
@ApiModelProperty(value = "大人单价")
//大人原单价"
@ApiModelProperty(value = "大人原单价")
private BigDecimal OriginalPrice;
//大人优惠单价"
@ApiModelProperty(value = "大人优惠单价")
private BigDecimal price;
//大人总价
@ApiModelProperty(value = "大人总价")
private BigDecimal totalPrice;
//大人真实总价(优惠后的价格)
@ApiModelProperty(value = "大人真实总价(优惠后的价格)")
private BigDecimal realPrice;
//儿童单价
@ApiModelProperty(value = "儿童单价")
private BigDecimal childPrice;
private BigDecimal childOriginalPrice;
//儿童优惠单价
@ApiModelProperty(value = "儿童优惠单价")
private BigDecimal childPrice;
//儿童总价
@ApiModelProperty(value = "儿童总价")
private BigDecimal totaiChildPrice;
private BigDecimal totalChildPrice;
//儿童真实总价(优惠后的价格)
@ApiModelProperty(value = "儿童真实总价(优惠后的价格)")
private BigDecimal realChildPrice;
//库存
@ApiModelProperty(value = "库存")
......
package com.xxfc.platform.tour.biz;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.xxfc.platform.tour.dto.TourSpePriceDTO;
import com.xxfc.platform.tour.entity.TourGoodSpePrice;
import com.xxfc.platform.tour.mapper.TourGoodSpePriceMapper;
import com.xxfc.platform.tour.vo.TourSpePriceVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import java.math.BigDecimal;
import java.math.RoundingMode;
/**
* 旅游商品规格表
*
* @author zjw
* @email nishijjo@qq.com
* @date 2019-06-06 11:41:51
*/
@Service
@Slf4j
public class TourGoodSpeBiz extends BaseBiz<TourGoodSpePriceMapper, TourGoodSpePrice> {
public ObjectRestResponse<TourSpePriceVo> getPricesByuserid(TourSpePriceDTO priceDto) {
if (priceDto == null || priceDto.getUserId() == null || priceDto.getUserId() == 0 ||
priceDto.getNumber() == null || priceDto.getNumber() == 0||priceDto.getSpeId()==null) {
return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE, "参数为空");
}
TourSpePriceVo priceVo = new TourSpePriceVo();
Integer speId = priceDto.getSpeId();
Integer number = priceDto.getNumber();
Integer childNumber = priceDto.getChildNumber() == null ? 0 : priceDto.getChildNumber();
if (speId != null) {
TourGoodSpePrice spePrice = mapper.selectByPrimaryKey(speId);
if (spePrice != null) {
Integer level = priceDto.getLevel();
priceVo.setUserId(priceDto.getUserId());
priceVo.setLevel(priceDto.getLevel());
priceVo.setStock(spePrice.getStock());
BigDecimal price = spePrice.getPrice();
BigDecimal childPrice = spePrice.getChildPrice();
if (level != null && level > 0) {
String memberPrice = spePrice.getMemberPrice();
JSONArray array = JSONArray.parseArray(memberPrice);
if (array.size() > 0) {
for (Object obj : array) {
JSONObject jsonObject = JSONObject.parseObject(obj.toString());
Integer levels = jsonObject.getInteger("level");
if (level == levels) {
String money = jsonObject.getString("price");
price = new BigDecimal(StringUtils.isNotBlank(money) ? money : "0.00");
String childMoney = jsonObject.getString("child_price");
childPrice = new BigDecimal(StringUtils.isNotBlank(childMoney) ? childMoney : "0.00");
break;
}
}
}
}
BigDecimal totalPrice = price.multiply(new BigDecimal(number)).setScale(2, RoundingMode.HALF_UP);
BigDecimal totalChildPrice = childNumber > 0 ? price.multiply(new BigDecimal(childNumber)).setScale(2, RoundingMode.HALF_UP): new BigDecimal("0.00");
priceVo.setPrice(price);
priceVo.setChildPrice(childPrice);
priceVo.setTotalPrice(totalPrice);
priceVo.setTotaiChildPrice(totalChildPrice);
return ObjectRestResponse.succ(priceVo);
}
}
return ObjectRestResponse.createDefaultFail();
}
//减库存
public ObjectRestResponse cutStock(Integer speId,Integer number) {
TourGoodSpePrice spePrice = mapper.selectByPrimaryKey(speId);
if (spePrice != null && spePrice.getStock() > 0 && spePrice.getStock() >= number) {
mapper.updStockById(speId, number);
return ObjectRestResponse.succ();
} else {
return ObjectRestResponse.createFailedResult(ResultCode.STOCK_CODE, "库存不足");
}
}
package com.xxfc.platform.tour.biz;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.xxfc.platform.tour.dto.TourSpePriceDTO;
import com.xxfc.platform.tour.entity.TourGoodSpePrice;
import com.xxfc.platform.tour.mapper.TourGoodSpePriceMapper;
import com.xxfc.platform.tour.vo.TourSpePriceVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import java.math.BigDecimal;
import java.math.RoundingMode;
/**
* 旅游商品规格表
*
* @author zjw
* @email nishijjo@qq.com
* @date 2019-06-06 11:41:51
*/
@Service
@Slf4j
public class TourGoodSpeBiz extends BaseBiz<TourGoodSpePriceMapper, TourGoodSpePrice> {
public ObjectRestResponse<TourSpePriceVo> getPricesByuserid(TourSpePriceDTO priceDto) {
if (priceDto == null || priceDto.getUserId() == null || priceDto.getUserId() == 0 ||
priceDto.getNumber() == null || priceDto.getNumber() == 0||priceDto.getSpeId()==null) {
return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE, "参数为空");
}
TourSpePriceVo priceVo = new TourSpePriceVo();
Integer speId = priceDto.getSpeId();
Integer number = priceDto.getNumber();
Integer childNumber = priceDto.getChildNumber() == null ? 0 : priceDto.getChildNumber();
if (speId != null) {
TourGoodSpePrice spePrice = mapper.selectByPrimaryKey(speId);
if (spePrice != null) {
Integer level = priceDto.getLevel();
priceVo.setUserId(priceDto.getUserId());
priceVo.setLevel(priceDto.getLevel());
priceVo.setStock(spePrice.getStock());
BigDecimal price = spePrice.getPrice();
BigDecimal childPrice = spePrice.getChildPrice();
priceVo.setOriginalPrice(price);
priceVo.setChildOriginalPrice(childPrice);
BigDecimal totalPrice = price.multiply(new BigDecimal(number)).setScale(2, RoundingMode.HALF_UP);
BigDecimal totalChildPrice = childNumber > 0 ? price.multiply(new BigDecimal(childNumber)).setScale(2, RoundingMode.HALF_UP): new BigDecimal("0.00");
priceVo.setTotalPrice(totalPrice);
priceVo.setTotalChildPrice(totalChildPrice);
if (level != null && level > 0) {
String memberPrice = spePrice.getMemberPrice();
JSONArray array = JSONArray.parseArray(memberPrice);
if (array.size() > 0) {
for (Object obj : array) {
JSONObject jsonObject = JSONObject.parseObject(obj.toString());
Integer levels = jsonObject.getInteger("level");
if (level == levels) {
String money = jsonObject.getString("price");
price = new BigDecimal(StringUtils.isNotBlank(money) ? money : "0.00");
String childMoney = jsonObject.getString("child_price");
childPrice = new BigDecimal(StringUtils.isNotBlank(childMoney) ? childMoney : "0.00");
break;
}
}
}
}
totalPrice = price.multiply(new BigDecimal(number)).setScale(2, RoundingMode.HALF_UP);
totalChildPrice = childNumber > 0 ? price.multiply(new BigDecimal(childNumber)).setScale(2, RoundingMode.HALF_UP): new BigDecimal("0.00");
priceVo.setPrice(price);
priceVo.setChildPrice(childPrice);
priceVo.setRealPrice(totalPrice);
priceVo.setRealChildPrice(totalChildPrice);
return ObjectRestResponse.succ(priceVo);
}
}
return ObjectRestResponse.createDefaultFail();
}
//减库存
public ObjectRestResponse cutStock(Integer speId,Integer number) {
TourGoodSpePrice spePrice = mapper.selectByPrimaryKey(speId);
if (spePrice != null && spePrice.getStock() > 0 && spePrice.getStock() >= number) {
mapper.updStockById(speId, number);
return ObjectRestResponse.succ();
} else {
return ObjectRestResponse.createFailedResult(ResultCode.STOCK_CODE, "库存不足");
}
}
}
\ No newline at end of file
package com.xxfc.platform.tour.common;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
//import com.xxfc.platform.vehicle.feign.UserFeign;
//import com.xxfc.platform.vehicle.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.rest.CommonBaseController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
@Slf4j
public class TourBaseController<Biz extends BaseBiz> {
public class TourBaseController<Biz extends BaseBiz> extends CommonBaseController {
@Autowired
protected Biz baseBiz;
@Autowired
protected UserFeign userFeign;
@Autowired
protected UserAuthConfig userAuthConfig;
public AppUserDTO getUserInfo(){
return userFeign.userDetailByToken(userAuthConfig.getToken(request)).getData();
}
// @Autowired
// protected HttpServletRequest request;
//
// @Autowired
// protected UserFeign userFeign;
// @Autowired
// protected UserAuthConfig userAuthConfig;
//
// public AppUserDTO getUserInfo(){
// return userFeign.userDetailByToken(userAuthConfig.getToken(request)).getData();
// }
}
package com.xxfc.platform.tour.rest;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.tour.biz.TourGoodSpeBiz;
......@@ -17,18 +16,17 @@ public class TourGoodSpeController extends TourBaseController<TourGoodSpeBiz> {
//获取价格
// @RequestMapping(value = "/user/prices", method = RequestMethod.POST)
// public ObjectRestResponse<TourSpePriceVo> prices(@RequestBody TourSpePriceDTO priceDto) {
// return baseBiz.getPricesByuserid(priceDto);
// }
//
// //减库存
// @RequestMapping(value = "/stock", method = RequestMethod.GET)
// public ObjectRestResponse<TourSpePriceVo> stock(
// @RequestParam(value = "speId",defaultValue = "0")Integer speId,
// @RequestParam(value = "number",defaultValue = "0") Integer number){
// return baseBiz.cutStock(speId,number);
// }
@RequestMapping(value = "/user/prices", method = RequestMethod.POST)
public ObjectRestResponse<TourSpePriceVo> prices(@RequestBody TourSpePriceDTO priceDto) {
return baseBiz.getPricesByuserid(priceDto);
}
//减库存
@RequestMapping(value = "/stock", method = RequestMethod.GET)
public ObjectRestResponse<TourSpePriceVo> stock(
@RequestParam(value = "speId",defaultValue = "0")Integer speId,
@RequestParam(value = "number",defaultValue = "0") Integer number){
return baseBiz.cutStock(speId,number);
}
}
\ No newline at end of file
......@@ -36,7 +36,7 @@
and t.id in (SELECT s.good_id from (
select good_id,
if(ROUND(( (2 * ASIN( SQRT( POW( SIN((latitude * PI() / 180.0- #{params.latitude}* PI() / 180.0)/2), 2)+COS( latitude * PI() / 180.0)*COS( #{params.longitude} * PI() / 180.0)
*POW(SIN((longitude * PI() / 180.0 - #{params.longitude}* PI() /180.0)/2),2))))*6378.137)*10000)/10000 is null ,0,ROUND(( (2 * ASIN( SQRT( POW( SIN((latitude * PI() / 180.0- #{params.latitude* PI() / 180.0)/2), 2)+COS( latitude * PI() / 180.0)*COS(#{params.longitude} * PI() / 180.0)
*POW(SIN((longitude * PI() / 180.0 - #{params.longitude}* PI() /180.0)/2),2))))*6378.137)*10000)/10000 is null ,0,ROUND(( (2 * ASIN( SQRT( POW( SIN((latitude * PI() / 180.0- #{params.latitude}* PI() / 180.0)/2), 2)+COS( latitude * PI() / 180.0)*COS(#{params.longitude} * PI() / 180.0)
*POW(SIN((longitude * PI() / 180.0 - #{params.longitude}* PI() /180.0)/2),2))))*6378.137)*10000)/10000 ) AS distance
FROM tour_good_site
order by distance
......
......@@ -38,7 +38,7 @@
<select id="getAllByGoodId" resultMap="tourDepartTimeVoMap">
SELECT id,good_id,good_id,DATE_FORMAT(start_time,'%Y-%m-%d') as start_time,DATE_FORMAT(end_time,'%Y-%m-%d') as end_time,spe_id,price,child_price,member_price,stock,
DATE_FORMAT(start_time,'%w') as startWeek,DATE_FORMAT(end_time,'%w') as endWeek,IF(IFNULL(DATEDIFF(start_time,NOW()),0)>0,'0','1') as overdue
FROM tour_good_spe_price WHERE good_id=#{goodId} and is_del=0 ORDER BY start_time
FROM tour_good_spe_price WHERE good_id=#{goodId} and is_del=0 ORDER BY start_time
</select>
<!-- 减库存-->
......
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