Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
QianQiXiang
haoban-manage3.0
Commits
d90be39e
Commit
d90be39e
authored
Apr 14, 2021
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
授权绑定,授权门店列表,binlog
parent
648e8cd4
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
1989 additions
and
81 deletions
+1989
-81
BindStoreInfoDTO.java
.../java/com/gic/haoban/manage/api/dto/BindStoreInfoDTO.java
+75
-0
MaterialDTO.java
.../main/java/com/gic/haoban/manage/api/dto/MaterialDTO.java
+10
-0
StoreOrGroupInfoDTO.java
...va/com/gic/haoban/manage/api/dto/StoreOrGroupInfoDTO.java
+36
-0
WxEnterpriseRelationDetailDTO.java
.../haoban/manage/api/dto/WxEnterpriseRelationDetailDTO.java
+93
-0
MaterialApiService.java
...com/gic/haoban/manage/api/service/MaterialApiService.java
+10
-0
WxEnterpriseRelatedApiService.java
...ban/manage/api/service/WxEnterpriseRelatedApiService.java
+47
-1
TabHaobanMaterialMapper.java
...an/manage/service/dao/mapper/TabHaobanMaterialMapper.java
+5
-0
TabHaobanStoreRangeMapper.java
.../manage/service/dao/mapper/TabHaobanStoreRangeMapper.java
+67
-0
TabHaobanStoreRelationMapper.java
...nage/service/dao/mapper/TabHaobanStoreRelationMapper.java
+48
-0
WxEnterpriseMapper.java
.../haoban/manage/service/dao/mapper/WxEnterpriseMapper.java
+2
-1
WxEnterpriseRelatedMapper.java
.../manage/service/dao/mapper/WxEnterpriseRelatedMapper.java
+10
-0
TabHaobanMaterial.java
...m/gic/haoban/manage/service/entity/TabHaobanMaterial.java
+10
-0
TabHaobanWxEnterpriseRelated.java
...n/manage/service/entity/TabHaobanWxEnterpriseRelated.java
+32
-0
TabStoreRange.java
...a/com/gic/haoban/manage/service/entity/TabStoreRange.java
+202
-0
TabStoreRelation.java
...om/gic/haoban/manage/service/entity/TabStoreRelation.java
+215
-0
GroupSyncPojo.java
...ava/com/gic/haoban/manage/service/pojo/GroupSyncPojo.java
+63
-0
StoreSyncPojo.java
...ava/com/gic/haoban/manage/service/pojo/StoreSyncPojo.java
+74
-0
MaterialService.java
...om/gic/haoban/manage/service/service/MaterialService.java
+2
-0
StoreRangeService.java
.../gic/haoban/manage/service/service/StoreRangeService.java
+74
-0
WxEnterpriseRelatedService.java
...an/manage/service/service/WxEnterpriseRelatedService.java
+10
-0
MaterialServiceImpl.java
...oban/manage/service/service/impl/MaterialServiceImpl.java
+13
-0
StoreRangeServiceImpl.java
...an/manage/service/service/impl/StoreRangeServiceImpl.java
+94
-0
WxEnterpriseRelatedServiceImpl.java
.../service/service/impl/WxEnterpriseRelatedServiceImpl.java
+28
-1
MaterialApiServiceImpl.java
...nage/service/service/out/impl/MaterialApiServiceImpl.java
+30
-0
WxEnterpriseRelatedApiServiceImpl.java
...e/service/out/impl/WxEnterpriseRelatedApiServiceImpl.java
+123
-7
KafkaMessageServiceImpl.java
...c/haoban/manage/service/task/KafkaMessageServiceImpl.java
+61
-18
kafka-setting.xml
haoban-manage3-service/src/main/resources/kafka-setting.xml
+1
-0
TabHaobanMaterialMapper.xml
...ice/src/main/resources/mapper/TabHaobanMaterialMapper.xml
+23
-3
TabHaobanStoreRangeMapper.xml
...e/src/main/resources/mapper/TabHaobanStoreRangeMapper.xml
+176
-0
TabHaobanStoreRelationMapper.xml
...rc/main/resources/mapper/TabHaobanStoreRelationMapper.xml
+152
-0
WxEnterpriseRelatedMapper.xml
...e/src/main/resources/mapper/WxEnterpriseRelatedMapper.xml
+25
-2
ServiceTest.java
haoban-manage3-service/src/test/java/ServiceTest.java
+19
-6
MaterialController.java
.../gic/haoban/manage/web/controller/MaterialController.java
+24
-8
WxEnterpriseController.java
.../haoban/manage/web/controller/WxEnterpriseController.java
+55
-34
WxEnterpriseBindQo.java
...java/com/gic/haoban/manage/web/qo/WxEnterpriseBindQo.java
+80
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/BindStoreInfoDTO.java
0 → 100644
View file @
d90be39e
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* Created 2021/4/14.
*
* @author hua
*/
public
class
BindStoreInfoDTO
implements
Serializable
{
private
String
storeId
;
private
String
storeCode
;
private
String
enterpriseId
;
private
String
storeName
;
private
String
storeGroupName
;
private
String
storeGroupId
;
private
Date
createTime
;
public
String
getStoreId
()
{
return
storeId
;
}
public
void
setStoreId
(
String
storeId
)
{
this
.
storeId
=
storeId
;
}
public
String
getStoreCode
()
{
return
storeCode
;
}
public
void
setStoreCode
(
String
storeCode
)
{
this
.
storeCode
=
storeCode
;
}
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
String
getStoreName
()
{
return
storeName
;
}
public
void
setStoreName
(
String
storeName
)
{
this
.
storeName
=
storeName
;
}
public
String
getStoreGroupName
()
{
return
storeGroupName
;
}
public
void
setStoreGroupName
(
String
storeGroupName
)
{
this
.
storeGroupName
=
storeGroupName
;
}
public
String
getStoreGroupId
()
{
return
storeGroupId
;
}
public
void
setStoreGroupId
(
String
storeGroupId
)
{
this
.
storeGroupId
=
storeGroupId
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/MaterialDTO.java
View file @
d90be39e
...
...
@@ -41,8 +41,18 @@ public class MaterialDTO implements Serializable{
private
Date
updateTime
;
private
String
fromMaterialId
=
"-1"
;
private
static
final
long
serialVersionUID
=
1L
;
public
String
getFromMaterialId
()
{
return
fromMaterialId
;
}
public
void
setFromMaterialId
(
String
fromMaterialId
)
{
this
.
fromMaterialId
=
fromMaterialId
;
}
public
String
getMaterialId
()
{
return
materialId
;
}
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/StoreOrGroupInfoDTO.java
0 → 100644
View file @
d90be39e
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
;
/**
* Created 2021/4/13.
*
* @author hua
*/
public
class
StoreOrGroupInfoDTO
{
private
String
relationId
;
private
int
relationType
;
private
String
relationName
;
public
String
getRelationId
()
{
return
relationId
;
}
public
void
setRelationId
(
String
relationId
)
{
this
.
relationId
=
relationId
;
}
public
int
getRelationType
()
{
return
relationType
;
}
public
void
setRelationType
(
int
relationType
)
{
this
.
relationType
=
relationType
;
}
public
String
getRelationName
()
{
return
relationName
;
}
public
void
setRelationName
(
String
relationName
)
{
this
.
relationName
=
relationName
;
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/WxEnterpriseRelationDetailDTO.java
0 → 100644
View file @
d90be39e
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* Created 2021/4/13.
*
* @author hua
*/
public
class
WxEnterpriseRelationDetailDTO
implements
Serializable
{
private
String
wxEnterpriseId
;
private
String
enterpriseId
;
private
String
enterpriseName
;
private
String
version
;
private
String
staffId
;
private
String
staffName
;
private
int
wxEnterpriseType
;
private
int
memberOpenCardFlag
;
private
List
<
StoreOrGroupInfoDTO
>
relations
;
public
String
getEnterpriseName
()
{
return
enterpriseName
;
}
public
void
setEnterpriseName
(
String
enterpriseName
)
{
this
.
enterpriseName
=
enterpriseName
;
}
public
List
<
StoreOrGroupInfoDTO
>
getRelations
()
{
return
relations
;
}
public
void
setRelations
(
List
<
StoreOrGroupInfoDTO
>
relations
)
{
this
.
relations
=
relations
;
}
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
String
getVersion
()
{
return
version
;
}
public
void
setVersion
(
String
version
)
{
this
.
version
=
version
;
}
public
String
getStaffId
()
{
return
staffId
;
}
public
void
setStaffId
(
String
staffId
)
{
this
.
staffId
=
staffId
;
}
public
String
getStaffName
()
{
return
staffName
;
}
public
void
setStaffName
(
String
staffName
)
{
this
.
staffName
=
staffName
;
}
public
int
getWxEnterpriseType
()
{
return
wxEnterpriseType
;
}
public
void
setWxEnterpriseType
(
int
wxEnterpriseType
)
{
this
.
wxEnterpriseType
=
wxEnterpriseType
;
}
public
int
getMemberOpenCardFlag
()
{
return
memberOpenCardFlag
;
}
public
void
setMemberOpenCardFlag
(
int
memberOpenCardFlag
)
{
this
.
memberOpenCardFlag
=
memberOpenCardFlag
;
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/MaterialApiService.java
View file @
d90be39e
...
...
@@ -4,6 +4,7 @@ import java.util.List;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.MaterialCategoryDTO
;
import
com.gic.haoban.manage.api.dto.MaterialDTO
;
...
...
@@ -33,4 +34,13 @@ public interface MaterialApiService {
List
<
MaterialCategoryDTO
>
listByParentCategory
(
String
categoryId
);
/**
* 分析素材
*
* @param toWxEnterpriseId
* @param wxEnterpriseId
* @param materialId
*/
ServiceResponse
<
Void
>
shareMaterial
(
String
wxEnterpriseId
,
String
toWxEnterpriseId
,
String
materialId
);
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/WxEnterpriseRelatedApiService.java
View file @
d90be39e
...
...
@@ -3,7 +3,9 @@ package com.gic.haoban.manage.api.service;
import
java.util.Date
;
import
java.util.List
;
import
com.gic.haoban.manage.api.dto.EnterpriseDetailDTO
;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.manage.api.dto.*
;
public
interface
WxEnterpriseRelatedApiService
{
List
<
EnterpriseDetailDTO
>
listEnterpriseByWxEnterpriseId
(
String
wxEnterpriseId
);
...
...
@@ -26,6 +28,50 @@ public interface WxEnterpriseRelatedApiService {
*/
List
<
EnterpriseDetailDTO
>
queryBindGicEnterpriseByTime
(
String
seqTime
);
@Deprecated
int
wxEnterpriseBind
(
String
enterpriseId
,
String
wxEnterpriseId
,
String
version
,
String
staffId
,
String
staffName
);
/**
* 企业绑定
*
* @param detailDTO
* @return
*/
int
wxEnterpriseBind
(
WxEnterpriseRelationDetailDTO
detailDTO
);
/**
* 刷新企业门店
*
* @param enterpriseId
* @param wxEnterpriseId
* @param staffId
* @return
*/
public
boolean
flushBindStoreByEnterpriseId
(
String
enterpriseId
,
String
wxEnterpriseId
,
String
staffId
);
/**
* 获取企业绑定详情
*
* @param wxEnterpriseId
* @param enterpriseId
* @return
*/
public
WxEnterpriseRelationDetailDTO
getEnterpriseBindInfo
(
String
wxEnterpriseId
,
String
enterpriseId
);
/**
* 根据商户id 获取关联的微信企业列表
*
* @param enterpriseId
* @return
*/
public
List
<
WxEnterpriseDTO
>
listWxEnterpriseByEid
(
String
enterpriseId
);
/**
* @param enterpriseId
* @param search
* @param pageInfo
* @return
*/
public
Page
<
BindStoreInfoDTO
>
pageBindStoreByEnterpriseId
(
String
wxEnterpriseId
,
String
enterpriseId
,
String
search
,
BasePageInfo
pageInfo
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanMaterialMapper.java
View file @
d90be39e
...
...
@@ -23,4 +23,8 @@ public interface TabHaobanMaterialMapper {
List
<
TabHaobanMaterial
>
listMaterialByCategoryId
(
String
categoryId
);
Page
<
TabHaobanMaterial
>
listMaterial
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"keyword"
)
String
keyword
,
@Param
(
"categoryId"
)
String
categoryId
,
@Param
(
"materialType"
)
Integer
materialType
);
TabHaobanMaterial
selectByfromMaterialId
(
@Param
(
"fromMaterialId"
)
String
fromMaterialId
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
List
<
TabHaobanMaterial
>
listByfromMaterialId
(
@Param
(
"fromMaterialId"
)
String
fromMaterialId
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanStoreRangeMapper.java
0 → 100644
View file @
d90be39e
package
com
.
gic
.
haoban
.
manage
.
service
.
dao
.
mapper
;
import
com.gic.haoban.manage.service.entity.TabStoreRange
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
@Mapper
public
interface
TabHaobanStoreRangeMapper
{
/**
*/
int
deleteByPrimaryKey
(
String
storeRangeId
);
/**
*/
int
insert
(
TabStoreRange
record
);
/**
*/
int
insertSelective
(
TabStoreRange
record
);
/**
*/
TabStoreRange
selectByPrimaryKey
(
String
storeRangeId
);
/**
*/
int
updateByPrimaryKeySelective
(
TabStoreRange
record
);
/**
*/
int
updateByPrimaryKey
(
TabStoreRange
record
);
/**
* 查询关联的所有分组信息
*
* @param wxEnterpriseId
* @param enterpriseId
* @return
*/
List
<
TabStoreRange
>
queryByEnterpriseId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"enterpriseId"
)
String
enterpriseId
);
/**
* 删除关联关系
*
* @param wxEnterpriseId
* @param enterpriseId
* @return
*/
int
deleteByEnterpriseId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"enterpriseId"
)
String
enterpriseId
);
/**
* 删除关联关系
*
* @param relationId
* @param enterpriseId
* @return
*/
int
delStoreRangeByRelationId
(
@Param
(
"relationId"
)
String
relationId
,
@Param
(
"enterpriseId"
)
String
enterpriseId
);
/**
* 批量插入
*/
int
insertBatch
(
@Param
(
"list"
)
List
<
TabStoreRange
>
list
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanStoreRelationMapper.java
0 → 100644
View file @
d90be39e
package
com
.
gic
.
haoban
.
manage
.
service
.
dao
.
mapper
;
import
com.gic.haoban.manage.service.entity.TabStoreRelation
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
@Mapper
public
interface
TabHaobanStoreRelationMapper
{
/**
*/
int
deleteByPrimaryKey
(
String
storeRelationId
);
/**
*/
int
insert
(
TabStoreRelation
record
);
/**
*/
int
insertSelective
(
TabStoreRelation
record
);
/**
*/
TabStoreRelation
selectByPrimaryKey
(
String
storeRelationId
);
/**
*/
int
updateByPrimaryKeySelective
(
TabStoreRelation
record
);
/**
*/
int
updateByPrimaryKey
(
TabStoreRelation
record
);
/**
* 删除门店
*
* @param enterpriseId
* @param storeId
* @return
*/
public
int
deleteStoreRalation
(
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"storeId"
)
String
storeId
);
/**
*/
List
<
TabStoreRelation
>
searchStoreRange
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"search"
)
String
search
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/WxEnterpriseMapper.java
View file @
d90be39e
...
...
@@ -30,7 +30,7 @@ public interface WxEnterpriseMapper {
List
<
TabHaobanWxEnterprise
>
listAll
();
List
<
TabHaobanWxEnterprise
>
listByIds
(
@Param
(
"enterpriseIds"
)
Set
<
String
>
e
nterpriseIds
);
List
<
TabHaobanWxEnterprise
>
listByIds
(
@Param
(
"enterpriseIds"
)
Set
<
String
>
wxE
nterpriseIds
);
List
<
TabHaobanWxEnterprise
>
getEnterpriseBycorpIdNoStatus
(
@Param
(
"corpId"
)
String
corpId
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/WxEnterpriseRelatedMapper.java
View file @
d90be39e
...
...
@@ -29,4 +29,13 @@ public interface WxEnterpriseRelatedMapper {
List
<
TabHaobanWxEnterpriseRelated
>
listEnterpriseByEnterpriseIds
(
@Param
(
"enterpriseIds"
)
List
<
String
>
enterpriseIds
);
List
<
TabHaobanWxEnterpriseRelated
>
listEnterpriseByTime
(
@Param
(
"time"
)
String
time
);
/**
* 查询企业下唯一商户
*
* @param enterpriseId
* @param wxEnterpriseId
* @return
*/
TabHaobanWxEnterpriseRelated
findOneByEIdAndWxEid
(
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabHaobanMaterial.java
View file @
d90be39e
...
...
@@ -38,6 +38,16 @@ public class TabHaobanMaterial implements Serializable {
private
Date
updateTime
;
private
String
fromMaterialId
;
public
String
getFromMaterialId
()
{
return
fromMaterialId
;
}
public
void
setFromMaterialId
(
String
fromMaterialId
)
{
this
.
fromMaterialId
=
fromMaterialId
;
}
private
static
final
long
serialVersionUID
=
1L
;
public
String
getMaterialId
()
{
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabHaobanWxEnterpriseRelated.java
View file @
d90be39e
...
...
@@ -22,8 +22,40 @@ public class TabHaobanWxEnterpriseRelated implements Serializable {
private
String
staffName
;
private
Integer
wxEnterpriseType
;
private
Integer
memberOpenCardFlag
;
private
Integer
rangeType
;
private
static
final
long
serialVersionUID
=
1L
;
public
Integer
getRangeType
()
{
return
rangeType
;
}
public
void
setRangeType
(
Integer
rangeType
)
{
this
.
rangeType
=
rangeType
;
}
public
Integer
getWxEnterpriseType
()
{
return
wxEnterpriseType
;
}
public
void
setWxEnterpriseType
(
Integer
wxEnterpriseType
)
{
this
.
wxEnterpriseType
=
wxEnterpriseType
;
}
public
Integer
getMemberOpenCardFlag
()
{
return
memberOpenCardFlag
;
}
public
void
setMemberOpenCardFlag
(
Integer
memberOpenCardFlag
)
{
this
.
memberOpenCardFlag
=
memberOpenCardFlag
;
}
public
String
getWxEnterpriseRelatedId
()
{
return
wxEnterpriseRelatedId
;
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabStoreRange.java
0 → 100644
View file @
d90be39e
package
com
.
gic
.
haoban
.
manage
.
service
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* Created By MBG-GUI-EXTENSION https://github.com/spawpaw/mybatis-generator-gui-extension
* Description:
* 门店选择器
*
* @author fdh
*/
public
class
TabStoreRange
implements
Serializable
{
/**
*
*/
private
String
storeRangeId
;
/**
*
*/
private
String
wxEnterpriseId
;
/**
* 商户id
*/
private
String
enterpriseId
;
/**
* 关联id 默认0
*/
private
String
relationId
;
/**
* 0所有门店 1分组 2门店
*/
private
Integer
relationType
;
/**
* 0删除 1正常
*/
private
Integer
statusFlag
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新时间
*/
private
Date
updateTime
;
/**
*/
private
static
final
long
serialVersionUID
=
1L
;
/**
* This method returns the value of the database column tab_haoban_store_range.store_range_id
*
* @return the value of tab_haoban_store_range.store_range_id
*/
public
String
getStoreRangeId
()
{
return
storeRangeId
;
}
/**
* This method sets the value of the database column tab_haoban_store_range.store_range_id
*
* @param storeRangeId the value for tab_haoban_store_range.store_range_id
*/
public
void
setStoreRangeId
(
String
storeRangeId
)
{
this
.
storeRangeId
=
storeRangeId
;
}
/**
* This method returns the value of the database column tab_haoban_store_range.wx_enterprise_id
*
* @return the value of tab_haoban_store_range.wx_enterprise_id
*/
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
/**
* This method sets the value of the database column tab_haoban_store_range.wx_enterprise_id
*
* @param wxEnterpriseId the value for tab_haoban_store_range.wx_enterprise_id
*/
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
/**
* This method returns the value of the database column tab_haoban_store_range.enterprise_id
*
* @return the value of tab_haoban_store_range.enterprise_id
*/
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
/**
* This method sets the value of the database column tab_haoban_store_range.enterprise_id
*
* @param enterpriseId the value for tab_haoban_store_range.enterprise_id
*/
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
/**
* This method returns the value of the database column tab_haoban_store_range.relation_id
*
* @return the value of tab_haoban_store_range.relation_id
*/
public
String
getRelationId
()
{
return
relationId
;
}
/**
* This method sets the value of the database column tab_haoban_store_range.relation_id
*
* @param relationId the value for tab_haoban_store_range.relation_id
*/
public
void
setRelationId
(
String
relationId
)
{
this
.
relationId
=
relationId
;
}
/**
* This method returns the value of the database column tab_haoban_store_range.relation_type
*
* @return the value of tab_haoban_store_range.relation_type
*/
public
Integer
getRelationType
()
{
return
relationType
;
}
/**
* This method sets the value of the database column tab_haoban_store_range.relation_type
*
* @param relationType the value for tab_haoban_store_range.relation_type
*/
public
void
setRelationType
(
Integer
relationType
)
{
this
.
relationType
=
relationType
;
}
/**
* This method returns the value of the database column tab_haoban_store_range.status_flag
*
* @return the value of tab_haoban_store_range.status_flag
*/
public
Integer
getStatusFlag
()
{
return
statusFlag
;
}
/**
* This method sets the value of the database column tab_haoban_store_range.status_flag
*
* @param statusFlag the value for tab_haoban_store_range.status_flag
*/
public
void
setStatusFlag
(
Integer
statusFlag
)
{
this
.
statusFlag
=
statusFlag
;
}
/**
* This method returns the value of the database column tab_haoban_store_range.create_time
*
* @return the value of tab_haoban_store_range.create_time
*/
public
Date
getCreateTime
()
{
return
createTime
;
}
/**
* This method sets the value of the database column tab_haoban_store_range.create_time
*
* @param createTime the value for tab_haoban_store_range.create_time
*/
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
/**
* This method returns the value of the database column tab_haoban_store_range.update_time
*
* @return the value of tab_haoban_store_range.update_time
*/
public
Date
getUpdateTime
()
{
return
updateTime
;
}
/**
* This method sets the value of the database column tab_haoban_store_range.update_time
*
* @param updateTime the value for tab_haoban_store_range.update_time
*/
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabStoreRelation.java
0 → 100644
View file @
d90be39e
package
com
.
gic
.
haoban
.
manage
.
service
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* Created By MBG-GUI-EXTENSION https://github.com/spawpaw/mybatis-generator-gui-extension
* Description:
* 好办门店权限
*
* @author fdh
*/
public
class
TabStoreRelation
implements
Serializable
{
/**
* 关联id
*/
private
String
storeRelationId
;
/**
* 企业id
*/
private
String
wxEnterpriseId
;
/**
* 门店id
*/
private
String
storeId
;
/**
* 门店名称
*/
private
String
storeName
;
/**
* 分组id
*/
private
String
storeGroupId
;
/**
* 企业id
*/
private
String
enterpriseId
;
/**
* 0删除 1正常
*/
private
Integer
statusFlag
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新时间
*/
private
Date
updateTime
;
/**
*/
private
static
final
long
serialVersionUID
=
1L
;
public
String
getStoreName
()
{
return
storeName
;
}
public
void
setStoreName
(
String
storeName
)
{
this
.
storeName
=
storeName
;
}
/**
* This method returns the value of the database column tab_haoban_store_relation.store_relation_id
*
* @return the value of tab_haoban_store_relation.store_relation_id
*/
public
String
getStoreRelationId
()
{
return
storeRelationId
;
}
/**
* This method sets the value of the database column tab_haoban_store_relation.store_relation_id
*
* @param storeRelationId the value for tab_haoban_store_relation.store_relation_id
*/
public
void
setStoreRelationId
(
String
storeRelationId
)
{
this
.
storeRelationId
=
storeRelationId
;
}
/**
* This method returns the value of the database column tab_haoban_store_relation.wx_enterprise_id
*
* @return the value of tab_haoban_store_relation.wx_enterprise_id
*/
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
/**
* This method sets the value of the database column tab_haoban_store_relation.wx_enterprise_id
*
* @param wxEnterpriseId the value for tab_haoban_store_relation.wx_enterprise_id
*/
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
/**
* This method returns the value of the database column tab_haoban_store_relation.store_id
*
* @return the value of tab_haoban_store_relation.store_id
*/
public
String
getStoreId
()
{
return
storeId
;
}
/**
* This method sets the value of the database column tab_haoban_store_relation.store_id
*
* @param storeId the value for tab_haoban_store_relation.store_id
*/
public
void
setStoreId
(
String
storeId
)
{
this
.
storeId
=
storeId
;
}
/**
* This method returns the value of the database column tab_haoban_store_relation.store_group_id
*
* @return the value of tab_haoban_store_relation.store_group_id
*/
public
String
getStoreGroupId
()
{
return
storeGroupId
;
}
/**
* This method sets the value of the database column tab_haoban_store_relation.store_group_id
*
* @param storeGroupId the value for tab_haoban_store_relation.store_group_id
*/
public
void
setStoreGroupId
(
String
storeGroupId
)
{
this
.
storeGroupId
=
storeGroupId
;
}
/**
* This method returns the value of the database column tab_haoban_store_relation.enterprise_id
*
* @return the value of tab_haoban_store_relation.enterprise_id
*/
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
/**
* This method sets the value of the database column tab_haoban_store_relation.enterprise_id
*
* @param enterpriseId the value for tab_haoban_store_relation.enterprise_id
*/
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
/**
* This method returns the value of the database column tab_haoban_store_relation.status_flag
*
* @return the value of tab_haoban_store_relation.status_flag
*/
public
Integer
getStatusFlag
()
{
return
statusFlag
;
}
/**
* This method sets the value of the database column tab_haoban_store_relation.status_flag
*
* @param statusFlag the value for tab_haoban_store_relation.status_flag
*/
public
void
setStatusFlag
(
Integer
statusFlag
)
{
this
.
statusFlag
=
statusFlag
;
}
/**
* This method returns the value of the database column tab_haoban_store_relation.create_time
*
* @return the value of tab_haoban_store_relation.create_time
*/
public
Date
getCreateTime
()
{
return
createTime
;
}
/**
* This method sets the value of the database column tab_haoban_store_relation.create_time
*
* @param createTime the value for tab_haoban_store_relation.create_time
*/
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
/**
* This method returns the value of the database column tab_haoban_store_relation.update_time
*
* @return the value of tab_haoban_store_relation.update_time
*/
public
Date
getUpdateTime
()
{
return
updateTime
;
}
/**
* This method sets the value of the database column tab_haoban_store_relation.update_time
*
* @param updateTime the value for tab_haoban_store_relation.update_time
*/
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/pojo/GroupSyncPojo.java
0 → 100644
View file @
d90be39e
package
com
.
gic
.
haoban
.
manage
.
service
.
pojo
;
import
com.alibaba.fastjson.annotation.JSONField
;
/**
* Created 2020/5/27.
*
* @author hua
*/
public
class
GroupSyncPojo
extends
BinlogBasePojo
{
@JSONField
(
name
=
"store_group_chain"
)
private
String
storeGroupChain
;
@JSONField
(
name
=
"store_group_id"
)
private
String
storeGroupId
;
@JSONField
(
name
=
"enterprise_id"
)
private
String
enterpriseId
;
private
Integer
status
;
private
Integer
oldStatus
;
public
String
getStoreGroupChain
()
{
return
storeGroupChain
;
}
public
void
setStoreGroupChain
(
String
storeGroupChain
)
{
this
.
storeGroupChain
=
storeGroupChain
;
}
public
String
getStoreGroupId
()
{
return
storeGroupId
;
}
public
void
setStoreGroupId
(
String
storeGroupId
)
{
this
.
storeGroupId
=
storeGroupId
;
}
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
Integer
getOldStatus
()
{
return
oldStatus
;
}
public
void
setOldStatus
(
Integer
oldStatus
)
{
this
.
oldStatus
=
oldStatus
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/pojo/StoreSyncPojo.java
0 → 100644
View file @
d90be39e
package
com
.
gic
.
haoban
.
manage
.
service
.
pojo
;
import
com.alibaba.fastjson.annotation.JSONField
;
/**
* Created 2020/5/27.
*
* @author hua
*/
public
class
StoreSyncPojo
extends
BinlogBasePojo
{
@JSONField
(
name
=
"store_group_id"
)
private
String
storeGroupId
;
@JSONField
(
name
=
"storeId"
)
private
String
storeId
;
@JSONField
(
name
=
"store_code"
)
private
String
storeCode
;
@JSONField
(
name
=
"enterprise_id"
)
private
String
enterpriseId
;
private
Integer
status
;
private
Integer
oldStatus
;
public
String
getStoreGroupId
()
{
return
storeGroupId
;
}
public
void
setStoreGroupId
(
String
storeGroupId
)
{
this
.
storeGroupId
=
storeGroupId
;
}
public
String
getStoreId
()
{
return
storeId
;
}
public
void
setStoreId
(
String
storeId
)
{
this
.
storeId
=
storeId
;
}
public
String
getStoreCode
()
{
return
storeCode
;
}
public
void
setStoreCode
(
String
storeCode
)
{
this
.
storeCode
=
storeCode
;
}
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
Integer
getOldStatus
()
{
return
oldStatus
;
}
public
void
setOldStatus
(
Integer
oldStatus
)
{
this
.
oldStatus
=
oldStatus
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/MaterialService.java
View file @
d90be39e
...
...
@@ -17,4 +17,6 @@ public interface MaterialService {
com
.
github
.
pagehelper
.
Page
listMaterial
(
String
wxEnterpriseId
,
String
keyword
,
String
categoryId
,
Integer
materialType
);
MaterialDTO
getMaterialByFromMaterialId
(
String
fromMaterialId
,
String
wxEnterpriseId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/StoreRangeService.java
0 → 100644
View file @
d90be39e
package
com
.
gic
.
haoban
.
manage
.
service
.
service
;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.manage.api.dto.StoreOrGroupInfoDTO
;
import
com.gic.haoban.manage.service.entity.TabStoreRange
;
import
com.gic.haoban.manage.service.entity.TabStoreRelation
;
import
java.util.List
;
/**
* Created 2021/4/9.
*
* @author hua
*/
public
interface
StoreRangeService
{
/**
* 保存企业的关联关系
*
* @param relations
* @param enterpriseId
* @param wxEnterpriseId
* @return
*/
public
boolean
saveStoreRange
(
List
<
StoreOrGroupInfoDTO
>
relations
,
String
enterpriseId
,
String
wxEnterpriseId
);
/**
* 绑定列表
*
* @param enterpriseId
* @param wxEnterpriseId
* @return
*/
public
List
<
StoreOrGroupInfoDTO
>
queryBindStoreRange
(
String
enterpriseId
,
String
wxEnterpriseId
);
/**
* 获取商户所有绑定列表
*
* @param enterpriseId
* @return
*/
public
List
<
TabStoreRange
>
queryAllBindRangeByEnterpriseId
(
String
enterpriseId
);
/**
* 删除分组id
*
* @param enterpriseId
* @param relationId
* @return
*/
public
boolean
delStoreRangeByRelationId
(
String
enterpriseId
,
String
relationId
);
/**
* 删除门店
*
* @param enterpriseId
* @param storeId
* @return
*/
public
boolean
delStoreRelationByStoreId
(
String
enterpriseId
,
String
storeId
);
/**
* 获取商户所有绑定列表 搜索
*
* @param enterpriseId
* @param wxEnterpriseId
* @param search
* @param pageInfo
* @return
*/
public
Page
<
TabStoreRelation
>
pageStoreRelation
(
String
enterpriseId
,
String
wxEnterpriseId
,
String
search
,
BasePageInfo
pageInfo
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/WxEnterpriseRelatedService.java
View file @
d90be39e
package
com
.
gic
.
haoban
.
manage
.
service
.
service
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated
;
import
java.util.List
;
...
...
@@ -8,7 +9,16 @@ public interface WxEnterpriseRelatedService {
TabHaobanWxEnterpriseRelated
getByGicEnterpriseIdByEnterpriseRelatedId
(
String
wxEnterpriseRelatedId
);
@Deprecated
TabHaobanWxEnterpriseRelated
getEnterpriseByGicEnterpriseId
(
String
gicEnterpriseId
);
List
<
TabHaobanWxEnterpriseRelated
>
getByWxEnterpriseId
(
String
wxEnterpriseId
);
/**
* 获取企业关联列表 根据商户id
*
* @param enterpriseId
* @return
*/
List
<
TabHaobanWxEnterprise
>
listByEnterpriseId
(
String
enterpriseId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/MaterialServiceImpl.java
View file @
d90be39e
...
...
@@ -3,6 +3,7 @@ package com.gic.haoban.manage.service.service.impl;
import
java.util.Date
;
import
java.util.List
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -44,6 +45,13 @@ public class MaterialServiceImpl implements MaterialService {
public
void
edit
(
MaterialDTO
materialDTO
)
{
materialDTO
.
setUpdateTime
(
new
Date
());
mapper
.
updateByPrimaryKeySelective
(
EntityUtil
.
changeEntityByJSON
(
TabHaobanMaterial
.
class
,
materialDTO
));
List
<
TabHaobanMaterial
>
materials
=
mapper
.
listByfromMaterialId
(
materialDTO
.
getMaterialId
());
if
(
CollectionUtils
.
isEmpty
(
materials
))
{
return
;
}
}
@Override
...
...
@@ -51,4 +59,9 @@ public class MaterialServiceImpl implements MaterialService {
return
mapper
.
listMaterial
(
wxEnterpriseId
,
keyword
,
categoryId
,
materialType
);
}
@Override
public
MaterialDTO
getMaterialByFromMaterialId
(
String
fromMaterialId
,
String
wxEnterpriseId
)
{
TabHaobanMaterial
tabHaobanMaterial
=
mapper
.
selectByfromMaterialId
(
fromMaterialId
,
wxEnterpriseId
);
return
EntityUtil
.
changeEntityByJSON
(
MaterialDTO
.
class
,
tabHaobanMaterial
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StoreRangeServiceImpl.java
0 → 100644
View file @
d90be39e
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
impl
;
import
com.gic.api.base.commons.Page
;
import
com.gic.commons.util.ToolUtil
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.manage.api.dto.StoreOrGroupInfoDTO
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanStoreRangeMapper
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanStoreRelationMapper
;
import
com.gic.haoban.manage.service.entity.TabStoreRange
;
import
com.gic.haoban.manage.service.entity.TabStoreRelation
;
import
com.gic.haoban.manage.service.service.StoreRangeService
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* Created 2021/4/9.
*
* @author hua
*/
public
class
StoreRangeServiceImpl
implements
StoreRangeService
{
@Autowired
private
TabHaobanStoreRangeMapper
tabHaobanStoreRangeMapper
;
@Autowired
private
TabHaobanStoreRelationMapper
tabHaobanStoreRelationMapper
;
@Override
public
boolean
saveStoreRange
(
List
<
StoreOrGroupInfoDTO
>
relations
,
String
enterpriseId
,
String
wxEnterpriseId
)
{
tabHaobanStoreRangeMapper
.
deleteByEnterpriseId
(
wxEnterpriseId
,
enterpriseId
);
List
<
TabStoreRange
>
ranges
=
relations
.
stream
().
map
(
dto
->
{
TabStoreRange
tabStoreRange
=
new
TabStoreRange
();
tabStoreRange
.
setEnterpriseId
(
enterpriseId
);
tabStoreRange
.
setWxEnterpriseId
(
wxEnterpriseId
);
tabStoreRange
.
setRelationId
(
dto
.
getRelationId
());
tabStoreRange
.
setRelationType
(
dto
.
getRelationType
());
tabStoreRange
.
setStoreRangeId
(
ToolUtil
.
randomUUID
());
return
tabStoreRange
;
}).
collect
(
Collectors
.
toList
());
tabHaobanStoreRangeMapper
.
insertBatch
(
ranges
);
return
true
;
}
@Override
public
List
<
StoreOrGroupInfoDTO
>
queryBindStoreRange
(
String
enterpriseId
,
String
wxEnterpriseId
)
{
List
<
TabStoreRange
>
tabStoreRanges
=
tabHaobanStoreRangeMapper
.
queryByEnterpriseId
(
wxEnterpriseId
,
enterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
tabStoreRanges
))
{
return
null
;
}
return
tabStoreRanges
.
stream
().
map
(
tab
->
{
StoreOrGroupInfoDTO
infoDTO
=
new
StoreOrGroupInfoDTO
();
infoDTO
.
setRelationId
(
tab
.
getRelationId
());
infoDTO
.
setRelationType
(
tab
.
getRelationType
());
return
infoDTO
;
}).
collect
(
Collectors
.
toList
());
}
@Override
public
List
<
TabStoreRange
>
queryAllBindRangeByEnterpriseId
(
String
enterpriseId
)
{
List
<
TabStoreRange
>
tabStoreRanges
=
tabHaobanStoreRangeMapper
.
queryByEnterpriseId
(
null
,
enterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
tabStoreRanges
))
{
return
null
;
}
return
tabStoreRanges
;
}
@Override
public
boolean
delStoreRangeByRelationId
(
String
enterpriseId
,
String
relationId
)
{
tabHaobanStoreRangeMapper
.
delStoreRangeByRelationId
(
relationId
,
enterpriseId
);
return
true
;
}
@Override
public
boolean
delStoreRelationByStoreId
(
String
enterpriseId
,
String
storeId
)
{
tabHaobanStoreRelationMapper
.
deleteStoreRalation
(
enterpriseId
,
storeId
);
return
true
;
}
@Override
public
Page
<
TabStoreRelation
>
pageStoreRelation
(
String
enterpriseId
,
String
wxEnterpriseId
,
String
search
,
BasePageInfo
pageInfo
)
{
PageHelper
.
startPage
(
pageInfo
);
List
<
TabStoreRelation
>
storeRelations
=
tabHaobanStoreRelationMapper
.
searchStoreRange
(
wxEnterpriseId
,
enterpriseId
,
search
);
Page
<
TabStoreRelation
>
retPage
=
PageUtil
.
changePageHelperToCurrentPage
(
new
PageInfo
<>(
storeRelations
));
return
retPage
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/WxEnterpriseRelatedServiceImpl.java
View file @
d90be39e
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
impl
;
import
com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.slf4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -8,13 +12,24 @@ import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseRelatedMapper;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated
;
import
com.gic.haoban.manage.service.service.WxEnterpriseRelatedService
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
static
org
.
slf4j
.
LoggerFactory
.
getLogger
;
@Service
public
class
WxEnterpriseRelatedServiceImpl
implements
WxEnterpriseRelatedService
{
private
static
final
Logger
logger
=
getLogger
(
WxEnterpriseRelatedServiceImpl
.
class
);
@Autowired
private
WxEnterpriseRelatedMapper
mapper
;
@Autowired
private
WxEnterpriseMapper
wxEnterpriseMapper
;
@Override
public
TabHaobanWxEnterpriseRelated
getByGicEnterpriseIdByEnterpriseRelatedId
(
String
wxEnterpriseRelatedId
)
{
...
...
@@ -23,7 +38,8 @@ public class WxEnterpriseRelatedServiceImpl implements WxEnterpriseRelatedServic
@Override
public
TabHaobanWxEnterpriseRelated
getEnterpriseByGicEnterpriseId
(
String
gicEnterpriseId
)
{
TabHaobanWxEnterpriseRelated
tab
=
mapper
.
findOneByEnterpriseId
(
gicEnterpriseId
);
//todo 销售线索-不能根据eid查询微信企业 因为目前一对多 需要改
TabHaobanWxEnterpriseRelated
tab
=
mapper
.
findOneByEnterpriseId
(
gicEnterpriseId
);
return
tab
;
}
...
...
@@ -33,4 +49,15 @@ public class WxEnterpriseRelatedServiceImpl implements WxEnterpriseRelatedServic
return
list
;
}
@Override
public
List
<
TabHaobanWxEnterprise
>
listByEnterpriseId
(
String
enterpriseId
)
{
List
<
String
>
eids
=
new
ArrayList
<>();
eids
.
add
(
enterpriseId
);
List
<
TabHaobanWxEnterpriseRelated
>
relateds
=
mapper
.
listEnterpriseByEnterpriseIds
(
eids
);
if
(
CollectionUtils
.
isEmpty
(
relateds
))
{
return
null
;
}
Set
<
String
>
wxEnterpriseIds
=
relateds
.
stream
().
map
(
tab
->
tab
.
getWxEnterpriseId
()).
collect
(
Collectors
.
toSet
());
return
wxEnterpriseMapper
.
listByIds
(
wxEnterpriseIds
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MaterialApiServiceImpl.java
View file @
d90be39e
...
...
@@ -5,6 +5,7 @@ import java.net.URL;
import
java.util.Date
;
import
java.util.List
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
org.apache.commons.io.IOUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -88,6 +89,7 @@ public class MaterialApiServiceImpl implements MaterialApiService {
@Override
public
void
editCategory
(
MaterialCategoryDTO
materialCategoryDTO
)
{
materialCategoryService
.
editCategory
(
materialCategoryDTO
);
}
...
...
@@ -272,4 +274,32 @@ public class MaterialApiServiceImpl implements MaterialApiService {
return
materialCategoryService
.
listByParentCategory
(
categoryId
);
}
@Override
public
ServiceResponse
<
Void
>
shareMaterial
(
String
wxEnterpriseId
,
String
toWxEnterpriseId
,
String
materialId
)
{
ServiceResponse
<
Void
>
res
=
new
ServiceResponse
<>();
MaterialDTO
materialDTO
=
materialService
.
selectMaterialById
(
materialId
);
if
(
null
==
materialDTO
)
{
logger
.
info
(
"不存在该素材"
);
res
.
setCode
(
2
);
res
.
setMessage
(
"不存在该素材"
);
return
res
;
}
if
(!
materialDTO
.
getFromMaterialId
().
equals
(
"-1"
))
{
logger
.
info
(
"该素材不允许分享"
);
res
.
setCode
(
3
);
res
.
setMessage
(
"该素材不允许分享"
);
return
res
;
}
MaterialDTO
fromMaterialDTO
=
materialService
.
getMaterialByFromMaterialId
(
materialId
,
toWxEnterpriseId
);
if
(
fromMaterialDTO
!=
null
)
{
logger
.
info
(
"已经存在素材,不能重复分享"
);
res
.
setCode
(
4
);
res
.
setMessage
(
"已经存在素材,不能重复分享"
);
return
res
;
}
materialDTO
.
setWxEnterpriseId
(
toWxEnterpriseId
);
materialDTO
.
setFromMaterialId
(
materialId
);
materialService
.
insertMaterial
(
materialDTO
);
return
res
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/WxEnterpriseRelatedApiServiceImpl.java
View file @
d90be39e
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
import
com.gic.enterprise.api.dto.*
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.service.entity.*
;
import
com.gic.haoban.manage.service.service.StoreRangeService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.enterprise.api.dto.EnterpriseDTO
;
import
com.gic.enterprise.api.dto.GicTreeDTO
;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.enterprise.api.service.StoreGroupService
;
import
com.gic.haoban.common.utils.UuidUtil
;
import
com.gic.haoban.manage.api.dto.EnterpriseDetailDTO
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.service.dao.mapper.StaffMapper
;
import
com.gic.haoban.manage.service.dao.mapper.WxEnterpriseRelatedMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated
;
import
com.gic.haoban.manage.service.service.DepartmentService
;
import
com.gic.haoban.manage.service.service.StaffService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseRelatedService
;
import
org.springframework.transaction.annotation.Transactional
;
@Service
public
class
WxEnterpriseRelatedApiServiceImpl
implements
WxEnterpriseRelatedApiService
{
...
...
@@ -45,6 +50,12 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
@Autowired
private
EnterpriseService
enterpriseService
;
@Autowired
private
StoreRangeService
storeRangeService
;
@Autowired
private
StoreService
storeService
;
//获取门店详情
public
boolean
isEnterpriseOver
(
String
eid
)
{
...
...
@@ -213,4 +224,109 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
}
return
0
;
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
int
wxEnterpriseBind
(
WxEnterpriseRelationDetailDTO
detailDTO
)
{
TabHaobanWxEnterpriseRelated
tab
=
wxEnterpriseRelatedMapper
.
findOneByEIdAndWxEid
(
detailDTO
.
getEnterpriseId
(),
detailDTO
.
getWxEnterpriseId
());
if
(
tab
==
null
)
{
logger
.
info
(
"该gicEnterpriseId已经绑定过了:{}"
,
JSONObject
.
toJSONString
(
detailDTO
));
//保存企业关联关系
tab
=
EntityUtil
.
changeEntityNew
(
TabHaobanWxEnterpriseRelated
.
class
,
detailDTO
);
tab
.
setStatusFlag
(
1
);
tab
.
setCreateTime
(
new
Date
());
tab
.
setUpdateTime
(
new
Date
());
tab
.
setWxEnterpriseRelatedId
(
UuidUtil
.
randomUUID
());
wxEnterpriseRelatedMapper
.
insertSelective
(
tab
);
}
//保存门店范围
storeRangeService
.
saveStoreRange
(
detailDTO
.
getRelations
(),
detailDTO
.
getEnterpriseId
(),
detailDTO
.
getWxEnterpriseId
());
//超级管理员新增
TabHaobanStaff
sStaff
=
staffMapper
.
selectSuperByWxEnterpriseId
(
detailDTO
.
getWxEnterpriseId
());
if
(
sStaff
==
null
)
{
TabHaobanStaff
staff
=
new
TabHaobanStaff
();
staff
.
setStaffName
(
"超级管理员"
);
staff
.
setWxEnterpriseId
(
detailDTO
.
getWxEnterpriseId
());
staff
.
setSuperManagerFlag
(
1
);
staffService
.
add
(
staff
);
}
return
0
;
}
@Override
public
boolean
flushBindStoreByEnterpriseId
(
String
enterpriseId
,
String
wxEnterpriseId
,
String
staffId
)
{
logger
.
info
(
"刷新绑定门店:eid:{},staffid:{}"
,
enterpriseId
,
staffId
);
List
<
TabStoreRange
>
groupInfoDTOS
=
storeRangeService
.
queryAllBindRangeByEnterpriseId
(
enterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
groupInfoDTOS
))
{
logger
.
info
(
"无需刷新:{}"
,
enterpriseId
);
return
true
;
}
//根据微信企业分组 wxEnterpriseId->(List)groupId
Map
<
String
,
Set
<
String
>>
relationMapByWxEid
=
groupInfoDTOS
.
stream
().
filter
(
tab
->
tab
.
getRelationType
()
==
1
)
.
collect
(
Collectors
.
groupingBy
(
tab
->
tab
.
getWxEnterpriseId
(),
Collectors
.
mapping
(
tab
->
tab
.
getRelationId
(),
Collectors
.
toSet
())));
//分组所在的企业map groupId->wxEnterpriseId
Map
<
String
,
String
>
groupMap
=
groupInfoDTOS
.
stream
().
filter
(
tab
->
tab
.
getRelationType
()
==
1
)
.
collect
(
Collectors
.
toMap
(
tab
->
tab
.
getRelationId
(),
tab
->
tab
.
getWxEnterpriseId
()));
// 获取所有门店信息
List
<
StoreSimpleDTO
>
storeDtos
=
storeService
.
listSimpleStore
(
enterpriseId
,
null
,
null
);
Map
<
String
,
List
<
String
>>
storeMapByGroupId
=
storeDtos
.
stream
().
collect
(
Collectors
.
groupingBy
(
dto
->
dto
.
getStoreGroupId
(),
Collectors
.
mapping
(
dto
->
dto
.
getStoreId
(),
Collectors
.
toList
())));
//获取所有门店分组
List
<
PowerStoreGroupDTO
>
storeGroupList
=
storeGroupService
.
getStoreGroupList
(
enterpriseId
,
null
);
Map
<
String
,
Set
<
String
>>
storeGroupChainMap
=
storeGroupList
.
stream
().
collect
(
Collectors
.
toMap
(
dto
->
dto
.
getStoreGroupId
(),
dto
->
Arrays
.
stream
(
dto
.
getStoreGroupChain
().
split
(
"-"
)).
filter
(
str
->
StringUtils
.
isNotBlank
(
str
)).
collect
(
Collectors
.
toSet
())));
return
false
;
}
@Override
public
WxEnterpriseRelationDetailDTO
getEnterpriseBindInfo
(
String
wxEnterpriseId
,
String
enterpriseId
)
{
TabHaobanWxEnterpriseRelated
wxEnterpriseRelated
=
wxEnterpriseRelatedMapper
.
findOneByEIdAndWxEid
(
enterpriseId
,
wxEnterpriseId
);
if
(
null
==
wxEnterpriseRelated
)
{
logger
.
info
(
"企业未绑定:eid:{},weid:{}"
,
enterpriseId
,
wxEnterpriseId
);
return
null
;
}
List
<
StoreOrGroupInfoDTO
>
infoDTOS
=
storeRangeService
.
queryBindStoreRange
(
enterpriseId
,
wxEnterpriseId
);
WxEnterpriseRelationDetailDTO
detailDTO
=
new
WxEnterpriseRelationDetailDTO
();
detailDTO
.
setRelations
(
infoDTOS
);
detailDTO
.
setEnterpriseId
(
enterpriseId
);
EnterpriseDTO
enterpriseDTO
=
enterpriseService
.
getEnterpriseById
(
enterpriseId
);
if
(
null
==
enterpriseDTO
)
{
detailDTO
.
setEnterpriseName
(
enterpriseDTO
.
getEnterpriseName
());
}
detailDTO
.
setMemberOpenCardFlag
(
wxEnterpriseRelated
.
getMemberOpenCardFlag
());
detailDTO
.
setWxEnterpriseType
(
wxEnterpriseRelated
.
getWxEnterpriseType
());
return
detailDTO
;
}
@Override
public
List
<
WxEnterpriseDTO
>
listWxEnterpriseByEid
(
String
enterpriseId
)
{
List
<
TabHaobanWxEnterprise
>
wxEnterprises
=
wxEnterpriseRelatedService
.
listByEnterpriseId
(
enterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
wxEnterprises
))
{
logger
.
info
(
"没有关联企业"
);
return
null
;
}
List
<
WxEnterpriseDTO
>
ret
=
EntityUtil
.
changeEntityListNew
(
WxEnterpriseDTO
.
class
,
wxEnterprises
);
return
ret
;
}
@Override
public
Page
<
BindStoreInfoDTO
>
pageBindStoreByEnterpriseId
(
String
wxEnterpriseId
,
String
enterpriseId
,
String
search
,
BasePageInfo
pageInfo
)
{
Page
<
TabStoreRelation
>
relationPage
=
storeRangeService
.
pageStoreRelation
(
enterpriseId
,
wxEnterpriseId
,
search
,
pageInfo
);
if
(
CollectionUtils
.
isEmpty
(
relationPage
.
getResult
()))
{
return
null
;
}
Page
<
BindStoreInfoDTO
>
retPage
=
PageUtil
.
changeToCurrentPage
(
relationPage
,
BindStoreInfoDTO
.
class
);
List
<
String
>
storeIds
=
relationPage
.
getResult
().
stream
().
map
(
tab
->
tab
.
getStoreId
()).
collect
(
Collectors
.
toList
());
List
<
StoreDTO
>
dtoList
=
storeService
.
queryStore
(
storeIds
);
retPage
.
setResult
(
EntityUtil
.
changeEntityListNew
(
BindStoreInfoDTO
.
class
,
dtoList
));
return
retPage
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/task/KafkaMessageServiceImpl.java
View file @
d90be39e
...
...
@@ -17,8 +17,11 @@ import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
import
com.gic.haoban.manage.api.service.StaffClerkRelationApiService
;
import
com.gic.haoban.manage.service.pojo.BinlogBasePojo
;
import
com.gic.haoban.manage.service.pojo.ClerkSyncPojo
;
import
com.gic.haoban.manage.service.pojo.GroupSyncPojo
;
import
com.gic.haoban.manage.service.pojo.StoreSyncPojo
;
import
com.gic.haoban.manage.service.service.StaffClerkBindLogService
;
import
com.gic.haoban.manage.service.service.StaffClerkRelationService
;
import
com.gic.haoban.manage.service.service.StoreRangeService
;
import
com.gic.haoban.task.api.dto.MqMessageQo
;
import
com.gic.mq.sdk.exception.RouterException
;
import
com.gic.qcloud.cmq.CMQClientException
;
...
...
@@ -47,6 +50,8 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
private
final
String
CLERK
=
"tab_gic_clerk"
;
private
final
String
GROUP
=
"tab_gic_store_group"
;
@Autowired
private
StaffClerkRelationService
staffClerkRelationService
;
...
...
@@ -58,6 +63,9 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
@Autowired
private
ClerkService
clerkService
;
@Autowired
private
StoreRangeService
storeRangeService
;
@Override
...
...
@@ -79,25 +87,31 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
ClerkSyncPojo
syncPojo
=
(
ClerkSyncPojo
)
pojo
;
GicRecordType
gicRecordType
=
GicRecordType
.
valueOf
(
syncPojo
.
getRecordType
());
if
(
gicRecordType
.
equals
(
GicRecordType
.
INSERT
)
||
gicRecordType
.
equals
(
GicRecordType
.
UPDATE
)){
//新增,更新某个人为店长
String
clerkId
=
syncPojo
.
getClerkId
();
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByClerkId
(
clerkId
);
Integer
clerkType
=
clerkDTO
.
getClerkType
();
if
(
clerkType
!=
null
&&
clerkType
.
intValue
()
==
1
){
//新增,更新某个人为店长
String
clerkId
=
syncPojo
.
getClerkId
();
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByClerkId
(
clerkId
);
Integer
clerkType
=
clerkDTO
.
getClerkType
();
if
(
clerkType
!=
null
&&
clerkType
.
intValue
()
==
1
){
//TODO 发消息处理新增店长,任务重新分配问题
try
{
logger
.
info
(
"待分配任务重分配======>{}"
,
clerkId
);
MqMessageQo
mqMessageQo
=
new
MqMessageQo
();
mqMessageQo
.
setType
(
MqMessageQo
.
DISTRIBUTE_TASK
);
mqMessageQo
.
setData
(
clerkId
);
String
s
=
JSONObject
.
toJSONString
(
mqMessageQo
);
GICMQClientUtil
.
getClientInstance
().
sendCommonMessage
(
RouterConstant
.
ROUTERTYPE
,
s
,
"com.gic.haoban.task.api.service.MqAsynApiService"
,
"run"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
logger
.
info
(
"待分配任务重分配======>{}"
,
clerkId
);
MqMessageQo
mqMessageQo
=
new
MqMessageQo
();
mqMessageQo
.
setType
(
MqMessageQo
.
DISTRIBUTE_TASK
);
mqMessageQo
.
setData
(
clerkId
);
String
s
=
JSONObject
.
toJSONString
(
mqMessageQo
);
GICMQClientUtil
.
getClientInstance
().
sendCommonMessage
(
RouterConstant
.
ROUTERTYPE
,
s
,
"com.gic.haoban.task.api.service.MqAsynApiService"
,
"run"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
//分组
}
else
if
(
record
.
value
().
getTableName
().
equals
(
GROUP
))
{
dealStoreGroup
((
GroupSyncPojo
)
pojo
);
//门店
}
else
if
(
record
.
value
().
getTableName
().
equals
(
STORE
))
{
dealStore
((
StoreSyncPojo
)
pojo
);
}
}
...
...
@@ -169,8 +183,10 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
if
(
record
.
getTableName
().
equals
(
CLERK
))
{
return
binlogMap
(
record
.
getFieldList
(),
record
.
getRecordType
(),
ClerkSyncPojo
.
class
);
}
else
if
(
record
.
getTableName
().
equals
(
STORE
))
{
return
binlogMap
(
record
.
getFieldList
(),
record
.
getRecordType
(),
ClerkSyncPojo
.
class
);
}
else
{
return
binlogMap
(
record
.
getFieldList
(),
record
.
getRecordType
(),
StoreSyncPojo
.
class
);
}
else
if
(
record
.
getTableName
().
equals
(
GROUP
))
{
return
binlogMap
(
record
.
getFieldList
(),
record
.
getRecordType
(),
GroupSyncPojo
.
class
);
}
else
{
return
null
;
}
}
...
...
@@ -192,5 +208,32 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
}
/**
* 门店的处理
*
* @param syncPojo
*/
private
void
dealStore
(
StoreSyncPojo
syncPojo
)
{
//删除门店 删除门店关联门店
if
(
syncPojo
.
getStatus
()
==
0
)
{
storeRangeService
.
delStoreRangeByRelationId
(
syncPojo
.
getEnterpriseId
(),
syncPojo
.
getStoreId
());
//删除门店
storeRangeService
.
delStoreRelationByStoreId
(
syncPojo
.
getEnterpriseId
(),
syncPojo
.
getStoreId
());
}
}
/**
* 门店分组的处理
*
* @param syncPojo
*/
private
void
dealStoreGroup
(
GroupSyncPojo
syncPojo
)
{
//删除
if
(
syncPojo
.
getOldStatus
()
==
1
&&
syncPojo
.
getStatus
()
==
0
)
{
storeRangeService
.
delStoreRangeByRelationId
(
syncPojo
.
getEnterpriseId
(),
syncPojo
.
getStoreGroupId
());
}
}
}
haoban-manage3-service/src/main/resources/kafka-setting.xml
View file @
d90be39e
...
...
@@ -38,6 +38,7 @@
<list>
<value>
haoban_gic_clerk
</value>
<value>
haoban_gic_store
</value>
<value>
haoban_gic_store_group
</value>
</list>
</constructor-arg>
<property
name=
"messageListener"
ref=
"kafkaConsumerService"
/>
...
...
haoban-manage3-service/src/main/resources/mapper/TabHaobanMaterialMapper.xml
View file @
d90be39e
...
...
@@ -4,6 +4,7 @@
<resultMap
id=
"BaseResultMap"
type=
"com.gic.haoban.manage.service.entity.TabHaobanMaterial"
>
<id
column=
"material_id"
property=
"materialId"
jdbcType=
"VARCHAR"
/>
<result
column=
"material_title"
property=
"materialTitle"
jdbcType=
"VARCHAR"
/>
<result
column=
"from_material_id"
property=
"fromMaterialId"
jdbcType=
"VARCHAR"
/>
<result
column=
"material_type"
property=
"materialType"
jdbcType=
"INTEGER"
/>
<result
column=
"category_id"
property=
"categoryId"
jdbcType=
"VARCHAR"
/>
<result
column=
"material_content"
property=
"materialContent"
jdbcType=
"VARCHAR"
/>
...
...
@@ -21,7 +22,7 @@
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
material_id,
material_title, material_type, category_id, material_content, wx_last_upload_time,
material_id,
from_material_id, material_title, material_type, category_id, material_content, wx_last_upload_time,
media_id, wx_enterprise_id, staff_id, staff_name, img_url, material_desc, status_flag,
link, create_time, update_time,wx_img_url
</sql>
...
...
@@ -36,13 +37,14 @@
where material_id = #{materialId,jdbcType=VARCHAR}
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanMaterial"
>
insert into tab_haoban_material (material_id,
material_title, material_type,
insert into tab_haoban_material (material_id,
from_material_id, material_title, material_type,
category_id, material_content, wx_last_upload_time,
media_id, wx_enterprise_id, staff_id,
staff_name, img_url,wx_img_url, material_desc,
status_flag, link, create_time,
update_time)
values (#{materialId,jdbcType=VARCHAR}, #{materialTitle,jdbcType=VARCHAR}, #{materialType,jdbcType=INTEGER},
values (#{materialId,jdbcType=VARCHAR},#{fromMaterialId}, #{materialTitle,jdbcType=VARCHAR},
#{materialType,jdbcType=INTEGER},
#{categoryId,jdbcType=VARCHAR}, #{materialContent,jdbcType=VARCHAR}, #{wxLastUploadTime,jdbcType=TIMESTAMP},
#{mediaId,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR}, #{staffId,jdbcType=VARCHAR},
#{staffName,jdbcType=VARCHAR}, #{imgUrl,jdbcType=VARCHAR},#{wxImgUrl,jdbcType=VARCHAR}, #{materialDesc,jdbcType=VARCHAR},
...
...
@@ -260,4 +262,21 @@
order by update_time desc
</select>
<select
id=
"selectByfromMaterialId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_material
where from_material_id = #{materialId,jdbcType=VARCHAR}
and status_flag=1
and wx_enterprise_id=#{wxEnterpriseId}
</select>
<select
id=
"listByfromMaterialId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_material
where from_material_id = #{materialId,jdbcType=VARCHAR}
and status_flag=1
</select>
</mapper>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/TabHaobanStoreRangeMapper.xml
0 → 100644
View file @
d90be39e
<?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.gic.haoban.manage.service.dao.mapper.TabHaobanStoreRangeMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.gic.haoban.manage.service.entity.TabStoreRange"
>
<id
column=
"store_range_id"
jdbcType=
"VARCHAR"
property=
"storeRangeId"
/>
<result
column=
"wx_enterprise_id"
jdbcType=
"VARCHAR"
property=
"wxEnterpriseId"
/>
<result
column=
"enterprise_id"
jdbcType=
"VARCHAR"
property=
"enterpriseId"
/>
<result
column=
"relation_id"
jdbcType=
"VARCHAR"
property=
"relationId"
/>
<result
column=
"relation_type"
jdbcType=
"INTEGER"
property=
"relationType"
/>
<result
column=
"status_flag"
jdbcType=
"INTEGER"
property=
"statusFlag"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
store_range_id, wx_enterprise_id, enterprise_id, relation_id, relation_type, status_flag,
create_time, update_time
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.String"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_store_range
where store_range_id = #{storeRangeId,jdbcType=VARCHAR}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.String"
>
delete from tab_haoban_store_range
where store_range_id = #{storeRangeId,jdbcType=VARCHAR}
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.haoban.manage.service.entity.TabStoreRange"
>
insert into tab_haoban_store_range (store_range_id, wx_enterprise_id, enterprise_id,
relation_id, relation_type, status_flag,
create_time, update_time)
values (#{storeRangeId,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR}, #{enterpriseId,jdbcType=VARCHAR},
#{relationId,jdbcType=VARCHAR}, #{relationType,jdbcType=INTEGER}, #{statusFlag,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabStoreRange"
>
insert into tab_haoban_store_range
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"storeRangeId != null"
>
store_range_id,
</if>
<if
test=
"wxEnterpriseId != null"
>
wx_enterprise_id,
</if>
<if
test=
"enterpriseId != null"
>
enterprise_id,
</if>
<if
test=
"relationId != null"
>
relation_id,
</if>
<if
test=
"relationType != null"
>
relation_type,
</if>
<if
test=
"statusFlag != null"
>
status_flag,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"storeRangeId != null"
>
#{storeRangeId,jdbcType=VARCHAR},
</if>
<if
test=
"wxEnterpriseId != null"
>
#{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if
test=
"enterpriseId != null"
>
#{enterpriseId,jdbcType=VARCHAR},
</if>
<if
test=
"relationId != null"
>
#{relationId,jdbcType=VARCHAR},
</if>
<if
test=
"relationType != null"
>
#{relationType,jdbcType=INTEGER},
</if>
<if
test=
"statusFlag != null"
>
#{statusFlag,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabStoreRange"
>
update tab_haoban_store_range
<set>
<if
test=
"wxEnterpriseId != null"
>
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if
test=
"enterpriseId != null"
>
enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
</if>
<if
test=
"relationId != null"
>
relation_id = #{relationId,jdbcType=VARCHAR},
</if>
<if
test=
"relationType != null"
>
relation_type = #{relationType,jdbcType=INTEGER},
</if>
<if
test=
"statusFlag != null"
>
status_flag = #{statusFlag,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where store_range_id = #{storeRangeId,jdbcType=VARCHAR}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.gic.haoban.manage.service.entity.TabStoreRange"
>
update tab_haoban_store_range
set wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
relation_id = #{relationId,jdbcType=VARCHAR},
relation_type = #{relationType,jdbcType=INTEGER},
status_flag = #{statusFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where store_range_id = #{storeRangeId,jdbcType=VARCHAR}
</update>
<select
id=
"queryByEnterpriseId"
parameterType=
"java.lang.String"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_store_range
where enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
<if
test=
"wxEnterpriseId!=null"
>
and wx_enterprise_id=#{wxEnterpriseId}
</if>
and status_flag =1
</select>
<update
id=
"deleteByEnterpriseId"
>
update tab_haoban_store_range
SET
status_flag = 0,
update_time = now()
where
where enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
and wx_enterprise_id=#{wxEnterpriseId}
and status_flag =1
</update>
<update
id=
"delStoreRangeByRelationId"
>
update tab_haoban_store_range
SET
status_flag = 0,
update_time = now()
where
where enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
and relation_id=#{relationId}
and status_flag =1
</update>
<insert
id=
"insertBatch"
>
insert into tab_haoban_store_range (store_range_id, wx_enterprise_id, enterprise_id,
relation_id, relation_type, status_flag,
create_time, update_time)
values
<foreach
collection=
"list"
item=
"item"
open=
"("
close=
")"
separator=
","
>
(#{storeRangeId,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR}, #{enterpriseId,jdbcType=VARCHAR},
#{relationId,jdbcType=VARCHAR}, #{relationType,jdbcType=INTEGER}, 1,
now(), now())
</foreach>
</insert>
</mapper>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/TabHaobanStoreRelationMapper.xml
0 → 100644
View file @
d90be39e
<?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.gic.haoban.manage.service.dao.mapper.TabHaobanStoreRelationMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.gic.haoban.manage.service.entity.TabStoreRelation"
>
<id
column=
"store_relation_id"
jdbcType=
"VARCHAR"
property=
"storeRelationId"
/>
<result
column=
"wx_enterprise_id"
jdbcType=
"VARCHAR"
property=
"wxEnterpriseId"
/>
<result
column=
"store_id"
jdbcType=
"VARCHAR"
property=
"storeId"
/>
<result
column=
"store_group_id"
jdbcType=
"VARCHAR"
property=
"storeGroupId"
/>
<result
column=
"enterprise_id"
jdbcType=
"VARCHAR"
property=
"enterpriseId"
/>
<result
column=
"status_flag"
jdbcType=
"INTEGER"
property=
"statusFlag"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
store_relation_id, wx_enterprise_id, store_id, store_group_id, enterprise_id, status_flag,
create_time, update_time
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.String"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_store_relation
where store_relation_id = #{storeRelationId,jdbcType=VARCHAR}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.String"
>
delete from tab_haoban_store_relation
where store_relation_id = #{storeRelationId,jdbcType=VARCHAR}
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.haoban.manage.service.entity.TabStoreRelation"
>
insert into tab_haoban_store_relation (store_relation_id, wx_enterprise_id,
store_id, store_group_id, enterprise_id,
status_flag, create_time, update_time
)
values (#{storeRelationId,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR},
#{storeId,jdbcType=VARCHAR}, #{storeGroupId,jdbcType=VARCHAR}, #{enterpriseId,jdbcType=VARCHAR},
#{statusFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabStoreRelation"
>
insert into tab_haoban_store_relation
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"storeRelationId != null"
>
store_relation_id,
</if>
<if
test=
"wxEnterpriseId != null"
>
wx_enterprise_id,
</if>
<if
test=
"storeId != null"
>
store_id,
</if>
<if
test=
"storeGroupId != null"
>
store_group_id,
</if>
<if
test=
"enterpriseId != null"
>
enterprise_id,
</if>
<if
test=
"statusFlag != null"
>
status_flag,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"storeRelationId != null"
>
#{storeRelationId,jdbcType=VARCHAR},
</if>
<if
test=
"wxEnterpriseId != null"
>
#{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if
test=
"storeId != null"
>
#{storeId,jdbcType=VARCHAR},
</if>
<if
test=
"storeGroupId != null"
>
#{storeGroupId,jdbcType=VARCHAR},
</if>
<if
test=
"enterpriseId != null"
>
#{enterpriseId,jdbcType=VARCHAR},
</if>
<if
test=
"statusFlag != null"
>
#{statusFlag,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabStoreRelation"
>
update tab_haoban_store_relation
<set>
<if
test=
"wxEnterpriseId != null"
>
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if
test=
"storeId != null"
>
store_id = #{storeId,jdbcType=VARCHAR},
</if>
<if
test=
"storeGroupId != null"
>
store_group_id = #{storeGroupId,jdbcType=VARCHAR},
</if>
<if
test=
"enterpriseId != null"
>
enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
</if>
<if
test=
"statusFlag != null"
>
status_flag = #{statusFlag,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where store_relation_id = #{storeRelationId,jdbcType=VARCHAR}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.gic.haoban.manage.service.entity.TabStoreRelation"
>
update tab_haoban_store_relation
set wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
store_id = #{storeId,jdbcType=VARCHAR},
store_group_id = #{storeGroupId,jdbcType=VARCHAR},
enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
status_flag = #{statusFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where store_relation_id = #{storeRelationId,jdbcType=VARCHAR}
</update>
<update
id=
"deleteStoreRalation"
>
update tab_haoban_store_relation
set
status_flag = 0,
update_time = now()
where store_id = #{storeId,jdbcType=VARCHAR}
and enterprise_id=#{enterpriseId}
and status_flag=1
</update>
<select
id=
"searchStoreRange"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_store_relation
where enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
and wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and store_name like concat("%",#{search},"%")
and status_flag=1
</select>
</mapper>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/WxEnterpriseRelatedMapper.xml
View file @
d90be39e
...
...
@@ -9,11 +9,14 @@
<result
column=
"staff_id"
property=
"staffId"
jdbcType=
"VARCHAR"
/>
<result
column=
"staff_name"
property=
"staffName"
jdbcType=
"VARCHAR"
/>
<result
column=
"status_flag"
property=
"statusFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"wx_enterprise_type"
property=
"wxEnterpriseType"
jdbcType=
"INTEGER"
/>
<result
column=
"member_open_card_flag"
property=
"memberOpenCardFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
wx_enterprise_related_id, wx_enterprise_id, enterprise_id, version, status_flag,
wx_enterprise_related_id, wx_enterprise_id, enterprise_id, version, status_flag, wx_enterprise_type,
member_open_card_flag,
create_time, update_time,staff_id,staff_name
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
...
...
@@ -52,6 +55,12 @@
<if
test=
"statusFlag != null"
>
status_flag,
</if>
<if
test=
"wxEnterpriseType != null"
>
wx_enterprise_type,
</if>
<if
test=
"memberOpenCardFlag != null"
>
member_open_card_flag,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
...
...
@@ -81,6 +90,12 @@
<if
test=
"statusFlag != null"
>
#{statusFlag,jdbcType=INTEGER},
</if>
<if
test=
"wxEnterpriseType != null"
>
#{wxEnterpriseType,jdbcType=INTEGER},
</if>
<if
test=
"memberOpenCardFlag != null"
>
#{memberOpenCardFlag,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
...
...
@@ -178,5 +193,12 @@
where status_flag = 1
AND DATE_FORMAT(update_time,'%Y-%m-%d') = #{time}
</select>
<select
id=
"findOneByEIdAndWxEid"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_wx_enterprise_related
where enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
and status_flag = 1 and wx_enterprise_id=#{wxEnterpriseId}
</select>
</mapper>
\ No newline at end of file
haoban-manage3-service/src/test/java/ServiceTest.java
View file @
d90be39e
...
...
@@ -211,12 +211,25 @@ public class ServiceTest {
// }
//
//
// @Test
// public void extensionList() {
//
// String s = qywxUserApiService.listSelfExternalUserid("ww9ede832a84b7ae5f", "01YQ-pcdYzF3K0So8uCFfkB5i8D5EBW7KcVB4qA8Ktk", "de2c33f2e8924ff884e0073ca2f2f711");
// System.out.println(JSONObject.toJSONString(s));
// }
@Test
public
void
extensionList
()
{
{
String
s
=
qywxUserApiService
.
listSelfExternalUserid
(
"ww9ede832a84b7ae5f"
,
"01YQ-pcdYzF3K0So8uCFfkB5i8D5EBW7KcVB4qA8Ktk"
,
"9ae4c4f1277340a186b16a17d937c72c"
);
System
.
out
.
println
(
"============客户联系========"
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
s
));
}
{
String
s
=
qywxUserApiService
.
listSelfExternalUserid
(
"ww9ede832a84b7ae5f"
,
"65zze159pYb4ofbFsIREZ5X7d7iaZ-bWsVIQk2y5kTU"
,
"9ae4c4f1277340a186b16a17d937c72c"
);
System
.
out
.
println
(
"============好办助手========"
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
s
));
}
{
String
s
=
qywxUserApiService
.
listSelfExternalUserid
(
"ww9ede832a84b7ae5f"
,
"IOJJKhQYu7SDjb9T8W8fBOUjpszI0b73XDQ-9eqlHmE"
,
"9ae4c4f1277340a186b16a17d937c72c"
);
System
.
out
.
println
(
"============会员小程序========"
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
s
));
}
}
// @Test
// public void extensionList1() {
// UserDTO selfWorkWxUser = qywxUserApiService.getSelfWorkWxUser("ww9ede832a84b7ae5f", "65zze159pYb4ofbFsIREZ5X7d7iaZ-bWsVIQk2y5kTU", "de2c33f2e8924ff884e0073ca2f2f711");
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/MaterialController.java
View file @
d90be39e
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
java.util.List
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.MaterialCategoryDTO
;
import
com.gic.haoban.manage.api.dto.MaterialDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
...
...
@@ -19,6 +12,12 @@ import com.gic.haoban.manage.api.service.MaterialApiService;
import
com.gic.haoban.manage.web.auth.AuthRequestUtil
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.vo.LoginVO
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
@RestController
public
class
MaterialController
extends
WebBaseController
{
...
...
@@ -212,4 +211,21 @@ public class MaterialController extends WebBaseController{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
/**
* 分析素材
*
* @return
*/
@RequestMapping
(
"/material-share"
)
public
HaobanResponse
materialShare
(
String
materialId
,
String
toWxEnterpriseId
)
{
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
getLoginUser
();
ServiceResponse
<
Void
>
response
=
materialApiService
.
shareMaterial
(
login
.
getWxEnterpriseId
(),
toWxEnterpriseId
,
materialId
);
if
(
response
.
getCode
()
==
1
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
else
{
HaoBanErrCode
.
ERR_DEFINE
.
setMsg
(
response
.
getMessage
());
return
resultResponse
(
HaoBanErrCode
.
ERR_DEFINE
);
}
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/WxEnterpriseController.java
View file @
d90be39e
...
...
@@ -3,7 +3,6 @@ package com.gic.haoban.manage.web.controller;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.druid.util.StringUtils
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
import
com.gic.commons.util.DateUtil
;
import
com.gic.enterprise.api.dto.EnterpriseAndUserDTO
;
...
...
@@ -15,21 +14,14 @@ import com.gic.enterprise.api.service.StoreService;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.EnterpriseDetailDTO
;
import
com.gic.haoban.manage.api.dto.SecretSettingDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.enums.SecretTypeEnum
;
import
com.gic.haoban.manage.api.service.DealSyncOperationApiService
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.api.service.*
;
import
com.gic.haoban.manage.web.anno.IgnoreLogin
;
import
com.gic.haoban.manage.web.auth.AuthRequestUtil
;
import
com.gic.haoban.manage.web.config.Config
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.qo.WxEnterpriseBindQo
;
import
com.gic.haoban.manage.web.vo.EnterpriseSearchVO
;
import
com.gic.haoban.manage.web.vo.LoginVO
;
import
com.gic.haoban.manage.web.vo.SecretSettingVO
;
...
...
@@ -48,7 +40,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
@RestController
...
...
@@ -77,8 +72,8 @@ public class WxEnterpriseController extends WebBaseController{
private
DealSyncOperationApiService
dealSyncOperationApiService
;
@Autowired
private
QuartzService
quartzService
;
//授权企业列表
@IgnoreLogin
@RequestMapping
(
"wx-enterprise-list"
)
...
...
@@ -167,16 +162,24 @@ public class WxEnterpriseController extends WebBaseController{
//微信企业绑定接口
@IgnoreLogin
@RequestMapping
(
"wx-enterprise-bind"
)
public
HaobanResponse
wxEnterpriseBind
(
String
enterpriseId
,
String
wxEnterpriseId
,
String
version
)
{
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isAnyBlank
(
enterpriseId
,
version
))
{
public
HaobanResponse
wxEnterpriseBind
(
WxEnterpriseBindQo
bindQo
)
{
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isAnyBlank
(
bindQo
.
getEnterpriseId
(),
bindQo
.
getVersion
()))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
getLoginUser
();
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
StaffDTO
staff
=
login
.
getStaffDTO
();
String
staffId
=
staff
.
getStaffId
();
String
staffName
=
staff
.
getStaffName
();
int
i
=
wxEnterpriseRelatedApiService
.
wxEnterpriseBind
(
enterpriseId
,
wxEnterpriseId
,
version
,
staffId
,
staffName
);
WxEnterpriseRelationDetailDTO
detailDTO
=
EntityUtil
.
changeEntityByOrika
(
WxEnterpriseRelationDetailDTO
.
class
,
bindQo
);
detailDTO
.
setEnterpriseId
(
bindQo
.
getEnterpriseId
());
detailDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
detailDTO
.
setStaffId
(
staffId
);
detailDTO
.
setStaffName
(
staffName
);
List
<
StoreOrGroupInfoDTO
>
storeOrGroupInfoDTOS
=
EntityUtil
.
changeEntityListByJSON
(
StoreOrGroupInfoDTO
.
class
,
bindQo
.
getRelations
());
detailDTO
.
setRelations
(
storeOrGroupInfoDTOS
);
int
i
=
wxEnterpriseRelatedApiService
.
wxEnterpriseBind
(
detailDTO
);
if
(
i
==
1
){
return
resultResponse
(
HaoBanErrCode
.
ERR_10006
);
}
...
...
@@ -566,22 +569,40 @@ public class WxEnterpriseController extends WebBaseController{
RedisUtil
.
getCache
(
dateKey
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
RedisUtil
.
getCache
(
dateKey
));
}
/**
* 获取刷新好友开关接口
* @return
*/
@RequestMapping
(
"/get-fresh-on-off"
)
public
HaobanResponse
getFreshOnOff
(){
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
dateKey
=
"haoban_fresh-wx-friend-enterprise"
;
Object
value
=
RedisUtil
.
getCache
(
dateKey
);
if
(
value
!=
null
){
String
valueStr
=
value
.
toString
();
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
valueStr
.
contains
(
wxEnterpriseId
));
/**
* 微信企业绑定详情
*
* @param enterpriseId
* @return
*/
@IgnoreLogin
@RequestMapping
(
"wx-enterprise-bind-detail"
)
public
HaobanResponse
wxEnterpriseBindDetail
(
String
enterpriseId
)
{
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isAnyBlank
(
enterpriseId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
false
);
}
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxEnterpriseRelationDetailDTO
bindInfo
=
wxEnterpriseRelatedApiService
.
getEnterpriseBindInfo
(
wxEnterpriseId
,
enterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
bindInfo
);
}
/**
* 绑定门店列表
*
* @param enterpriseId
* @return
*/
@IgnoreLogin
@RequestMapping
(
"bind-store-list"
)
public
HaobanResponse
bindStoreList
(
String
enterpriseId
,
String
search
,
BasePageInfo
basePageInfo
)
{
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
Page
<
BindStoreInfoDTO
>
retPage
=
wxEnterpriseRelatedApiService
.
pageBindStoreByEnterpriseId
(
wxEnterpriseId
,
enterpriseId
,
search
,
basePageInfo
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
retPage
);
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/qo/WxEnterpriseBindQo.java
0 → 100644
View file @
d90be39e
package
com
.
gic
.
haoban
.
manage
.
web
.
qo
;
import
java.io.Serializable
;
/**
* Created 2021/4/13.
*
* @author hua
*/
public
class
WxEnterpriseBindQo
implements
Serializable
{
private
String
wxEnterpriseId
;
private
String
enterpriseId
;
private
String
version
;
private
int
rangeType
=
1
;
private
String
relations
;
/**
* 0 自动开卡同一开平 1加好友不开卡
*/
private
int
memberOpenCardFlag
;
/**
* 企业微信类型 0 总部 1代理
*/
private
int
wxEnterpriseType
;
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
String
getVersion
()
{
return
version
;
}
public
void
setVersion
(
String
version
)
{
this
.
version
=
version
;
}
public
int
getRangeType
()
{
return
rangeType
;
}
public
void
setRangeType
(
int
rangeType
)
{
this
.
rangeType
=
rangeType
;
}
public
String
getRelations
()
{
return
relations
;
}
public
void
setRelations
(
String
relations
)
{
this
.
relations
=
relations
;
}
public
int
getMemberOpenCardFlag
()
{
return
memberOpenCardFlag
;
}
public
void
setMemberOpenCardFlag
(
int
memberOpenCardFlag
)
{
this
.
memberOpenCardFlag
=
memberOpenCardFlag
;
}
public
int
getWxEnterpriseType
()
{
return
wxEnterpriseType
;
}
public
void
setWxEnterpriseType
(
int
wxEnterpriseType
)
{
this
.
wxEnterpriseType
=
wxEnterpriseType
;
}
}
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