Просмотр исходного кода

[公众号会员][新增]:公众号会员同步、关注、取消关注等会员信息更新

release
Stormeye Wu 7 лет назад
Родитель
Сommit
6df5f0e826
22 измененных файлов: 1896 добавлений и 506 удалений
  1. +144
    -0
      mallinkService/src/main/java/com/iformall/domain/dto/WxCUserBasicInfoDto.java
  2. +6
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxAuthorizerInfo.java
  3. +600
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxCUser.java
  4. +2
    -6
      mallinkService/src/main/java/com/iformall/domain/vo/WxWeappInfo.java
  5. +9
    -8
      mallinkService/src/main/java/com/iformall/mapper/WxAuthorizerInfoMapper.java
  6. +27
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxCUserMapper.java
  7. +85
    -0
      mallinkService/src/main/java/com/iformall/service/WxCUserService.java
  8. +140
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCUserServiceImpl.java
  9. +10
    -0
      mallinkService/src/main/java/com/iformall/utils/Constant.java
  10. +138
    -107
      mallinkService/src/main/resources/mapper/WxAuthorizerInfoMapper.xml
  11. +294
    -0
      mallinkService/src/main/resources/mapper/WxCUserMapper.xml
  12. +45
    -47
      mallinkService/src/main/resources/mapper/WxComponentVerifyTicketMapper.xml
  13. +5
    -5
      mallinkService/src/main/resources/mapper/WxPayAccountMapper.xml
  14. +53
    -61
      mallinkService/src/main/resources/mapper/WxTemplateMsgMapper.xml
  15. +60
    -58
      mallinkService/src/main/resources/mapper/WxWeappAuditStatusMapper.xml
  16. +43
    -45
      mallinkService/src/main/resources/mapper/WxWeappBasicSetMapper.xml
  17. +58
    -55
      mallinkService/src/main/resources/mapper/WxWeappCodeStatusMapper.xml
  18. +45
    -47
      mallinkService/src/main/resources/mapper/WxWeappExtSetMapper.xml
  19. +58
    -55
      mallinkService/src/main/resources/mapper/WxWeappReleaseStatusMapper.xml
  20. +34
    -9
      mlWechatOpen/src/main/java/com/iformall/mp/controller/WxMemController.java
  21. +17
    -2
      mlWechatOpen/src/main/java/com/iformall/mp/handler/SubscribeHandler.java
  22. +23
    -1
      mlWechatOpen/src/main/java/com/iformall/mp/handler/UnsubscribeHandler.java

+ 144
- 0
mallinkService/src/main/java/com/iformall/domain/dto/WxCUserBasicInfoDto.java Просмотреть файл

@@ -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;
}
}

+ 6
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxAuthorizerInfo.java Просмотреть файл

@@ -21,6 +21,10 @@ public class WxAuthorizerInfo implements Serializable {
@Transient
protected String sortColumns;

@io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
private String tenantId;
@io.swagger.annotations.ApiModelProperty(value="1B端2C端",name="type")
private Integer type;
@io.swagger.annotations.ApiModelProperty(value="授权方appid",name="authorizerAppid")
private String authorizerAppid;
@io.swagger.annotations.ApiModelProperty(value="授权方头像",name="headImg")
@@ -75,6 +79,7 @@ public class WxAuthorizerInfo implements Serializable {
public static enum Field
{
Id_ASC("`id` ASC"),Id_DESC("`id` DESC")
,TenantId_ASC("`tenant_id` ASC"),TenantId_DESC("`tenant_id` DESC")
,AuthorizerAppid_ASC("`authorizer_appid` ASC"),AuthorizerAppid_DESC("`authorizer_appid` DESC")
,HeadImg_ASC("`head_img` ASC"),HeadImg_DESC("`head_img` DESC")
,Alias_ASC("`alias` ASC"),Alias_DESC("`alias` DESC")
@@ -96,6 +101,7 @@ public class WxAuthorizerInfo implements Serializable {
,ReleaseTime_ASC("`release_time` ASC"),ReleaseTime_DESC("`release_time` DESC")
,OpenAppId_ASC("`open_appid` ASC"),OpenAppId_DESC("`open_appid` DESC")
,BindOpenTime_ASC("`bind_open_time` ASC"),BindOpen_DESC("`bind_open_time` DESC")
,Type_ASC("`type` ASC"),Type_DESC("`type` DESC")
;
private String value;
Field(String value){


+ 600
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxCUser.java Просмотреть файл

@@ -0,0 +1,600 @@
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;
/**积分**/
@io.swagger.annotations.ApiModelProperty(value="积分",name="credit")
private Integer credit;


//渠道名称
@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 Integer getCredit() {
return credit;
}

public void setCredit(Integer credit) {
this.credit = credit;
}

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")
,Credit_ASC("`credit` ASC"),Credit_DESC("`credit` 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() - Constant.H_EXPIRE < currentDate.getTime())
{
//生成一个token
this.token = UUID.randomUUID().toString();
//过期时间
this.expireTime = new Date(currentDate.getTime() + Constant.EXPIRE);
}
return this.token;
}
}

+ 2
- 6
mallinkService/src/main/java/com/iformall/domain/vo/WxWeappInfo.java Просмотреть файл

@@ -11,16 +11,14 @@ import java.util.List;
@EqualsAndHashCode(callSuper = true)
public class WxWeappInfo extends WxAuthorizerInfo {

@io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
private String tenantId;
@io.swagger.annotations.ApiModelProperty(value="小程序类型(1-B端 2-C端)",name="type")
private Integer type;
@io.swagger.annotations.ApiModelProperty(value="小程序名称",name="name")
private String name;

public static enum Field
{
Id_ASC("ai.`id` ASC"),Id_DESC("ai.`id` DESC")
,TenantID_ASC("ai.`tenant_id` ASC"),TenantID_DESC("ai.`tenant_id` DESC")
,Type_ASC("ai.`type` ASC"),Type_DESC("ai.`type` DESC")
,AuthorizerAppid_ASC("ai.`authorizer_appid` ASC"),AuthorizerAppid_DESC("ai.`authorizer_appid` DESC")
,HeadImg_ASC("ai.`head_img` ASC"),HeadImg_DESC("ai.`head_img` DESC")
,Alias_ASC("ai.`alias` ASC"),Alias_DESC("ai.`alias` DESC")
@@ -43,8 +41,6 @@ public class WxWeappInfo extends WxAuthorizerInfo {
,OpenAppid_ASC("ai.`open_appid` ASC"),OpenAppid_DESC("ai.`open_appid` DESC")
,BindOpenTime_ASC("ai.`bind_open_time` ASC"),BindOpenTime_DESC("ai.`bind_open_time` DESC")
,Name_ASC("a.`name` ASC"),Name_DESC("a.`name` DESC")
,TenantID_ASC("a.`tenant_id` ASC"),TenantID_DESC("a.`tenant_id` DESC")
,Type_ASC("a.`type` ASC"),Type_DESC("a.`type` DESC")
;
private String value;
Field(String value){


+ 9
- 8
mallinkService/src/main/java/com/iformall/mapper/WxAuthorizerInfoMapper.java Просмотреть файл

@@ -9,21 +9,22 @@ public interface WxAuthorizerInfoMapper extends CommonMapper<WxAuthorizerInfo, L

List<WxAuthorizerInfo> findList(WxAuthorizerInfo wxAuthorizerInfo);

List<WxWeappInfo> findWeappList();

List<WxWeappInfo> findWxMpList();
WxAuthorizerInfo findMp(WxAuthorizerInfo wxAuthorizerInfo);

List<WxWeappInfo> findVoList(WxWeappInfo wxWeappInfo);
WxAuthorizerInfo findWeChatMp(WxAuthorizerInfo wxAuthorizerInfo);

int updateReleaseInfo(WxAuthorizerInfo wxAuthorizerInfo);

int updateRefreshToken(WxAuthorizerInfo wxAuthorizerInfo);

int updateAccessToken(WxAuthorizerInfo wxAuthorizerInfo);

List<WxWeappInfo> findWeappList();

List<WxWeappInfo> findWxMpList();

List<WxWeappInfo> findVoList(WxWeappInfo wxWeappInfo);


}

+ 27
- 0
mallinkService/src/main/java/com/iformall/mapper/WxCUserMapper.java Просмотреть файл

@@ -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);
}

+ 85
- 0
mallinkService/src/main/java/com/iformall/service/WxCUserService.java Просмотреть файл

@@ -0,0 +1,85 @@
package com.iformall.service;

import com.github.pagehelper.PageInfo;
import com.iformall.domain.dto.WxCUserBasicInfoDto;
import com.iformall.domain.po.WxAuthorizerInfo;
import com.iformall.domain.po.WxCUser;
import me.chanjar.weixin.mp.bean.result.WxMpUser;

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);

/**
* 根据object获得实体
*
* @param record
* @return
*/
WxCUser getByObject(WxCUser record);

/**
* 保存或更新实体
*
* @param record
*/
int saveOrUpdate(WxCUser record);

/**
* 保存或更新实体
*
* @param mpUser
* @param authorizerInfo
*/
int saveOrUpdateMpUser(WxMpUser mpUser, WxAuthorizerInfo authorizerInfo);

/**
* 根据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);
}

+ 140
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCUserServiceImpl.java Просмотреть файл

@@ -0,0 +1,140 @@
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.WxAuthorizerInfo;
import com.iformall.domain.po.WxCUser;
import com.iformall.enums.EnumAppType;
import com.iformall.mapper.WxCUserMapper;
import com.iformall.service.WxCUserService;
import me.chanjar.weixin.mp.bean.result.WxMpUser;
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 WxCUser getByObject(WxCUser record) {
try {
return wxCUserMapper.selectOne(record);
} catch (Exception e) {
logger.error("NOT found: " + e.getMessage());
}
return null;
}

@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 int saveOrUpdateMpUser(WxMpUser mpUser, WxAuthorizerInfo authorizerInfo) {
// 1. check user exist
WxCUser userQ = new WxCUser();
userQ.setTenantId(authorizerInfo.getTenantId());
userQ.setUnionId(mpUser.getUnionId());
userQ.setOpenAppId(authorizerInfo.getOpenAppid());
if(authorizerInfo.getType().equals(EnumAppType.MP_S.getCode())) {
userQ.setMpOpenId(mpUser.getOpenId());
userQ.setMpAppId(authorizerInfo.getAuthorizerAppid());
} else if(authorizerInfo.getType().equals(EnumAppType.MP_P.getCode())) {
userQ.setSubsOpenId(mpUser.getOpenId());
userQ.setSubsAppId(authorizerInfo.getAuthorizerAppid());
}
WxCUser oldUser = getByObject(userQ);
if(oldUser != null) {
userQ.setId(oldUser.getId());
}
if(StringUtils.isBlank(oldUser.getNickName()) && StringUtils.isNotBlank(mpUser.getNickname())) {
userQ.setNickName(mpUser.getNickname());
userQ.setGender(mpUser.getSex());
userQ.setAvatarUrl(mpUser.getHeadImgUrl());
userQ.setCity(mpUser.getCity());
userQ.setProvince(mpUser.getProvince());
userQ.setLanguage(mpUser.getLanguage());
}
if(authorizerInfo.getType().equals(EnumAppType.MP_S.getCode())) {
userQ.setMpSubscribe(mpUser.getSubscribe()?1:0);
userQ.setMpSubscribeScene(mpUser.getSubscribeScene());
userQ.setMpSubscribeTime(new Date(mpUser.getSubscribeTime()));
} else if(authorizerInfo.getType().equals(EnumAppType.MP_P.getCode())) {
userQ.setSubsSubscribe(mpUser.getSubscribe()?1:0);
userQ.setSubsSubscribeScene(mpUser.getSubscribeScene());
userQ.setMpSubscribeTime(new Date(mpUser.getSubscribeTime()));
}
return saveOrUpdate(userQ);
}

@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);
}
}

+ 10
- 0
mallinkService/src/main/java/com/iformall/utils/Constant.java Просмотреть файл

@@ -2,6 +2,16 @@ package com.iformall.utils;

public class Constant {

// 1小时过期,
public final static int H_EXPIRE = 3600000;

// TOKEN过期时间, 24小时后过期
public final static int EXPIRE = H_EXPIRE * 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";


+ 138
- 107
mallinkService/src/main/resources/mapper/WxAuthorizerInfoMapper.xml Просмотреть файл

@@ -1,68 +1,76 @@
<?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">
`id`,`authorizer_appid`,`head_img`,`alias`,`qrcode_url`,`create_time`,`authorization_status`,`auth_time`,
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxAuthorizerInfo">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="type" jdbcType="INTEGER" property="type"/>
<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`,`tenant_id`,`type`,`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`,
`open_appid`,`bind_open_time`,`refresh_token`,
`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 != tenantId ">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != type ">
and `type` = #{type}
</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 +102,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,68 +113,85 @@
<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>

<select id="findMp" parameterType="com.iformall.domain.po.WxAuthorizerInfo" resultMap="BaseResultMap">
select
<include refid="allColumns"/>
FROM wx_authorizer_info
where open_appid = (select open_appid from wx_authorizer_info where authorizer_appid = #{authorizerAppid})
and `type` = 3 and `tenant_id` = #{tenantId}
</select>

<select id="findWeChatMp" parameterType="com.iformall.domain.po.WxAuthorizerInfo" resultMap="BaseResultMap">
select
<include refid="allColumns"/>
from wx_authorizer_info
where `authorizer_appid` = #{authorizerAppid}
</select>

<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="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="type" jdbcType="INTEGER" property="type"/>
<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="name" jdbcType="VARCHAR" property="name"/>
</resultMap>

<sql id="allVColumns">
ai.`id`,ai.`authorizer_appid`,ai.`head_img`,ai.`alias`,ai.`qrcode_url`,ai.`create_time`,ai.`update_time`,
ai.`id`,ai.`tenant_id`,ai.`type`,ai.`authorizer_appid`,ai.`head_img`,ai.`alias`,ai.`qrcode_url`,ai.`create_time`,ai.`update_time`,
ai.`authorization_status`,ai.`auth_time`,
ai.`base_status`,ai.`base_time`,
ai.`domain_status`,ai.`domain_time`,
@@ -174,7 +199,7 @@
ai.`template_status`,ai.`template_time`,
ai.`current_version`,ai.`current_desc`,ai.`release_time`,
ai.`open_appid`,ai.`bind_open_time`,
a.`tenant_id`,a.`type`,a.`name`
a.`name`
</sql>

<sql id="dynamicVWhereConditions">
@@ -185,8 +210,11 @@
<if test=" null != name ">
and a.`name` like concat('%', #{name},'%')
</if>
<if test=" null != tenantId ">
and ai.`tenant_id` = #{tenantId}
</if>
<if test=" null != type ">
and a.`type` = #{type}
and ai.`type` = #{type}
</if>
<if test=" null != authorizerAppid ">
and ai.`authorizer_appid` = #{authorizerAppid}
@@ -233,29 +261,32 @@
#{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="findWeappList" resultMap="BaseResultMap">
select <include refid="allVColumns" />
<select id="findWeappList" resultMap="VBaseResultMap">
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 id="findWxMpList" resultMap="VBaseResultMap">
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>

+ 294
- 0
mallinkService/src/main/resources/mapper/WxCUserMapper.xml Просмотреть файл

@@ -0,0 +1,294 @@
<?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"/>
<result column="credit" jdbcType="INTEGER" property="credit"/>
</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`,`credit`
</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 != credit ">
and `credit` = #{credit}
</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 &gt;= #{startTime}
</if>
<if test=" null != endTime">
and create_date &lt; #{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 &gt;= #{startDate}
</if>
<if test=" null != endDate">
and create_date &lt; #{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 &gt;= #{startDate}
</if>
<if test=" null != endDate">
and create_date &lt; #{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>

+ 45
- 47
mallinkService/src/main/resources/mapper/WxComponentVerifyTicketMapper.xml Просмотреть файл

@@ -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>

+ 5
- 5
mallinkService/src/main/resources/mapper/WxPayAccountMapper.xml Просмотреть файл

@@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxPayAccount">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="mch_id" jdbcType="VARCHAR" property="mchId"/>
<result column="parent_mch_id" jdbcType="VARCHAR" property="parentMchId"/>
<result column="sub_mch_id" jdbcType="VARCHAR" property="subMchId"/>
<result column="api_key" jdbcType="VARCHAR" property="apiKey"/>
<result column="notify_url" jdbcType="VARCHAR" property="notifyUrl"/>
<result column="cert_path" jdbcType="VARCHAR" property="certPath"/>
@@ -14,7 +14,7 @@
</resultMap>

<sql id="allColumns">
`id`,`mch_id`,`parent_mch_id`,`api_key`,`notify_url`,`cert_path`,`type`,`share`,`rate`
`id`,`mch_id`,`sub_mch_id`,`api_key`,`notify_url`,`cert_path`,`type`,`share`,`rate`
</sql>

<sql id="dynamicWhereConditions">
@@ -25,11 +25,11 @@
</if>

<if test=" null != mchId ">
and `mch_id` like concat('%', #{mchId},'%')
and `mch_id` = #{mchId}
</if>

<if test=" null != parentMchId ">
and `parent_mch_id` like concat('%', #{parentMchId},'%')
<if test=" null != subMchId ">
and `sub_mch_id` = #{subMchId}
</if>

<if test=" null != apiKey ">


+ 53
- 61
mallinkService/src/main/resources/mapper/WxTemplateMsgMapper.xml Просмотреть файл

@@ -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>

+ 60
- 58
mallinkService/src/main/resources/mapper/WxWeappAuditStatusMapper.xml Просмотреть файл

@@ -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>

+ 43
- 45
mallinkService/src/main/resources/mapper/WxWeappBasicSetMapper.xml Просмотреть файл

@@ -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>

+ 58
- 55
mallinkService/src/main/resources/mapper/WxWeappCodeStatusMapper.xml Просмотреть файл

@@ -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>

+ 45
- 47
mallinkService/src/main/resources/mapper/WxWeappExtSetMapper.xml Просмотреть файл

@@ -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>

+ 58
- 55
mallinkService/src/main/resources/mapper/WxWeappReleaseStatusMapper.xml Просмотреть файл

@@ -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>

+ 34
- 9
mlWechatOpen/src/main/java/com/iformall/mp/controller/WxMemController.java Просмотреть файл

@@ -1,7 +1,13 @@
package com.iformall.mp.controller;

import com.iformall.common.ResultData;
import com.iformall.domain.po.WxAuthorizerInfo;
import com.iformall.domain.po.WxCUser;
import com.iformall.enums.EnumAppType;
import com.iformall.mapper.WxAuthorizerInfoMapper;
import com.iformall.mapper.WxCUserMapper;
import com.iformall.mp.manager.WxMpManager;
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;

/**
@@ -28,22 +35,40 @@ public class WxMemController {
@Autowired
private WxMpManager wxMpManager;

@Autowired
private WxAuthorizerInfoMapper wxAuthorizerInfoMapper;

@Autowired
private WxCUserService userService;

@GetMapping("/syncAccountFansList")
public ResultData syncAccountFansList(@PathVariable String appId) throws WxErrorException {
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());

WxAuthorizerInfo authQ = new WxAuthorizerInfo();
authQ.setAuthorizerAppid(appId);
WxAuthorizerInfo authorizerInfo = wxAuthorizerInfoMapper.findWeChatMp(authQ);

String nextOpenId = null;

while (true) {
WxMpUserList mpUserList = wxService.getUserService().userList(nextOpenId);
logger.info(mpUserList.toString());
if(mpUserList.getOpenids().size() > 0) {
userList = wxService.getUserService().userInfoList(mpUserList.getOpenids());
logger.info(userList.toString());
List<WxMpUser> userList = wxService.getUserService().userInfoList(mpUserList.getOpenids());
logger.info(userList.toString());
saveToDB(userList, authorizerInfo);
nextOpenId = mpUserList.getNextOpenid();
if(StringUtils.isBlank(nextOpenId)) {
break;
}
}
return new ResultData();
}

private void saveToDB(List<WxMpUser> userList, WxAuthorizerInfo authorizerInfo) {
for(WxMpUser mpUser: userList) {
userService.saveOrUpdateMpUser(mpUser, authorizerInfo);
}
}
}

+ 17
- 2
mlWechatOpen/src/main/java/com/iformall/mp/handler/SubscribeHandler.java Просмотреть файл

@@ -1,12 +1,16 @@
package com.iformall.mp.handler;

import com.iformall.domain.po.WxAuthorizerInfo;
import com.iformall.mapper.WxAuthorizerInfoMapper;
import com.iformall.mp.builder.TextBuilder;
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.Map;
@@ -17,6 +21,12 @@ import java.util.Map;
@Component
public class SubscribeHandler extends AbstractHandler {

@Autowired
private WxAuthorizerInfoMapper wxAuthorizerInfoMapper;

@Autowired
private WxCUserService userService;

@Override
public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
Map<String, Object> context, WxMpService weixinService,
@@ -24,12 +34,17 @@ public class SubscribeHandler extends AbstractHandler {

this.logger.info("新关注用户 OPENID: " + wxMessage.getFromUser());

String appId = weixinService.getWxMpConfigStorage().getAppId();
WxAuthorizerInfo authQ = new WxAuthorizerInfo();
authQ.setAuthorizerAppid(appId);
WxAuthorizerInfo authorizerInfo = wxAuthorizerInfoMapper.findWeChatMp(authQ);

// 获取微信用户基本信息
try {
WxMpUser userWxInfo = weixinService.getUserService()
.userInfo(wxMessage.getFromUser(), null);
.userInfo(wxMessage.getFromUser());
if (userWxInfo != null) {
// TODO 可以添加关注用户到本地数据库
userService.saveOrUpdateMpUser(userWxInfo, authorizerInfo);
}
} catch (WxErrorException e) {
if (e.getError().getErrorCode() == 48001) {


+ 23
- 1
mlWechatOpen/src/main/java/com/iformall/mp/handler/UnsubscribeHandler.java Просмотреть файл

@@ -1,9 +1,14 @@
package com.iformall.mp.handler;

import com.iformall.domain.po.WxAuthorizerInfo;
import com.iformall.mapper.WxAuthorizerInfoMapper;
import com.iformall.service.WxCUserService;
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.Map;
@@ -14,13 +19,30 @@ import java.util.Map;
@Component
public class UnsubscribeHandler extends AbstractHandler {

@Autowired
private WxAuthorizerInfoMapper wxAuthorizerInfoMapper;

@Autowired
private WxCUserService userService;

@Override
public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
Map<String, Object> context, WxMpService wxMpService,
WxSessionManager sessionManager) {
String openId = wxMessage.getFromUser();
this.logger.info("取消关注用户 OPENID: " + openId);
// TODO 可以更新本地数据库为取消关注状态
String appId = wxMpService.getWxMpConfigStorage().getAppId();
WxAuthorizerInfo authQ = new WxAuthorizerInfo();
authQ.setAuthorizerAppid(appId);
WxAuthorizerInfo authorizerInfo = wxAuthorizerInfoMapper.findWeChatMp(authQ);

WxMpUser mpUser = new WxMpUser();
mpUser.setOpenId(wxMessage.getFromUser());
mpUser.setSubscribe(false);
mpUser.setSubscribeTime(wxMessage.getCreateTime());

userService.saveOrUpdateMpUser(mpUser, authorizerInfo);

return null;
}



Загрузка…
Отмена
Сохранить