Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
徐少华
midjourney-proxy
Commits
c8025a4b
Commit
c8025a4b
authored
Jul 30, 2019
by
裴大威
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'zcy/addIp' into 'master'
add ip See merge request rays/pcloud-book!72
parents
384a9a26
dfe53c32
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
189 additions
and
96 deletions
+189
-96
BookWxQrcodeDTO.java
.../main/java/com/pcloud/book/group/dto/BookWxQrcodeDTO.java
+20
-0
UpdateQrDTO.java
.../src/main/java/com/pcloud/book/group/dto/UpdateQrDTO.java
+9
-48
WeixinQrcodeService.java
...va/com/pcloud/book/group/service/WeixinQrcodeService.java
+6
-0
WeixinQrcodeBiz.java
.../main/java/com/pcloud/book/group/biz/WeixinQrcodeBiz.java
+2
-0
WeixinQrcodeBizImpl.java
...a/com/pcloud/book/group/biz/impl/WeixinQrcodeBizImpl.java
+60
-7
WeixinQrcodeDao.java
.../main/java/com/pcloud/book/group/dao/WeixinQrcodeDao.java
+4
-0
WeixinQrcodeDaoImpl.java
...a/com/pcloud/book/group/dao/impl/WeixinQrcodeDaoImpl.java
+12
-0
WeixinQrcode.java
.../main/java/com/pcloud/book/group/entity/WeixinQrcode.java
+10
-0
WeixinQrcodeServiceImpl.java
...loud/book/group/service/impl/WeixinQrcodeServiceImpl.java
+8
-0
SendWeixinRequestTools.java
...a/com/pcloud/book/group/tools/SendWeixinRequestTools.java
+20
-37
WeixinQrcodeVO.java
...rc/main/java/com/pcloud/book/group/vo/WeixinQrcodeVO.java
+11
-0
WeixinQrcode.Mapper.xml
...k/src/main/resources/mapper/group/WeixinQrcode.Mapper.xml
+27
-4
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/group/dto/BookWxQrcodeDTO.java
View file @
c8025a4b
...
...
@@ -26,6 +26,10 @@ public class BookWxQrcodeDTO implements Serializable {
*/
private
String
robotWxId
;
private
Integer
generation
;
private
String
wechatGroupIp
;
public
String
getWeixinGroupId
()
{
return
weixinGroupId
;
}
...
...
@@ -42,6 +46,22 @@ public class BookWxQrcodeDTO implements Serializable {
this
.
robotWxId
=
robotWxId
;
}
public
Integer
getGeneration
()
{
return
generation
;
}
public
void
setGeneration
(
Integer
generation
)
{
this
.
generation
=
generation
;
}
public
String
getWechatGroupIp
()
{
return
wechatGroupIp
;
}
public
void
setWechatGroupIp
(
String
wechatGroupIp
)
{
this
.
wechatGroupIp
=
wechatGroupIp
;
}
@Override
public
String
toString
()
{
return
"BookWxQrcodeDTO{"
+
...
...
pcloud-facade-book/src/main/java/com/pcloud/book/group/dto/UpdateQrDTO.java
View file @
c8025a4b
...
...
@@ -2,12 +2,16 @@ package com.pcloud.book.group.dto;
import
java.io.Serializable
;
import
lombok.Data
;
/**
* @author lily
* @date 2019/3/5 9:49
*/
@Data
public
class
UpdateQrDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
7244150746099558299L
;
/**
* 群二维码标识
*/
...
...
@@ -30,54 +34,11 @@ public class UpdateQrDTO implements Serializable {
*/
private
String
robotWxId
;
public
String
getRobotWxId
()
{
return
robotWxId
;
}
public
void
setRobotWxId
(
String
robotWxId
)
{
this
.
robotWxId
=
robotWxId
;
}
public
String
getRequestUrl
()
{
return
requestUrl
;
}
public
void
setRequestUrl
(
String
requestUrl
)
{
this
.
requestUrl
=
requestUrl
;
}
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
Integer
getUpdateState
()
{
return
updateState
;
}
/**
* com.sdk.wxgroup.RefreshUrlEnum
*/
private
Integer
env
;
public
void
setUpdateState
(
Integer
updateState
)
{
this
.
updateState
=
updateState
;
}
private
Integer
generation
;
@Override
public
String
toString
()
{
return
"UpdateQrDTO{"
+
"id="
+
id
+
", url='"
+
url
+
'\''
+
", updateState="
+
updateState
+
", requestUrl='"
+
requestUrl
+
'\''
+
", robotWxId='"
+
robotWxId
+
'\''
+
'}'
;
}
}
pcloud-facade-book/src/main/java/com/pcloud/book/group/service/WeixinQrcodeService.java
View file @
c8025a4b
...
...
@@ -13,6 +13,8 @@ import org.springframework.http.ResponseEntity;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
...
...
@@ -77,6 +79,10 @@ public interface WeixinQrcodeService {
@GetMapping
(
"inviteNewRobot"
)
void
inviteNewRobot
(
@RequestParam
(
"wxUserId"
)
String
wxUserId
);
@ApiOperation
(
value
=
"通过群id获取群版本信息"
,
httpMethod
=
"GET"
)
@RequestMapping
(
value
=
"getGroupVersionIp"
,
method
=
RequestMethod
.
POST
)
ResponseEntity
<
ResponseDto
<
Map
<
String
,
BookWxQrcodeDTO
>>>
getGroupVersionIp
(
@RequestBody
List
<
String
>
wxGroupIds
);
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/WeixinQrcodeBiz.java
View file @
c8025a4b
...
...
@@ -127,4 +127,6 @@ public interface WeixinQrcodeBiz {
* @param wxUserId 用户微信ID
*/
void
inviteNewRobot
(
String
wxUserId
);
Map
<
String
,
BookWxQrcodeDTO
>
getGroupVersion
(
List
<
String
>
wxGroupIds
);
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/WeixinQrcodeBizImpl.java
View file @
c8025a4b
package
com
.
pcloud
.
book
.
group
.
biz
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.consumer.promotion.PromotionConsr
;
import
com.pcloud.book.consumer.wechatgroup.WechatGroupConsr
;
...
...
@@ -14,6 +15,7 @@ import com.pcloud.book.group.dto.WeixinQrcodeCountDTO;
import
com.pcloud.book.group.dto.WeixinQrcodeDTO
;
import
com.pcloud.book.group.entity.WeixinQrcode
;
import
com.pcloud.book.group.enums.UpdateStatusEnum
;
import
com.pcloud.book.group.tools.Kit
;
import
com.pcloud.book.group.tools.QrcodeTools
;
import
com.pcloud.book.group.tools.SendWeixinRequestTools
;
import
com.pcloud.book.group.vo.QrStatisticsVO
;
...
...
@@ -28,6 +30,7 @@ import com.pcloud.common.utils.string.StringUtil;
import
com.pcloud.wechatgroup.group.dto.GroupRobotDTO
;
import
com.sdk.wxgroup.AddToGroupVO
;
import
com.sdk.wxgroup.GroupInfoVO
;
import
com.sdk.wxgroup.QrcodeVO
;
import
com.sdk.wxgroup.WxGroupSDK
;
import
org.slf4j.Logger
;
...
...
@@ -39,6 +42,7 @@ import org.springframework.stereotype.Component;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -118,10 +122,10 @@ public class WeixinQrcodeBizImpl implements WeixinQrcodeBiz {
@Override
public
void
setUpdateQrUrlByQuartz
()
{
EXECUTOR_SERVICE
.
execute
(()
->
{
setUpdateQrUrl
();
setUpdateQr4Error
(
null
);
});
// ThreadPoolUtils.OTHER_THREAD_POOL
.execute(() -> {
//
setUpdateQrUrl();
//
setUpdateQr4Error(null);
//
});
}
@Override
...
...
@@ -145,7 +149,7 @@ public class WeixinQrcodeBizImpl implements WeixinQrcodeBiz {
.
map
(
UpdateQrDTO:
:
getId
).
distinct
()
.
collect
(
Collectors
.
toList
());
weixinQrcodeDao
.
setOnUpdate
(
qrIds
);
SendWeixinRequestTools
.
updateQrUrl
(
updateQrs
);
//
SendWeixinRequestTools.updateQrUrl(updateQrs);
}
}
...
...
@@ -192,7 +196,7 @@ public class WeixinQrcodeBizImpl implements WeixinQrcodeBiz {
if
(
ListUtils
.
isEmpty
(
updateQrs
))
{
break
;
}
SendWeixinRequestTools
.
updateQrUrlVIP
(
updateQrs
);
updateQrUrlVIP
(
updateQrs
);
}
}
}
...
...
@@ -246,6 +250,9 @@ public class WeixinQrcodeBizImpl implements WeixinQrcodeBiz {
@ParamLog
(
"新增二维码"
)
@Override
public
void
addQrcode
(
WeixinQrcodeVO
weixinQrcodeVO
,
Long
partyId
)
{
if
(
null
==
weixinQrcodeVO
.
getGeneration
()){
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"请选择微信群版本!"
);
}
WeixinQrcode
weixinQrcode
=
new
WeixinQrcode
();
BeanUtils
.
copyProperties
(
weixinQrcodeVO
,
weixinQrcode
);
weixinQrcode
.
setCreateUser
(
partyId
);
...
...
@@ -273,6 +280,7 @@ public class WeixinQrcodeBizImpl implements WeixinQrcodeBiz {
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"二维码无法识别,请重新上传!"
);
}
weixinQrcode
.
setQrcodeUrl
(
QrcodeTools
.
ossToFile
(
newUrl
));
weixinQrcode
.
setGeneration
(
weixinQrcodeVO
.
getGeneration
());
Long
qrcodeId
=
weixinQrcodeDao
.
insert
(
weixinQrcode
);
//若需要同步微信群id 则同步微信群
if
(
StringUtil
.
isEmpty
(
weixinQrcodeVO
.
getWeixinGroupId
())){
...
...
@@ -283,7 +291,9 @@ public class WeixinQrcodeBizImpl implements WeixinQrcodeBiz {
@Override
@ParamLog
(
"获取机器人二维码分配情况"
)
public
Map
<
Long
,
WeixinQrcodeCountDTO
>
listWeixinQrcodeCountByRobot
(
List
<
Long
>
robotIds
)
{
if
(
ListUtils
.
isEmpty
(
robotIds
))
return
null
;
if
(
ListUtils
.
isEmpty
(
robotIds
))
{
return
null
;
}
Map
<
Long
,
WeixinQrcodeCountDTO
>
robotQrCountMap
=
weixinQrcodeDao
.
listWeixinQrcodeCountByRobot
(
robotIds
);
return
robotQrCountMap
;
}
...
...
@@ -366,4 +376,47 @@ public class WeixinQrcodeBizImpl implements WeixinQrcodeBiz {
}
}
@Override
public
Map
<
String
,
BookWxQrcodeDTO
>
getGroupVersion
(
List
<
String
>
wxGroupIds
)
{
if
(
ListUtils
.
isEmpty
(
wxGroupIds
))
{
return
new
HashMap
<>();
}
return
weixinQrcodeDao
.
listByWxGroupIds
(
wxGroupIds
)
==
null
?
new
HashMap
<>()
:
weixinQrcodeDao
.
listByWxGroupIds
(
wxGroupIds
);
}
private
void
updateQrUrlVIP
(
List
<
UpdateQrDTO
>
updateQrs
)
{
if
(
ListUtils
.
isEmpty
(
updateQrs
))
{
return
;
}
List
<
Integer
>
generations
=
updateQrs
.
stream
().
map
(
UpdateQrDTO:
:
getGeneration
).
collect
(
Collectors
.
toList
());
Map
<
Integer
,
List
<
QrcodeVO
>>
map
=
new
HashMap
<>();
generations
.
forEach
(
item
->
map
.
put
(
item
,
new
ArrayList
<>()));
for
(
UpdateQrDTO
updateQrDTO
:
updateQrs
)
{
QrcodeVO
qrcodeVO
=
new
QrcodeVO
();
qrcodeVO
.
setPriority
(
2
);
qrcodeVO
.
setId
(
updateQrDTO
.
getId
());
qrcodeVO
.
setOperation
(
0
);
qrcodeVO
.
setAltId
(
updateQrDTO
.
getRobotWxId
());
String
url
=
updateQrDTO
.
getUrl
();
if
(
url
.
contains
(
"https://oss"
))
{
url
=
url
.
replace
(
"//oss"
,
"//file"
);
}
qrcodeVO
.
setUrl
(
url
);
qrcodeVO
.
setRequestUrl
(
"/book/v1.0/weixinQrcodeService/updateQrUrl"
);
Integer
generation
=
updateQrDTO
.
getGeneration
();
List
<
QrcodeVO
>
list
=
map
.
get
(
generation
);
list
.
add
(
qrcodeVO
);
}
for
(
Map
.
Entry
<
Integer
,
List
<
QrcodeVO
>>
entry
:
map
.
entrySet
())
{
Integer
generation
=
entry
.
getKey
();
List
<
QrcodeVO
>
qrcodeList
=
entry
.
getValue
();
String
virtualMachineIp
=
weixinQrcodeDao
.
getVirtualIp
(
generation
);
try
{
Kit
.
post
(
"http://"
+
virtualMachineIp
+
":8080/autoGroup"
,
JSON
.
toJSONString
(
qrcodeList
));
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"更新二维码地址(7天过期更新VIP插队)失败"
,
e
);
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/WeixinQrcodeDao.java
View file @
c8025a4b
...
...
@@ -151,4 +151,8 @@ public interface WeixinQrcodeDao extends BaseDao<WeixinQrcode> {
* @return
*/
List
<
BookWxQrcodeDTO
>
listOver10AvailableGroupByPage
(
Map
<
String
,
Object
>
paramMap
);
Map
<
String
,
BookWxQrcodeDTO
>
listByWxGroupIds
(
List
<
String
>
wxGroupIds
);
String
getVirtualIp
(
Integer
generation
);
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/WeixinQrcodeDaoImpl.java
View file @
c8025a4b
...
...
@@ -142,4 +142,16 @@ public class WeixinQrcodeDaoImpl extends BaseDaoImpl<WeixinQrcode> implements We
public
List
<
BookWxQrcodeDTO
>
listOver10AvailableGroupByPage
(
Map
<
String
,
Object
>
paramMap
)
{
return
this
.
getSqlSession
().
selectList
(
this
.
getStatement
(
"listOver10AvailableGroupByPage"
),
paramMap
);
}
@Override
public
Map
<
String
,
BookWxQrcodeDTO
>
listByWxGroupIds
(
List
<
String
>
wxGroupIds
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"wxGroupIds"
,
wxGroupIds
);
return
this
.
getSessionTemplate
().
selectMap
(
getStatement
(
"listByWxGroupIds"
),
paramMap
,
"weixinGroupId"
);
}
@Override
public
String
getVirtualIp
(
Integer
generation
)
{
return
this
.
getSessionTemplate
().
selectOne
(
"getVirtualIp"
,
generation
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/entity/WeixinQrcode.java
View file @
c8025a4b
...
...
@@ -74,6 +74,8 @@ public class WeixinQrcode extends BaseEntity {
*/
private
Long
updateUser
;
private
Integer
generation
;
@Override
public
Long
getId
()
{
return
id
;
...
...
@@ -176,6 +178,14 @@ public class WeixinQrcode extends BaseEntity {
this
.
robotWxId
=
robotWxId
;
}
public
Integer
getGeneration
()
{
return
generation
;
}
public
void
setGeneration
(
Integer
generation
)
{
this
.
generation
=
generation
;
}
@Override
public
String
toString
()
{
return
"WeixinQrcode{"
+
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/service/impl/WeixinQrcodeServiceImpl.java
View file @
c8025a4b
...
...
@@ -17,9 +17,11 @@ import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -109,4 +111,10 @@ public class WeixinQrcodeServiceImpl implements WeixinQrcodeService {
weixinQrcodeBiz
.
inviteNewRobot
(
wxUserId
);
}
@Override
@RequestMapping
(
value
=
"getGroupVersionIp"
,
method
=
RequestMethod
.
POST
)
public
ResponseEntity
<
ResponseDto
<
Map
<
String
,
BookWxQrcodeDTO
>>>
getGroupVersionIp
(
@RequestBody
List
<
String
>
wxGroupIds
)
{
return
ResponseHandleUtil
.
toResponse
(
weixinQrcodeBiz
.
getGroupVersion
(
wxGroupIds
));
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/tools/SendWeixinRequestTools.java
View file @
c8025a4b
...
...
@@ -50,7 +50,7 @@ public class SendWeixinRequestTools {
@ParamLog
(
"更新二维码地址(7天过期更新)"
)
public
static
void
updateQrUrl
(
List
<
UpdateQrDTO
>
updateQrs
)
{
if
(
ListUtils
.
isEmpty
(
updateQrs
))
{
/*
if (ListUtils.isEmpty(updateQrs)) {
return;
}
List<QrcodeVO> qrcodes = new ArrayList<>();
...
...
@@ -60,39 +60,20 @@ public class SendWeixinRequestTools {
qrcodeVO.setOperation(0);
qrcodeVO.setId(updateQrDTO.getId());
qrcodeVO.setAltId(updateQrDTO.getRobotWxId());
qrcodeVO
.
setUrl
(
updateQrDTO
.
getUrl
());
qrcodeVO
.
setRequestUrl
(
"/book/v1.0/weixinQrcodeService/updateQrUrl"
);
qrcodes
.
add
(
qrcodeVO
);
}
try
{
WxGroupSDK
.
refresh
(
qrcodes
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"更新二维码地址(7天过期更新)失败"
,
e
);
}
}
@ParamLog
(
"更新二维码地址(7天过期更新VIP插队)"
)
public
static
void
updateQrUrlVIP
(
List
<
UpdateQrDTO
>
updateQrs
)
{
if
(
ListUtils
.
isEmpty
(
updateQrs
))
{
return
;
}
List
<
QrcodeVO
>
qrcodes
=
new
ArrayList
<>();
for
(
UpdateQrDTO
updateQrDTO
:
updateQrs
)
{
QrcodeVO
qrcodeVO
=
new
QrcodeVO
();
qrcodeVO
.
setPriority
(
2
);
qrcodeVO
.
setId
(
updateQrDTO
.
getId
());
qrcodeVO
.
setOperation
(
0
);
qrcodeVO
.
setAltId
(
updateQrDTO
.
getRobotWxId
());
qrcodeVO
.
setUrl
(
updateQrDTO
.
getUrl
());
String url = updateQrDTO.getUrl();
if (url.contains("https://oss")) {
url = url.replace("//oss", "//file");
}
qrcodeVO.setUrl(url);
qrcodeVO.setRequestUrl("/book/v1.0/weixinQrcodeService/updateQrUrl");
qrcodes.add(qrcodeVO);
}
try {
WxGroupSDK
.
refresh
(
qrcodes
);
// TODO 更新ip
Kit.post("http:/192.168.82.213:8080/autoGroup",JSON.toJSONString(qrcodeList));
} catch (Exception e) {
LOGGER
.
error
(
"更新二维码地址(7天过期更新VIP插队
)失败"
,
e
);
}
log.error("更新二维码地址(7天过期更新
)失败", e);
}
*/
}
/**
...
...
@@ -101,7 +82,7 @@ public class SendWeixinRequestTools {
* @Date:2019/4/15 15:36
*/
public
static
void
syncOneWeixinGroupId
(
Long
qrcodeId
,
String
qrcodeUrl
,
String
weixinRobotId
)
{
List
<
QrcodeVO
>
qrcodeVOS
=
new
ArrayList
<>();
/*
List<QrcodeVO> qrcodeVOS = new ArrayList<>();
QrcodeVO qrcodeVO = new QrcodeVO();
qrcodeVO.setId(qrcodeId);
qrcodeVO.setUrl(qrcodeUrl);
...
...
@@ -111,10 +92,11 @@ public class SendWeixinRequestTools {
qrcodeVO.setRequestUrl("/book/v1.0/weixinQrcodeService/syncWeixinGroupId");
qrcodeVOS.add(qrcodeVO);
try {
WxGroupSDK
.
syncWeixinGroupId
(
qrcodeVOS
);
// TODO 更新ip
WxGroupSDK.syncWeixinGroupId(qrcodeVOS, null);
} catch (Exception e) {
LOGGER
.
error
(
"发送同步微信id请求失败"
,
e
);
}
log
.error("发送同步微信id请求失败", e);
}
*/
}
/**
...
...
@@ -123,7 +105,7 @@ public class SendWeixinRequestTools {
* @Date:2019/4/26 17:50
*/
public
static
void
syncWeixinGroupIds
(
List
<
SyncWeixinGroupIdRequestDTO
>
weixinGroupIdDTOS
)
{
if
(
ListUtils
.
isEmpty
(
weixinGroupIdDTOS
))
{
/*
if (ListUtils.isEmpty(weixinGroupIdDTOS)) {
return;
}
List<QrcodeVO> qrcodeVOS = new ArrayList<>();
...
...
@@ -138,10 +120,11 @@ public class SendWeixinRequestTools {
qrcodeVOS.add(qrcodeVO);
}
try {
WxGroupSDK
.
syncWeixinGroupId
(
qrcodeVOS
);
// TODO 更新ip
WxGroupSDK.syncWeixinGroupId(qrcodeVOS, null);
} catch (Exception e) {
LOGGER
.
error
(
"批量同步微信群标识失败"
,
e
);
}
log
.error("批量同步微信群标识失败", e);
}
*/
}
@ParamLog
(
"修改微信群名称"
)
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/vo/WeixinQrcodeVO.java
View file @
c8025a4b
...
...
@@ -28,6 +28,9 @@ public class WeixinQrcodeVO implements Serializable {
@ApiModelProperty
(
"微信群标识"
)
private
String
weixinGroupId
;
@ApiModelProperty
(
"微信群版本号"
)
private
Integer
generation
;
public
String
getWeixinGroupId
()
{
return
weixinGroupId
;
}
...
...
@@ -60,6 +63,14 @@ public class WeixinQrcodeVO implements Serializable {
this
.
robotWxId
=
robotWxId
;
}
public
Integer
getGeneration
()
{
return
generation
;
}
public
void
setGeneration
(
Integer
generation
)
{
this
.
generation
=
generation
;
}
@Override
public
String
toString
()
{
return
"WeixinQrcodeVO{"
+
...
...
pcloud-service-book/src/main/resources/mapper/group/WeixinQrcode.Mapper.xml
View file @
c8025a4b
...
...
@@ -10,6 +10,7 @@
<result
column=
"qrcode_url"
property=
"qrcodeUrl"
jdbcType=
"BIGINT"
/>
<result
column=
"use_state"
property=
"useState"
jdbcType=
"TINYINT"
/>
<result
column=
"update_qr_time"
property=
"updateQrTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"generation"
property=
"generation"
jdbcType=
"INTEGER"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
...
...
@@ -27,8 +28,8 @@
<insert
id=
"insert"
parameterType =
"weixinQrcode"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
INSERT INTO
weixin_qrcode(qrcode_url, weixin_group_id, robot_id, robot_wx_id, update_state, create_user, create_time, update_qr_time)
VALUES (#{qrcodeUrl,jdbcType=VARCHAR},#{weixinGroupId,jdbcType=VARCHAR}, #{robotId,jdbcType=BIGINT},#{robotWxId,jdbcType=VARCHAR},#{updateState},#{createUser}, NOW(),now())
weixin_qrcode(qrcode_url, weixin_group_id, robot_id, robot_wx_id, update_state, create_user, create_time, update_qr_time
, generation
)
VALUES (#{qrcodeUrl,jdbcType=VARCHAR},#{weixinGroupId,jdbcType=VARCHAR}, #{robotId,jdbcType=BIGINT},#{robotWxId,jdbcType=VARCHAR},#{updateState},#{createUser}, NOW(),now()
, #{generation}
)
</insert>
<select
id=
"getOneWechatGroup"
resultType =
"WeixinQrcodeDTO"
>
...
...
@@ -73,7 +74,7 @@
<select
id=
"getInitialQr"
resultType=
"UpdateQrDTO"
parameterType=
"map"
>
select
qrcode_url url, ID, robot_wx_id robotWxId
qrcode_url url, ID, robot_wx_id robotWxId
, generation
from
weixin_qrcode
where
...
...
@@ -117,7 +118,7 @@
<select
id=
"getQrOnHandle"
resultType=
"UpdateQrDTO"
parameterType=
"map"
>
select
qrcode_url url, ID, robot_wx_id robotWxId
qrcode_url url, ID, robot_wx_id robotWxId
, generation
from
weixin_qrcode
where
...
...
@@ -253,4 +254,25 @@
LIMIT #{currentPage}, #{numPerPage}
</select>
<select
id=
"listByWxGroupIds"
parameterType=
"map"
resultType=
"com.pcloud.book.group.dto.BookWxQrcodeDTO"
>
SELECT
weixin_group_id weixinGroupId,
robot_wx_id robotWxId,
a.generation,
b.wechat_group_ip wechatGroupIp
FROM
`weixin_qrcode` a left join weixin_qrcode_generation b
on a.generation = b.generation
WHERE
weixin_group_id IN
<foreach
collection=
"wxGroupIds"
open=
"("
close=
")"
separator=
","
item=
"item"
>
#{item}
</foreach>
</select>
<select
id=
"getVirtualIp"
parameterType=
"int"
resultType=
"string"
>
SELECT virtual_machine_ip from weixin_qrcode_generation
where generation = #{_parameter}
</select>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment