记得上下班打卡 | git大法好,push需谨慎

Commit c318f074 authored by anjiabin's avatar anjiabin
parents 1d4e089c 9a8222af
...@@ -227,7 +227,7 @@ public class KylinOrderRefundAdminController extends BaseController { ...@@ -227,7 +227,7 @@ public class KylinOrderRefundAdminController extends BaseController {
@NotNull(message = "类型不能为空") @RequestParam int type) { @NotNull(message = "类型不能为空") @RequestParam int type) {
String codeNum = kylinOrderRefundsService.getOrderRefundCode(code,type); String codeNum = kylinOrderRefundsService.getOrderRefundCode(code,type);
if(codeNum==null){ if(codeNum==null){
return error("查询失败"); return success("ERROR");
}else{ }else{
return success(codeNum); return success(codeNum);
} }
......
...@@ -42,6 +42,8 @@ ...@@ -42,6 +42,8 @@
</ul> </ul>
</div> </div>
</form> </form>
</div>
<div class="col-sm-12 search-collapse">
<form id="formId2"> <form id="formId2">
<div class="select-list"> <div class="select-list">
<ul> <ul>
...@@ -53,6 +55,10 @@ ...@@ -53,6 +55,10 @@
<a class="btn btn-primary btn-rounded btn-sm" onclick="findCode()"><i <a class="btn btn-primary btn-rounded btn-sm" onclick="findCode()"><i
class="fa fa-search"></i>&nbsp;查询</a> class="fa fa-search"></i>&nbsp;查询</a>
</li> </li>
<li>
<label>长订单号:</label>
<input type="text" name="allCode" readonly/>
</li>
</ul> </ul>
</div> </div>
</form> </form>
...@@ -114,8 +120,9 @@ ...@@ -114,8 +120,9 @@
function findCode() { function findCode() {
var shortCode = document.getElementsByName("findCode")[0].value; var shortCode = document.getElementsByName("findCode")[0].value;
$.operate.get(prefix + "/search/code?code="+shortCode+"&type=2", null, function (res) { var allCode = document.getElementsByName("allCode")[0];
$.modal.alert(res); $.operate.get(prefix + "/search/code?code=" + shortCode + "&type=2", function (res) {
allCode.value=res.msg;
}); });
} }
......
...@@ -475,20 +475,24 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM ...@@ -475,20 +475,24 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
@Override @Override
public String getOrderRefundCode(String code, int type) { public String getOrderRefundCode(String code, int type) {
String orderCode = null; String orderCode = null;
if (type == 1) { try {
KylinOrderRefunds data = kylinOrderRefundsMapper.selectOne(new UpdateWrapper<KylinOrderRefunds>().like("order_refund_code", code)); if (type == 1) {
if (data == null) { KylinOrderRefunds data = kylinOrderRefundsMapper.selectOne(new UpdateWrapper<KylinOrderRefunds>().like("order_refund_code", code));
return null; if (data == null) {
} else { return null;
orderCode = data.getOrderRefundCode(); } else {
} orderCode = data.getOrderRefundCode();
} else if (type == 2) { }
KylinOrderTickets data = kylinOrderTicketsMapper.selectOne(new UpdateWrapper<KylinOrderTickets>().like("order_code", code)); } else if (type == 2) {
if (data == null) { KylinOrderTickets data = kylinOrderTicketsMapper.selectOne(new UpdateWrapper<KylinOrderTickets>().like("order_code", code));
return null; if (data == null) {
} else { return null;
orderCode = data.getOrderCode(); } else {
orderCode = data.getOrderCode();
}
} }
}catch (Exception e){
} }
return orderCode; return orderCode;
} }
......
...@@ -299,6 +299,44 @@ public class AdamLoginController { ...@@ -299,6 +299,44 @@ public class AdamLoginController {
} }
@ApiOperationSupport(order = 6) @ApiOperationSupport(order = 6)
@ApiOperation(value = "第三方账号登录v1")
@PostMapping(value = {"login/tpa_v1"})
public ResponseDto<AdamLoginInfoVo> loginByTpaV1(@Valid @RequestBody AdamThirdPartParam parameter) {
log.debug("login by tpa:{}", JsonUtils.toJson(parameter));
boolean toRegister = false;
AdamLoginInfoVo loginInfoVo = AdamLoginInfoVo.getNew();
if (StringUtils.isEmpty(parameter.getMobile())) {
String uid = adamRdmService.getUidByPlatformOpenId(parameter.getPlatform(), parameter.getOpenId());
if (StringUtils.isEmpty(uid)) return ResponseDto.failure(ErrorMapping.get("10006"));
loginInfoVo.setUserInfo(adamRdmService.getUserInfoVoByUid(uid));
// loginInfoVo.setRealNameInfo(adamRdmService.getRealInfoVoByUid(uid));
// loginInfoVo.setThirdPartInfo(adamRdmService.getThirdPartVoListByUid(uid));
loginInfoVo.setUserMemberVo(adamRdmService.getUserMemberVoByUid(uid));
// loginInfoVo.setMemberVo(adamRdmService.getMemberSimpleVo());
} else {// 新账号注册
ResponseDto<AdamLoginInfoVo> checkSmsCodeDto = this.checkSmsCode(parameter.getMobile(), parameter.getCode());
if (!checkSmsCodeDto.isSuccess()) {
return checkSmsCodeDto;
}
ResponseDto<AdamUserInfoVo> registerRespDto = adamUserService.register(parameter);
if (!registerRespDto.isSuccess()) {
return ResponseDto.failure(registerRespDto.getCode(), registerRespDto.getMessage());
} else {
AdamUserInfoVo registerUserInfo = registerRespDto.getData();
loginInfoVo.setUserInfo(registerUserInfo);
loginInfoVo.setThirdPartInfo(adamRdmService.getThirdPartVoListByUid(registerUserInfo.getUid()));
// loginInfoVo.setMemberVo(adamRdmService.getMemberSimpleVo());
}
toRegister = true;
}
loginInfoVo.setToken(this.ssoProcess(loginInfoVo.getUserInfo()));
loginInfoVo.getUserInfo().setMobile(SensitizeUtil.custom(loginInfoVo.getUserInfo().getMobile(), 3, 4));
log.info(UserPathDto.setData(toRegister ? "注册" : "登录", ServletUtils.getRequest().getParameterMap(), loginInfoVo));
return ResponseDto.success(loginInfoVo);
}
@ApiOperationSupport(order = 7)
@ApiOperation(value = "登出") @ApiOperation(value = "登出")
@PostMapping(value = {"out"}) @PostMapping(value = {"out"})
public void logout() { public void logout() {
...@@ -307,7 +345,7 @@ public class AdamLoginController { ...@@ -307,7 +345,7 @@ public class AdamLoginController {
redisUtil.del(jwtValidator.getSsoRedisKey().concat(CurrentUtil.getCurrentUid())); redisUtil.del(jwtValidator.getSsoRedisKey().concat(CurrentUtil.getCurrentUid()));
} }
@ApiOperationSupport(order = 7) @ApiOperationSupport(order = 8)
@ApiOperation(value = "注销") @ApiOperation(value = "注销")
@PostMapping(value = {"close"}) @PostMapping(value = {"close"})
public ResponseDto<Object> close() { public ResponseDto<Object> close() {
...@@ -320,14 +358,14 @@ public class AdamLoginController { ...@@ -320,14 +358,14 @@ public class AdamLoginController {
return ResponseDto.success(); return ResponseDto.success();
} }
@ApiOperationSupport(order = 8) @ApiOperationSupport(order = 9)
@ApiOperation(value = "时间戳") @ApiOperation(value = "时间戳")
@GetMapping(value = {"ts"}) @GetMapping(value = {"ts"})
public ResponseDto<Long> timestamp() { public ResponseDto<Long> timestamp() {
return ResponseDto.success(LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli()); return ResponseDto.success(LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli());
} }
@ApiOperationSupport(order = 9) @ApiOperationSupport(order = 10)
@ApiOperation(value = "微信小程序登录凭证校验", notes = "这里仅用于获取OPENID使用。登录凭证校验。通过 wx.login 接口获得临时登录凭证 code 后传到开发者服务器调用此接口完成登录流程。更多使用方法详见 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/login/auth.code2Session.html") @ApiOperation(value = "微信小程序登录凭证校验", notes = "这里仅用于获取OPENID使用。登录凭证校验。通过 wx.login 接口获得临时登录凭证 code 后传到开发者服务器调用此接口完成登录流程。更多使用方法详见 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/login/auth.code2Session.html")
@GetMapping(value = {"wxa/code2session"}) @GetMapping(value = {"wxa/code2session"})
public ResponseDto<String> wxaCode2Session(@RequestParam String jsCode) { public ResponseDto<String> wxaCode2Session(@RequestParam String jsCode) {
...@@ -350,7 +388,7 @@ public class AdamLoginController { ...@@ -350,7 +388,7 @@ public class AdamLoginController {
return ResponseDto.success(openId); return ResponseDto.success(openId);
} }
@ApiOperationSupport(order = 10) @ApiOperationSupport(order = 11)
@ApiOperation(value = "微信网站应用登录", notes = "这里仅用于获取OPENID使用。方法详见 https://developers.weixin.qq.com/doc/oplatform/Website_App/WeChat_Login/Wechat_Login.html") @ApiOperation(value = "微信网站应用登录", notes = "这里仅用于获取OPENID使用。方法详见 https://developers.weixin.qq.com/doc/oplatform/Website_App/WeChat_Login/Wechat_Login.html")
@GetMapping(value = {"wx/oauth2/access_token"}) @GetMapping(value = {"wx/oauth2/access_token"})
public ResponseDto<String> wxOauth2AccessToken(@RequestParam String code) { public ResponseDto<String> wxOauth2AccessToken(@RequestParam String code) {
......
...@@ -473,7 +473,7 @@ public class DataImpl { ...@@ -473,7 +473,7 @@ public class DataImpl {
Class.forName(driverClassName); //执行驱动 Class.forName(driverClassName); //执行驱动
con = DriverManager.getConnection(url, username, password); //获取连接 con = DriverManager.getConnection(url, username, password); //获取连接
String sqlAllCount = "select count(0) as 'allCount' from order_tickets where performance_id > 5721 and status != 2 and status != -1 and created_at like '2021-" + month + "%'"; //设置的预编译语句格式 String sqlAllCount = "select count(0) as 'allCount' from order_tickets where performance_id > 5721 and status != 2 and status != -1 and created_at like '2020-" + month + "%'"; //设置的预编译语句格式
// String sqlAllCount = "select count(0) as 'allCount' from order_tickets where performance_id = "+month + " and status != 2 and status !=-1"; //设置的预编译语句格式 // String sqlAllCount = "select count(0) as 'allCount' from order_tickets where performance_id = "+month + " and status != 2 and status !=-1"; //设置的预编译语句格式
pstmt = con.prepareStatement(sqlAllCount); pstmt = con.prepareStatement(sqlAllCount);
ResultSet allCount = pstmt.executeQuery(); ResultSet allCount = pstmt.executeQuery();
......
...@@ -604,7 +604,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor ...@@ -604,7 +604,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
// 排序 分页 // 排序 分页
Pageable pageable = PageRequest.of(page, size, Sort.by(Sort.Direction.DESC, "createdAt")); Pageable pageable = PageRequest.of(page, size, Sort.by(Sort.Direction.DESC, "createdAt"));
//条件 //条件
Criteria criteria = Criteria.where("status").is(status).and("isCreateSave").is(1); Criteria criteria = Criteria.where("status").is(status).and("isCreateSave").is(1).and("merchantId").is(performancePartnerListParam.getMerchantId());
if (!performancePartnerListParam.getTitle().isEmpty()) { if (!performancePartnerListParam.getTitle().isEmpty()) {
criteria.and("title").regex(".*?\\" + performancePartnerListParam.getTitle()); criteria.and("title").regex(".*?\\" + performancePartnerListParam.getTitle());
} }
......
...@@ -182,3 +182,30 @@ CREATE TABLE `sweet_manual_shop` ...@@ -182,3 +182,30 @@ CREATE TABLE `sweet_manual_shop`
DEFAULT CHARSET = utf8 DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci COLLATE = utf8_unicode_ci
ROW_FORMAT = DYNAMIC COMMENT '电子宣传手册商铺表'; ROW_FORMAT = DYNAMIC COMMENT '电子宣传手册商铺表';
-- 正在现场服务号关注事件储存用户信息表
drop TABLE if exists `sweet_wechat_user`;
CREATE TABLE `sweet_wechat_user`
(
`mid` bigint unsigned NOT NULL AUTO_INCREMENT,
`user_id` varchar(200) NOT NULL DEFAULT '' COMMENT 'user_id',
`openId` varchar(200) NOT NULL DEFAULT '' COMMENT 'openId',
`unionId` varchar(200) NOT NULL DEFAULT '' COMMENT 'unionId',
`nickname` varchar(200) NOT NULL DEFAULT '' COMMENT '昵称',
`sexDesc` varchar(200) NOT NULL DEFAULT '' COMMENT '性别',
`sex` tinyint NOT NULL DEFAULT 0 COMMENT '性别 男1',
`headImgUrl` varchar(200) NOT NULL DEFAULT '' COMMENT '头像',
`language` varchar(200) NOT NULL DEFAULT '' COMMENT 'zh_CN',
`country` varchar(200) NOT NULL DEFAULT '' COMMENT '国家',
`province` varchar(200) NOT NULL DEFAULT '' COMMENT '省',
`city` varchar(200) NOT NULL DEFAULT '' COMMENT '市',
`subscribeTime` datetime NULL DEFAULT null COMMENT '关注时间',
`subscribeScene` varchar(200) NOT NULL DEFAULT '' COMMENT 'ADD_SCENE_SEARCH 关注方式',
`created_at` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_at` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`mid`),
KEY `sweet_wechat_user_user_id` (`user_id`)
) ENGINE = InnoDB
DEFAULT CHARSET utf8mb4
COLLATE utf8mb4_unicode_ci
ROW_FORMAT = DYNAMIC COMMENT '正在现场服务号关注事件储存用户信息表';
...@@ -73,19 +73,19 @@ public class SweetAppletController { ...@@ -73,19 +73,19 @@ public class SweetAppletController {
@ApiOperation("时间表") @ApiOperation("时间表")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "manualId", value = "电子手册id", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "manualId", value = "电子手册id", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "dateTime", value = "时间 全部传 \"\"", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "dateTime", value = "时间 全部不传", required = false),
@ApiImplicitParam(type = "query", dataType = "String", name = "stage", value = "舞台 全部传 \"\"", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "stage", value = "舞台 全部不传", required = false),
@ApiImplicitParam(type = "query", dataType = "Integer", name = "isSign", value = "是否签名(1是0否)", required = true), @ApiImplicitParam(type = "query", dataType = "Integer", name = "isSign", value = "是否签名(1是0否)", required = true),
@ApiImplicitParam(type = "query", dataType = "Integer", name = "page", value = "页数", required = false), @ApiImplicitParam(type = "query", dataType = "Integer", name = "page", value = "页数", required = false),
@ApiImplicitParam(type = "query", dataType = "Integer", name = "size", value = "数量", required = false), @ApiImplicitParam(type = "query", dataType = "Integer", name = "size", value = "数量", required = false),
@ApiImplicitParam(type = "query", dataType = "String", name = "uid", value = "用户id", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "uid", value = "用户id", required = true),
}) })
public ResponseDto<SweetManualArtistList2Dto> timeList(@RequestParam String manualId, public ResponseDto<SweetManualArtistList2Dto> timeList(@RequestParam String manualId,
@RequestParam String dateTime, @RequestParam(required = false) String dateTime,
@RequestParam String stage, @RequestParam(required = false) String stage,
@RequestParam Integer isSign, @RequestParam Integer isSign,
@RequestParam Integer page, @RequestParam(required = false) Integer page,
@RequestParam Integer size, @RequestParam(required = false) Integer size,
@RequestParam String uid) { @RequestParam String uid) {
List<SweetManualArtistListDto> allReturnArtist = new ArrayList(); List<SweetManualArtistListDto> allReturnArtist = new ArrayList();
...@@ -103,7 +103,7 @@ public class SweetAppletController { ...@@ -103,7 +103,7 @@ public class SweetAppletController {
endPosition = (page) * size; endPosition = (page) * size;
} }
if (page != null && dateTime.equals("")) { if (page == null && dateTime == null) {
try { try {
dateTime = data.getDate().get(0); dateTime = data.getDate().get(0);
} catch (Exception e) { } catch (Exception e) {
...@@ -112,25 +112,25 @@ public class SweetAppletController { ...@@ -112,25 +112,25 @@ public class SweetAppletController {
} }
for (SweetManualArtistListDto item : artistData) { for (SweetManualArtistListDto item : artistData) {
boolean isSave = false; boolean isSave = true;
if (isSign == 1) { if (isSign == 1) {
if (item.getSignatureStart() != null) { if (item.getSignatureStart() == null) {
//保留 //保留
isSave = true; isSave = false;
} }
} }
if (!dateTime.isEmpty()) { if (dateTime != null) {
if (item.getPerformanceStart().contains(dateTime)) { if (!item.getPerformanceStart().contains(dateTime)) {
//保留 //保留
isSave = true; isSave = false;
} }
} }
if (!stage.isEmpty()) { if (stage != null) {
if (item.getTitle().equalsIgnoreCase(stage)) { if (!item.getTitle().equalsIgnoreCase(stage)) {
//保留 //保留
isSave = true; isSave = false;
} }
} }
...@@ -146,17 +146,20 @@ public class SweetAppletController { ...@@ -146,17 +146,20 @@ public class SweetAppletController {
item.setIsWatch(0); item.setIsWatch(0);
item.setIsSign(0); item.setIsSign(0);
for (String artistsId : relationData.getWatchList()) { if (relationData.getWatchList() != null) {
if (artistsId.equalsIgnoreCase(item.getArtistId())) { for (String artistsId : relationData.getWatchList()) {
item.setIsWatch(1); if (artistsId.equalsIgnoreCase(item.getArtistId())) {
break; item.setIsWatch(1);
break;
}
} }
} }
if (relationData.getSignList() != null) {
for (String artistsId : relationData.getSignList()) { for (String artistsId : relationData.getSignList()) {
if (artistsId.equalsIgnoreCase(item.getArtistId())) { if (artistsId.equalsIgnoreCase(item.getArtistId())) {
item.setIsSign(1); item.setIsSign(1);
break; break;
}
} }
} }
......
...@@ -20,6 +20,9 @@ public class SweetWechatActionCallbackController { ...@@ -20,6 +20,9 @@ public class SweetWechatActionCallbackController {
@Autowired @Autowired
private SweetWechatCallbackServiceImpl sweetWechatCallbackService; private SweetWechatCallbackServiceImpl sweetWechatCallbackService;
@Autowired
private WechatSignUtils wechatSignUtils;
@GetMapping("record") @GetMapping("record")
@ApiOperation("get") @ApiOperation("get")
public void record( public void record(
...@@ -30,7 +33,7 @@ public class SweetWechatActionCallbackController { ...@@ -30,7 +33,7 @@ public class SweetWechatActionCallbackController {
@RequestParam() String echostr @RequestParam() String echostr
) { ) {
try { try {
if (WechatSignUtils.checkSignature(signature, timestamp, nonce)) { if (wechatSignUtils.checkSignature(signature, timestamp, nonce)) {
log.info("验签通过"); log.info("验签通过");
PrintWriter out = response.getWriter(); PrintWriter out = response.getWriter();
out.print(echostr); out.print(echostr);
...@@ -46,7 +49,8 @@ public class SweetWechatActionCallbackController { ...@@ -46,7 +49,8 @@ public class SweetWechatActionCallbackController {
@PostMapping("record") @PostMapping("record")
@ApiOperation("post") @ApiOperation("post")
public String record( public String record(
@RequestBody String requestBody, // @RequestBody String requestBody,
@RequestParam String requestBody,
@RequestParam("signature") String signature, @RequestParam("signature") String signature,
@RequestParam("timestamp") String timestamp, @RequestParam("timestamp") String timestamp,
@RequestParam("nonce") String nonce, @RequestParam("nonce") String nonce,
...@@ -57,7 +61,7 @@ public class SweetWechatActionCallbackController { ...@@ -57,7 +61,7 @@ public class SweetWechatActionCallbackController {
log.info("\n接收微信请求:[openid=[{}], [signature=[{}], encType=[{}], msgSignature=[{}]," log.info("\n接收微信请求:[openid=[{}], [signature=[{}], encType=[{}], msgSignature=[{}],"
+ " timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] ", + " timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] ",
openid, signature, encType, msgSignature, timestamp, nonce, requestBody); openid, signature, encType, msgSignature, timestamp, nonce, requestBody);
if (!WechatSignUtils.checkSignature(signature, timestamp, nonce)) { if (!wechatSignUtils.checkSignature(signature, timestamp, nonce)) {
log.info("验签未通过,非法请求,可能属于伪造的请求!"); log.info("验签未通过,非法请求,可能属于伪造的请求!");
return ""; return "";
} }
......
...@@ -17,6 +17,12 @@ public class SweetManualArtistListDto implements Serializable,Cloneable { ...@@ -17,6 +17,12 @@ public class SweetManualArtistListDto implements Serializable,Cloneable {
private String artistId; private String artistId;
@ApiModelProperty("艺人名称") @ApiModelProperty("艺人名称")
private String name; private String name;
@ApiModelProperty("拼音")
private String pinyin;
@ApiModelProperty("简介")
private String describes;
@ApiModelProperty("头像图片")
private String picUrl;
@ApiModelProperty("舞台id") @ApiModelProperty("舞台id")
private String stageId; private String stageId;
@ApiModelProperty("舞台名称") @ApiModelProperty("舞台名称")
......
...@@ -35,6 +35,7 @@ public class SubscribeHandler implements WxMpMessageHandler { ...@@ -35,6 +35,7 @@ public class SubscribeHandler implements WxMpMessageHandler {
} }
log.info("根据 openId:[{}]获取到的微信用户信息:[{}]", wxMessage.getFromUser(), wxMpUser.toString()); log.info("根据 openId:[{}]获取到的微信用户信息:[{}]", wxMessage.getFromUser(), wxMpUser.toString());
return null; return null;
} }
} }
...@@ -70,10 +70,10 @@ public class SweetWechatCallbackServiceImpl { ...@@ -70,10 +70,10 @@ public class SweetWechatCallbackServiceImpl {
.end(); .end();
// 取消关注事件 // 取消关注事件
router.rule().async(false).msgType(WxConsts.XmlMsgType.EVENT) /*router.rule().async(false).msgType(WxConsts.XmlMsgType.EVENT)
.event(WxConsts.EventType.UNSUBSCRIBE) .event(WxConsts.EventType.UNSUBSCRIBE)
.handler(unsubscribeHandler) .handler(unsubscribeHandler)
.end(); .end();*/
return router; return router;
} }
...@@ -82,9 +82,10 @@ public class SweetWechatCallbackServiceImpl { ...@@ -82,9 +82,10 @@ public class SweetWechatCallbackServiceImpl {
WxMpConfigStorage wxMpConfig = wxMpConfig(appid, secret, token, aeskey); WxMpConfigStorage wxMpConfig = wxMpConfig(appid, secret, token, aeskey);
WxMpService wxMpService = wxMpService(wxMpConfig); WxMpService wxMpService = wxMpService(wxMpConfig);
String out = null; String out = null;
if (encType == null) { if (encType == null || encType.isEmpty()) {
// 明文传输的消息 // 明文传输的消息
WxMpXmlMessage inMessage = WxMpXmlMessage.fromXml(requestBody); WxMpXmlMessage inMessage = WxMpXmlMessage.fromXml(requestBody);
log.info("\n消息内容为:\n[{}] ", inMessage.toString());
WxMpXmlOutMessage outMessage = messageRouter(wxMpService).route(inMessage); WxMpXmlOutMessage outMessage = messageRouter(wxMpService).route(inMessage);
if (outMessage == null) { if (outMessage == null) {
return ""; return "";
......
package com.liquidnet.service.sweet.utils; package com.liquidnet.service.sweet.utils;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.security.MessageDigest; import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
...@@ -14,11 +15,12 @@ import java.util.Arrays; ...@@ -14,11 +15,12 @@ import java.util.Arrays;
* @author jiangxiulong * @author jiangxiulong
* @since 2021-07-29 3:19 下午 * @since 2021-07-29 3:19 下午
*/ */
@Component
public class WechatSignUtils { public class WechatSignUtils {
// 与接口配置信息中的 Token 要一致 // 与接口配置信息中的 Token 要一致
@Value("${liquidnet.wechat.zhengzai.service.token}") @Value("${liquidnet.wechat.zhengzai.service.token}")
private static String token; private String token;
/** /**
* 验证签名 * 验证签名
...@@ -28,7 +30,7 @@ public class WechatSignUtils { ...@@ -28,7 +30,7 @@ public class WechatSignUtils {
* @param nonce * @param nonce
* @return * @return
*/ */
public static boolean checkSignature(String signature, String timestamp, String nonce) { public boolean checkSignature(String signature, String timestamp, String nonce) {
String[] arr = new String[]{token, timestamp, nonce}; String[] arr = new String[]{token, timestamp, nonce};
// 将 token、timestamp、nonce 三个参数进行字典序排序 // 将 token、timestamp、nonce 三个参数进行字典序排序
Arrays.sort(arr); Arrays.sort(arr);
...@@ -59,7 +61,7 @@ public class WechatSignUtils { ...@@ -59,7 +61,7 @@ public class WechatSignUtils {
* @param byteArray * @param byteArray
* @return * @return
*/ */
private static String byteToStr(byte[] byteArray) { private String byteToStr(byte[] byteArray) {
String strDigest = ""; String strDigest = "";
for (int i = 0; i < byteArray.length; i++) { for (int i = 0; i < byteArray.length; i++) {
strDigest += byteToHexStr(byteArray[i]); strDigest += byteToHexStr(byteArray[i]);
...@@ -73,7 +75,7 @@ public class WechatSignUtils { ...@@ -73,7 +75,7 @@ public class WechatSignUtils {
* @param mByte * @param mByte
* @return * @return
*/ */
private static String byteToHexStr(byte mByte) { private String byteToHexStr(byte mByte) {
char[] Digit = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; char[] Digit = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
char[] tempArr = new char[2]; char[] tempArr = new char[2];
tempArr[0] = Digit[(mByte >>> 4) & 0X0F]; tempArr[0] = Digit[(mByte >>> 4) & 0X0F];
......
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
<result column="manual_relation_id" property="manualRelationId"/> <result column="manual_relation_id" property="manualRelationId"/>
<result column="artists_id" property="artistId"/> <result column="artists_id" property="artistId"/>
<result column="name" property="name"/> <result column="name" property="name"/>
<result column="pinyin" property="pinyin"/>
<result column="describes" property="describes"/>
<result column="pic_url" property="picUrl"/>
<result column="stage_id" property="stageId"/> <result column="stage_id" property="stageId"/>
<result column="title" property="title"/> <result column="title" property="title"/>
<result column="performance_start" property="performanceStart"/> <result column="performance_start" property="performanceStart"/>
...@@ -22,6 +25,9 @@ ...@@ -22,6 +25,9 @@
select manual_relation_id, select manual_relation_id,
sa.`artists_id`, sa.`artists_id`,
sa.`name`, sa.`name`,
sa.pinyin,
sa.describes,
sa.pic_url,
ss.stage_id, ss.stage_id,
ss.title, ss.title,
performance_start, performance_start,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment