Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
b55c7a19
Commit
b55c7a19
authored
Feb 06, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
店铺白名单
parent
bf84e2ea
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
1652 additions
and
3 deletions
+1652
-3
ch-dao/src/main/java/com/wwdz/ch/db/dao/distribution/ShopWhiteListDao.java
...ava/com/wwdz/ch/db/dao/distribution/ShopWhiteListDao.java
+10
-0
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/ShopWhiteList.java
...ava/com/wwdz/ch/db/domain/distribution/ShopWhiteList.java
+264
-0
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/ShopWhiteListExample.java
.../wwdz/ch/db/domain/distribution/ShopWhiteListExample.java
+963
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/ShopWhiteListDaoImpl.java
...om/wwdz/ch/db/impl/distribution/ShopWhiteListDaoImpl.java
+31
-0
ch-dao/src/main/java/com/wwdz/ch/db/mapper/distribution/ShopWhiteListMapper.java
...m/wwdz/ch/db/mapper/distribution/ShopWhiteListMapper.java
+69
-0
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/distribution/ShopWhiteListMapper.xml
...om/wwdz/ch/db/mapper/distribution/ShopWhiteListMapper.xml
+306
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/UserServiceImpl.java
...pi/src/main/java/com/wwdz/ch/wx/impl/UserServiceImpl.java
+9
-3
No files found.
ch-dao/src/main/java/com/wwdz/ch/db/dao/distribution/ShopWhiteListDao.java
0 → 100644
View file @
b55c7a19
package
com.wwdz.ch.db.dao.distribution
;
import
com.wwdz.ch.db.domain.distribution.ShopWhiteList
;
public
interface
ShopWhiteListDao
{
boolean
isExisted
(
long
userId
);
ShopWhiteList
findByUserId
(
long
userId
);
}
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/ShopWhiteList.java
0 → 100644
View file @
b55c7a19
package
com.wwdz.ch.db.domain.distribution
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
/**
* @author shiyu
* @date 2024/02/06
*/
@Data
public
class
ShopWhiteList
implements
Entity
{
private
Integer
id
;
/**
* 用户id
*/
private
Long
userId
;
/**
* 店铺id
*/
private
Long
shopId
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 是否有效
*/
private
Boolean
isValid
;
private
static
final
long
serialVersionUID
=
1L
;
@Override
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
getClass
().
getSimpleName
());
sb
.
append
(
" ["
);
sb
.
append
(
"Hash = "
).
append
(
hashCode
());
sb
.
append
(
", id="
).
append
(
id
);
sb
.
append
(
", userId="
).
append
(
userId
);
sb
.
append
(
", shopId="
).
append
(
shopId
);
sb
.
append
(
", createTime="
).
append
(
createTime
);
sb
.
append
(
", isValid="
).
append
(
isValid
);
sb
.
append
(
", serialVersionUID="
).
append
(
serialVersionUID
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
}
@Override
public
boolean
equals
(
Object
that
)
{
if
(
this
==
that
)
{
return
true
;
}
if
(
that
==
null
)
{
return
false
;
}
if
(
getClass
()
!=
that
.
getClass
())
{
return
false
;
}
ShopWhiteList
other
=
(
ShopWhiteList
)
that
;
return
(
this
.
getId
()
==
null
?
other
.
getId
()
==
null
:
this
.
getId
().
equals
(
other
.
getId
()))
&&
(
this
.
getUserId
()
==
null
?
other
.
getUserId
()
==
null
:
this
.
getUserId
().
equals
(
other
.
getUserId
()))
&&
(
this
.
getShopId
()
==
null
?
other
.
getShopId
()
==
null
:
this
.
getShopId
().
equals
(
other
.
getShopId
()))
&&
(
this
.
getCreateTime
()
==
null
?
other
.
getCreateTime
()
==
null
:
this
.
getCreateTime
().
equals
(
other
.
getCreateTime
()))
&&
(
this
.
getIsValid
()
==
null
?
other
.
getIsValid
()
==
null
:
this
.
getIsValid
().
equals
(
other
.
getIsValid
()));
}
@Override
public
int
hashCode
()
{
final
int
prime
=
31
;
int
result
=
1
;
result
=
prime
*
result
+
((
getId
()
==
null
)
?
0
:
getId
().
hashCode
());
result
=
prime
*
result
+
((
getUserId
()
==
null
)
?
0
:
getUserId
().
hashCode
());
result
=
prime
*
result
+
((
getShopId
()
==
null
)
?
0
:
getShopId
().
hashCode
());
result
=
prime
*
result
+
((
getCreateTime
()
==
null
)
?
0
:
getCreateTime
().
hashCode
());
result
=
prime
*
result
+
((
getIsValid
()
==
null
)
?
0
:
getIsValid
().
hashCode
());
return
result
;
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table shop_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
enum
Column
{
id
(
"id"
,
"id"
,
"INTEGER"
,
false
),
userId
(
"user_id"
,
"userId"
,
"BIGINT"
,
false
),
shopId
(
"shop_id"
,
"shopId"
,
"BIGINT"
,
false
),
createTime
(
"create_time"
,
"createTime"
,
"TIMESTAMP"
,
false
),
isValid
(
"is_valid"
,
"isValid"
,
"BIT"
,
false
);
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table shop_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private
static
final
String
BEGINNING_DELIMITER
=
"`"
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table shop_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private
static
final
String
ENDING_DELIMITER
=
"`"
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table shop_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private
final
String
column
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table shop_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private
final
boolean
isColumnNameDelimited
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table shop_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private
final
String
javaProperty
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table shop_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private
final
String
jdbcType
;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table shop_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
value
()
{
return
this
.
column
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table shop_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
getValue
()
{
return
this
.
column
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table shop_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
getJavaProperty
()
{
return
this
.
javaProperty
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table shop_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
getJdbcType
()
{
return
this
.
jdbcType
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table shop_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Column
(
String
column
,
String
javaProperty
,
String
jdbcType
,
boolean
isColumnNameDelimited
)
{
this
.
column
=
column
;
this
.
javaProperty
=
javaProperty
;
this
.
jdbcType
=
jdbcType
;
this
.
isColumnNameDelimited
=
isColumnNameDelimited
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table shop_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
desc
()
{
return
this
.
getEscapedColumnName
()
+
" DESC"
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table shop_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
asc
()
{
return
this
.
getEscapedColumnName
()
+
" ASC"
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table shop_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
static
Column
[]
excludes
(
Column
...
excludes
)
{
ArrayList
<
Column
>
columns
=
new
ArrayList
<>(
Arrays
.
asList
(
Column
.
values
()));
if
(
excludes
!=
null
&&
excludes
.
length
>
0
)
{
columns
.
removeAll
(
new
ArrayList
<>(
Arrays
.
asList
(
excludes
)));
}
return
columns
.
toArray
(
new
Column
[]{});
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table shop_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
getEscapedColumnName
()
{
if
(
this
.
isColumnNameDelimited
)
{
return
new
StringBuilder
().
append
(
BEGINNING_DELIMITER
).
append
(
this
.
column
).
append
(
ENDING_DELIMITER
).
toString
();
}
else
{
return
this
.
column
;
}
}
}
}
\ No newline at end of file
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/ShopWhiteListExample.java
0 → 100644
View file @
b55c7a19
This diff is collapsed.
Click to expand it.
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/ShopWhiteListDaoImpl.java
0 → 100644
View file @
b55c7a19
package
com.wwdz.ch.db.impl.distribution
;
import
com.wwdz.ch.db.dao.distribution.ShopWhiteListDao
;
import
com.wwdz.ch.db.domain.distribution.ShopWhiteList
;
import
com.wwdz.ch.db.domain.distribution.ShopWhiteListExample
;
import
com.wwdz.ch.db.mapper.distribution.ShopWhiteListMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Repository
;
@Repository
public
class
ShopWhiteListDaoImpl
implements
ShopWhiteListDao
{
@Autowired
ShopWhiteListMapper
shopWhiteListMapper
;
@Override
public
boolean
isExisted
(
long
userId
)
{
ShopWhiteListExample
example
=
new
ShopWhiteListExample
();
ShopWhiteListExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andUserIdEqualTo
(
userId
);
return
shopWhiteListMapper
.
countByExample
(
example
)
>
0
;
}
@Override
public
ShopWhiteList
findByUserId
(
long
userId
)
{
ShopWhiteListExample
example
=
new
ShopWhiteListExample
();
ShopWhiteListExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andUserIdEqualTo
(
userId
);
return
shopWhiteListMapper
.
selectOneByExample
(
example
);
}
}
ch-dao/src/main/java/com/wwdz/ch/db/mapper/distribution/ShopWhiteListMapper.java
0 → 100644
View file @
b55c7a19
package
com.wwdz.ch.db.mapper.distribution
;
import
com.wwdz.ch.db.domain.distribution.ShopWhiteList
;
import
com.wwdz.ch.db.domain.distribution.ShopWhiteListExample
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
@Mapper
public
interface
ShopWhiteListMapper
{
long
countByExample
(
ShopWhiteListExample
example
);
int
deleteByExample
(
ShopWhiteListExample
example
);
int
deleteByPrimaryKey
(
Integer
id
);
int
insert
(
ShopWhiteList
record
);
int
insertSelective
(
ShopWhiteList
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table shop_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
ShopWhiteList
selectOneByExample
(
ShopWhiteListExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table shop_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
ShopWhiteList
selectOneByExampleSelective
(
@Param
(
"example"
)
ShopWhiteListExample
example
,
@Param
(
"selective"
)
ShopWhiteList
.
Column
...
selective
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table shop_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
List
<
ShopWhiteList
>
selectByExampleSelective
(
@Param
(
"example"
)
ShopWhiteListExample
example
,
@Param
(
"selective"
)
ShopWhiteList
.
Column
...
selective
);
List
<
ShopWhiteList
>
selectByExample
(
ShopWhiteListExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table shop_white_list
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
ShopWhiteList
selectByPrimaryKeySelective
(
@Param
(
"id"
)
Integer
id
,
@Param
(
"selective"
)
ShopWhiteList
.
Column
...
selective
);
ShopWhiteList
selectByPrimaryKey
(
Integer
id
);
int
updateByExampleSelective
(
@Param
(
"record"
)
ShopWhiteList
record
,
@Param
(
"example"
)
ShopWhiteListExample
example
);
int
updateByExample
(
@Param
(
"record"
)
ShopWhiteList
record
,
@Param
(
"example"
)
ShopWhiteListExample
example
);
int
updateByPrimaryKeySelective
(
ShopWhiteList
record
);
int
updateByPrimaryKey
(
ShopWhiteList
record
);
}
\ No newline at end of file
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/distribution/ShopWhiteListMapper.xml
0 → 100644
View file @
b55c7a19
This diff is collapsed.
Click to expand it.
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/UserServiceImpl.java
View file @
b55c7a19
...
@@ -23,9 +23,11 @@ import com.wwdz.ch.db.dao.AiAssistantDao;
...
@@ -23,9 +23,11 @@ import com.wwdz.ch.db.dao.AiAssistantDao;
import
com.wwdz.ch.db.dao.ConsignSaleDao
;
import
com.wwdz.ch.db.dao.ConsignSaleDao
;
import
com.wwdz.ch.db.dao.ReturnOrderDao
;
import
com.wwdz.ch.db.dao.ReturnOrderDao
;
import
com.wwdz.ch.db.dao.UserDao
;
import
com.wwdz.ch.db.dao.UserDao
;
import
com.wwdz.ch.db.dao.distribution.ShopWhiteListDao
;
import
com.wwdz.ch.db.domain.AiAssistant
;
import
com.wwdz.ch.db.domain.AiAssistant
;
import
com.wwdz.ch.db.domain.Switch
;
import
com.wwdz.ch.db.domain.Switch
;
import
com.wwdz.ch.db.domain.User
;
import
com.wwdz.ch.db.domain.User
;
import
com.wwdz.ch.db.domain.distribution.ShopWhiteList
;
import
com.wwdz.ch.db.dto.request.FollowFansRecordRequestDto
;
import
com.wwdz.ch.db.dto.request.FollowFansRecordRequestDto
;
import
com.wwdz.ch.wx.constant.CacheCodeConstants
;
import
com.wwdz.ch.wx.constant.CacheCodeConstants
;
import
com.wwdz.ch.wx.constant.LoginTypeEnum
;
import
com.wwdz.ch.wx.constant.LoginTypeEnum
;
...
@@ -144,6 +146,9 @@ public class UserServiceImpl implements UserService {
...
@@ -144,6 +146,9 @@ public class UserServiceImpl implements UserService {
@Reference
@Reference
ShopReadService
shopReadService
;
ShopReadService
shopReadService
;
@Autowired
ShopWhiteListDao
shopWhiteListDao
;
@Override
@Override
public
Result
finishLogin
(
UserRequestDto
dto
)
{
public
Result
finishLogin
(
UserRequestDto
dto
)
{
...
@@ -188,15 +193,16 @@ public class UserServiceImpl implements UserService {
...
@@ -188,15 +193,16 @@ public class UserServiceImpl implements UserService {
userDao
.
insertByMapper
(
user
);
userDao
.
insertByMapper
(
user
);
result
.
put
(
"phone"
,
phone
);
result
.
put
(
"phone"
,
phone
);
//判断登录用户是否是分销商
//判断登录用户是否是分销商
if
(
dto
.
getUserId
()
==
42192256L
||
dto
.
getUserId
()
==
61074146L
||
dto
.
getUserId
()
==
3387401L
)
{
if
(
shopWhiteListDao
.
isExisted
(
dto
.
getUserId
()))
{
ShopWhiteList
shopWhiteList
=
shopWhiteListDao
.
findByUserId
(
dto
.
getUserId
());
result
.
put
(
"isShop"
,
true
);
result
.
put
(
"isShop"
,
true
);
result
.
put
(
"shopId"
,
61319910L
);
result
.
put
(
"shopId"
,
shopWhiteList
.
getShopId
()
==
null
?
dto
.
getUserId
()
:
shopWhiteList
.
getShopId
()
);
}
else
{
}
else
{
try
{
try
{
CloudServerResponse
<
ShopDTO
>
cloudServerResponse
=
shopReadService
.
getShopByUserId
(
dto
.
getUserId
(),
new
ShopQueryOption
());
CloudServerResponse
<
ShopDTO
>
cloudServerResponse
=
shopReadService
.
getShopByUserId
(
dto
.
getUserId
(),
new
ShopQueryOption
());
if
(
cloudServerResponse
.
isSuccess
())
{
if
(
cloudServerResponse
.
isSuccess
())
{
ShopDTO
shopDTO
=
cloudServerResponse
.
getResult
();
ShopDTO
shopDTO
=
cloudServerResponse
.
getResult
();
if
(
shopDTO
!=
null
&&
!
ObjectUtils
.
isEmpty
(
shopDTO
.
getShopId
()))
{
if
(
shopDTO
!=
null
&&
!
ObjectUtils
.
isEmpty
(
shopDTO
.
getShopId
())
&&
shopDTO
.
getPayStatus
()
==
1
&&
shopDTO
.
getCheckStatus
()
==
1
&&
shopDTO
.
getType
()
==
4
)
{
result
.
put
(
"isShop"
,
true
);
result
.
put
(
"isShop"
,
true
);
result
.
put
(
"shopId"
,
shopDTO
.
getShopId
());
result
.
put
(
"shopId"
,
shopDTO
.
getShopId
());
}
else
{
}
else
{
...
...
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