| @@ -0,0 +1,144 @@ | |||
| package com.iformall.domain.dto; | |||
| import java.io.Serializable; | |||
| import java.util.Date; | |||
| import javax.persistence.Id; | |||
| import javax.persistence.Transient; | |||
| /** | |||
| * 用户查询dto | |||
| * @author jinguo | |||
| * | |||
| */ | |||
| public class WxCUserBasicInfoDto implements Serializable{ | |||
| /** | |||
| * | |||
| */ | |||
| private static final long serialVersionUID = -1116465873573690766L; | |||
| @Id | |||
| protected Long id; | |||
| @io.swagger.annotations.ApiModelProperty(value="开始时间",name="startTime") | |||
| private Date startTime; | |||
| @io.swagger.annotations.ApiModelProperty(value="结束时间",name="endTime") | |||
| private Date endTime; | |||
| @io.swagger.annotations.ApiModelProperty(value="手机号",name="phone") | |||
| private String phone; | |||
| @io.swagger.annotations.ApiModelProperty(value="姓名",name="name") | |||
| private String name; | |||
| /*租户id**/ | |||
| // @io.swagger.annotations.ApiModelProperty(value="租户id",name="tenantId") | |||
| @Transient | |||
| private String tenantId; | |||
| @Transient | |||
| private Date birthStartTime; | |||
| @Transient | |||
| private Date birthEndTime; | |||
| @Transient | |||
| private Integer levelStartScore; | |||
| @Transient | |||
| private Integer levelEndScore; | |||
| @Transient | |||
| private Integer sex; | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public Date getBirthStartTime() { | |||
| return birthStartTime; | |||
| } | |||
| public void setBirthStartTime(Date birthStartTime) { | |||
| this.birthStartTime = birthStartTime; | |||
| } | |||
| public Date getBirthEndTime() { | |||
| return birthEndTime; | |||
| } | |||
| public void setBirthEndTime(Date birthEndTime) { | |||
| this.birthEndTime = birthEndTime; | |||
| } | |||
| public Integer getSex() { | |||
| return sex; | |||
| } | |||
| public void setSex(Integer sex) { | |||
| this.sex = sex; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String tenantId) { | |||
| this.tenantId = tenantId; | |||
| } | |||
| public Date getStartTime() { | |||
| return startTime; | |||
| } | |||
| public void setStartTime(Date startTime) { | |||
| this.startTime = startTime; | |||
| } | |||
| public Date getEndTime() { | |||
| return endTime; | |||
| } | |||
| public void setEndTime(Date endTime) { | |||
| this.endTime = endTime; | |||
| } | |||
| public String getPhone() { | |||
| return phone; | |||
| } | |||
| public void setPhone(String phone) { | |||
| this.phone = phone; | |||
| } | |||
| public Integer getLevelEndScore() { | |||
| return levelEndScore; | |||
| } | |||
| public void setLevelEndScore(Integer levelEndScore) { | |||
| this.levelEndScore = levelEndScore; | |||
| } | |||
| public Integer getLevelStartScore() { | |||
| return levelStartScore; | |||
| } | |||
| public void setLevelStartScore(Integer levelStartScore) { | |||
| this.levelStartScore = levelStartScore; | |||
| } | |||
| } | |||
| @@ -0,0 +1,587 @@ | |||
| package com.iformall.domain.po; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import com.iformall.utils.Constant; | |||
| import javax.persistence.*; | |||
| import java.util.*; | |||
| import java.math.*; | |||
| import javax.persistence.Transient; | |||
| import java.util.List; | |||
| import javax.persistence.Id; | |||
| import java.io.Serializable; | |||
| @Table(name = "wx_c_user") | |||
| @JsonIgnoreProperties(ignoreUnknown = true) | |||
| public class WxCUser implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| protected List<Long> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getSortColumns() { | |||
| return sortColumns; | |||
| } | |||
| public List<Long> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<Long> ids) { | |||
| this.ids = ids; | |||
| } | |||
| /*租户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| private String tenantId; | |||
| /*微信openId**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="微信openId",name="openId") | |||
| private String openId; | |||
| /*微信unionId**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="微信unionId",name="unionId") | |||
| private String unionId; | |||
| /*用户昵称**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="用户昵称",name="nickName") | |||
| private String nickName; | |||
| /*用户性别**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="用户性别",name="gender") | |||
| private Integer gender; | |||
| /*用户头像地址**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="用户头像地址",name="avatarUrl") | |||
| private String avatarUrl; | |||
| /*用户绑定的手机号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="用户绑定的手机号",name="phone") | |||
| private String phone; | |||
| /*用户没有区号的手机号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="用户没有区号的手机号",name="purePhone") | |||
| private String purePhone; | |||
| /*用户所在城市**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="用户所在城市",name="city") | |||
| private String city; | |||
| /*用户所在省份**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="用户所在省份",name="province") | |||
| private String province; | |||
| /*用户所在语言**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="用户所在语言",name="language") | |||
| private String language; | |||
| /*用户手机区号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="用户手机区号",name="countryCode") | |||
| private String countryCode; | |||
| /*用户注册IP**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="用户注册IP",name="registerIp") | |||
| private String registerIp; | |||
| /***/ | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="verifyCodePhone") | |||
| private String verifyCodePhone; | |||
| /*注册时记录用户扫码渠道,如朋友圈广告**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="注册时记录用户扫码渠道,如朋友圈广告",name="qrcodeSource") | |||
| private String qrcodeSource; | |||
| /*二维码来源,小程序**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="二维码来源,小程序",name="scene") | |||
| private String scene; | |||
| /*渠道,小程序**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="渠道,小程序",name="sceneAddress") | |||
| private String sceneAddress; | |||
| /*session key for 微信小程序**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="session key for 微信小程序",name="sessionKey") | |||
| private String sessionKey; | |||
| /*成长值**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="成长值",name="score") | |||
| private Integer score; | |||
| /*更新时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| private Date updateDate; | |||
| /*创建时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| /*小程序的appId**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="小程序的appId",name="appId") | |||
| private String appId; | |||
| /*用户登录用token**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="用户登录用token",name="token") | |||
| private String token; | |||
| /*用户过期时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="用户过期时间",name="expireTime") | |||
| private Date expireTime; | |||
| /*经度**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="经度",name="longitude") | |||
| private BigDecimal longitude; | |||
| /*纬度**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="纬度",name="latitude") | |||
| private BigDecimal latitude; | |||
| /*登录次数**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="登录次数",name="loginCount") | |||
| private Integer loginCount; | |||
| /*附加信息**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="附加信息",name="extraInfo") | |||
| private String extraInfo; | |||
| /**是否关注公众号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="是否关注公众号",name="isSubscribe") | |||
| private Integer isSubscribe; | |||
| @io.swagger.annotations.ApiModelProperty(value="微信开放平台appId",name="openAppId") | |||
| private String openAppId; | |||
| @io.swagger.annotations.ApiModelProperty(value="服务号openId",name="mpOpenId") | |||
| private String mpOpenId; | |||
| @io.swagger.annotations.ApiModelProperty(value="服务号appId",name="mpAppId") | |||
| private String mpAppId; | |||
| @io.swagger.annotations.ApiModelProperty(value="是否关注服务号",name="mpSubscribe") | |||
| private Integer mpSubscribe; | |||
| @io.swagger.annotations.ApiModelProperty(value="关注服务号时间",name="mpSubscribeTime") | |||
| private Date mpSubscribeTime; | |||
| @io.swagger.annotations.ApiModelProperty(value="关注服务号Scene",name="mpSubscribeScene") | |||
| private String mpSubscribeScene; | |||
| @io.swagger.annotations.ApiModelProperty(value="订阅号openId",name="subsOpenId") | |||
| private String subsOpenId; | |||
| @io.swagger.annotations.ApiModelProperty(value="订阅号appId",name="subsAppId") | |||
| private String subsAppId; | |||
| @io.swagger.annotations.ApiModelProperty(value="是否关注订阅号",name="subsSubscribe") | |||
| private Integer subsSubscribe; | |||
| @io.swagger.annotations.ApiModelProperty(value="关注订阅号时间",name="subsSubscribeTime") | |||
| private Date subsSubscribeTime; | |||
| @io.swagger.annotations.ApiModelProperty(value="关注订阅号Scene",name="subsSubscribeScene") | |||
| private String subsSubscribeScene; | |||
| //渠道名称 | |||
| @Transient | |||
| private String channelName; | |||
| //渠道描述 | |||
| @Transient | |||
| protected String sceneDescription; | |||
| @Transient | |||
| List<String> sceneList; | |||
| @Transient | |||
| protected Date startDate; | |||
| @Transient | |||
| protected Date endDate; | |||
| public Date getStartDate() { | |||
| return startDate; | |||
| } | |||
| public void setStartDate(Date startDate) { | |||
| this.startDate = startDate; | |||
| } | |||
| public Date getEndDate() { | |||
| return endDate; | |||
| } | |||
| public void setEndDate(Date endDate) { | |||
| this.endDate = endDate; | |||
| } | |||
| public List<String> getSceneList() { | |||
| return sceneList; | |||
| } | |||
| public void setSceneList(List<String> sceneList) { | |||
| this.sceneList = sceneList; | |||
| } | |||
| public String getChannelName() { | |||
| return channelName; | |||
| } | |||
| public void setChannelName(String channelName) { | |||
| this.channelName = channelName; | |||
| } | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String _tenantId) { | |||
| tenantId = _tenantId; | |||
| } | |||
| public String getOpenId() { | |||
| return openId; | |||
| } | |||
| public void setOpenId(String _openId) { | |||
| openId = _openId; | |||
| } | |||
| public String getUnionId() { | |||
| return unionId; | |||
| } | |||
| public void setUnionId(String _unionId) { | |||
| unionId = _unionId; | |||
| } | |||
| public String getNickName() { | |||
| return nickName; | |||
| } | |||
| public void setNickName(String _nickName) { | |||
| nickName = _nickName; | |||
| } | |||
| public Integer getGender() { | |||
| return gender; | |||
| } | |||
| public void setGender(Integer _gender) { | |||
| gender = _gender; | |||
| } | |||
| public String getAvatarUrl() { | |||
| return avatarUrl; | |||
| } | |||
| public void setAvatarUrl(String _avatarUrl) { | |||
| avatarUrl = _avatarUrl; | |||
| } | |||
| public String getPhone() { | |||
| return phone; | |||
| } | |||
| public void setPhone(String _phone) { | |||
| phone = _phone; | |||
| } | |||
| public String getPurePhone() { | |||
| return purePhone; | |||
| } | |||
| public void setPurePhone(String _purePhone) { | |||
| purePhone = _purePhone; | |||
| } | |||
| public String getCity() { | |||
| return city; | |||
| } | |||
| public void setCity(String _city) { | |||
| city = _city; | |||
| } | |||
| public String getProvince() { | |||
| return province; | |||
| } | |||
| public void setProvince(String _province) { | |||
| province = _province; | |||
| } | |||
| public String getLanguage() { | |||
| return language; | |||
| } | |||
| public void setLanguage(String _language) { | |||
| language = _language; | |||
| } | |||
| public String getCountryCode() { | |||
| return countryCode; | |||
| } | |||
| public void setCountryCode(String _countryCode) { | |||
| countryCode = _countryCode; | |||
| } | |||
| public String getRegisterIp() { | |||
| return registerIp; | |||
| } | |||
| public void setRegisterIp(String _registerIp) { | |||
| registerIp = _registerIp; | |||
| } | |||
| public String getVerifyCodePhone() { | |||
| return verifyCodePhone; | |||
| } | |||
| public void setVerifyCodePhone(String _verifyCodePhone) { | |||
| verifyCodePhone = _verifyCodePhone; | |||
| } | |||
| public String getQrcodeSource() { | |||
| return qrcodeSource; | |||
| } | |||
| public void setQrcodeSource(String _qrcodeSource) { | |||
| qrcodeSource = _qrcodeSource; | |||
| } | |||
| public String getScene() { | |||
| return scene; | |||
| } | |||
| public void setScene(String _scene) { | |||
| scene = _scene; | |||
| } | |||
| public String getSceneAddress() { | |||
| return sceneAddress; | |||
| } | |||
| public void setSceneAddress(String _sceneAddress) { | |||
| sceneAddress = _sceneAddress; | |||
| } | |||
| public String getSessionKey() { | |||
| return sessionKey; | |||
| } | |||
| public void setSessionKey(String _sessionKey) { | |||
| sessionKey = _sessionKey; | |||
| } | |||
| public Integer getScore() { | |||
| return score; | |||
| } | |||
| public void setScore(Integer _score) { | |||
| score = _score; | |||
| } | |||
| public Date getUpdateDate() { | |||
| return updateDate; | |||
| } | |||
| public void setUpdateDate(Date _updateDate) { | |||
| updateDate = _updateDate; | |||
| } | |||
| public Date getCreateDate() { | |||
| return createDate; | |||
| } | |||
| public void setCreateDate(Date _createDate) { | |||
| createDate = _createDate; | |||
| } | |||
| public String getAppId() { | |||
| return appId; | |||
| } | |||
| public void setAppId(String _appId) { | |||
| appId = _appId; | |||
| } | |||
| public String getToken() { | |||
| return token; | |||
| } | |||
| public void setToken(String _token) { | |||
| token = _token; | |||
| } | |||
| public Date getExpireTime() { | |||
| return expireTime; | |||
| } | |||
| public void setExpireTime(Date _expireTime) { | |||
| expireTime = _expireTime; | |||
| } | |||
| public BigDecimal getLongitude() { | |||
| return longitude; | |||
| } | |||
| public void setLongitude(BigDecimal longitude) { | |||
| this.longitude = longitude; | |||
| } | |||
| public BigDecimal getLatitude() { | |||
| return latitude; | |||
| } | |||
| public void setLatitude(BigDecimal latitude) { | |||
| this.latitude = latitude; | |||
| } | |||
| public Integer getLoginCount() { | |||
| return loginCount; | |||
| } | |||
| public void setLoginCount(Integer loginCount) { | |||
| this.loginCount = loginCount; | |||
| } | |||
| public String getSceneDescription() { | |||
| return sceneDescription; | |||
| } | |||
| public void setSceneDescription(String sceneDescription) { | |||
| this.sceneDescription = sceneDescription; | |||
| } | |||
| public String getExtraInfo() { | |||
| return extraInfo; | |||
| } | |||
| public void setExtraInfo(String extraInfo) { | |||
| this.extraInfo = extraInfo; | |||
| } | |||
| public Integer getIsSubscribe() { | |||
| return isSubscribe; | |||
| } | |||
| public void setIsSubscribe(Integer isSubscribe) { | |||
| this.isSubscribe = isSubscribe; | |||
| } | |||
| public String getOpenAppId() { | |||
| return openAppId; | |||
| } | |||
| public void setOpenAppId(String openAppId) { | |||
| this.openAppId = openAppId; | |||
| } | |||
| public String getMpOpenId() { | |||
| return mpOpenId; | |||
| } | |||
| public void setMpOpenId(String mpOpenId) { | |||
| this.mpOpenId = mpOpenId; | |||
| } | |||
| public String getMpAppId() { | |||
| return mpAppId; | |||
| } | |||
| public void setMpAppId(String mpAppId) { | |||
| this.mpAppId = mpAppId; | |||
| } | |||
| public Integer getMpSubscribe() { | |||
| return mpSubscribe; | |||
| } | |||
| public void setMpSubscribe(Integer mpSubscribe) { | |||
| this.mpSubscribe = mpSubscribe; | |||
| } | |||
| public Date getMpSubscribeTime() { | |||
| return mpSubscribeTime; | |||
| } | |||
| public void setMpSubscribeTime(Date mpSubscribeTime) { | |||
| this.mpSubscribeTime = mpSubscribeTime; | |||
| } | |||
| public String getMpSubscribeScene() { | |||
| return mpSubscribeScene; | |||
| } | |||
| public void setMpSubscribeScene(String mpSubscribeScene) { | |||
| this.mpSubscribeScene = mpSubscribeScene; | |||
| } | |||
| public String getSubsOpenId() { | |||
| return subsOpenId; | |||
| } | |||
| public void setSubsOpenId(String subsOpenId) { | |||
| this.subsOpenId = subsOpenId; | |||
| } | |||
| public String getSubsAppId() { | |||
| return subsAppId; | |||
| } | |||
| public void setSubsAppId(String subsAppId) { | |||
| this.subsAppId = subsAppId; | |||
| } | |||
| public Integer getSubsSubscribe() { | |||
| return subsSubscribe; | |||
| } | |||
| public void setSubsSubscribe(Integer subsSubscribe) { | |||
| this.subsSubscribe = subsSubscribe; | |||
| } | |||
| public Date getSubsSubscribeTime() { | |||
| return subsSubscribeTime; | |||
| } | |||
| public void setSubsSubscribeTime(Date subsSubscribeTime) { | |||
| this.subsSubscribeTime = subsSubscribeTime; | |||
| } | |||
| public String getSubsSubscribeScene() { | |||
| return subsSubscribeScene; | |||
| } | |||
| public void setSubsSubscribeScene(String subsSubscribeScene) { | |||
| this.subsSubscribeScene = subsSubscribeScene; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,TenantId_ASC("`tenant_id` ASC"),TenantId_DESC("`tenant_id` DESC") | |||
| ,OpenId_ASC("`open_id` ASC"),OpenId_DESC("`open_id` DESC") | |||
| ,UnionId_ASC("`union_id` ASC"),UnionId_DESC("`union_id` DESC") | |||
| ,NickName_ASC("`nick_name` ASC"),NickName_DESC("`nick_name` DESC") | |||
| ,Gender_ASC("`gender` ASC"),Gender_DESC("`gender` DESC") | |||
| ,AvatarUrl_ASC("`avatar_url` ASC"),AvatarUrl_DESC("`avatar_url` DESC") | |||
| ,Phone_ASC("`phone` ASC"),Phone_DESC("`phone` DESC") | |||
| ,PurePhone_ASC("`pure_phone` ASC"),PurePhone_DESC("`pure_phone` DESC") | |||
| ,City_ASC("`city` ASC"),City_DESC("`city` DESC") | |||
| ,Province_ASC("`province` ASC"),Province_DESC("`province` DESC") | |||
| ,Language_ASC("`language` ASC"),Language_DESC("`language` DESC") | |||
| ,CountryCode_ASC("`country_code` ASC"),CountryCode_DESC("`country_code` DESC") | |||
| ,RegisterIp_ASC("`register_ip` ASC"),RegisterIp_DESC("`register_ip` DESC") | |||
| ,VerifyCodePhone_ASC("`verify_code_phone` ASC"),VerifyCodePhone_DESC("`verify_code_phone` DESC") | |||
| ,QrcodeSource_ASC("`qrcode_source` ASC"),QrcodeSource_DESC("`qrcode_source` DESC") | |||
| ,Scene_ASC("`scene` ASC"),Scene_DESC("`scene` DESC") | |||
| ,SceneAddress_ASC("`scene_address` ASC"),SceneAddress_DESC("`scene_address` DESC") | |||
| ,SessionKey_ASC("`session_key` ASC"),SessionKey_DESC("`session_key` DESC") | |||
| ,Score_ASC("`score` ASC"),Score_DESC("`score` DESC") | |||
| ,UpdateDate_ASC("`update_date` ASC"),UpdateDate_DESC("`update_date` DESC") | |||
| ,CreateDate_ASC("`create_date` ASC"),CreateDate_DESC("`create_date` DESC") | |||
| ,AppId_ASC("`app_id` ASC"),AppId_DESC("`app_id` DESC") | |||
| ,Token_ASC("`token` ASC"),Token_DESC("`token` DESC") | |||
| ,ExpireTime_ASC("`expire_time` ASC"),ExpireTime_DESC("`expire_time` DESC") | |||
| ,Longitude_ASC("`longitude` ASC"),Longitude_DESC("`longitude` DESC") | |||
| ,Latitude_ASC("`latitude` ASC"),Latitude_DESC("`latitude` DESC") | |||
| ,LoginCount_ASC("`login_count` ASC"),LoginCount_DESC("`login_count` DESC") | |||
| ,ExtraInfo_ASC("`extra_info` ASC"),ExtraInfo_DESC("`extra_info` DESC") | |||
| ,IsSubscribe_ASC("`is_subscribe` ASC"),IsSubscribe_DESC("`is_subscribe` DESC") | |||
| ; | |||
| private String value; | |||
| Field(String value){ | |||
| this.value = value; | |||
| } | |||
| public String getValue() { | |||
| return value; | |||
| } | |||
| public void setCol(String value) { | |||
| this.value = value; | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return this.getValue(); | |||
| } | |||
| } | |||
| public void setSortColumns(WxCUser.Field... fields) | |||
| { | |||
| if (fields == null || fields.length == 0) { | |||
| return; | |||
| } | |||
| for (int k = 0; k < fields.length; k++) { | |||
| if (fields[k] == null) { | |||
| return; | |||
| } | |||
| } | |||
| StringBuilder sb = new StringBuilder(fields[0].toString()); | |||
| for (int k = 1; k < fields.length; k++) { | |||
| sb.append(","); | |||
| sb.append(fields[k].toString()); | |||
| } | |||
| this.sortColumns = sb.toString(); | |||
| } | |||
| public void setSortColumns(String sortColumns) | |||
| { | |||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||
| return; | |||
| } | |||
| if (sortColumns.contains(",")) { | |||
| String[] cols = sortColumns.split(","); | |||
| java.util.List<Field> fList = new java.util.ArrayList(); | |||
| for (int k = 0; k < cols.length; k++) { | |||
| fList.add(Field.valueOf(cols[k])); | |||
| } | |||
| this.setSortColumns(fList.toArray(new Field[fList.size()])); | |||
| } else { | |||
| this.setSortColumns(Field.valueOf(sortColumns)); | |||
| } | |||
| } | |||
| public String createToken(Date currentDate) { | |||
| if (expireTime == null || expireTime.getTime() < currentDate.getTime()) | |||
| { | |||
| //生成一个token | |||
| this.token = UUID.randomUUID().toString(); | |||
| //过期时间 | |||
| this.expireTime = new Date(currentDate.getTime() + Constant.EXPIRE * 1000); | |||
| } | |||
| return this.token; | |||
| } | |||
| } | |||
| @@ -48,6 +48,9 @@ public class WxPayAccount implements Serializable { | |||
| /**微信服务商号*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="微信服务商号",name="subMchId") | |||
| private String subMchId; | |||
| @io.swagger.annotations.ApiModelProperty(value="微信服务商号",name="parentMchId") | |||
| private String parentMchId; | |||
| /**支付密钥**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="支付密钥",name="apiKey") | |||
| private String apiKey; | |||
| @@ -90,7 +93,15 @@ public class WxPayAccount implements Serializable { | |||
| this.subMchId = subMchId; | |||
| } | |||
| public String getApiKey() { | |||
| public String getParentMchId() { | |||
| return parentMchId; | |||
| } | |||
| public void setParentMchId(String parentMchId) { | |||
| this.parentMchId = parentMchId; | |||
| } | |||
| public String getApiKey() { | |||
| return apiKey; | |||
| } | |||
| public void setApiKey(String _apiKey) { | |||
| @@ -111,9 +122,10 @@ public class WxPayAccount implements Serializable { | |||
| public Integer getType() { | |||
| return type; | |||
| } | |||
| public void setType(Integer type) { | |||
| this.type = type; | |||
| } | |||
| public void setType(Integer type) { | |||
| this.type = type; | |||
| } | |||
| public Integer getShare() { | |||
| return share; | |||
| } | |||
| @@ -0,0 +1,38 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * Created by Stormeye on 2018/08/09. | |||
| */ | |||
| public enum EnumWechatSubscribe { | |||
| // 0为未关注,1为关注, 2再次关注 | |||
| NO(0, "未关注"), | |||
| YES(1, "关注"), | |||
| AGAIN(2, "再次关注"), | |||
| ; | |||
| public static EnumWechatSubscribe getEnum(Integer code) { | |||
| for (EnumWechatSubscribe value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumWechatSubscribe(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -15,6 +15,8 @@ public interface WxAuthorizerInfoMapper extends CommonMapper<WxAuthorizerInfo, L | |||
| List<WxWeappInfo> findVoList(WxWeappInfo wxWeappInfo); | |||
| WxWeappInfo findVo(WxWeappInfo wxWeappInfo); | |||
| int updateReleaseInfo(WxAuthorizerInfo wxAuthorizerInfo); | |||
| int updateRefreshToken(WxAuthorizerInfo wxAuthorizerInfo); | |||
| @@ -0,0 +1,27 @@ | |||
| package com.iformall.mapper; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.dto.WxCUserBasicInfoDto; | |||
| import com.iformall.domain.po.WxCUser; | |||
| public interface WxCUserMapper extends CommonMapper<WxCUser, Long> { | |||
| List<WxCUser> findList(WxCUser wxCUser); | |||
| WxCUser findByOpenId(WxCUser record); | |||
| WxCUser findByUnionId(WxCUser record); | |||
| WxCUser findByToken(String token); | |||
| long findCount(WxCUserBasicInfoDto dto); | |||
| List<WxCUser> listByChannel(WxCUser wxCUser); | |||
| long countByChannel(WxCUser wxCUser); | |||
| } | |||
| @@ -50,6 +50,14 @@ public interface WxAuthorizerInfoService { | |||
| * @return | |||
| */ | |||
| WxAuthorizerInfo getByAppId(String appId); | |||
| /** | |||
| * 根据appId获得实体 | |||
| * | |||
| * @param appId | |||
| * @return | |||
| */ | |||
| WxWeappInfo getWeappByAppId(String appId); | |||
| /** | |||
| * 保存或更新实体 | |||
| @@ -0,0 +1,67 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.dto.WxCUserBasicInfoDto; | |||
| import com.iformall.domain.po.WxCUser; | |||
| public interface WxCUserService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxCUser> listAsPage(WxCUser record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据Id获得实体 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| WxCUser getById(Long id); | |||
| /** | |||
| * 根据openId获得实体 | |||
| * | |||
| * @param record | |||
| * @return | |||
| */ | |||
| WxCUser getByOpenId(WxCUser record); | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| int saveOrUpdate(WxCUser record); | |||
| /** | |||
| * 根据Id删除实体 | |||
| * | |||
| * @param id | |||
| */ | |||
| void deleteById(Long id); | |||
| /** | |||
| * 统计数量 | |||
| * @param dto | |||
| * @return | |||
| */ | |||
| long findCount(WxCUserBasicInfoDto dto); | |||
| /** | |||
| * 通过渠道获取会员信息 | |||
| * @param user | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxCUser> listByChannel(WxCUser user, Integer pageIndex, Integer pageSize); | |||
| long countByChannel(WxCUser user); | |||
| } | |||
| @@ -66,6 +66,19 @@ public class WxAuthorizerInfoServiceImpl implements WxAuthorizerInfoService { | |||
| return null; | |||
| } | |||
| @Override | |||
| public WxWeappInfo getWeappByAppId(String appId) { | |||
| WxWeappInfo authQ = new WxWeappInfo(); | |||
| authQ.setAuthorizerAppid(appId); | |||
| try { | |||
| WxWeappInfo authorizerInfo = authorizerInfoMapper.findVo(authQ); | |||
| return authorizerInfo; | |||
| } catch (Exception e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| return null; | |||
| } | |||
| @Override | |||
| public void saveOrUpdate(WxAuthorizerInfo record) { | |||
| // 1. 添加到wx_authorizer_info表中 | |||
| @@ -0,0 +1,89 @@ | |||
| package com.iformall.service.impl; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.domain.dto.WxCUserBasicInfoDto; | |||
| import com.iformall.domain.po.WxCUser; | |||
| import com.iformall.mapper.WxCUserMapper; | |||
| import com.iformall.service.WxCUserService; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.Date; | |||
| @Service | |||
| public class WxCUserServiceImpl implements WxCUserService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxCUserMapper wxCUserMapper; | |||
| @Override | |||
| public PageInfo<WxCUser> listAsPage(WxCUser record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public WxCUser getById(Long id) { | |||
| return wxCUserMapper.selectByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public WxCUser getByOpenId(WxCUser record) { | |||
| return wxCUserMapper.findByOpenId(record); | |||
| } | |||
| @Override | |||
| public int saveOrUpdate(WxCUser user) { | |||
| int ret = 0; | |||
| Date curr = new Date(); | |||
| if (user.getId() == null) { | |||
| // 检查用户是否已有同一微信开放平台账号 | |||
| if(StringUtils.isNotBlank(user.getUnionId()) && StringUtils.isNotBlank(user.getOpenAppId())) { | |||
| WxCUser oldUser = wxCUserMapper.findByUnionId(user); | |||
| if(oldUser != null) { | |||
| // 已有,更新 | |||
| user.setId(oldUser.getId()); | |||
| // TODO 是否其他信息需要更新 | |||
| ret = wxCUserMapper.updateByPrimaryKeySelective(user); | |||
| return ret; | |||
| } | |||
| } | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| user.setId(idWorker.nextId()); | |||
| user.setLoginCount(1); | |||
| user.setCreateDate(curr); | |||
| user.setUpdateDate(curr); | |||
| ret = wxCUserMapper.insertSelective(user); | |||
| } else { | |||
| user.setUpdateDate(curr); | |||
| ret = wxCUserMapper.updateByPrimaryKeySelective(user); | |||
| } | |||
| return ret; | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| wxCUserMapper.deleteByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public long findCount(WxCUserBasicInfoDto dto) { | |||
| return wxCUserMapper.findCount(dto); | |||
| } | |||
| @Override | |||
| public PageInfo<WxCUser> listByChannel(WxCUser user, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserMapper.listByChannel(user)); | |||
| } | |||
| @Override | |||
| public long countByChannel(WxCUser user) { | |||
| return wxCUserMapper.countByChannel(user); | |||
| } | |||
| } | |||
| @@ -2,6 +2,16 @@ package com.iformall.utils; | |||
| public class Constant { | |||
| // 1小时过期, | |||
| public final static int C_EXPIRE = 3600000; | |||
| // TOKEN过期时间, 24小时后过期 | |||
| public final static int EXPIRE = 3600 * 24; | |||
| // C端token | |||
| public static final String LOGIN_USER_KEY = "LOGIN_USER_KEY"; | |||
| public static final String TENANT_ID = "TENANT_ID"; | |||
| public static final String fileDirectory = "./uploads/"; | |||
| public static final String importMemPrev = "importmem/"; | |||
| public static final String adminPage = "http://admin.malls.iformall.com"; | |||
| @@ -1,99 +1,97 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.MallPermissionMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.MallPermission"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="name" jdbcType="VARCHAR" property="name" /> | |||
| <result column="available" jdbcType="VARCHAR" property="available" /> | |||
| <result column="parent_id" jdbcType="BIGINT" property="parentId" /> | |||
| <result column="parent_ids" jdbcType="VARCHAR" property="parentIds" /> | |||
| <result column="permission" jdbcType="VARCHAR" property="permission" /> | |||
| <result column="resource_type" jdbcType="VARCHAR" property="resourceType" /> | |||
| <result column="url" jdbcType="VARCHAR" property="url" /> | |||
| <result column="sort" jdbcType="INTEGER" property="sort" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.MallPermission"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="name" jdbcType="VARCHAR" property="name"/> | |||
| <result column="available" jdbcType="VARCHAR" property="available"/> | |||
| <result column="parent_id" jdbcType="BIGINT" property="parentId"/> | |||
| <result column="parent_ids" jdbcType="VARCHAR" property="parentIds"/> | |||
| <result column="permission" jdbcType="VARCHAR" property="permission"/> | |||
| <result column="resource_type" jdbcType="VARCHAR" property="resourceType"/> | |||
| <result column="url" jdbcType="VARCHAR" property="url"/> | |||
| <result column="sort" jdbcType="INTEGER" property="sort"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`name`,`available`,`parent_id`,`parent_ids`,`permission`,`resource_type`,`url`,`sort` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != name "> | |||
| and `name` like concat('%', #{name},'%') | |||
| </if> | |||
| <if test=" null != nameLike and '' != nameLike "> and `name` like concat('%', #{nameLike},'%')</if> | |||
| <if test=" null != available "> | |||
| and `available` like concat('%', #{available},'%') | |||
| </if> | |||
| <if test=" null != parentId "> | |||
| and `parent_id` = #{parentId} | |||
| </if> | |||
| <if test=" null != parentIds "> | |||
| and `parent_ids` like concat('%', #{parentIds},'%') | |||
| </if> | |||
| <if test=" null != permission "> | |||
| and `permission` like concat('%', #{permission},'%') | |||
| </if> | |||
| <if test=" null != permissions "> | |||
| and `permission` in | |||
| <foreach collection="permissions" item="item_permission" open="(" close=")" separator=","> | |||
| #{item_permission} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != resourceType "> | |||
| and `resource_type` like concat('%', #{resourceType},'%') | |||
| </if> | |||
| <if test=" null != url "> | |||
| and `url` like concat('%', #{url},'%') | |||
| </if> | |||
| <if test=" null != sort "> | |||
| and `sort` = #{sort} | |||
| </if> | |||
| <if test=" null != sortFrom "> and `sort` >= #{sortFrom} </if> | |||
| <if test=" null != sortTo "> and #{sortTo} >= `sort` </if> | |||
| <if test=" null != sortGte "> and `sort` >= #{sortGte} </if> | |||
| <if test=" null != sortGt "> and `sort` > #{sortGt} </if> | |||
| <if test=" null != sortLte "> and #{sortLte} >= `sort` </if> | |||
| <if test=" null != sortLt "> and #{sortLt} > `sort` </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.MallPermission" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from mall_permission | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != name "> | |||
| and `name` like concat('%', #{name},'%') | |||
| </if> | |||
| <if test=" null != nameLike and '' != nameLike ">and `name` like concat('%', #{nameLike},'%')</if> | |||
| <if test=" null != available "> | |||
| and `available` like concat('%', #{available},'%') | |||
| </if> | |||
| <if test=" null != parentId "> | |||
| and `parent_id` = #{parentId} | |||
| </if> | |||
| <if test=" null != parentIds "> | |||
| and `parent_ids` like concat('%', #{parentIds},'%') | |||
| </if> | |||
| <if test=" null != permission "> | |||
| and `permission` like concat('%', #{permission},'%') | |||
| </if> | |||
| <if test=" null != permissions "> | |||
| and `permission` in | |||
| <foreach collection="permissions" item="item_permission" open="(" close=")" separator=","> | |||
| #{item_permission} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != resourceType "> | |||
| and `resource_type` like concat('%', #{resourceType},'%') | |||
| </if> | |||
| <if test=" null != url "> | |||
| and `url` like concat('%', #{url},'%') | |||
| </if> | |||
| <if test=" null != sort "> | |||
| and `sort` = #{sort} | |||
| </if> | |||
| <if test=" null != sortFrom ">and `sort` >= #{sortFrom}</if> | |||
| <if test=" null != sortTo ">and #{sortTo} >= `sort`</if> | |||
| <if test=" null != sortGte ">and `sort` >= #{sortGte}</if> | |||
| <if test=" null != sortGt ">and `sort` > #{sortGt}</if> | |||
| <if test=" null != sortLte ">and #{sortLte} >= `sort`</if> | |||
| <if test=" null != sortLt ">and #{sortLt} > `sort`</if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.MallPermission" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from mall_permission | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| </mapper> | |||
| @@ -153,7 +153,7 @@ | |||
| </if> | |||
| </select> | |||
| <update id="removeWebOpenId" > | |||
| <update id="removeWebOpenId"> | |||
| update mall_user_info | |||
| set `web_open_id` = null | |||
| where 1=1 | |||
| @@ -17,7 +17,6 @@ | |||
| <result column="pay_id" jdbcType="BIGINT" property="payId"/> | |||
| <result column="type" jdbcType="INTEGER" property="type"/> | |||
| <result column="pay_bill_id" jdbcType="BIGINT" property="payBillId"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| @@ -36,7 +35,7 @@ | |||
| </if> | |||
| <if test=" null != appId "> | |||
| and `app_id` = #{appId} | |||
| and `app_id` = #{appId} | |||
| </if> | |||
| <if test=" null != parentAppId "> | |||
| and `parent_app_id` like concat('%', #{parentAppId},'%') | |||
| @@ -1,35 +1,35 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxAuthorizerInfoMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxAuthorizerInfo"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="authorizer_appid" jdbcType="VARCHAR" property="authorizerAppid" /> | |||
| <result column="head_img" jdbcType="VARCHAR" property="headImg" /> | |||
| <result column="alias" jdbcType="VARCHAR" property="alias" /> | |||
| <result column="qrcode_url" jdbcType="VARCHAR" property="qrcodeUrl" /> | |||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> | |||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> | |||
| <result column="authorization_status" jdbcType="INTEGER" property="authorizationStatus" /> | |||
| <result column="auth_time" jdbcType="TIMESTAMP" property="authTime" /> | |||
| <result column="base_status" jdbcType="INTEGER" property="baseStatus" /> | |||
| <result column="base_time" jdbcType="TIMESTAMP" property="baseTime" /> | |||
| <result column="domain_status" jdbcType="INTEGER" property="domainStatus" /> | |||
| <result column="domain_time" jdbcType="TIMESTAMP" property="domainTime" /> | |||
| <result column="webdomain_status" jdbcType="INTEGER" property="webdomainStatus" /> | |||
| <result column="webdomain_time" jdbcType="TIMESTAMP" property="webdomainTime" /> | |||
| <result column="template_status" jdbcType="INTEGER" property="templateStatus" /> | |||
| <result column="template_time" jdbcType="TIMESTAMP" property="templateTime" /> | |||
| <result column="current_version" jdbcType="VARCHAR" property="currentVersion" /> | |||
| <result column="current_desc" jdbcType="VARCHAR" property="currentDesc" /> | |||
| <result column="release_time" jdbcType="TIMESTAMP" property="releaseTime" /> | |||
| <result column="open_appid" jdbcType="VARCHAR" property="openAppid" /> | |||
| <result column="bind_open_time" jdbcType="TIMESTAMP" property="bindOpenTime" /> | |||
| <result column="refresh_token" jdbcType="VARCHAR" property="refreshToken" /> | |||
| <result column="access_token" jdbcType="VARCHAR" property="accessToken" /> | |||
| <result column="access_token_expire" jdbcType="TIMESTAMP" property="accessTokenExpire" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxAuthorizerInfo"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="authorizer_appid" jdbcType="VARCHAR" property="authorizerAppid"/> | |||
| <result column="head_img" jdbcType="VARCHAR" property="headImg"/> | |||
| <result column="alias" jdbcType="VARCHAR" property="alias"/> | |||
| <result column="qrcode_url" jdbcType="VARCHAR" property="qrcodeUrl"/> | |||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> | |||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | |||
| <result column="authorization_status" jdbcType="INTEGER" property="authorizationStatus"/> | |||
| <result column="auth_time" jdbcType="TIMESTAMP" property="authTime"/> | |||
| <result column="base_status" jdbcType="INTEGER" property="baseStatus"/> | |||
| <result column="base_time" jdbcType="TIMESTAMP" property="baseTime"/> | |||
| <result column="domain_status" jdbcType="INTEGER" property="domainStatus"/> | |||
| <result column="domain_time" jdbcType="TIMESTAMP" property="domainTime"/> | |||
| <result column="webdomain_status" jdbcType="INTEGER" property="webdomainStatus"/> | |||
| <result column="webdomain_time" jdbcType="TIMESTAMP" property="webdomainTime"/> | |||
| <result column="template_status" jdbcType="INTEGER" property="templateStatus"/> | |||
| <result column="template_time" jdbcType="TIMESTAMP" property="templateTime"/> | |||
| <result column="current_version" jdbcType="VARCHAR" property="currentVersion"/> | |||
| <result column="current_desc" jdbcType="VARCHAR" property="currentDesc"/> | |||
| <result column="release_time" jdbcType="TIMESTAMP" property="releaseTime"/> | |||
| <result column="open_appid" jdbcType="VARCHAR" property="openAppid"/> | |||
| <result column="bind_open_time" jdbcType="TIMESTAMP" property="bindOpenTime"/> | |||
| <result column="refresh_token" jdbcType="VARCHAR" property="refreshToken"/> | |||
| <result column="access_token" jdbcType="VARCHAR" property="accessToken"/> | |||
| <result column="access_token_expire" jdbcType="TIMESTAMP" property="accessTokenExpire"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`authorizer_appid`,`head_img`,`alias`,`qrcode_url`,`create_time`,`authorization_status`,`auth_time`, | |||
| `base_status`, `base_time`, `domain_status`, `domain_time`, `webdomain_status`, `webdomain_time`, `template_status`, `template_time`, | |||
| `current_version`,`current_desc`,`release_time`, | |||
| @@ -37,32 +37,32 @@ | |||
| `access_token`,`access_token_expire` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != authorizerAppid "> | |||
| and `authorizer_appid` = #{authorizerAppid} | |||
| </if> | |||
| <if test=" null != headImg "> | |||
| and `head_img` like concat('%', #{headImg},'%') | |||
| </if> | |||
| <if test=" null != alias "> | |||
| and `alias` like concat('%', #{alias},'%') | |||
| </if> | |||
| <if test=" null != qrcodeUrl "> | |||
| and `qrcode_url` like concat('%', #{qrcodeUrl},'%') | |||
| </if> | |||
| <if test=" null != createTime "> | |||
| and `create_time` = #{createTime} | |||
| </if> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != authorizerAppid "> | |||
| and `authorizer_appid` = #{authorizerAppid} | |||
| </if> | |||
| <if test=" null != headImg "> | |||
| and `head_img` like concat('%', #{headImg},'%') | |||
| </if> | |||
| <if test=" null != alias "> | |||
| and `alias` like concat('%', #{alias},'%') | |||
| </if> | |||
| <if test=" null != qrcodeUrl "> | |||
| and `qrcode_url` like concat('%', #{qrcodeUrl},'%') | |||
| </if> | |||
| <if test=" null != createTime "> | |||
| and `create_time` = #{createTime} | |||
| </if> | |||
| <if test=" null != updateTime "> | |||
| and `update_time` = #{updateTime} | |||
| </if> | |||
| <if test=" null != authorizationStatus "> | |||
| and `authorization_status` = #{authorizationStatus} | |||
| </if> | |||
| <if test=" null != authorizationStatus "> | |||
| and `authorization_status` = #{authorizationStatus} | |||
| </if> | |||
| <if test=" null != authTime "> | |||
| and `auth_time` = #{authTime} | |||
| </if> | |||
| @@ -94,7 +94,7 @@ | |||
| and `current_version` = #{currentVersion} | |||
| </if> | |||
| <if test=" null != currentDesc "> | |||
| and `current_desc` like concat('%', #{currentDesc},'%') | |||
| and `current_desc` like concat('%', #{currentDesc},'%') | |||
| </if> | |||
| <if test=" null != releaseTime "> | |||
| and `release_time` = #{releaseTime} | |||
| @@ -105,64 +105,66 @@ | |||
| <if test=" null != bindOpenTime "> | |||
| and `bind_open_time` = #{bindOpenTime} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxAuthorizerInfo" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_authorizer_info | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxAuthorizerInfo" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_authorizer_info | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <update id="updateReleaseInfo" parameterType="com.iformall.domain.po.WxAuthorizerInfo" > | |||
| <update id="updateReleaseInfo" parameterType="com.iformall.domain.po.WxAuthorizerInfo"> | |||
| update wx_authorizer_info | |||
| set `current_version` = #{currentVersion}, `current_desc` = #{currentDesc}, `release_time` = #{releaseTime}, `update_time` = #{updateTime} | |||
| where `authorizer_appid` = #{authorizerAppid} | |||
| </update> | |||
| <update id="updateRefreshToken" parameterType="com.iformall.domain.po.WxAuthorizerInfo" > | |||
| <update id="updateRefreshToken" parameterType="com.iformall.domain.po.WxAuthorizerInfo"> | |||
| update wx_authorizer_info | |||
| set `refresh_token` = #{refreshToken} | |||
| where `authorizer_appid` = #{authorizerAppid} | |||
| </update> | |||
| <update id="updateAccessToken" parameterType="com.iformall.domain.po.WxAuthorizerInfo" > | |||
| <update id="updateAccessToken" parameterType="com.iformall.domain.po.WxAuthorizerInfo"> | |||
| update wx_authorizer_info | |||
| set `access_token` = #{accessToken}, `access_token_expire` = #{accessTokenExpire} | |||
| where `authorizer_appid` = #{authorizerAppid} | |||
| </update> | |||
| <resultMap id="VBaseResultMap" type="com.iformall.domain.vo.WxWeappInfo"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="authorizer_appid" jdbcType="VARCHAR" property="authorizerAppid" /> | |||
| <result column="head_img" jdbcType="VARCHAR" property="headImg" /> | |||
| <result column="alias" jdbcType="VARCHAR" property="alias" /> | |||
| <result column="qrcode_url" jdbcType="VARCHAR" property="qrcodeUrl" /> | |||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> | |||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> | |||
| <result column="authorization_status" jdbcType="INTEGER" property="authorizationStatus" /> | |||
| <result column="auth_time" jdbcType="TIMESTAMP" property="authTime" /> | |||
| <result column="base_status" jdbcType="INTEGER" property="baseStatus" /> | |||
| <result column="base_time" jdbcType="TIMESTAMP" property="baseTime" /> | |||
| <result column="domain_status" jdbcType="INTEGER" property="domainStatus" /> | |||
| <result column="domain_time" jdbcType="TIMESTAMP" property="domainTime" /> | |||
| <result column="webdomain_status" jdbcType="INTEGER" property="webdomainStatus" /> | |||
| <result column="webdomain_time" jdbcType="TIMESTAMP" property="webdomainTime" /> | |||
| <result column="template_status" jdbcType="INTEGER" property="templateStatus" /> | |||
| <result column="template_time" jdbcType="TIMESTAMP" property="templateTime" /> | |||
| <result column="current_version" jdbcType="VARCHAR" property="currentVersion" /> | |||
| <result column="current_desc" jdbcType="VARCHAR" property="currentDesc" /> | |||
| <result column="release_time" jdbcType="TIMESTAMP" property="releaseTime" /> | |||
| <result column="open_appid" jdbcType="VARCHAR" property="openAppid" /> | |||
| <result column="bind_open_time" jdbcType="TIMESTAMP" property="bindOpenTime" /> | |||
| <result column="tenant_id" jdbcType="INTEGER" property="tenantId" /> | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| <result column="name" jdbcType="TIMESTAMP" property="name" /> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="authorizer_appid" jdbcType="VARCHAR" property="authorizerAppid"/> | |||
| <result column="head_img" jdbcType="VARCHAR" property="headImg"/> | |||
| <result column="alias" jdbcType="VARCHAR" property="alias"/> | |||
| <result column="qrcode_url" jdbcType="VARCHAR" property="qrcodeUrl"/> | |||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> | |||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | |||
| <result column="authorization_status" jdbcType="INTEGER" property="authorizationStatus"/> | |||
| <result column="auth_time" jdbcType="TIMESTAMP" property="authTime"/> | |||
| <result column="base_status" jdbcType="INTEGER" property="baseStatus"/> | |||
| <result column="base_time" jdbcType="TIMESTAMP" property="baseTime"/> | |||
| <result column="domain_status" jdbcType="INTEGER" property="domainStatus"/> | |||
| <result column="domain_time" jdbcType="TIMESTAMP" property="domainTime"/> | |||
| <result column="webdomain_status" jdbcType="INTEGER" property="webdomainStatus"/> | |||
| <result column="webdomain_time" jdbcType="TIMESTAMP" property="webdomainTime"/> | |||
| <result column="template_status" jdbcType="INTEGER" property="templateStatus"/> | |||
| <result column="template_time" jdbcType="TIMESTAMP" property="templateTime"/> | |||
| <result column="current_version" jdbcType="VARCHAR" property="currentVersion"/> | |||
| <result column="current_desc" jdbcType="VARCHAR" property="currentDesc"/> | |||
| <result column="release_time" jdbcType="TIMESTAMP" property="releaseTime"/> | |||
| <result column="open_appid" jdbcType="VARCHAR" property="openAppid"/> | |||
| <result column="bind_open_time" jdbcType="TIMESTAMP" property="bindOpenTime"/> | |||
| <result column="tenant_id" jdbcType="INTEGER" property="tenantId"/> | |||
| <result column="type" jdbcType="INTEGER" property="type"/> | |||
| <result column="name" jdbcType="TIMESTAMP" property="name"/> | |||
| </resultMap> | |||
| <sql id="allVColumns"> | |||
| @@ -233,29 +235,40 @@ | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findVoList" parameterType="com.iformall.domain.vo.WxWeappInfo" resultMap="VBaseResultMap"> | |||
| select <include refid="allVColumns" /> | |||
| select | |||
| <include refid="allVColumns"/> | |||
| from wx_authorizer_info ai | |||
| left join wx_appinfo a on ai.`authorizer_appid` = a.app_id | |||
| <include refid="dynamicVWhereConditions" /> | |||
| <include refid="dynamicVWhereConditions"/> | |||
| </select> | |||
| <select id="findVo" parameterType="com.iformall.domain.vo.WxWeappInfo" resultMap="VBaseResultMap"> | |||
| select | |||
| <include refid="allVColumns"/> | |||
| from wx_authorizer_info ai | |||
| left join wx_appinfo a on ai.`authorizer_appid` = a.app_id | |||
| where ai.`authorizer_appid` = #{authorizerAppid} | |||
| </select> | |||
| <select id="findWeappList" resultMap="BaseResultMap"> | |||
| select <include refid="allVColumns" /> | |||
| select | |||
| <include refid="allVColumns"/> | |||
| from wx_authorizer_info ai | |||
| left join wx_appinfo a on ai.`authorizer_appid` = a.app_id | |||
| where a.type = 1 or a.type = 2 | |||
| </select> | |||
| <select id="findWxMpList" resultMap="BaseResultMap"> | |||
| select <include refid="allVColumns" /> | |||
| select | |||
| <include refid="allVColumns"/> | |||
| from wx_authorizer_info ai | |||
| left join wx_appinfo a on ai.`authorizer_appid` = a.app_id | |||
| where a.type = 3 or a.type = 4 | |||
| </select> | |||
| </mapper> | |||
| @@ -0,0 +1,289 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxCUserMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCUser"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="open_id" jdbcType="VARCHAR" property="openId"/> | |||
| <result column="union_id" jdbcType="VARCHAR" property="unionId"/> | |||
| <result column="nick_name" jdbcType="VARCHAR" property="nickName"/> | |||
| <result column="gender" jdbcType="INTEGER" property="gender"/> | |||
| <result column="avatar_url" jdbcType="VARCHAR" property="avatarUrl"/> | |||
| <result column="phone" jdbcType="VARCHAR" property="phone"/> | |||
| <result column="pure_phone" jdbcType="VARCHAR" property="purePhone"/> | |||
| <result column="city" jdbcType="VARCHAR" property="city"/> | |||
| <result column="province" jdbcType="VARCHAR" property="province"/> | |||
| <result column="language" jdbcType="VARCHAR" property="language"/> | |||
| <result column="country_code" jdbcType="VARCHAR" property="countryCode"/> | |||
| <result column="register_ip" jdbcType="VARCHAR" property="registerIp"/> | |||
| <result column="verify_code_phone" jdbcType="VARCHAR" property="verifyCodePhone"/> | |||
| <result column="qrcode_source" jdbcType="VARCHAR" property="qrcodeSource"/> | |||
| <result column="scene" jdbcType="VARCHAR" property="scene"/> | |||
| <result column="scene_address" jdbcType="VARCHAR" property="sceneAddress"/> | |||
| <result column="session_key" jdbcType="VARCHAR" property="sessionKey"/> | |||
| <result column="score" jdbcType="INTEGER" property="score"/> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> | |||
| <result column="app_id" jdbcType="VARCHAR" property="appId"/> | |||
| <result column="token" jdbcType="VARCHAR" property="token"/> | |||
| <result column="expire_time" jdbcType="TIMESTAMP" property="expireTime"/> | |||
| <result column="latitude" jdbcType="DECIMAL" property="latitude"/> | |||
| <result column="longitude" jdbcType="DECIMAL" property="longitude"/> | |||
| <result column="login_count" jdbcType="INTEGER" property="loginCount"/> | |||
| <result column="extra_info" jdbcType="VARCHAR" property="extraInfo"/> | |||
| <result column="is_subscribe" jdbcType="TINYINT" property="isSubscribe"/> | |||
| <result column="open_app_id" jdbcType="VARCHAR" property="openAppId"/> | |||
| <result column="mp_open_id" jdbcType="VARCHAR" property="mpOpenId"/> | |||
| <result column="mp_app_id" jdbcType="VARCHAR" property="mpAppId"/> | |||
| <result column="mp_subscribe" jdbcType="TINYINT" property="mpSubscribe"/> | |||
| <result column="mp_subscribe_time" jdbcType="TIMESTAMP" property="mpSubscribeTime"/> | |||
| <result column="mp_subscribe_scene" jdbcType="VARCHAR" property="mpSubscribeScene"/> | |||
| <result column="subs_open_id" jdbcType="VARCHAR" property="subsOpenId"/> | |||
| <result column="subs_app_id" jdbcType="VARCHAR" property="subsAppId"/> | |||
| <result column="subs_subscribe" jdbcType="TINYINT" property="subsSubscribe"/> | |||
| <result column="subs_subscribe_time" jdbcType="TIMESTAMP" property="subsSubscribeTime"/> | |||
| <result column="subs_subscribe_scene" jdbcType="VARCHAR" property="subsSubscribeScene"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`open_id`,`union_id`,`nick_name`,`gender`,`avatar_url`,`phone`,`pure_phone`, | |||
| `city`,`province`,`language`,`country_code`,`register_ip`,`verify_code_phone`, | |||
| `qrcode_source`,`scene`,`scene_address`,`session_key`,`score`, | |||
| `update_date`,`create_date`,`app_id`,`token`,`expire_time`,`latitude`, `longitude`, | |||
| `login_count`, `extra_info`, `is_subscribe`, | |||
| `open_app_id`, | |||
| `mp_open_id`,`mp_app_id`,`mp_subscribe`,`mp_subscribe_time`,`mp_subscribe_scene`, | |||
| `subs_open_id`,`subs_app_id`,`subs_subscribe`,`subs_subscribe_time`,`subs_subscribe_scene` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id`= #{tenantId} | |||
| </if> | |||
| <if test=" null != openId "> | |||
| and `open_id` like concat('%', #{openId},'%') | |||
| </if> | |||
| <if test=" null != unionId "> | |||
| and `union_id` like concat('%', #{unionId},'%') | |||
| </if> | |||
| <if test=" null != nickName "> | |||
| and `nick_name` like concat('%', #{nickName},'%') | |||
| </if> | |||
| <if test=" null != gender "> | |||
| and `gender` = #{gender} | |||
| </if> | |||
| <if test=" null != avatarUrl "> | |||
| and `avatar_url` like concat('%', #{avatarUrl},'%') | |||
| </if> | |||
| <if test=" null != phone "> | |||
| and `phone` like concat('%', #{phone},'%') | |||
| </if> | |||
| <if test=" null != purePhone "> | |||
| and `pure_phone` like concat('%', #{purePhone},'%') | |||
| </if> | |||
| <if test=" null != city "> | |||
| and `city` like concat('%', #{city},'%') | |||
| </if> | |||
| <if test=" null != province "> | |||
| and `province` like concat('%', #{province},'%') | |||
| </if> | |||
| <if test=" null != language "> | |||
| and `language` like concat('%', #{language},'%') | |||
| </if> | |||
| <if test=" null != countryCode "> | |||
| and `country_code` like concat('%', #{countryCode},'%') | |||
| </if> | |||
| <if test=" null != registerIp "> | |||
| and `register_ip` like concat('%', #{registerIp},'%') | |||
| </if> | |||
| <if test=" null != verifyCodePhone "> | |||
| and `verify_code_phone` like concat('%', #{verifyCodePhone},'%') | |||
| </if> | |||
| <if test=" null != qrcodeSource "> | |||
| and `qrcode_source` like concat('%', #{qrcodeSource},'%') | |||
| </if> | |||
| <if test=" null != scene "> | |||
| and `scene` like concat('%', #{scene},'%') | |||
| </if> | |||
| <if test=" null != sceneAddress "> | |||
| and `scene_address` like concat('%', #{sceneAddress},'%') | |||
| </if> | |||
| <if test=" null != sessionKey "> | |||
| and `session_key` like concat('%', #{sessionKey},'%') | |||
| </if> | |||
| <if test=" null != score "> | |||
| and `score` = #{score} | |||
| </if> | |||
| <if test=" null != updateDate "> | |||
| and `update_date` = #{updateDate} | |||
| </if> | |||
| <if test=" null != createDate "> | |||
| and `create_date` = #{createDate} | |||
| </if> | |||
| <if test=" null != appId "> | |||
| and `app_id` like concat('%', #{appId},'%') | |||
| </if> | |||
| <if test=" null != token "> | |||
| and `token` like concat('%', #{token},'%') | |||
| </if> | |||
| <if test=" null != expireTime "> | |||
| and `expire_time` = #{expireTime} | |||
| </if> | |||
| <if test=" null != latitude "> | |||
| and `latitude` = #{latitude} | |||
| </if> | |||
| <if test=" null != longitude "> | |||
| and `longitude` = #{longitude} | |||
| </if> | |||
| <if test=" null != loginCount "> | |||
| and `login_count` = #{loginCount} | |||
| </if> | |||
| <if test=" null != extraInfo "> | |||
| and `extra_info` = #{extraInfo} | |||
| </if> | |||
| <if test=" null != isSubscribe "> | |||
| and `is_subscribe` = #{isSubscribe} | |||
| </if> | |||
| <if test=" null != openAppId "> | |||
| and `open_app_id` = #{openAppId} | |||
| </if> | |||
| <if test=" null != mpOpenId "> | |||
| and `mp_open_id` = #{mpOpenId} | |||
| </if> | |||
| <if test=" null != mpAppId "> | |||
| and `mp_app_id` = #{mpAppId} | |||
| </if> | |||
| <if test=" null != subsOpenId "> | |||
| and `subs_open_id` = #{subsOpenId} | |||
| </if> | |||
| <if test=" null != subsAppId "> | |||
| and `subs_app_id` = #{subsAppId} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxCUser" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_c_user | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="findByOpenId" parameterType="com.iformall.domain.po.WxCUser" resultMap="BaseResultMap"> | |||
| select * from wx_c_user | |||
| where `app_id` = #{appId} and `open_id` = #{openId} | |||
| </select> | |||
| <select id="findByUnionId" parameterType="com.iformall.domain.po.WxCUser" resultMap="BaseResultMap"> | |||
| select * from wx_c_user | |||
| where `open_app_id` = #{openAppId} and `union_id` = #{unionId} | |||
| </select> | |||
| <select id="findByToken" resultMap="BaseResultMap"> | |||
| select * from wx_c_user | |||
| where `token` = #{token} | |||
| </select> | |||
| <select id="findCount" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long"> | |||
| select count(id) from wx_c_user where 1=1 | |||
| <if test=" null != sex "> | |||
| and gender =#{sex} | |||
| </if> | |||
| <if test=" null != startTime "> | |||
| and create_date >= #{startTime} | |||
| </if> | |||
| <if test=" null != endTime"> | |||
| and create_date < #{endTime} | |||
| </if> | |||
| <if test="null != tenantId"> | |||
| and tenant_id =#{tenantId} | |||
| </if> | |||
| </select> | |||
| <select id="listByChannel" resultMap="BaseResultMap" > | |||
| select id,nick_name,phone,create_date,scene_address from wx_c_user where 1=1 | |||
| <if test="null != tenantId"> | |||
| and tenant_id =#{tenantId} | |||
| </if> | |||
| <if test=" null != startDate "> | |||
| and create_date >= #{startDate} | |||
| </if> | |||
| <if test=" null != endDate"> | |||
| and create_date < #{endDate} | |||
| </if> | |||
| <if test=" sceneList!= null "> | |||
| and scene_address in | |||
| <foreach collection="sceneList" index="index" item="scene" open="(" separator="," close=")"> | |||
| #{scene} | |||
| </foreach> | |||
| </if> | |||
| order by create_date desc | |||
| </select> | |||
| <select id="countByChannel" resultType="java.lang.Long" > | |||
| select count(id) from wx_c_user where 1=1 | |||
| <if test="null != tenantId"> | |||
| and tenant_id =#{tenantId} | |||
| </if> | |||
| <if test=" null != startDate "> | |||
| and create_date >= #{startDate} | |||
| </if> | |||
| <if test=" null != endDate"> | |||
| and create_date < #{endDate} | |||
| </if> | |||
| <if test=" sceneList!= null "> | |||
| and scene_address in | |||
| <foreach collection="sceneList" index="index" item="scene" open="(" separator="," close=")"> | |||
| #{scene} | |||
| </foreach> | |||
| </if> | |||
| </select> | |||
| </mapper> | |||
| @@ -1,60 +1,58 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxComponentVerifyTicketMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxComponentVerifyTicket"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="component_appid" jdbcType="VARCHAR" property="componentAppid" /> | |||
| <result column="component_verify_ticket" jdbcType="VARCHAR" property="componentVerifyTicket" /> | |||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> | |||
| <result column="deadline" jdbcType="TIMESTAMP" property="deadline" /> | |||
| <result column="access_token" jdbcType="VARCHAR" property="accessToken" /> | |||
| <result column="access_token_expire" jdbcType="TIMESTAMP" property="accessTokenExpire" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxComponentVerifyTicket"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="component_appid" jdbcType="VARCHAR" property="componentAppid"/> | |||
| <result column="component_verify_ticket" jdbcType="VARCHAR" property="componentVerifyTicket"/> | |||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> | |||
| <result column="deadline" jdbcType="TIMESTAMP" property="deadline"/> | |||
| <result column="access_token" jdbcType="VARCHAR" property="accessToken"/> | |||
| <result column="access_token_expire" jdbcType="TIMESTAMP" property="accessTokenExpire"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`component_appid`,`component_verify_ticket`,`create_time`,`deadline` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != componentAppid "> | |||
| and `component_appid` = #{componentAppid} | |||
| </if> | |||
| <if test=" null != componentVerifyTicket "> | |||
| and `component_verify_ticket` like concat('%', #{componentVerifyTicket},'%') | |||
| </if> | |||
| <if test=" null != createTime "> | |||
| and `create_time` = #{createTime} | |||
| </if> | |||
| <if test=" null != deadline "> | |||
| and `deadline` = #{deadline} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxComponentVerifyTicket" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_component_verify_ticket | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != componentAppid "> | |||
| and `component_appid` = #{componentAppid} | |||
| </if> | |||
| <if test=" null != componentVerifyTicket "> | |||
| and `component_verify_ticket` like concat('%', #{componentVerifyTicket},'%') | |||
| </if> | |||
| <if test=" null != createTime "> | |||
| and `create_time` = #{createTime} | |||
| </if> | |||
| <if test=" null != deadline "> | |||
| and `deadline` = #{deadline} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxComponentVerifyTicket" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_component_verify_ticket | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <update id="updateAccessToken" parameterType="com.iformall.domain.po.WxComponentVerifyTicket"> | |||
| update wx_component_verify_ticket | |||
| set `access_token` = #{accessToken}, `access_token_expire` = #{accessTokenExpire} | |||
| where component_appid = #{componentAppid} | |||
| </update> | |||
| </mapper> | |||
| @@ -1,68 +1,60 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxTemplateMsgMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxTemplateMsg"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||
| <result column="template_id" jdbcType="VARCHAR" property="templateId" /> | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxTemplateMsg"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="template_id" jdbcType="VARCHAR" property="templateId"/> | |||
| <result column="type" jdbcType="INTEGER" property="type"/> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`template_id`,`type`,`create_date`,`update_date` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != templateId "> | |||
| and `template_id` like concat('%', #{templateId},'%') | |||
| </if> | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| <if test=" null != createDate "> | |||
| and `create_date` = #{createDate} | |||
| </if> | |||
| <if test=" null != updateDate "> | |||
| and `update_date` = #{updateDate} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxTemplateMsg" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_template_msg | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != templateId "> | |||
| and `template_id` = #{templateId} | |||
| </if> | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| <if test=" null != createDate "> | |||
| and `create_date` = #{createDate} | |||
| </if> | |||
| <if test=" null != updateDate "> | |||
| and `update_date` = #{updateDate} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxTemplateMsg" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_template_msg | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| </mapper> | |||
| @@ -1,37 +1,37 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxWeappAuditStatusMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxWeappAuditStatus"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||
| <result column="app_id" jdbcType="VARCHAR" property="appId" /> | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| <result column="user_version" jdbcType="VARCHAR" property="userVersion" /> | |||
| <result column="version_desc" jdbcType="VARCHAR" property="versionDesc" /> | |||
| <result column="auditid" jdbcType="INTEGER" property="auditid" /> | |||
| <result column="audit_status" jdbcType="INTEGER" property="auditStatus" /> | |||
| <result column="audit_err_code" jdbcType="VARCHAR" property="auditErrCode" /> | |||
| <result column="audit_time" jdbcType="TIMESTAMP" property="auditTime" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxWeappAuditStatus"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="app_id" jdbcType="VARCHAR" property="appId"/> | |||
| <result column="type" jdbcType="INTEGER" property="type"/> | |||
| <result column="user_version" jdbcType="VARCHAR" property="userVersion"/> | |||
| <result column="version_desc" jdbcType="VARCHAR" property="versionDesc"/> | |||
| <result column="auditid" jdbcType="INTEGER" property="auditid"/> | |||
| <result column="audit_status" jdbcType="INTEGER" property="auditStatus"/> | |||
| <result column="audit_err_code" jdbcType="VARCHAR" property="auditErrCode"/> | |||
| <result column="audit_time" jdbcType="TIMESTAMP" property="auditTime"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`app_id`,`type`,`user_version`,`version_desc`, `audit_status`,`audit_err_code`,`audit_time` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != appId "> | |||
| and `app_id` = #{appId} | |||
| </if> | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| <if test=" null != appId "> | |||
| and `app_id` = #{appId} | |||
| </if> | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| <if test=" null != userVersion "> | |||
| and `user_version` = #{userVersion} | |||
| </if> | |||
| @@ -41,32 +41,33 @@ | |||
| <if test=" null != auditStatus "> | |||
| and `audit_status` = #{auditStatus} | |||
| </if> | |||
| <if test=" null != auditTime "> | |||
| and `audit_time` = #{auditTime} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxWeappAuditStatus" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> | |||
| from wx_weapp_audit_status | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| <if test=" null != auditTime "> | |||
| and `audit_time` = #{auditTime} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxWeappAuditStatus" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_weapp_audit_status | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <update id="updateStatus" parameterType="com.iformall.domain.po.WxWeappReleaseStatus" > | |||
| <update id="updateStatus" parameterType="com.iformall.domain.po.WxWeappReleaseStatus"> | |||
| update wx_weapp_audit_status | |||
| set `user_version` = #{userVersion}, `version_desc` = #{versionDesc}, | |||
| `audit_status` = #{auditStatus}, `audit_err_code` = #{auditErrCode}, `audit_time` = #{auditTime} | |||
| where `app_id` = #{appId} and `type` = #{type} | |||
| </update> | |||
| <select id="findUserVersions" resultType="hashmap" > | |||
| <select id="findUserVersions" resultType="hashmap"> | |||
| select user_version as version | |||
| from wx_weapp_audit_status | |||
| where 1=1 | |||
| @@ -80,16 +81,16 @@ | |||
| </select> | |||
| <resultMap id="VBaseResultMap" type="com.iformall.domain.vo.WxWeappAuditStatusVo"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||
| <result column="app_id" jdbcType="VARCHAR" property="appId" /> | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| <result column="user_version" jdbcType="VARCHAR" property="userVersion" /> | |||
| <result column="version_desc" jdbcType="VARCHAR" property="versionDesc" /> | |||
| <result column="audit_status" jdbcType="INTEGER" property="auditStatus" /> | |||
| <result column="audit_err_code" jdbcType="VARCHAR" property="auditErrCode" /> | |||
| <result column="audit_time" jdbcType="TIMESTAMP" property="auditTime" /> | |||
| <result column="name" jdbcType="VARCHAR" property="name" /> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="app_id" jdbcType="VARCHAR" property="appId"/> | |||
| <result column="type" jdbcType="INTEGER" property="type"/> | |||
| <result column="user_version" jdbcType="VARCHAR" property="userVersion"/> | |||
| <result column="version_desc" jdbcType="VARCHAR" property="versionDesc"/> | |||
| <result column="audit_status" jdbcType="INTEGER" property="auditStatus"/> | |||
| <result column="audit_err_code" jdbcType="VARCHAR" property="auditErrCode"/> | |||
| <result column="audit_time" jdbcType="TIMESTAMP" property="auditTime"/> | |||
| <result column="name" jdbcType="VARCHAR" property="name"/> | |||
| </resultMap> | |||
| <sql id="allVoColumns"> | |||
| @@ -130,14 +131,15 @@ | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findVoList" parameterType="com.iformall.domain.vo.WxWeappAuditStatusVo" resultMap="VBaseResultMap"> | |||
| select <include refid="allVoColumns" /> | |||
| select | |||
| <include refid="allVoColumns"/> | |||
| from wx_weapp_audit_status c | |||
| left join wx_appinfo a on c.`app_id` = a.`app_id` | |||
| <include refid="dynamicVoWhereConditions" /> | |||
| <include refid="dynamicVoWhereConditions"/> | |||
| </select> | |||
| </mapper> | |||
| @@ -1,55 +1,53 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxWeappBasicSetMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxWeappBasicSet"> | |||
| <id column="id" jdbcType="INTEGER" property="id" /> | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| <result column="deploy" jdbcType="INTEGER" property="deploy" /> | |||
| <result column="domain_url" jdbcType="VARCHAR" property="domainUrl" /> | |||
| <result column="version" jdbcType="VARCHAR" property="version" /> | |||
| <result column="template_info" jdbcType="VARCHAR" property="templateInfo" /> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxWeappBasicSet"> | |||
| <id column="id" jdbcType="INTEGER" property="id"/> | |||
| <result column="type" jdbcType="INTEGER" property="type"/> | |||
| <result column="deploy" jdbcType="INTEGER" property="deploy"/> | |||
| <result column="domain_url" jdbcType="VARCHAR" property="domainUrl"/> | |||
| <result column="version" jdbcType="VARCHAR" property="version"/> | |||
| <result column="template_info" jdbcType="VARCHAR" property="templateInfo"/> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`type`,`domain_url`,`version`,`template_info`,`create_date`,`update_date` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| <if test=" null != deploy "> | |||
| and `deploy` = #{deploy} | |||
| </if> | |||
| <if test=" null != createDate "> | |||
| and `create_date` = #{createDate} | |||
| </if> | |||
| <if test=" null != updateDate "> | |||
| and `update_date` = #{updateDate} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxWeappBasicSet" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_weapp_basic_set | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| <if test=" null != createDate "> | |||
| and `create_date` = #{createDate} | |||
| </if> | |||
| <if test=" null != updateDate "> | |||
| and `update_date` = #{updateDate} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxWeappBasicSet" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_weapp_basic_set | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| </mapper> | |||
| @@ -1,67 +1,69 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxWeappCodeStatusMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxWeappCodeStatus"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||
| <result column="app_id" jdbcType="VARCHAR" property="appId" /> | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| <result column="user_version" jdbcType="VARCHAR" property="userVersion" /> | |||
| <result column="version_desc" jdbcType="VARCHAR" property="versionDesc" /> | |||
| <result column="code_status" jdbcType="INTEGER" property="codeStatus" /> | |||
| <result column="code_err_code" jdbcType="VARCHAR" property="codeErrCode" /> | |||
| <result column="code_time" jdbcType="TIMESTAMP" property="codeTime" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxWeappCodeStatus"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="app_id" jdbcType="VARCHAR" property="appId"/> | |||
| <result column="type" jdbcType="INTEGER" property="type"/> | |||
| <result column="user_version" jdbcType="VARCHAR" property="userVersion"/> | |||
| <result column="version_desc" jdbcType="VARCHAR" property="versionDesc"/> | |||
| <result column="code_status" jdbcType="INTEGER" property="codeStatus"/> | |||
| <result column="code_err_code" jdbcType="VARCHAR" property="codeErrCode"/> | |||
| <result column="code_time" jdbcType="TIMESTAMP" property="codeTime"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`app_id`,`type`,`user_version`,`version_desc`,`code_status`,`code_err_code`,`code_time` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != appId "> | |||
| and `app_id` = #{appId} | |||
| </if> | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| <if test=" null != appId "> | |||
| and `app_id` = #{appId} | |||
| </if> | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| <if test=" null != userVersion "> | |||
| and `user_version` = #{userVersion} | |||
| </if> | |||
| <if test=" null != codeStatus "> | |||
| and `code_status` = #{codeStatus} | |||
| </if> | |||
| <if test=" null != codeTime "> | |||
| and `code_time` = #{codeTime} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxWeappCodeStatus" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_weapp_code_status | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| <if test=" null != codeTime "> | |||
| and `code_time` = #{codeTime} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxWeappCodeStatus" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_weapp_code_status | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <update id="updateStatus" parameterType="com.iformall.domain.po.WxWeappCodeStatus" > | |||
| <update id="updateStatus" parameterType="com.iformall.domain.po.WxWeappCodeStatus"> | |||
| update wx_weapp_code_status | |||
| set `user_version` = #{userVersion}, `version_desc`= #{versionDesc}, | |||
| `code_status` = #{codeStatus}, `code_err_code` = #{codeErrCode}, `code_time` = #{codeTime} | |||
| where `app_id` = #{appId} and `type` = #{type} | |||
| </update> | |||
| <select id="findUserVersions" resultType="hashmap" > | |||
| <select id="findUserVersions" resultType="hashmap"> | |||
| select user_version as version | |||
| from wx_weapp_code_status | |||
| where 1=1 | |||
| @@ -72,16 +74,16 @@ | |||
| </select> | |||
| <resultMap id="VBaseResultMap" type="com.iformall.domain.vo.WxWeappCodeStatusVo"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||
| <result column="app_id" jdbcType="VARCHAR" property="appId" /> | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| <result column="user_version" jdbcType="VARCHAR" property="userVersion" /> | |||
| <result column="version_desc" jdbcType="VARCHAR" property="versionDesc" /> | |||
| <result column="code_status" jdbcType="INTEGER" property="codeStatus" /> | |||
| <result column="code_err_code" jdbcType="VARCHAR" property="codeErrCode" /> | |||
| <result column="code_time" jdbcType="TIMESTAMP" property="codeTime" /> | |||
| <result column="name" jdbcType="VARCHAR" property="name" /> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="app_id" jdbcType="VARCHAR" property="appId"/> | |||
| <result column="type" jdbcType="INTEGER" property="type"/> | |||
| <result column="user_version" jdbcType="VARCHAR" property="userVersion"/> | |||
| <result column="version_desc" jdbcType="VARCHAR" property="versionDesc"/> | |||
| <result column="code_status" jdbcType="INTEGER" property="codeStatus"/> | |||
| <result column="code_err_code" jdbcType="VARCHAR" property="codeErrCode"/> | |||
| <result column="code_time" jdbcType="TIMESTAMP" property="codeTime"/> | |||
| <result column="name" jdbcType="VARCHAR" property="name"/> | |||
| </resultMap> | |||
| <sql id="allVoColumns"> | |||
| @@ -117,13 +119,14 @@ | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findVoList" parameterType="com.iformall.domain.vo.WxWeappCodeStatusVo" resultMap="VBaseResultMap"> | |||
| select <include refid="allVoColumns" /> | |||
| select | |||
| <include refid="allVoColumns"/> | |||
| from wx_weapp_code_status c | |||
| left join wx_appinfo a on c.`app_id` = a.`app_id` | |||
| <include refid="dynamicVoWhereConditions" /> | |||
| <include refid="dynamicVoWhereConditions"/> | |||
| </select> | |||
| </mapper> | |||
| @@ -1,54 +1,52 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxWeappExtSetMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxWeappExtSet"> | |||
| <id column="id" jdbcType="INTEGER" property="id" /> | |||
| <result column="app_id" jdbcType="VARCHAR" property="appId" /> | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| <result column="ext_json" jdbcType="VARCHAR" property="extJson" /> | |||
| <result column="release_json" jdbcType="VARCHAR" property="releaseJson" /> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxWeappExtSet"> | |||
| <id column="id" jdbcType="INTEGER" property="id"/> | |||
| <result column="app_id" jdbcType="VARCHAR" property="appId"/> | |||
| <result column="type" jdbcType="INTEGER" property="type"/> | |||
| <result column="ext_json" jdbcType="VARCHAR" property="extJson"/> | |||
| <result column="release_json" jdbcType="VARCHAR" property="releaseJson"/> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`app_id`,`type`,`ext_json`,`release_json`,`create_date`,`update_date` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != appId "> | |||
| and `app_id` = #{appId} | |||
| </if> | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| <if test=" null != createDate "> | |||
| and `create_date` = #{createDate} | |||
| </if> | |||
| <if test=" null != updateDate "> | |||
| and `update_date` = #{updateDate} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxWeappExtSet" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_weapp_ext_set | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != appId "> | |||
| and `app_id` = #{appId} | |||
| </if> | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| <if test=" null != createDate "> | |||
| and `create_date` = #{createDate} | |||
| </if> | |||
| <if test=" null != updateDate "> | |||
| and `update_date` = #{updateDate} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxWeappExtSet" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_weapp_ext_set | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| </mapper> | |||
| @@ -1,67 +1,69 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxWeappReleaseStatusMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxWeappReleaseStatus"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||
| <result column="app_id" jdbcType="VARCHAR" property="appId" /> | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| <result column="user_version" jdbcType="VARCHAR" property="userVersion" /> | |||
| <result column="version_desc" jdbcType="VARCHAR" property="versionDesc" /> | |||
| <result column="release_status" jdbcType="VARCHAR" property="releaseStatus" /> | |||
| <result column="release_err_code" jdbcType="INTEGER" property="releaseErrCode" /> | |||
| <result column="release_time" jdbcType="TIMESTAMP" property="releaseTime" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxWeappReleaseStatus"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="app_id" jdbcType="VARCHAR" property="appId"/> | |||
| <result column="type" jdbcType="INTEGER" property="type"/> | |||
| <result column="user_version" jdbcType="VARCHAR" property="userVersion"/> | |||
| <result column="version_desc" jdbcType="VARCHAR" property="versionDesc"/> | |||
| <result column="release_status" jdbcType="VARCHAR" property="releaseStatus"/> | |||
| <result column="release_err_code" jdbcType="INTEGER" property="releaseErrCode"/> | |||
| <result column="release_time" jdbcType="TIMESTAMP" property="releaseTime"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`app_id`,`type`,`user_version`,`version_desc`,`release_status`,`release_err_code`,`release_time` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != appId "> | |||
| and `app_id` = #{appId} | |||
| </if> | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| and `app_id` = #{appId} | |||
| </if> | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| <if test=" null != userVersion "> | |||
| and `user_version` = #{userVersion} | |||
| </if> | |||
| <if test=" null != releaseStatus "> | |||
| and `release_status` = #{releaseStatus} | |||
| </if> | |||
| <if test=" null != releaseTime "> | |||
| and `release_time` = #{releaseTime} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxWeappReleaseStatus" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_weapp_release_status | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| <if test=" null != releaseTime "> | |||
| and `release_time` = #{releaseTime} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <update id="updateStatus" parameterType="com.iformall.domain.po.WxWeappReleaseStatus" > | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxWeappReleaseStatus" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_weapp_release_status | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <update id="updateStatus" parameterType="com.iformall.domain.po.WxWeappReleaseStatus"> | |||
| update wx_weapp_release_status | |||
| set `user_version` = #{userVersion}, `version_desc` = #{versionDesc}, | |||
| `release_status` = #{releaseStatus}, `release_err_code` = #{releaseErrCode}, `release_time` = #{releaseTime} | |||
| where `app_id` = #{appId} and `type` = #{type} | |||
| </update> | |||
| <select id="findUserVersions" resultType="hashmap" > | |||
| <select id="findUserVersions" resultType="hashmap"> | |||
| select user_version as version | |||
| from wx_weapp_release_status | |||
| where 1 = 1 | |||
| @@ -72,16 +74,16 @@ | |||
| </select> | |||
| <resultMap id="VBaseResultMap" type="com.iformall.domain.vo.WxWeappReleaseStatusVo"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||
| <result column="app_id" jdbcType="VARCHAR" property="appId" /> | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| <result column="user_version" jdbcType="VARCHAR" property="userVersion" /> | |||
| <result column="version_desc" jdbcType="VARCHAR" property="versionDesc" /> | |||
| <result column="release_status" jdbcType="INTEGER" property="releaseStatus" /> | |||
| <result column="release_err_code" jdbcType="VARCHAR" property="releaseErrCode" /> | |||
| <result column="release_time" jdbcType="TIMESTAMP" property="releaseTime" /> | |||
| <result column="name" jdbcType="TIMESTAMP" property="name" /> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="app_id" jdbcType="VARCHAR" property="appId"/> | |||
| <result column="type" jdbcType="INTEGER" property="type"/> | |||
| <result column="user_version" jdbcType="VARCHAR" property="userVersion"/> | |||
| <result column="version_desc" jdbcType="VARCHAR" property="versionDesc"/> | |||
| <result column="release_status" jdbcType="INTEGER" property="releaseStatus"/> | |||
| <result column="release_err_code" jdbcType="VARCHAR" property="releaseErrCode"/> | |||
| <result column="release_time" jdbcType="TIMESTAMP" property="releaseTime"/> | |||
| <result column="name" jdbcType="TIMESTAMP" property="name"/> | |||
| </resultMap> | |||
| <sql id="allVoColumns"> | |||
| @@ -122,14 +124,15 @@ | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findVoList" parameterType="com.iformall.domain.vo.WxWeappReleaseStatusVo" resultMap="VBaseResultMap"> | |||
| select <include refid="allVoColumns" /> | |||
| select | |||
| <include refid="allVoColumns"/> | |||
| from wx_weapp_release_status c | |||
| left join wx_appinfo a on c.`app_id` = a.`app_id` | |||
| <include refid="dynamicVoWhereConditions" /> | |||
| <include refid="dynamicVoWhereConditions"/> | |||
| </select> | |||
| </mapper> | |||
| @@ -1,7 +1,13 @@ | |||
| package com.iformall.mp.controller; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxCUser; | |||
| import com.iformall.domain.vo.WxWeappInfo; | |||
| import com.iformall.enums.EnumAppType; | |||
| import com.iformall.enums.EnumWechatSubscribe; | |||
| import com.iformall.mp.manager.WxMpManager; | |||
| import com.iformall.service.WxAuthorizerInfoService; | |||
| import com.iformall.service.WxCUserService; | |||
| import me.chanjar.weixin.common.error.WxErrorException; | |||
| import me.chanjar.weixin.mp.api.WxMpService; | |||
| import me.chanjar.weixin.mp.bean.result.WxMpUser; | |||
| @@ -15,6 +21,7 @@ import org.springframework.web.bind.annotation.PathVariable; | |||
| import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| /** | |||
| @@ -25,25 +32,68 @@ import java.util.List; | |||
| public class WxMemController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| private WxAuthorizerInfoService authorizerInfoService; | |||
| @Autowired | |||
| private WxCUserService userService; | |||
| @Autowired | |||
| private WxMpManager wxMpManager; | |||
| @GetMapping("/syncAccountFansList") | |||
| public ResultData syncAccountFansList(@PathVariable String appId) throws WxErrorException { | |||
| final WxMpService wxService = wxMpManager.getMpService(appId); | |||
| final WxWeappInfo weappInfo = authorizerInfoService.getWeappByAppId(appId); | |||
| if(weappInfo.getType().equals(EnumAppType.MP_S.getCode()) || weappInfo.getType().equals(EnumAppType.MP_P.getCode())) { | |||
| final WxMpService wxService = wxMpManager.getMpService(appId); | |||
| WxMpUserList mpUserList = wxService.getUserService().userList(null); | |||
| logger.info(mpUserList.toString()); | |||
| List<WxMpUser> userList = wxService.getUserService().userInfoList(mpUserList.getOpenids()); | |||
| logger.info(userList.toString()); | |||
| while(StringUtils.isNotBlank(mpUserList.getNextOpenid())) { | |||
| mpUserList = wxService.getUserService().userList(mpUserList.getNextOpenid()); | |||
| logger.info(mpUserList.toString()); | |||
| if(mpUserList.getOpenids().size() > 0) { | |||
| userList = wxService.getUserService().userInfoList(mpUserList.getOpenids()); | |||
| logger.info(userList.toString()); | |||
| String nextOpenId = null; | |||
| while(true) { | |||
| nextOpenId = syncUsers(wxService, weappInfo, nextOpenId); | |||
| if(StringUtils.isBlank(nextOpenId)) | |||
| break; | |||
| } | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| private String syncUsers(WxMpService wxMpService, WxWeappInfo appinfo, String nextOpenId) throws WxErrorException { | |||
| WxMpUserList mpUserList = wxMpService.getUserService().userList(nextOpenId); | |||
| logger.info(mpUserList.toString()); | |||
| if(mpUserList.getOpenids().size() <= 0){ | |||
| return mpUserList.getNextOpenid(); | |||
| } | |||
| List<WxMpUser> userList = wxMpService.getUserService().userInfoList(mpUserList.getOpenids()); | |||
| logger.info(userList.toString()); | |||
| userList.stream().forEach(mpuser -> { | |||
| WxCUser user = new WxCUser(); | |||
| user.setUnionId(mpuser.getUnionId()); | |||
| user.setOpenAppId(appinfo.getOpenAppid()); | |||
| if(appinfo.getType().equals(EnumAppType.MP_S.getCode())) { | |||
| user.setMpAppId(appinfo.getAuthorizerAppid()); | |||
| user.setMpOpenId(mpuser.getOpenId()); | |||
| user.setMpSubscribe(EnumWechatSubscribe.YES.getCode()); | |||
| user.setMpSubscribeTime(new Date(mpuser.getSubscribeTime())); | |||
| user.setMpSubscribeScene(mpuser.getSubscribeScene()); | |||
| } else if(appinfo.getType().equals(EnumAppType.MP_S.getCode())) { | |||
| user.setSubsAppId(appinfo.getAuthorizerAppid()); | |||
| user.setSubsOpenId(mpuser.getOpenId()); | |||
| user.setSubsSubscribe(EnumWechatSubscribe.YES.getCode()); | |||
| user.setSubsSubscribeTime(new Date(mpuser.getSubscribeTime())); | |||
| user.setSubsSubscribeScene(mpuser.getSubscribeScene()); | |||
| } | |||
| user.setNickName(mpuser.getNickname()); | |||
| user.setGender(mpuser.getSex()); | |||
| user.setLanguage(mpuser.getLanguage()); | |||
| user.setCity(mpuser.getCity()); | |||
| user.setProvince(mpuser.getProvince()); | |||
| user.setCountryCode(mpuser.getCountry()); | |||
| user.setAvatarUrl(mpuser.getHeadImgUrl()); | |||
| user.setScene(mpuser.getQrScene()); | |||
| user.setSceneAddress(mpuser.getQrSceneStr()); | |||
| userService.saveOrUpdate(user); | |||
| }); | |||
| return mpUserList.getNextOpenid(); | |||
| } | |||
| } | |||
| @@ -1,14 +1,22 @@ | |||
| package com.iformall.mp.handler; | |||
| import com.iformall.domain.po.WxCUser; | |||
| import com.iformall.domain.vo.WxWeappInfo; | |||
| import com.iformall.enums.EnumAppType; | |||
| import com.iformall.enums.EnumWechatSubscribe; | |||
| import com.iformall.mp.builder.TextBuilder; | |||
| import com.iformall.service.WxAuthorizerInfoService; | |||
| import com.iformall.service.WxCUserService; | |||
| import me.chanjar.weixin.common.error.WxErrorException; | |||
| import me.chanjar.weixin.common.session.WxSessionManager; | |||
| import me.chanjar.weixin.mp.api.WxMpService; | |||
| import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; | |||
| import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; | |||
| import me.chanjar.weixin.mp.bean.result.WxMpUser; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Component; | |||
| import java.util.Date; | |||
| import java.util.Map; | |||
| /** | |||
| @@ -17,6 +25,12 @@ import java.util.Map; | |||
| @Component | |||
| public class SubscribeHandler extends AbstractHandler { | |||
| @Autowired | |||
| private WxAuthorizerInfoService authorizerInfoService; | |||
| @Autowired | |||
| private WxCUserService userService; | |||
| @Override | |||
| public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, | |||
| Map<String, Object> context, WxMpService weixinService, | |||
| @@ -24,12 +38,39 @@ public class SubscribeHandler extends AbstractHandler { | |||
| this.logger.info("新关注用户 OPENID: " + wxMessage.getFromUser()); | |||
| WxWeappInfo weappInfo = authorizerInfoService.getWeappByAppId(weixinService.getWxMpConfigStorage().getAppId()); | |||
| // 获取微信用户基本信息 | |||
| try { | |||
| WxMpUser userWxInfo = weixinService.getUserService() | |||
| .userInfo(wxMessage.getFromUser(), null); | |||
| if (userWxInfo != null) { | |||
| // TODO 可以添加关注用户到本地数据库 | |||
| WxCUser user = new WxCUser(); | |||
| user.setUnionId(userWxInfo.getUnionId()); | |||
| user.setOpenAppId(weappInfo.getOpenAppid()); | |||
| if(weappInfo.getType().equals(EnumAppType.MP_S.getCode())) { | |||
| user.setMpAppId(weappInfo.getAuthorizerAppid()); | |||
| user.setMpOpenId(userWxInfo.getOpenId()); | |||
| user.setMpSubscribe(EnumWechatSubscribe.YES.getCode()); | |||
| user.setMpSubscribeTime(new Date(userWxInfo.getSubscribeTime())); | |||
| user.setMpSubscribeScene(userWxInfo.getSubscribeScene()); | |||
| } else if(weappInfo.getType().equals(EnumAppType.MP_S.getCode())) { | |||
| user.setSubsAppId(weappInfo.getAuthorizerAppid()); | |||
| user.setSubsOpenId(userWxInfo.getOpenId()); | |||
| user.setSubsSubscribe(EnumWechatSubscribe.YES.getCode()); | |||
| user.setSubsSubscribeTime(new Date(userWxInfo.getSubscribeTime())); | |||
| user.setSubsSubscribeScene(userWxInfo.getSubscribeScene()); | |||
| } | |||
| user.setNickName(userWxInfo.getNickname()); | |||
| user.setGender(userWxInfo.getSex()); | |||
| user.setLanguage(userWxInfo.getLanguage()); | |||
| user.setCity(userWxInfo.getCity()); | |||
| user.setProvince(userWxInfo.getProvince()); | |||
| user.setCountryCode(userWxInfo.getCountry()); | |||
| user.setAvatarUrl(userWxInfo.getHeadImgUrl()); | |||
| user.setScene(userWxInfo.getQrScene()); | |||
| user.setSceneAddress(userWxInfo.getQrSceneStr()); | |||
| userService.saveOrUpdate(user); | |||
| } | |||
| } catch (WxErrorException e) { | |||
| if (e.getError().getErrorCode() == 48001) { | |||
| @@ -34,13 +34,14 @@ public class UserUnionIdSchedule { | |||
| private final int TIME_OUT_VALUE = 4 * 60 * 1000; //4分钟 | |||
| @Autowired | |||
| WxPayOrderMapper payOrderMapper; | |||
| private WxPayOrderMapper payOrderMapper; | |||
| @Autowired | |||
| private WxOpenService openService; | |||
| private WxPayAccountMapper payAccountMapper; | |||
| @Autowired | |||
| private WxPayAccountMapper payAccountMapper; | |||
| private WxOpenService openService; | |||
| @Autowired | |||
| WxAppinfoService wxAppinfoService; | |||