Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
Aidea
Project
Project
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
sa_aidea
Aidea
Commits
c80b825a
Commit
c80b825a
authored
Nov 12, 2020
by
谢希宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Aidea product update by Strive Date 2020-11-12
parent
c799f851
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
203 additions
and
96 deletions
+203
-96
ConsultSheetMapper.xml
...n/java/com/cftech/consultsheet/dao/ConsultSheetMapper.xml
+15
-14
ConsultSheetServiceImpl.java
...ch/consultsheet/service/impl/ConsultSheetServiceImpl.java
+23
-5
MobileConsultSheetController.java
...cftech/consultsheet/web/MobileConsultSheetController.java
+0
-1
common-test.properties
cftech-common-web/src/main/resources/common-test.properties
+1
-1
AddressMapper.java
.../src/main/java/com/cftech/addresst/dao/AddressMapper.java
+2
-1
AddressMapper.xml
...e/src/main/java/com/cftech/addresst/dao/AddressMapper.xml
+50
-48
AddressService.java
...main/java/com/cftech/addresst/service/AddressService.java
+23
-18
AddressServiceImpl.java
.../com/cftech/addresst/service/impl/AddressServiceImpl.java
+5
-5
MobileAddressController.java
...java/com/cftech/addresst/web/MobileAddressController.java
+2
-2
MobileQybaseController.java
.../java/com/cftech/base/org/web/MobileQybaseController.java
+1
-1
QyMediaUtil.java
...le/src/main/java/com/cftech/base/org/api/QyMediaUtil.java
+78
-0
MpApiConstants.java
...c/main/java/com/cftech/core/constants/MpApiConstants.java
+2
-0
QyTokenUtil.java
...odule/src/main/java/com/cftech/core/util/QyTokenUtil.java
+1
-0
No files found.
aidea-modules/consult-module/src/main/java/com/cftech/consultsheet/dao/ConsultSheetMapper.xml
View file @
c80b825a
...
@@ -197,24 +197,25 @@
...
@@ -197,24 +197,25 @@
<if
test=
"sort!=null"
>
ORDER BY ${sort.param} ${sort.type}
</if>
<if
test=
"sort!=null"
>
ORDER BY ${sort.param} ${sort.type}
</if>
<if
test=
"limit>0"
>
limit #{offset},#{limit}
</if>
<if
test=
"limit>0"
>
limit #{offset},#{limit}
</if>
</select>
</select>
<select
id=
"consultSheetList"
resultType=
"com.cftech.consultsheet.model.ConsultSheet"
>
<select
id=
"consultSheetList"
resultType=
"com.cftech.consultsheet.model.ConsultSheet"
>
SELECT
SELECT
<include
refid=
"sqlCol"
/>
<include
refid=
"sqlCol"
/>
from t_aidea_consult_sheet
from t_aidea_consult_sheet
where del_flag = 0
where del_flag = 0
<if
test=
"openid!=null"
>
<if
test=
"openid!=null"
>
and open_id = #{openid}
and open_id = #{openid}
</if>
</if>
<if
test=
"name!=null and name !=''"
>
<if
test=
"name!=null and name !=''"
>
and user_name
like concat('%',#{name},'%')
and CONVERT(AES_DECRYPT(user_name,'aideakey') USING UTF8)
like concat('%',#{name},'%')
</if>
</if>
<if
test=
"id!=null"
>
<if
test=
"id!=null"
>
and id = #{id}
and id = #{id}
</if>
</if>
ORDER BY create_time DESC
ORDER BY create_time DESC
<if
test=
"page!=null and pageSize !='' and pageSize!=null and page !=''"
>
<if
test=
"page!=null and pageSize !='' and pageSize!=null and page !=''"
>
limit #{page},
#{pageSize}
limit #{page},
#{pageSize}
</if>
</if>
</select>
</select>
<update
id=
"update"
parameterType=
"com.cftech.consultsheet.model.ConsultSheet"
>
<update
id=
"update"
parameterType=
"com.cftech.consultsheet.model.ConsultSheet"
>
...
...
aidea-modules/consult-module/src/main/java/com/cftech/consultsheet/service/impl/ConsultSheetServiceImpl.java
View file @
c80b825a
package
com
.
cftech
.
consultsheet
.
service
.
impl
;
package
com
.
cftech
.
consultsheet
.
service
.
impl
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.cftech.accounts.model.MpAccountsEntity
;
import
com.cftech.accounts.model.MpAccountsEntity
;
import
com.cftech.accounts.service.MpAccountsService
;
import
com.cftech.accounts.service.MpAccountsService
;
import
com.cftech.base.codingrule.utils.CodingruleUtils
;
import
com.cftech.base.codingrule.utils.CodingruleUtils
;
import
com.cftech.base.org.api.QyMediaUtil
;
import
com.cftech.base.org.api.QyMsgUtil
;
import
com.cftech.base.org.api.QyMsgUtil
;
import
com.cftech.base.org.model.Qyuser
;
import
com.cftech.base.org.model.Qyuser
;
import
com.cftech.base.org.service.QyuserService
;
import
com.cftech.base.org.service.QyuserService
;
...
@@ -18,11 +20,14 @@ import com.cftech.core.scope.OrderType;
...
@@ -18,11 +20,14 @@ import com.cftech.core.scope.OrderType;
import
com.cftech.core.sql.Conds
;
import
com.cftech.core.sql.Conds
;
import
com.cftech.core.sql.Sort
;
import
com.cftech.core.sql.Sort
;
import
com.cftech.core.util.Constants
;
import
com.cftech.core.util.Constants
;
import
com.cftech.core.util.MpTokenUtil
;
import
com.cftech.core.util.StringUtils
;
import
com.cftech.core.util.StringUtils
;
import
com.cftech.core.util.SystemConfig
;
import
com.cftech.core.util.SystemConfig
;
import
com.cftech.cos.config.cosconfig.model.Cosconfig
;
import
com.cftech.member.model.Member
;
import
com.cftech.member.model.Member
;
import
com.cftech.member.service.MemberService
;
import
com.cftech.member.service.MemberService
;
import
com.cftech.order.service.OrderService
;
import
com.cftech.order.service.OrderService
;
import
org.mp.api.wxbase.wxmedia.JwMediaAPI
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
...
@@ -61,6 +66,12 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
...
@@ -61,6 +66,12 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
@Autowired
@Autowired
private
CodingruleUtils
codingruleUtils
;
private
CodingruleUtils
codingruleUtils
;
@Autowired
private
MpTokenUtil
mpTokenUtil
;
@Autowired
private
QyMediaUtil
mediaUtil
;
@Autowired
@Autowired
private
QyMsgUtil
qyMsgUtil
;
private
QyMsgUtil
qyMsgUtil
;
...
@@ -99,11 +110,22 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
...
@@ -99,11 +110,22 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
public
JSONObject
pollingConsultSheet
(
ConsultSheet
consultSheet
)
{
public
JSONObject
pollingConsultSheet
(
ConsultSheet
consultSheet
)
{
JSONObject
retObj
=
new
JSONObject
();
JSONObject
retObj
=
new
JSONObject
();
try
{
try
{
MpAccountsEntity
mpAccounts
Appid
=
mpAccountsService
.
getMpAccountsAppid
(
consultSheet
.
getAppId
());
MpAccountsEntity
mpAccounts
Entity
=
mpAccountsService
.
getMpAccountsAppid
(
consultSheet
.
getAppId
());
consultSheet
.
setConsultId
(
codingruleUtils
.
getNumber
(
consultSheet
.
getAccountsId
(),
ConsultSheet
.
class
.
getName
()));
consultSheet
.
setConsultId
(
codingruleUtils
.
getNumber
(
consultSheet
.
getAccountsId
(),
ConsultSheet
.
class
.
getName
()));
//处理处方单图片
String
fileName
=
mediaUtil
.
downloadMpMediaToDisk
(
mpAccountsEntity
.
getId
(),
"consultSheet"
,
consultSheet
.
getPrescription
());
String
url
=
SystemConfig
.
p
.
getProperty
(
"QY_DOMAIN"
)
+
SystemConfig
.
p
.
getProperty
(
"IMAGEURL"
).
replace
(
"{PICFILENAME}"
,
fileName
);
consultSheet
.
setAccountsId
(
mpAccountsEntity
.
getId
());
consultSheet
.
setPrescription
(
url
);
if
(
consultSheetMapper
.
save
(
consultSheet
)
>
0
)
{
if
(
consultSheetMapper
.
save
(
consultSheet
)
>
0
)
{
memberProcess
(
consultSheet
.
getOpenId
(),
consultSheet
);
memberProcess
(
consultSheet
.
getOpenId
(),
consultSheet
);
//展示客服二维码
Qyuser
serviceCus
=
qyuserService
.
fetchById
(
consultSheet
.
getServiceId
());
retObj
.
put
(
"errorNo"
,
0
);
retObj
.
put
(
"errorNo"
,
0
);
retObj
.
put
(
"data"
,
serviceCus
.
getQrcode
());
retObj
.
put
(
"errorMsg"
,
"咨询单提交成功,请等待药师审核"
);
retObj
.
put
(
"errorMsg"
,
"咨询单提交成功,请等待药师审核"
);
}
else
{
}
else
{
retObj
.
put
(
"errorNo"
,
1
);
retObj
.
put
(
"errorNo"
,
1
);
...
@@ -292,8 +314,4 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
...
@@ -292,8 +314,4 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
agenId
,
msg
,
false
);
agenId
,
msg
,
false
);
}
}
@Scheduled
(
cron
=
"*/5 * * * * ?"
)
public
void
dingshi
()
{
System
.
out
.
println
(
"启动定时任务5秒一次"
);
}
}
}
\ No newline at end of file
aidea-modules/consult-module/src/main/java/com/cftech/consultsheet/web/MobileConsultSheetController.java
View file @
c80b825a
...
@@ -49,6 +49,5 @@ public class MobileConsultSheetController {
...
@@ -49,6 +49,5 @@ public class MobileConsultSheetController {
public
void
test
(
Long
id
)
{
public
void
test
(
Long
id
)
{
ConsultSheet
consultSheet
=
consultSheetService
.
fetchById
(
id
);
ConsultSheet
consultSheet
=
consultSheetService
.
fetchById
(
id
);
consultSheetService
.
sendQyWechatMassage
(
consultSheet
);
consultSheetService
.
sendQyWechatMassage
(
consultSheet
);
}
}
}
}
cftech-common-web/src/main/resources/common-test.properties
View file @
c80b825a
...
@@ -41,7 +41,7 @@ LOG_URL=http://www.michang-tech.com.cn:6989/log/addlog
...
@@ -41,7 +41,7 @@ LOG_URL=http://www.michang-tech.com.cn:6989/log/addlog
#\u6821\u9A8C\u5151\u6362\u5BC6\u7801KEY
#\u6821\u9A8C\u5151\u6362\u5BC6\u7801KEY
MEMBER_PASSWORD_KEY
=
DONGCHANGINT9527;
MEMBER_PASSWORD_KEY
=
DONGCHANGINT9527;
list.refreshtoken
=
true
list.refreshtoken
=
true
jwt.domain
=
127.0.0.1
jwt.domain
=
pd.shxrtech.com
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD
jwt.duration
=
86400000
jwt.duration
=
86400000
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u03AAtrue
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u03AAtrue
...
...
membercard-modules/shipping-address-module/src/main/java/com/cftech/addresst/dao/AddressMapper.java
View file @
c80b825a
...
@@ -5,6 +5,7 @@ import com.cftech.addresst.model.Address;
...
@@ -5,6 +5,7 @@ import com.cftech.addresst.model.Address;
import
com.cftech.addresst.model.AddressVO
;
import
com.cftech.addresst.model.AddressVO
;
import
com.cftech.addresst.model.Area
;
import
com.cftech.addresst.model.Area
;
import
com.cftech.core.generic.GenericDao
;
import
com.cftech.core.generic.GenericDao
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -30,7 +31,7 @@ public interface AddressMapper extends GenericDao<Address> {
...
@@ -30,7 +31,7 @@ public interface AddressMapper extends GenericDao<Address> {
* @Param
* @Param
* @return
* @return
**/
**/
List
<
AddressVO
>
addressList
(
String
open
Id
);
List
<
AddressVO
>
addressList
(
@Param
(
"openId"
)
String
openId
,
@Param
(
"addressId"
)
Long
address
Id
);
/**
/**
* @Description 根据id查询收货地址
* @Description 根据id查询收货地址
* @Date 9:53 2020/10/20
* @Date 9:53 2020/10/20
...
...
membercard-modules/shipping-address-module/src/main/java/com/cftech/addresst/dao/AddressMapper.xml
View file @
c80b825a
...
@@ -127,57 +127,59 @@
...
@@ -127,57 +127,59 @@
)
)
</insert>
</insert>
<select
id=
"addressId"
resultType=
"com.cftech.addresst.model.AddressVO"
>
<select
id=
"addressId"
resultType=
"com.cftech.addresst.model.AddressVO"
>
select
select
t.id,
t.id,
t.open_id as openId,
t.open_id as openId,
t.address_name as addressName,
t.address_name as addressName,
t.address,
t.address,
t.province_id as provinceId,
t.province_id as provinceId,
t.city_id as cityId,
t.city_id as cityId,
t.area_id as areaId,
t.area_id as areaId,
t.sex,
t.sex,
t.phone,
t.phone,
t.whether,
t.whether,
t.accounts_id as accountsId,
t.accounts_id as accountsId,
a.areaid,
a.areaid,
a.citytype,
a.citytype,
a.areaname provinceName,
a.areaname provinceName,
b.areaname cityName,
b.areaname cityName,
c.areaname areaName
c.areaname areaName
FROM
FROM
t_shipping_address t
t_shipping_address t
LEFT JOIN area a ON t.province_id = a.areaid
LEFT JOIN area a ON t.province_id = a.areaid
LEFT JOIN area b ON t.city_id = b.areaid
LEFT JOIN area b ON t.city_id = b.areaid
LEFT JOIN area c ON t.area_id = c.areaid
LEFT JOIN area c ON t.area_id = c.areaid
and t.del_flag=0
and t.del_flag=0
WHERE t.id = #{id}
WHERE t.id = #{id}
</select>
</select>
<select
id=
"addressList"
resultType=
"com.cftech.addresst.model.AddressVO"
>
<select
id=
"addressList"
resultType=
"com.cftech.addresst.model.AddressVO"
>
SELECT
SELECT
t.id,
t.id,
t.open_id as openId,
t.open_id as openId,
t.address_name as addressName,
t.address_name as addressName,
t.address,
t.address,
t.province_id as provinceId,
t.province_id as provinceId,
t.city_id as cityId,
t.city_id as cityId,
t.area_id as areaId,
t.area_id as areaId,
t.sex,
t.sex,
t.phone,
t.phone,
t.whether,
t.whether,
t.accounts_id as accountsId,
t.accounts_id as accountsId,
a.areaid,
a.areaid,
a.citytype,
a.citytype,
a.areaname provinceName,
a.areaname provinceName,
b.areaname cityName,
b.areaname cityName,
c.areaname areaName
c.areaname areaName
FROM
FROM
t_shipping_address t
t_shipping_address t
LEFT JOIN area a ON t.province_id = a.areaid
LEFT JOIN area a ON t.province_id = a.areaid
LEFT JOIN area b ON t.city_id = b.areaid
LEFT JOIN area b ON t.city_id = b.areaid
LEFT JOIN area c ON t.area_id = c.areaid
LEFT JOIN area c ON t.area_id = c.areaid
WHERE t.open_id = #{openId}
WHERE t.open_id = #{openId}
and t.del_flag=0
AND t.del_flag=0
<if
test=
"addressId != null and addressId != '' "
>
AND t.id = #{addressId}
</if>
</select>
</select>
<select
id=
"fetchById"
parameterType=
"java.lang.Long"
resultMap=
"resultMap"
>
<select
id=
"fetchById"
parameterType=
"java.lang.Long"
resultMap=
"resultMap"
>
...
...
membercard-modules/shipping-address-module/src/main/java/com/cftech/addresst/service/AddressService.java
View file @
c80b825a
...
@@ -10,50 +10,55 @@ import java.io.Serializable;
...
@@ -10,50 +10,55 @@ import java.io.Serializable;
import
java.util.List
;
import
java.util.List
;
/**
/**
* 收货地址管理Service
* 收货地址管理Service
*
*
* @author Licc
* @author Licc
* @date: 2020-09-29 17:17
* @date: 2020-09-29 17:17
*/
*/
public
interface
AddressService
extends
GenericService
<
Address
>
{
public
interface
AddressService
extends
GenericService
<
Address
>
{
List
<
Area
>
listArea
();
List
<
Area
>
listArea
();
/**
/**
* @Description 个人收货地址数据回填
* @return
* @Description 个人收货地址数据回填
* @Date 9:53 2020/10/20
* @Date 9:53 2020/10/20
* @Param
* @Param
* @return
**/
**/
JSONObject
addressList
(
String
openId
,
String
appId
);
JSONObject
addressList
(
String
openId
,
String
appId
,
Long
addressId
);
/**
/**
* @Description 根据id查询收货地址
* @return
* @Description 根据id查询收货地址
* @Date 9:53 2020/10/20
* @Date 9:53 2020/10/20
* @Param
* @Param
* @return
**/
**/
JSONObject
addressId
(
Long
id
,
String
appId
);
JSONObject
addressId
(
Long
id
,
String
appId
);
/**
/**
* @Description 个人收货地址新增
* @return
* @Description 个人收货地址新增
* @Date 9:53 2020/10/20
* @Date 9:53 2020/10/20
* @Param
* @Param
* @return
**/
**/
JSONObject
addressAdd
(
Address
address
);
JSONObject
addressAdd
(
Address
address
);
/**
/**
* @return
* @Author Licc
* @Author Licc
* @Description
个人收货地址修改
* @Description 个人收货地址修改
* @Date 15:23 2020/10/20
* @Date 15:23 2020/10/20
* @Param
* @Param
* @return
**/
**/
JSONObject
updateAddress
(
Address
address
);
JSONObject
updateAddress
(
Address
address
);
/**
/**
* @return
* @Author Licc
* @Author Licc
* @Description
个人收货地址删除
* @Description 个人收货地址删除
* @Date 15:53 2020/10/20
* @Date 15:53 2020/10/20
* @Param
* @Param
* @return
**/
**/
JSONObject
deleteAddress
(
String
id
,
String
appId
);
JSONObject
deleteAddress
(
String
id
,
String
appId
);
}
}
membercard-modules/shipping-address-module/src/main/java/com/cftech/addresst/service/impl/AddressServiceImpl.java
View file @
c80b825a
...
@@ -51,7 +51,7 @@ public class AddressServiceImpl extends GenericServiceImpl<Address> implements A
...
@@ -51,7 +51,7 @@ public class AddressServiceImpl extends GenericServiceImpl<Address> implements A
}
}
@Override
@Override
public
JSONObject
addressList
(
String
openId
,
String
appId
)
{
public
JSONObject
addressList
(
String
openId
,
String
appId
,
Long
addressId
)
{
JSONObject
rtnJson
=
new
JSONObject
();
JSONObject
rtnJson
=
new
JSONObject
();
try
{
try
{
...
@@ -61,7 +61,7 @@ public class AddressServiceImpl extends GenericServiceImpl<Address> implements A
...
@@ -61,7 +61,7 @@ public class AddressServiceImpl extends GenericServiceImpl<Address> implements A
return
rtnJson
;
return
rtnJson
;
}
}
MpAccountsEntity
mpAccountsAppid
=
mpAccountsService
.
getMpAccountsAppid
(
appId
);
MpAccountsEntity
mpAccountsAppid
=
mpAccountsService
.
getMpAccountsAppid
(
appId
);
List
<
AddressVO
>
addressList
=
addressMapper
.
addressList
(
openId
);
List
<
AddressVO
>
addressList
=
addressMapper
.
addressList
(
openId
,
addressId
);
Log
.
info
(
"参数:"
+
addressList
);
Log
.
info
(
"参数:"
+
addressList
);
if
(!
addressList
.
equals
(
""
)
||
addressList
!=
null
)
{
if
(!
addressList
.
equals
(
""
)
||
addressList
!=
null
)
{
rtnJson
.
put
(
"errorNo"
,
"0"
);
rtnJson
.
put
(
"errorNo"
,
"0"
);
...
@@ -79,7 +79,7 @@ public class AddressServiceImpl extends GenericServiceImpl<Address> implements A
...
@@ -79,7 +79,7 @@ public class AddressServiceImpl extends GenericServiceImpl<Address> implements A
public
JSONObject
addressId
(
Long
id
,
String
appId
)
{
public
JSONObject
addressId
(
Long
id
,
String
appId
)
{
JSONObject
rtnJson
=
new
JSONObject
();
JSONObject
rtnJson
=
new
JSONObject
();
try
{
try
{
if
(
id
.
equals
(
""
)
)
{
if
(
id
==
null
)
{
rtnJson
.
put
(
"errorNo"
,
"1"
);
rtnJson
.
put
(
"errorNo"
,
"1"
);
rtnJson
.
put
(
"errorMsg"
,
"id不能为空"
);
rtnJson
.
put
(
"errorMsg"
,
"id不能为空"
);
return
rtnJson
;
return
rtnJson
;
...
@@ -89,11 +89,11 @@ public class AddressServiceImpl extends GenericServiceImpl<Address> implements A
...
@@ -89,11 +89,11 @@ public class AddressServiceImpl extends GenericServiceImpl<Address> implements A
if
(
addressVOS
!=
null
){
if
(
addressVOS
!=
null
){
Log
.
info
(
"参数:"
+
addressVOS
);
Log
.
info
(
"参数:"
+
addressVOS
);
rtnJson
.
put
(
"errorNo"
,
"0"
);
rtnJson
.
put
(
"errorNo"
,
"0"
);
rtnJson
.
put
(
"
errorMsg
"
,
addressVOS
);
rtnJson
.
put
(
"
data
"
,
addressVOS
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
rtnJson
.
put
(
"errorN
O
"
,
"1"
);
rtnJson
.
put
(
"errorN
o
"
,
"1"
);
}
}
return
rtnJson
;
return
rtnJson
;
}
}
...
...
membercard-modules/shipping-address-module/src/main/java/com/cftech/addresst/web/MobileAddressController.java
View file @
c80b825a
...
@@ -37,8 +37,8 @@ public class MobileAddressController {
...
@@ -37,8 +37,8 @@ public class MobileAddressController {
* @Param
* @Param
**/
**/
@RequestMapping
(
value
=
"/addressList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
},
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@RequestMapping
(
value
=
"/addressList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
},
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
JSONObject
addressList
(
String
openId
,
String
appId
)
{
public
JSONObject
addressList
(
String
openId
,
String
appId
,
Long
addressId
)
{
return
addressService
.
addressList
(
openId
,
app
Id
);
return
addressService
.
addressList
(
openId
,
appId
,
address
Id
);
}
}
/**
/**
...
...
qy-modules/qy-orgunit-module/src/main/java/com/cftech/base/org/web/MobileQybaseController.java
View file @
c80b825a
...
@@ -191,7 +191,7 @@ public class MobileQybaseController {
...
@@ -191,7 +191,7 @@ public class MobileQybaseController {
}
}
}
}
String
filePath
=
USER_IMAGES_DIR
+
""
;
String
filePath
=
USER_IMAGES_DIR
;
String
picPath
=
filePath
+
File
.
separator
+
picFileName
;
String
picPath
=
filePath
+
File
.
separator
+
picFileName
;
//取后缀
//取后缀
...
...
qy-modules/qyapi-module/src/main/java/com/cftech/base/org/api/QyMediaUtil.java
View file @
c80b825a
package
com
.
cftech
.
base
.
org
.
api
;
package
com
.
cftech
.
base
.
org
.
api
;
import
com.cftech.accounts.model.MpAccountsEntity
;
import
com.cftech.accounts.model.MpAccountsEntity
;
import
com.cftech.core.constants.MpApiConstants
;
import
com.cftech.core.constants.WxApiConstants
;
import
com.cftech.core.constants.WxApiConstants
;
import
com.cftech.core.util.MpTokenUtil
;
import
com.cftech.core.util.QyTokenUtil
;
import
com.cftech.core.util.QyTokenUtil
;
import
com.cftech.core.util.SystemConfig
;
import
com.cftech.core.util.SystemConfig
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -25,6 +27,9 @@ public class QyMediaUtil {
...
@@ -25,6 +27,9 @@ public class QyMediaUtil {
private
final
QyTokenUtil
qyTokenUtil
;
private
final
QyTokenUtil
qyTokenUtil
;
@Autowired
private
MpTokenUtil
mpTokenUtil
;
// 图片目录
// 图片目录
public
static
final
String
USER_IMAGES_DIR
=
SystemConfig
.
p
.
getProperty
(
"userfiles.imgdir"
);
public
static
final
String
USER_IMAGES_DIR
=
SystemConfig
.
p
.
getProperty
(
"userfiles.imgdir"
);
...
@@ -53,6 +58,79 @@ public class QyMediaUtil {
...
@@ -53,6 +58,79 @@ public class QyMediaUtil {
return
res
;
return
res
;
}
}
/**
* 下载媒体文件至磁盘(服务号)
*
* @param accountsId 微信账号
* @param moduleName 模块名称,可不填
* @param mediaId 媒体的Id
* @return 形成的文件名称
*/
public
String
downloadMpMediaToDisk
(
Long
accountsId
,
String
moduleName
,
String
mediaId
)
{
String
finalFileName
=
""
;
MpAccountsEntity
accountsEntity
=
mpTokenUtil
.
searchAccountsById
(
accountsId
);
BufferedInputStream
bis
=
null
;
FileOutputStream
fos
=
null
;
HttpURLConnection
conn
=
null
;
String
requestUrl
=
MpApiConstants
.
MEDIA_GET
.
replace
(
"ACCESS_TOKEN"
,
mpTokenUtil
.
getToken
(
accountsEntity
))
.
replace
(
"MEDIA_ID"
,
mediaId
);
try
{
URL
url
=
new
URL
(
requestUrl
);
conn
=
(
HttpURLConnection
)
url
.
openConnection
();
conn
.
setDoInput
(
true
);
conn
.
setRequestMethod
(
"GET"
);
//String fileExt = getFileEndWitsh(conn.getHeaderField("Content-Type"));
String
fileExt
=
".jpg"
;
String
fileName
=
getRundomName
(
moduleName
);
finalFileName
=
fileName
+
fileExt
;
String
dir
=
USER_IMAGES_DIR
;
File
ff
=
new
File
(
dir
);
if
(!
ff
.
exists
())
{
ff
.
mkdir
();
}
String
realPath
=
dir
+
File
.
separator
+
finalFileName
;
bis
=
new
BufferedInputStream
(
conn
.
getInputStream
());
fos
=
new
FileOutputStream
(
new
File
(
realPath
));
byte
[]
buf
=
new
byte
[
8096
];
int
size
=
0
;
while
((
size
=
bis
.
read
(
buf
))
!=
-
1
)
{
fos
.
write
(
buf
,
0
,
size
);
}
fos
.
close
();
bis
.
close
();
conn
.
disconnect
();
}
catch
(
IOException
e
)
{
log
.
error
(
"下载媒体文件失败:{}"
,
e
.
getMessage
());
}
finally
{
if
(
fos
!=
null
)
{
try
{
fos
.
close
();
}
catch
(
IOException
e
)
{
log
.
error
(
"下载媒体文件失败 IOException:{}"
,
e
.
getMessage
());
}
}
if
(
bis
!=
null
)
{
try
{
bis
.
close
();
}
catch
(
IOException
e
)
{
log
.
error
(
"下载媒体文件失败 IOException:{}"
,
e
.
getMessage
());
}
}
if
(
conn
!=
null
)
{
conn
.
disconnect
();
}
}
return
finalFileName
;
}
/**
/**
* 下载媒体文件至磁盘
* 下载媒体文件至磁盘
*
*
...
...
token-module/src/main/java/com/cftech/core/constants/MpApiConstants.java
View file @
c80b825a
...
@@ -10,5 +10,7 @@ public class MpApiConstants {
...
@@ -10,5 +10,7 @@ public class MpApiConstants {
/* JSAPI_TICKET */
/* JSAPI_TICKET */
public
static
final
String
JSAPI_TICKET_GET
=
"https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=ACCESS_TOKEN&type=jsapi"
;
public
static
final
String
JSAPI_TICKET_GET
=
"https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=ACCESS_TOKEN&type=jsapi"
;
public
static
final
String
MEDIA_GET
=
"https://api.weixin.qq.com/cgi-bin/media/get?access_token=ACCESS_TOKEN&media_id=MEDIA_ID"
;
}
}
token-module/src/main/java/com/cftech/core/util/QyTokenUtil.java
View file @
c80b825a
...
@@ -127,6 +127,7 @@ public class QyTokenUtil {
...
@@ -127,6 +127,7 @@ public class QyTokenUtil {
return
token
;
return
token
;
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
log
.
error
(
"获取token失败"
+
e
.
getMessage
());
}
}
return
null
;
return
null
;
}
}
...
...
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