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
haoban3.0
haoban-manage3.0
Commits
dc4b5524
Commit
dc4b5524
authored
Feb 02, 2023
by
jinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
通讯录接口开发
parent
ceb42c4a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
18 deletions
+45
-18
WxEnterpriseActiveDataServiceImpl.java
...rvice/service/impl/WxEnterpriseActiveDataServiceImpl.java
+15
-11
TabHaobanWxEnterpriseActiveDataMapper.xml
...esources/mapper/TabHaobanWxEnterpriseActiveDataMapper.xml
+5
-2
ServiceTest.java
haoban-manage3-service/src/test/java/ServiceTest.java
+0
-5
WxEnterpriseActiveDataServiceTest.java
...vice/src/test/java/WxEnterpriseActiveDataServiceTest.java
+25
-0
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/WxEnterpriseActiveDataServiceImpl.java
View file @
dc4b5524
...
...
@@ -40,7 +40,7 @@ public class WxEnterpriseActiveDataServiceImpl implements WxEnterpriseActiveData
if
(
StrUtil
.
isBlank
(
wxEnterpriseId
))
return
0
;
List
<
HashMap
<
String
,
Integer
>>
feeOrderAccountMapList
=
tabHaobanQywxFeeOrderAccountMapper
.
countStatusByWxEnterpriseId
(
wxEnterpriseId
);
log
.
info
(
"查询订单表返回的map"
,
JSONObject
.
toJSONString
(
feeOrderAccountMapList
));
log
.
info
(
"查询订单表返回的map
:{}
"
,
JSONObject
.
toJSONString
(
feeOrderAccountMapList
));
if
(
CollUtil
.
isEmpty
(
feeOrderAccountMapList
))
{
return
0
;
}
...
...
@@ -49,24 +49,25 @@ public class WxEnterpriseActiveDataServiceImpl implements WxEnterpriseActiveData
for
(
HashMap
<
String
,
Integer
>
map
:
feeOrderAccountMapList
)
{
switch
(
map
.
get
(
"status"
))
{
case
1
:
purchased
+=
map
.
get
(
"num"
);
inactive
+=
map
.
get
(
"num"
);
//这里map.get("num")是Long类型,无法直接和Integer做运算
purchased
+=
Integer
.
valueOf
(
String
.
valueOf
(
map
.
get
(
"num"
)));
inactive
+=
Integer
.
valueOf
(
String
.
valueOf
(
map
.
get
(
"num"
)));
break
;
case
2
:
purchased
+=
map
.
get
(
"num"
);
activated
+=
map
.
get
(
"num"
);
purchased
+=
Integer
.
valueOf
(
String
.
valueOf
(
map
.
get
(
"num"
))
);
activated
+=
Integer
.
valueOf
(
String
.
valueOf
(
map
.
get
(
"num"
))
);
break
;
case
3
:
purchased
+=
map
.
get
(
"num"
);
expired
+=
map
.
get
(
"num"
);
purchased
+=
Integer
.
valueOf
(
String
.
valueOf
(
map
.
get
(
"num"
))
);
expired
+=
Integer
.
valueOf
(
String
.
valueOf
(
map
.
get
(
"num"
))
);
break
;
case
4
:
purchased
+=
map
.
get
(
"num"
);
transfer
+=
map
.
get
(
"num"
);
purchased
+=
Integer
.
valueOf
(
String
.
valueOf
(
map
.
get
(
"num"
))
);
transfer
+=
Integer
.
valueOf
(
String
.
valueOf
(
map
.
get
(
"num"
))
);
break
;
case
5
:
purchased
+=
map
.
get
(
"num"
);
activated
+=
map
.
get
(
"num"
);
purchased
+=
Integer
.
valueOf
(
String
.
valueOf
(
map
.
get
(
"num"
))
);
activated
+=
Integer
.
valueOf
(
String
.
valueOf
(
map
.
get
(
"num"
))
);
break
;
default
:
break
;
...
...
@@ -82,15 +83,18 @@ public class WxEnterpriseActiveDataServiceImpl implements WxEnterpriseActiveData
tabHaobanWxEnterpriseActiveData
.
setInactive
(
inactive
);
tabHaobanWxEnterpriseActiveData
.
setUsed
(
used
);
tabHaobanWxEnterpriseActiveData
.
setTransfer
(
transfer
);
tabHaobanWxEnterpriseActiveData
.
setExpired
(
expired
);
return
tabHaobanWxEnterpriseActiveDataMapper
.
updateActiveDataByWxEnterpriseId
(
tabHaobanWxEnterpriseActiveData
);
}
else
{
//新增
tabHaobanWxEnterpriseActiveData
=
new
TabHaobanWxEnterpriseActiveData
();
tabHaobanWxEnterpriseActiveData
.
setId
(
UniqueIdUtils
.
uniqueLong
());
tabHaobanWxEnterpriseActiveData
.
setWxEnterpriseId
(
wxEnterpriseId
);
tabHaobanWxEnterpriseActiveData
.
setActivated
(
activated
);
tabHaobanWxEnterpriseActiveData
.
setPurchased
(
purchased
);
tabHaobanWxEnterpriseActiveData
.
setInactive
(
inactive
);
tabHaobanWxEnterpriseActiveData
.
setUsed
(
used
);
tabHaobanWxEnterpriseActiveData
.
setExpired
(
expired
);
tabHaobanWxEnterpriseActiveData
.
setTransfer
(
transfer
);
return
tabHaobanWxEnterpriseActiveDataMapper
.
insert
(
tabHaobanWxEnterpriseActiveData
);
}
...
...
haoban-manage3-service/src/main/resources/mapper/TabHaobanWxEnterpriseActiveDataMapper.xml
View file @
dc4b5524
...
...
@@ -15,9 +15,9 @@
<result
column=
"delete_flag"
jdbcType=
"INTEGER"
property=
"deleteFlag"
/>
</resultMap>
<insert
id=
"insert"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseActiveData"
>
insert into tab_haoban_wx_enterprise_active_data (id, wx_enterprise_id, purchased,
insert into tab_haoban_wx_enterprise_active_data (id, wx_enterprise_id, purchased,
used,
inactive, transfer, activated,expired,create_time,delete_flag)
values (#{id,jdbcType=BIGINT}, #{wxEnterpriseId,jdbcType=VARCHAR}, #{purchased,jdbcType=INTEGER},#{inactive,jdbcType=INTEGER},
values (#{id,jdbcType=BIGINT}, #{wxEnterpriseId,jdbcType=VARCHAR}, #{purchased,jdbcType=INTEGER},#{
used,jdbcType=INTEGER},#{
inactive,jdbcType=INTEGER},
#{transfer,jdbcType=INTEGER},#{activated,jdbcType=INTEGER},#{expired,jdbcType=INTEGER},now(),0)
</insert>
...
...
@@ -35,6 +35,9 @@
<if
test=
"purchased != null"
>
purchased = #{purchased,jdbcType=INTEGER},
</if>
<if
test=
"used != null"
>
purchased = #{used,jdbcType=INTEGER},
</if>
<if
test=
"inactive != null"
>
inactive = #{inactive,jdbcType=INTEGER},
</if>
...
...
haoban-manage3-service/src/test/java/ServiceTest.java
View file @
dc4b5524
...
...
@@ -72,9 +72,4 @@ public class ServiceTest {
String
autoActiveStatus
=
qywxUserApiService
.
getAutoActiveStatus
(
"wp59NLDQAAJL6DsM6YwOGqJlhCBykkeA"
,
config
.
getCorpid
());
System
.
out
.
println
(
autoActiveStatus
);
}
@Test
public
void
test5
(){
int
qrCodeByStaffId
=
staffApiService
.
getQrCodeByStaffId
(
"00af1fe7e75644a7accdcb84e126e50c"
);
System
.
out
.
println
(
"111111111111111111111111111111111"
+
qrCodeByStaffId
);
}
}
haoban-manage3-service/src/test/java/WxEnterpriseActiveDataServiceTest.java
0 → 100644
View file @
dc4b5524
import
com.gic.haoban.manage.api.service.hm.HmPageApiService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseActiveDataService
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
/**
* @description:
* @Author: wenhua
* @Date: 2023/2/2 14:12
*/
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@ContextConfiguration
(
locations
=
{
"classpath:applicationContext-conf.xml"
})
public
class
WxEnterpriseActiveDataServiceTest
{
@Autowired
private
WxEnterpriseActiveDataService
wxEnterpriseActiveDataService
;
@Test
public
void
test
(){
Integer
integer
=
wxEnterpriseActiveDataService
.
saveOrUpdate
(
"ca66a01b79474c40b3e7c7f93daf1a3b"
);
System
.
out
.
println
(
integer
);
}
}
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