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

Commit c318f074 authored by anjiabin's avatar anjiabin
parents 1d4e089c 9a8222af
......@@ -227,7 +227,7 @@ public class KylinOrderRefundAdminController extends BaseController {
@NotNull(message = "类型不能为空") @RequestParam int type) {
String codeNum = kylinOrderRefundsService.getOrderRefundCode(code,type);
if(codeNum==null){
return error("查询失败");
return success("ERROR");
}else{
return success(codeNum);
}
......
......@@ -42,6 +42,8 @@
</ul>
</div>
</form>
</div>
<div class="col-sm-12 search-collapse">
<form id="formId2">
<div class="select-list">
<ul>
......@@ -53,6 +55,10 @@
<a class="btn btn-primary btn-rounded btn-sm" onclick="findCode()"><i
class="fa fa-search"></i>&nbsp;查询</a>
</li>
<li>
<label>长订单号:</label>
<input type="text" name="allCode" readonly/>
</li>
</ul>
</div>
</form>
......@@ -114,8 +120,9 @@
function findCode() {
var shortCode = document.getElementsByName("findCode")[0].value;
$.operate.get(prefix + "/search/code?code="+shortCode+"&type=2", null, function (res) {
$.modal.alert(res);
var allCode = document.getElementsByName("allCode")[0];
$.operate.get(prefix + "/search/code?code=" + shortCode + "&type=2", function (res) {
allCode.value=res.msg;
});
}
......
......@@ -475,6 +475,7 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
@Override
public String getOrderRefundCode(String code, int type) {
String orderCode = null;
try {
if (type == 1) {
KylinOrderRefunds data = kylinOrderRefundsMapper.selectOne(new UpdateWrapper<KylinOrderRefunds>().like("order_refund_code", code));
if (data == null) {
......@@ -490,6 +491,9 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
orderCode = data.getOrderCode();
}
}
}catch (Exception e){
}
return orderCode;
}
}
......@@ -299,6 +299,44 @@ public class AdamLoginController {
}
@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 = "登出")
@PostMapping(value = {"out"})
public void logout() {
......@@ -307,7 +345,7 @@ public class AdamLoginController {
redisUtil.del(jwtValidator.getSsoRedisKey().concat(CurrentUtil.getCurrentUid()));
}
@ApiOperationSupport(order = 7)
@ApiOperationSupport(order = 8)
@ApiOperation(value = "注销")
@PostMapping(value = {"close"})
public ResponseDto<Object> close() {
......@@ -320,14 +358,14 @@ public class AdamLoginController {
return ResponseDto.success();
}
@ApiOperationSupport(order = 8)
@ApiOperationSupport(order = 9)
@ApiOperation(value = "时间戳")
@GetMapping(value = {"ts"})
public ResponseDto<Long> timestamp() {
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")
@GetMapping(value = {"wxa/code2session"})
public ResponseDto<String> wxaCode2Session(@RequestParam String jsCode) {
......@@ -350,7 +388,7 @@ public class AdamLoginController {
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")
@GetMapping(value = {"wx/oauth2/access_token"})
public ResponseDto<String> wxOauth2AccessToken(@RequestParam String code) {
......
......@@ -473,7 +473,7 @@ public class DataImpl {
Class.forName(driverClassName); //执行驱动
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"; //设置的预编译语句格式
pstmt = con.prepareStatement(sqlAllCount);
ResultSet allCount = pstmt.executeQuery();
......
......@@ -604,7 +604,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
// 排序 分页
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()) {
criteria.and("title").regex(".*?\\" + performancePartnerListParam.getTitle());
}
......
......@@ -182,3 +182,30 @@ CREATE TABLE `sweet_manual_shop`
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci
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 {
@ApiOperation("时间表")
@ApiImplicitParams({
@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 = "stage", value = "舞台 全部传 \"\"", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "dateTime", value = "时间 全部不传", required = false),
@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 = "page", value = "页数", required = false),
@ApiImplicitParam(type = "query", dataType = "Integer", name = "size", value = "数量", required = false),
@ApiImplicitParam(type = "query", dataType = "String", name = "uid", value = "用户id", required = true),
})
public ResponseDto<SweetManualArtistList2Dto> timeList(@RequestParam String manualId,
@RequestParam String dateTime,
@RequestParam String stage,
@RequestParam(required = false) String dateTime,
@RequestParam(required = false) String stage,
@RequestParam Integer isSign,
@RequestParam Integer page,
@RequestParam Integer size,
@RequestParam(required = false) Integer page,
@RequestParam(required = false) Integer size,
@RequestParam String uid) {
List<SweetManualArtistListDto> allReturnArtist = new ArrayList();
......@@ -103,7 +103,7 @@ public class SweetAppletController {
endPosition = (page) * size;
}
if (page != null && dateTime.equals("")) {
if (page == null && dateTime == null) {
try {
dateTime = data.getDate().get(0);
} catch (Exception e) {
......@@ -112,25 +112,25 @@ public class SweetAppletController {
}
for (SweetManualArtistListDto item : artistData) {
boolean isSave = false;
boolean isSave = true;
if (isSign == 1) {
if (item.getSignatureStart() != null) {
//保留
isSave = true;
if (item.getSignatureStart() == null) {
//保留
isSave = false;
}
}
if (!dateTime.isEmpty()) {
if (item.getPerformanceStart().contains(dateTime)) {
//保留
isSave = true;
if (dateTime != null) {
if (!item.getPerformanceStart().contains(dateTime)) {
//保留
isSave = false;
}
}
if (!stage.isEmpty()) {
if (item.getTitle().equalsIgnoreCase(stage)) {
if (stage != null) {
if (!item.getTitle().equalsIgnoreCase(stage)) {
//保留
isSave = true;
isSave = false;
}
}
......@@ -146,19 +146,22 @@ public class SweetAppletController {
item.setIsWatch(0);
item.setIsSign(0);
if (relationData.getWatchList() != null) {
for (String artistsId : relationData.getWatchList()) {
if (artistsId.equalsIgnoreCase(item.getArtistId())) {
item.setIsWatch(1);
break;
}
}
}
if (relationData.getSignList() != null) {
for (String artistsId : relationData.getSignList()) {
if (artistsId.equalsIgnoreCase(item.getArtistId())) {
item.setIsSign(1);
break;
}
}
}
returnArtist.add(item);
}
......
......@@ -20,6 +20,9 @@ public class SweetWechatActionCallbackController {
@Autowired
private SweetWechatCallbackServiceImpl sweetWechatCallbackService;
@Autowired
private WechatSignUtils wechatSignUtils;
@GetMapping("record")
@ApiOperation("get")
public void record(
......@@ -30,7 +33,7 @@ public class SweetWechatActionCallbackController {
@RequestParam() String echostr
) {
try {
if (WechatSignUtils.checkSignature(signature, timestamp, nonce)) {
if (wechatSignUtils.checkSignature(signature, timestamp, nonce)) {
log.info("验签通过");
PrintWriter out = response.getWriter();
out.print(echostr);
......@@ -46,7 +49,8 @@ public class SweetWechatActionCallbackController {
@PostMapping("record")
@ApiOperation("post")
public String record(
@RequestBody String requestBody,
// @RequestBody String requestBody,
@RequestParam String requestBody,
@RequestParam("signature") String signature,
@RequestParam("timestamp") String timestamp,
@RequestParam("nonce") String nonce,
......@@ -57,7 +61,7 @@ public class SweetWechatActionCallbackController {
log.info("\n接收微信请求:[openid=[{}], [signature=[{}], encType=[{}], msgSignature=[{}],"
+ " timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] ",
openid, signature, encType, msgSignature, timestamp, nonce, requestBody);
if (!WechatSignUtils.checkSignature(signature, timestamp, nonce)) {
if (!wechatSignUtils.checkSignature(signature, timestamp, nonce)) {
log.info("验签未通过,非法请求,可能属于伪造的请求!");
return "";
}
......
......@@ -17,6 +17,12 @@ public class SweetManualArtistListDto implements Serializable,Cloneable {
private String artistId;
@ApiModelProperty("艺人名称")
private String name;
@ApiModelProperty("拼音")
private String pinyin;
@ApiModelProperty("简介")
private String describes;
@ApiModelProperty("头像图片")
private String picUrl;
@ApiModelProperty("舞台id")
private String stageId;
@ApiModelProperty("舞台名称")
......
......@@ -35,6 +35,7 @@ public class SubscribeHandler implements WxMpMessageHandler {
}
log.info("根据 openId:[{}]获取到的微信用户信息:[{}]", wxMessage.getFromUser(), wxMpUser.toString());
return null;
}
}
......@@ -70,10 +70,10 @@ public class SweetWechatCallbackServiceImpl {
.end();
// 取消关注事件
router.rule().async(false).msgType(WxConsts.XmlMsgType.EVENT)
/*router.rule().async(false).msgType(WxConsts.XmlMsgType.EVENT)
.event(WxConsts.EventType.UNSUBSCRIBE)
.handler(unsubscribeHandler)
.end();
.end();*/
return router;
}
......@@ -82,9 +82,10 @@ public class SweetWechatCallbackServiceImpl {
WxMpConfigStorage wxMpConfig = wxMpConfig(appid, secret, token, aeskey);
WxMpService wxMpService = wxMpService(wxMpConfig);
String out = null;
if (encType == null) {
if (encType == null || encType.isEmpty()) {
// 明文传输的消息
WxMpXmlMessage inMessage = WxMpXmlMessage.fromXml(requestBody);
log.info("\n消息内容为:\n[{}] ", inMessage.toString());
WxMpXmlOutMessage outMessage = messageRouter(wxMpService).route(inMessage);
if (outMessage == null) {
return "";
......
package com.liquidnet.service.sweet.utils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
......@@ -14,11 +15,12 @@ import java.util.Arrays;
* @author jiangxiulong
* @since 2021-07-29 3:19 下午
*/
@Component
public class WechatSignUtils {
// 与接口配置信息中的 Token 要一致
@Value("${liquidnet.wechat.zhengzai.service.token}")
private static String token;
private String token;
/**
* 验证签名
......@@ -28,7 +30,7 @@ public class WechatSignUtils {
* @param nonce
* @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};
// 将 token、timestamp、nonce 三个参数进行字典序排序
Arrays.sort(arr);
......@@ -59,7 +61,7 @@ public class WechatSignUtils {
* @param byteArray
* @return
*/
private static String byteToStr(byte[] byteArray) {
private String byteToStr(byte[] byteArray) {
String strDigest = "";
for (int i = 0; i < byteArray.length; i++) {
strDigest += byteToHexStr(byteArray[i]);
......@@ -73,7 +75,7 @@ public class WechatSignUtils {
* @param mByte
* @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[] tempArr = new char[2];
tempArr[0] = Digit[(mByte >>> 4) & 0X0F];
......
......@@ -6,6 +6,9 @@
<result column="manual_relation_id" property="manualRelationId"/>
<result column="artists_id" property="artistId"/>
<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="title" property="title"/>
<result column="performance_start" property="performanceStart"/>
......@@ -22,6 +25,9 @@
select manual_relation_id,
sa.`artists_id`,
sa.`name`,
sa.pinyin,
sa.describes,
sa.pic_url,
ss.stage_id,
ss.title,
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