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

Commit b5e85a19 authored by 张国柄's avatar 张国柄

Merge remote-tracking branch 'origin/dev_member_voucher_refund' into dev_member_voucher_refund

parents 3d7248f6 e65cd97a
......@@ -19,6 +19,10 @@ public class AdamRedisConst {
public static final String INFO_ADDRESSES = PREFIX.concat("info:addresses:");
public static final String INFO_CERTIFICATION = PREFIX.concat("info:certification:");
/**
* 认证失败标记
*/
public static final String INFO_CERTIFICATION_JUNK = PREFIX.concat("info:certification_junk:");
public static final String INFO_MEMBER_SIMPLE = PREFIX.concat("info:member:simple");
public static final String INFO_MEMBER_CATEGORY = PREFIX.concat("info:member:category:");
......@@ -38,7 +42,7 @@ public class AdamRedisConst {
public static final String INFO_MEMBER_ORDER = PREFIX.concat("info:morder:");
public static final String INFO_MEMBER_ORDER_BUY_CODE = PREFIX.concat("info:mordercode:");
// public static final String INFO_LIBRARY_NKNAME = INFO.concat("library:nkname");
// public static final String INFO_LIBRARY_NKNAME = PREFIX.concat("info:library:nkname");
public static final String BLK_LIST_MEMBER_UID = PREFIX.concat("blacklist:member:uid");
......
......@@ -14,6 +14,10 @@ public class OrderDetailsVo implements Cloneable {
private Integer expressStatus;
private Long restTime;
private Integer isCanRefund;
private Integer isShowQrCode;
private String showQrCodeTime;
private List<KylinOrderRefundsOrderCodeVo> orderRefundsVoList;
private List<KylinOrderCoupons> orderCouponsList;
......
......@@ -9,9 +9,9 @@
<div class="col-sm-12">
<div class="tabs-container">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#tab-2" aria-expanded="false">演出详情</a>
<li id="li-tab-2" class="active"><a data-toggle="tab" href="#tab-2" aria-expanded="false">演出详情</a>
</li>
<li class=""><a data-toggle="tab" href="#tab-1" aria-expanded="true" id="tab-nav-1"> 演出数据</a>
<li id="li-tab-1"><a data-toggle="tab" href="#tab-1" aria-expanded="true" id="tab-nav-1"> 演出数据</a>
</li>
<!-- <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">校园分销</a>-->
<!-- </li>-->
......@@ -19,13 +19,15 @@
<!-- </li>-->
<!-- <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">状态管理</a>-->
<!-- </li>-->
<li class=""><a data-toggle="tab" href="#tab-6" aria-expanded="false" onclick="refundConfigInfo()">退款管理</a>
<li id="li-tab-6"><a data-toggle="tab" href="#tab-6" aria-expanded="false" onclick="refundConfigInfo()">退款管理</a>
</li>
<li class=""><a data-toggle="tab" href="#tab-3" aria-expanded="false" onclick="memberInfo()">会员信息配置</a>
<li id="li-tab-3"><a data-toggle="tab" href="#tab-3" aria-expanded="false" onclick="memberInfo()">会员信息配置</a>
</li>
<li class=""><a data-toggle="tab" href="#tab-4" aria-expanded="false" onclick="agentInfo()">代理配置</a>
<li id="li-tab-4"><a data-toggle="tab" href="#tab-4" aria-expanded="false" onclick="agentInfo()">代理配置</a>
</li>
<li class=""><a data-toggle="tab" href="#tab-5" aria-expanded="false" onclick="damaiInfo()">大麦配置</a>
<li id="li-tab-5"><a data-toggle="tab" href="#tab-5" aria-expanded="false" onclick="damaiInfo()">大麦配置</a>
</li>
<li id="li-tab-7"><a data-toggle="tab" href="#tab-7" aria-expanded="false" onclick="transferInfo()">转赠配置</a>
</li>
</ul>
<div class="tab-content">
......@@ -241,6 +243,12 @@
height=800px frameborder=0></iframe>
</div>
</div>
<div id="tab-7" class="tab-pane">
<div class="panel-body">
<iframe id="transfer_iframe" name="transfer_iframe" marginwidth=0 marginheight=0 width=100%
height=800px frameborder=0></iframe>
</div>
</div>
</div>
......@@ -254,6 +262,42 @@
const isShow = '[[${kylinPerformanceMisVo.isShow}]]';
const auditStatus = '[[${kylinPerformanceMisVo.auditStatus}]]';
var agentFlag = [[${@permission.hasPermi('kylin:performances:agent')}]];
if(agentFlag=="hidden"){
document.getElementById("li-tab-4").style.display = "none";
}
var otherFlag = [[${@permission.hasPermi('kylin:performances:audit')}]];
if(otherFlag=="hidden"){
document.getElementById("li-tab-2").style.display = "none";
document.getElementById("tab-2").style.display = "none";
}
var refundFlag = [[${@permission.hasPermi('kylin:performances:refund')}]];
if(refundFlag=="hidden"){
document.getElementById("li-tab-6").style.display = "none";
}
var memberFlag = [[${@permission.hasPermi('kylin:performances:member')}]];
if(memberFlag=="hidden"){
document.getElementById("li-tab-3").style.display = "none";
}
var damaiFlag = [[${@permission.hasPermi('kylin:performances:damai')}]];
if(damaiFlag=="hidden"){
document.getElementById("li-tab-5").style.display = "none";
}
var dataFlag = [[${@permission.hasPermi('kylin:performances:data')}]];
if(dataFlag=="hidden"){
document.getElementById("li-tab-1").style.display = "none";
}
var transferFlag = [[${@permission.hasPermi('kylin:performances:transfer')}]];
if(transferFlag=="hidden"){
document.getElementById("li-tab-7").style.display = "none";
}
if (auditStatus != 0) {
document.getElementsByName("auditBtn")[0].style.display = "none";
}
......@@ -322,6 +366,11 @@
document.getElementById("refundConfig_iframe").src = "../refundConfig/" + '[[${kylinPerformanceMisVo.performancesId}]]'.replaceAll("\"", "");
}
//转正配置
function transferInfo(){
// document.getElementById("transfer_iframe").src = "../refundConfig/" + '[[${kylinPerformanceMisVo.performancesId}]]'.replaceAll("\"", "");
}
$("#tab-nav-1").bind("click", function () {
$("#tab_iframe_1").attr("src", prefix + "/performanceStatic/" + '[[${kylinPerformanceMisVo.performancesId}]]'.replaceAll("\"", ""));
});
......
......@@ -54,7 +54,7 @@
align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + updateFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.performancesId + '\')"><i class="fa fa-edit"></i>审核</a> ');
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.performancesId + '\')"><i class="fa fa-edit"></i>审核</a> ');
return actions.join('');
}
}]
......
......@@ -269,6 +269,7 @@ public class PerformanceVoUtils {
performanceRelations.setPerformanceRelationsId(IDGenerator.nextSnowId().toString());
performanceRelations.setCreatedAt(null);
performanceRelations.setUpdatedAt(updatedAt);
performanceRelations.setMerchantId(null);
performancesMapper.update(performances, new UpdateWrapper<KylinPerformances>().eq("performances_id", performances.getPerformancesId()));
performanceStatusMapper.update(performanceStatus, new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", performances.getPerformancesId()));
......
......@@ -17,7 +17,7 @@ public class LnsRegex {
/**
* 汉字-姓名(2~20位)
*/
public static final String CN_HANZI = "^[\\u4e00-\\u9fa5]{2,20}$";
public static final String CN_HANZI = "^[\\u4e00-\\u9fa5+\\·?\\u4e00-\\u9fa5+]{2,30}$";
/**
* 汉字-省|市|区(2~30位)
*/
......
......@@ -149,7 +149,7 @@ public final class RedisUtil {
}
//删除Redis
for (Integer redisDb: hashMap.keySet()) {
for (Integer redisDb : hashMap.keySet()) {
ArrayList<String> delRedisKeyList = hashMap.get(redisDb);
redisConfig.getRedisTemplateByDb(redisDb).delete(delRedisKeyList);
}
......@@ -746,4 +746,22 @@ public final class RedisUtil {
public Object getDB15RedisGet(String redisKey) {
return redisConfig.getRedisTemplateByDb(15).opsForValue().get(redisKey);
}
public boolean getDB15RedisHasKey(String redisKey, String item) {
return redisConfig.getRedisTemplateByDb(15).opsForSet().isMember(redisKey, item);
}
public static void main(String[] args) {
String[] keys = {
"adam:identity:mobile:18518013286"
};
for (String key : keys) {
long value = key.hashCode();
int idx = ((int) (value ^ (value >>> 32)) % 250);
System.out.printf("\n[%s] - idx:%s", key, idx);
}
}
}
......@@ -77,6 +77,7 @@ public class MQConst {
ANSWERINSERT_DRAW("sweet:stream:rk.answerInsert", "group.answerInsert", "答案"),
SWEET_USER_INSERT_DRAW("sweet:stream:rk.sweetUserInsert", "group.sweetUserInsert", "关注服务号的用户信息"),
SWEET_REMIND_INSERT_DRAW("sweet:stream:rk.remindInsert", "group.remindInsert", "提醒记录"),
SWEET_APPLET_USER_INSERT_DRAW("sweet:stream:rk.sweetAppletUserInsert", "group.sweetAppletUserInsert", "小程序登录记录用户解密后信息"),
;
private final String key;
......
......@@ -55,6 +55,16 @@ public class SmsEnum {
* - 您已成功购买${name}门票。可至个人中心查看订单,个人中心地址:http://t.cn/ExMlr1B。演出${time}开始。请持购票人身份证到现场取票。咨询电话:4001680650。
*/
SMS_181500419,
/**
* 微信关注正在现场服务号通知
* - 模版内容:您已成功购买$(name)门票。可至个人中心查看订单http://tcn/ExMir1B。演出$(time)开始。微信关注正在现场服务号,联系我们。
*/
SMS_223192705,
/**
* 微信关注正在现场服务号通知
* - 模版内容:您已成功购买$(name)门票。可至个人中心查看订单http://tcn/ExMir1B。演出$(time)开始。微信关注摩登天空服务号,联系我们。
*/
SMS_223203737,
;
}
}
......@@ -22,7 +22,7 @@
mobile
FROM kylin_check_user
<where>
merchant_id=#{merchantId} AND `status` = 1
`status` = 1
<if test="mobile !=null and mobile !='' ">
AND `mobile` LIKE concat('%', #{mobile}, '%')
</if>
......
......@@ -500,6 +500,7 @@
group by kotr.performance_id,kot.user_id
) t
) AS ut ON ut.performance_id = kp.performances_id
order by kt.type desc,kt.use_start asc
</select>
<select id="getPerformanceSponsorList" resultMap="performanceSponsorDaoResult">
select distinct kp.sponsor_id, kp.sponsor, kp.sponsor_type
......
......@@ -136,6 +136,9 @@ public class AdamEntersController {
if (!Pattern.matches(LnsRegex.Valid.CN_HANZI, parameter.getName())) {
return ResponseDto.failure(ErrorMapping.get("10103"));
}
if (!Pattern.matches(LnsRegex.Valid.CN_ID_CARD_REF, parameter.getIdCard())) {
return ResponseDto.failure(ErrorMapping.get("10104"));
}
}
if (StringUtils.isBlank(parameter.getEntersId())) {
return ResponseDto.failure(ErrorMapping.get("10015"));
......
......@@ -231,9 +231,6 @@ public class AdamUserController {
return ResponseDto.failure(ErrorMapping.get("10104"));
}
AdamRealInfoVo vo = adamUserService.identity(CurrentUtil.getCurrentUid(), name, idCard);
if (null == vo) {
return ResponseDto.failure(ErrorMapping.get("10000"));
}
vo.setName(SensitizeUtil.chineseName(vo.getName()));
vo.setIdCard(SensitizeUtil.custom(vo.getIdCard(), 3, 2));
return ResponseDto.success(vo);
......
package com.liquidnet.service.adam.service;
import com.fasterxml.jackson.databind.JsonNode;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.common.exception.LiquidnetServiceException;
import com.liquidnet.commons.lang.util.IdentityUtils;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.commons.lang.util.SensitizeUtil;
import com.liquidnet.service.adam.constant.AdamRedisConst;
import com.liquidnet.service.adam.dto.vo.*;
import com.liquidnet.service.adam.util.ObjectUtil;
import com.liquidnet.service.base.ErrorMapping;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -155,15 +160,81 @@ public class AdamRdmService {
return vo;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | <ID_TYPE+ID_NO, ID_NAME> */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 认证失败的<ID_TYPE+ID_NO, ID_NAME> */
public boolean setCertificationJunk(int idType, String idNo, String idName) {
return redisUtil.set(AdamRedisConst.INFO_CERTIFICATION_JUNK + idType + idNo, idName, 604800);
}
public boolean isCertificationJunk(int idType, String idNo, String idName) {
String o = (String) redisUtil.get(AdamRedisConst.INFO_CERTIFICATION_JUNK + idType + idNo);
return !StringUtils.isEmpty(o) && o.equals(idName);
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 认证成功的<ID_TYPE+ID_NO, ID_NAME> */
/**
* 目前只针对身份证类型三方服务认证成功的标记
*
* @param idType
* @param idNo
* @param idName
* @return
*/
public boolean setCertification(int idType, String idNo, String idName) {
return redisUtil.set(AdamRedisConst.INFO_CERTIFICATION + idType + idNo, idName);
}
public boolean isCertification(int idType, String idNo, String idName) {
/**
* 目前只针对身份证类型三方服务认证成功的标记
*
* @param idType
* @param idNo
* @param idName
* @return
*/
public int isCertification(int idType, String idNo, String idName) {
String o = (String) redisUtil.get(AdamRedisConst.INFO_CERTIFICATION + idType + idNo);
return !StringUtils.isEmpty(o) && o.equals(idName);
if (StringUtils.isEmpty(o)) {
return -1;
}
return o.equals(idName) ? 1 : 0;
// return !StringUtils.isEmpty(o) && o.equals(idName);
}
/**
* 身份证实名处理
*
* @param uid
* @param name
* @param idCard
*/
public void identityHandler1(String uid, String name, String idCard) {
int rst = this.isCertification(1, idCard, name);
switch (rst) {
case -1:// 本地不存在
if (this.isCertificationJunk(1, idCard, name)) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("10102");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
}
String respStr = IdentityUtils.aliThird(name, idCard);
JsonNode respJNode = JsonUtils.fromJson(respStr, JsonNode.class);
if (null == respJNode || !"0".equals(respJNode.get("error_code").asText())) {
log.info("###实名认证失败[{}]", respStr);
this.setCertificationJunk(1, idCard, name);
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("10102");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
}
this.setCertification(1, idCard, name);
break;
case 0:// 本地存在,验证不通过
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("10102");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
case 1:// 本地存在,验证通过
break;
}
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | <UID, List<AdamThirdPartInfoVo>> */
......
......@@ -49,11 +49,12 @@ public class AdamEntersServiceImpl implements IAdamEntersService {
if (1 == parameter.getType()) {
if (!adamRdmService.isCertification(1, parameter.getIdCard(), parameter.getName())) {
identityHandler(currentUid, parameter.getName(), parameter.getIdCard());
adamRdmService.setCertification(1, parameter.getIdCard(), parameter.getName());
}
// if (!adamRdmService.isCertification(1, parameter.getIdCard(), parameter.getName())) {
// identityHandler(currentUid, parameter.getName(), parameter.getIdCard());
//
// adamRdmService.setCertification(1, parameter.getIdCard(), parameter.getName());
// }
adamRdmService.identityHandler1(currentUid, parameter.getName(), parameter.getIdCard());
}
......@@ -134,9 +135,12 @@ public class AdamEntersServiceImpl implements IAdamEntersService {
LocalDateTime now = LocalDateTime.now();
if (1 == parameter.getType()) {
if (!adamRdmService.isCertification(1, parameter.getIdCard(), parameter.getName())) {
identityHandler(currentUid, parameter.getName(), parameter.getIdCard());
}
// if (!adamRdmService.isCertification(1, parameter.getIdCard(), parameter.getName())) {
// identityHandler(currentUid, parameter.getName(), parameter.getIdCard());
//
// adamRdmService.setCertification(1, parameter.getIdCard(), parameter.getName());
// }
adamRdmService.identityHandler1(currentUid, parameter.getName(), parameter.getIdCard());
}
List<AdamEntersVo> vos = adamRdmService.getEntersVoByUid(currentUid);
......@@ -214,14 +218,4 @@ public class AdamEntersServiceImpl implements IAdamEntersService {
log.debug("#collect.process耗时:{}ms", System.currentTimeMillis() - s);
return vos;
}
private void identityHandler(String currentUid, String name, String idCard) {
String respStr = IdentityUtils.aliThird(name, idCard);
JsonNode respJNode = JsonUtils.fromJson(respStr, JsonNode.class);
if (null == respJNode || !"0".equals(respJNode.get("error_code").asText())) {
log.info("###实名认证失败[{}]", respStr);
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("10102");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
}
}
}
......@@ -321,17 +321,24 @@ public class AdamUserServiceImpl implements IAdamUserService {
@Override
// @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public AdamRealInfoVo identity(String uid, String name, String idCard) {
AdamRealInfoVo vo = null;
if (!adamRdmService.isCertification(1, idCard, name)) {
String respStr = IdentityUtils.aliThird(name, idCard);
JsonNode respJNode = JsonUtils.fromJson(respStr, JsonNode.class);
if (null == respJNode || !"0".equals(respJNode.get("error_code").asText())) {
log.info("###实名认证失败[{}]", respStr);
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("10102");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
}
adamRdmService.setCertification(1, idCard, name);
}
// if (!adamRdmService.isCertification(1, idCard, name)) {
// if (adamRdmService.isCertificationJunk(1, idCard, name)) {
// ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("10102");
// throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
// }
//
// String respStr = IdentityUtils.aliThird(name, idCard);
// JsonNode respJNode = JsonUtils.fromJson(respStr, JsonNode.class);
// if (null == respJNode || !"0".equals(respJNode.get("error_code").asText())) {
// log.info("###实名认证失败[{}]", respStr);
// adamRdmService.setCertificationJunk(1, idCard, name);
// ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("10102");
// throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
// }
// adamRdmService.setCertification(1, idCard, name);
// }
adamRdmService.identityHandler1(uid, name, idCard);
AdamRealName realName = new AdamRealName();
realName.setRealNameId(IDGenerator.nextSnowId() + "");
......@@ -343,12 +350,7 @@ public class AdamUserServiceImpl implements IAdamUserService {
realName.setCreatedAt(LocalDateTime.now());
adamRealNameService.add(realName);
vo = AdamRealInfoVo.getNew();
vo.setUid(uid);
vo.setName(name);
vo.setIdCard(idCard);
vo.setType(realName.getType());
vo.setState(1);
AdamRealInfoVo vo = AdamRealInfoVo.getNew().copy(realName);
long s = System.currentTimeMillis();
adamRdmService.setRealInfoVoByUid(uid, vo);
......
......@@ -27,7 +27,7 @@
10101=姓名或身份证件号无效
10102=身份证号与姓名不符
10103=已超出姓名长度限制
10103=身份证姓名不合规
10104=身份证号码不合规
10105=入场人不存在
10106=收获地址不存在
......
......@@ -32,7 +32,7 @@ public class RedisRefundReceiver implements StreamListener<String, MapRecord<Str
log.info("body " + message.getValue());
boolean result = this.consumerSqlDaoHandler(message.getValue().get("message"));
// if(result){
log.error("consumer success delete message messageId:{} ",message.getId());
log.info("consumer success delete message messageId:{} ",message.getId());
try {
// stringRedisTemplate.multi();
stringRedisTemplate.opsForStream().acknowledge(DragonConstant.MysqlRedisQueueEnum.DRAGON_REFUND_GROUP.getCode(), message);
......
......@@ -39,6 +39,9 @@ public class KylinUtils {
KylinOrderTicketVo data = dataSingle;
BeanUtils.copyProperties(data, voItem);
List<KylinOrderListVo> redisData = (List<KylinOrderListVo>) redisUtil.get(KylinRedisConst.ORDER_LIST + userId);
if(redisData==null){
return false;
}
if (type == 1) {
redisVo.add(voItem);
if (redisData.size() > 0) {
......
package com.liquidnet.service.consumer.sweet.config;
import com.liquidnet.service.consumer.sweet.receiver.ConsumerSweetAppletUserRdsReceiver;
import lombok.var;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.stream.Consumer;
import org.springframework.data.redis.connection.stream.MapRecord;
import org.springframework.data.redis.connection.stream.ReadOffset;
import org.springframework.data.redis.connection.stream.StreamOffset;
import org.springframework.data.redis.stream.StreamMessageListenerContainer;
import org.springframework.data.redis.stream.Subscription;
import java.time.Duration;
import static com.liquidnet.service.base.constant.MQConst.SweetQueue.SWEET_APPLET_USER_INSERT_DRAW;
@Configuration
public class ConsumerSweetAppletUserRedisStreamConfig {
@Autowired
ConsumerSweetAppletUserRdsReceiver consumerSweetAppletUserRdsReceiver;
private StreamMessageListenerContainer<String, MapRecord<String, String, String>> buildStreamMessageListenerContainer(RedisConnectionFactory factory) {
var options = StreamMessageListenerContainer
.StreamMessageListenerContainerOptions
.builder()
.pollTimeout(Duration.ofMillis(1))
.build();
return StreamMessageListenerContainer.create(factory, options);
}
/**
* 小程序登录记录用户解密后信息
*/
private Subscription receiveSqlSweetAppletUser(StreamMessageListenerContainer<String, MapRecord<String, String, String>> listenerContainer, int t) {
return listenerContainer.receiveAutoAck(
Consumer.from(SWEET_APPLET_USER_INSERT_DRAW.getGroup(), SWEET_APPLET_USER_INSERT_DRAW.name() + t),
StreamOffset.create(SWEET_APPLET_USER_INSERT_DRAW.getKey(), ReadOffset.lastConsumed()), consumerSweetAppletUserRdsReceiver
);
}
/* —————————————————————————— | —————————————————————————— | —————————————————————————— */
@Bean
public Subscription subscriptionSqlSweetAppletUser(RedisConnectionFactory factory) {
var listenerContainer = this.buildStreamMessageListenerContainer(factory);
var subscription = receiveSqlSweetAppletUser(listenerContainer, 1);
listenerContainer.start();
return subscription;
}
@Bean
public Subscription subscriptionSqlSweetAppletUser2(RedisConnectionFactory factory) {
var listenerContainer = this.buildStreamMessageListenerContainer(factory);
var subscription = receiveSqlSweetAppletUser(listenerContainer, 1);
listenerContainer.start();
return subscription;
}
@Bean
public Subscription subscriptionSqlSweetAppletUser3(RedisConnectionFactory factory) {
var listenerContainer = this.buildStreamMessageListenerContainer(factory);
var subscription = receiveSqlSweetAppletUser(listenerContainer, 1);
listenerContainer.start();
return subscription;
}
/* -------------------------------------------------------- | */
}
......@@ -17,7 +17,7 @@ import java.util.HashMap;
@Slf4j
public abstract class AbstractSqlRedisReceiver implements StreamListener<String, MapRecord<String, String, String>> {
@Autowired
private IBaseDao baseDao;
public IBaseDao baseDao;
@Autowired
StringRedisTemplate stringRedisTemplate;
@Autowired
......
package com.liquidnet.service.consumer.sweet.receiver;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.connection.stream.MapRecord;
import org.springframework.data.redis.connection.stream.StreamRecords;
import org.springframework.stereotype.Component;
import java.util.HashMap;
@Slf4j
@Component
public class ConsumerSweetAppletUserRdsReceiver extends AbstractSqlRedisReceiver {
@Override
protected String getRedisStreamKey() {
return MQConst.SweetQueue.SWEET_APPLET_USER_INSERT_DRAW.getKey();
}
@Override
protected String getRedisStreamGroup() {
return MQConst.SweetQueue.SWEET_APPLET_USER_INSERT_DRAW.getGroup();
}
@Override
public void onMessage(MapRecord<String, String, String> message) {
log.debug("CONSUMER SQL[streamKey:{},messageId:{},stream:{},body:{}]",
this.getRedisStreamKey(), message.getId(), message.getStream(), message.getValue());
boolean result = this.consumerSqlDaoHandler(message.getValue().get("message"));
log.info("CONSUMER SQL RESULT:{} ==> MESSAGE_ID:{}", result, message.getId());
try {
stringRedisTemplate.opsForStream().acknowledge(getRedisStreamGroup(), message);
stringRedisTemplate.opsForStream().delete(this.getRedisStreamKey(), message.getId());
} catch (Exception e) {
log.error("#CONSUMER SQL RESULT:{} ==> DEL_REDIS_QUEUE_MSG_EXCEPTION[MESSAGE_ID:{},MSG:{}]", result, message.getId(), JsonUtils.toJson(message), e);
} finally {
try {
stringRedisTemplate.opsForStream().acknowledge(getRedisStreamGroup(), message);
stringRedisTemplate.opsForStream().delete(this.getRedisStreamKey(), message.getId());
} catch (Exception ignored) {
}
}
}
private boolean consumerSqlDaoHandler(String msg) {
Boolean aBoolean = false;
try {
SqlMapping.SqlMessage sqlMessage = JsonUtils.fromJson(msg, SqlMapping.SqlMessage.class);
if (sqlMessage == null) {
aBoolean = true;
} else {
aBoolean = baseDao.batchSqls(sqlMessage.getSqls(), sqlMessage.getArgs());
}
} catch (Exception e) {
log.error("CONSUMER SQL FAIL ==> {}", e.getMessage(), e);
} finally {
if (!aBoolean) {
HashMap<String, String> map = CollectionUtil.mapStringString();
map.put("message", msg);
// stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(this.getRedisStreamKey()));
}
}
return aBoolean;
}
}
......@@ -40,6 +40,7 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
......@@ -161,11 +162,17 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
LocalDateTime date = DateUtil.Formatter.yyyyMMddHHmmss.parse(ticketVo.getQrCodeShowTime());
if (LocalDateTime.now().isAfter(date)) {
orderTicketVo.setQrCode(orderTicketVo.getQrCode());
vo.setIsShowQrCode(ticketVo.getIsShowCode());
vo.setShowQrCodeTime(ticketVo.getQrCodeShowTime() == null ? "" : ticketVo.getQrCodeShowTime());
} else {
orderTicketVo.setQrCode("");
vo.setIsShowQrCode(ticketVo.getIsShowCode());
vo.setShowQrCodeTime(ticketVo.getQrCodeShowTime() == null ? "" : ticketVo.getQrCodeShowTime());
}
} else {
orderTicketVo.setQrCode("");
vo.setIsShowQrCode(0);
vo.setShowQrCodeTime("");
}
currentTime = System.currentTimeMillis() - currentTime;
......@@ -405,6 +412,58 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
if (refundSinglePrice.compareTo(BigDecimal.ZERO) <= 0) {
return "申请金额不得小于0";
}
// 临时手续费
if (orderTicketVo.getPerformanceId().equals("245383231370444809122956")) {
// 手续费比例
float chargesNum = 0.0f;
// 票种演出开始时间
String useStart = orderTicketVo.getUseStart();
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime useStartD = LocalDateTime.parse(useStart, df);
// 3、15天之前的时间
LocalDateTime useStartD15Before = useStartD.minusDays(15);
LocalDateTime useStartD3Before = useStartD.minusDays(3);
// 当前时间
LocalDateTime nowTime = LocalDateTime.now();
if (useStartD15Before.isAfter(nowTime)) { // 15天以前的时间大于当前时间 距离演出开始日期>15天
chargesNum = 0.1f;
log.info("距离演出开始日期>15天");
log.info("票种演出开始时间 {}", useStartD);
log.info("15天之前的时间 {}", useStartD15Before);
log.info("3天之前的时间 {}", useStartD3Before);
log.info("当前时间 {}", nowTime);
log.info("手续费比例 {}", chargesNum);
} else if (useStartD3Before.isAfter(nowTime)) { // 3天以前的时间大于当前时间 距离演出开始日期>3天-15天 含15天
chargesNum = 0.5f;
log.info("距离演出开始日期3-15天");
log.info("票种演出开始时间 {}", useStartD);
log.info("15天之前的时间 {}", useStartD15Before);
log.info("3天之前的时间 {}", useStartD3Before);
log.info("当前时间 {}", nowTime);
log.info("手续费比例 {}", chargesNum);
} else { // 三天以内 <=3
log.info("距离演出开始日期<=3");
log.info("票种演出开始时间 {}", useStartD);
log.info("15天之前的时间 {}", useStartD15Before);
log.info("3天之前的时间 {}", useStartD3Before);
log.info("当前时间 {}", nowTime);
log.info("手续费比例 {}", chargesNum);
return "当前日期不支持退票";
}
BigDecimal multiply = refundSinglePrice.multiply(BigDecimal.valueOf(chargesNum));
log.info("multiply {}", multiply);
refundSinglePrice = refundSinglePrice.subtract(multiply);
log.info("去除手续费申请金额 {}", refundSinglePrice);
if (refundSinglePrice.compareTo(BigDecimal.ZERO) <= 0) {
return "申请金额不得小于0";
// return "去除手续费申请金额不得小于0";
}
} else{
log.info("演出id1111 {}", orderTicketVo.getPerformanceId());
}
// 临时手续费 end
Map token = CurrentUtil.getTokenClaims();
String username = StringUtils.defaultString(((String) token.get("nickname")), "");
String result = refundsStatusService.userOrderTicketRefunding(orderTicketVo, refundSinglePrice.doubleValue(), orderTicketEntitiesId, reason, picList, uid, username, kylinOrderRefundsVoBaseList.size());
......
......@@ -193,7 +193,9 @@ public class KylinPerformancesServiceImpl implements IKylinPerformancesService {
List<KylinTicketTimesVo> ticketTimesList = vo.getTicketTimeList();
if (null != ticketTimesList) {
for (KylinTicketTimesVo partner : ticketTimesList) {
for (int i = 0; i < ticketTimesList.size(); i++) {
KylinTicketTimesVo partner = ticketTimesList.get(i);
List<KylinTicketVo> ticketList = partner.getTicketList();
List<KylinTicketVo> ticketListNew = ObjectUtil.getKylinTicketVoArrayList();
for (KylinTicketVo ticket : ticketList) {
......@@ -207,16 +209,17 @@ public class KylinPerformancesServiceImpl implements IKylinPerformancesService {
Integer isMemberStatus = getIsMemberStatus(ticket);
ticket.setIsMemberStatus(isMemberStatus);
if (null == isAgent || 0 == isAgent) {
if (0 == ticket.getIsAgent()) {
ticketListNew.add(ticket);
}
} else if (1 == isAgent) {
ticketListNew.add(ticket);
} else if (1 >= isAgent) {
if (1 == ticket.getIsAgent()) {
ticketListNew.add(ticket);
}
}
}
partner.setTicketList(ticketListNew);
if (ticketListNew.size() == 0) {
ticketTimesList.remove(i);
}
}
}
......
......@@ -289,6 +289,9 @@ public class DataUtils {
if (obj == null) {
// 固定条件
Query query = getCommonWhere();
// 排序
Sort sortName = Sort.by(Sort.Direction.ASC, "sellTime");
query.with(sortName);
// 今天的
HashMap toDayTime = DateUtil.oneDayStartEnd();
......@@ -303,6 +306,9 @@ public class DataUtils {
// 固定条件
Query queryT = getCommonWhere();
// 排序
Sort sortNameT = Sort.by(Sort.Direction.ASC, "sellTime");
queryT.with(sortNameT);
// 三天的
Calendar cal = Calendar.getInstance();
......
......@@ -871,9 +871,9 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
SmsEnum.ADTemplate adTemplate = null;
if (orderTicketData.getGetTicketType().equals("express")) {
adTemplate = SmsEnum.ADTemplate.SMS_181490473;
adTemplate = SmsEnum.ADTemplate.SMS_223203737;
} else if (orderTicketData.getGetTicketType().equals("electronic")) {
adTemplate = ticketData.getIsShowCode() == 1 ? SmsEnum.ADTemplate.SMS_171358560 : SmsEnum.ADTemplate.SMS_181500419;
adTemplate = ticketData.getIsShowCode() == 1 ? SmsEnum.ADTemplate.SMS_223203737 : SmsEnum.ADTemplate.SMS_223203737;
}
if (null != adTemplate) {
......@@ -921,12 +921,22 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
}
public boolean checkAgent(String agentId, KylinTicketVo ticketData) {
boolean isAgent = ticketData.getIsAgent() == 1;
if (isAgent) {
return redisUtil.sHasKey(KylinRedisConst.AGENT, agentId);
} else {
if(agentId.equals(0)){
return true;
}else{
boolean isAgent = ticketData.getIsAgent() == 1;
if (isAgent) {
return true;
} else {
return !redisUtil.getDB15RedisHasKey(KylinRedisConst.AGENT, agentId);
}
}
// boolean isAgent = ticketData.getIsAgent() == 1;
// if (isAgent) {
// return redisUtil.getDB15RedisHasKey(KylinRedisConst.AGENT, agentId);
// } else {
// return true;
// }
}
private boolean sycDamaiOrder(String orderId, int isMember) {
......
......@@ -57,9 +57,9 @@ public class KylinCheckUserPerformancesPartnerController {
public ResponseDto<PageInfo<ChildPerformanceDao>> childPerformanceList(@RequestParam("merchantId") @NotNull(message = "商户ID不能为空") String merchantId,
@RequestParam("checkUserId") @NotNull(message = "验票用户ID不能为空") String checkUserId,
@RequestParam("page") @NotNull(message = "页数不能为空") @Min(1) int page,
@RequestParam("size") @NotNull(message = "数量不能为空") @Min(1)int size,
@RequestParam("size") @NotNull(message = "数量不能为空") @Min(1) int size,
@RequestParam("name") String name) {
return userPerformancesPartnerService.childPerformanceList(merchantId, checkUserId, page, size,name);
return userPerformancesPartnerService.childPerformanceList(merchantId, checkUserId, page, size, name);
}
@GetMapping(value = "unRelation")
......@@ -70,6 +70,6 @@ public class KylinCheckUserPerformancesPartnerController {
@RequestParam("page") @NotNull(message = "页数不能为空") @Min(1) int page,
@RequestParam("size") @NotNull(message = "数量不能为空") @Min(1) int size,
@RequestParam("name") String name) {
return userPerformancesPartnerService.unChildPerformanceList(merchantId, checkUserId, page, size,name);
return userPerformancesPartnerService.unChildPerformanceList(merchantId, checkUserId, page, size, name);
}
}
......@@ -57,6 +57,9 @@ public class KylinCheckUserPartnerServiceImpl extends ServiceImpl<KylinCheckUser
try {
PageHelper.startPage(page, size);
List<ChildListDao> data = checkUserMapper.childSimpleList(merchantId, mobile);
for (ChildListDao item : data) {
item.setMobile(item.getMobile().substring(0, 3) + "****" + item.getMobile().substring(7));
}
pageInfo = new PageInfo(data);
return pageInfo;
} catch (Exception e) {
......@@ -86,8 +89,8 @@ public class KylinCheckUserPartnerServiceImpl extends ServiceImpl<KylinCheckUser
public ResponseDto<String> create(String merchantId, String name, String pwd, String mobile) {
try {
int count = checkUserMapper.selectCount(Wrappers.lambdaQuery(KylinCheckUser.class).eq(KylinCheckUser::getMobile,mobile).eq(KylinCheckUser::getStatus,1));
if(count>0){
int count = checkUserMapper.selectCount(Wrappers.lambdaQuery(KylinCheckUser.class).eq(KylinCheckUser::getMobile, mobile).eq(KylinCheckUser::getStatus, 1));
if (count > 0) {
return ResponseDto.failure("手机号已存在");
}
......@@ -114,8 +117,8 @@ public class KylinCheckUserPartnerServiceImpl extends ServiceImpl<KylinCheckUser
@Override
public ResponseDto<String> change(String merchantId, String checkUserId, String name, String pwd, String mobile) {
try {
KylinCheckUser kylinCheckUser = checkUserMapper.selectOne(Wrappers.lambdaQuery(KylinCheckUser.class).eq(KylinCheckUser::getMobile,mobile).eq(KylinCheckUser::getStatus,1));
if(kylinCheckUser!=null && !kylinCheckUser.getCheckUserId().equals(checkUserId)){
KylinCheckUser kylinCheckUser = checkUserMapper.selectOne(Wrappers.lambdaQuery(KylinCheckUser.class).eq(KylinCheckUser::getMobile, mobile).eq(KylinCheckUser::getStatus, 1));
if (kylinCheckUser != null && !kylinCheckUser.getCheckUserId().equals(checkUserId)) {
return ResponseDto.failure("手机号已存在");
}
......
......@@ -112,10 +112,10 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
PerformancePartnerVo createParam = mongoTemplate.findOne(Query.query(Criteria.where("performancesId").is(step1Param.getPerformancesId())), PerformancePartnerVo.class, PerformancePartnerVo.class.getSimpleName());
if (createParam == null) {
result = createStep1(step1Param);
log.info(UserPathDto.setPartnerData(step1Param.getMerchantId(),"createStep1", step1Param,result));
log.info(UserPathDto.setPartnerData(step1Param.getMerchantId(), "createStep1", step1Param, result));
} else {// 修改
result = updateStep1(step1Param);
log.info(UserPathDto.setPartnerData(step1Param.getMerchantId(),"updateStep1", step1Param,result));
log.info(UserPathDto.setPartnerData(step1Param.getMerchantId(), "updateStep1", step1Param, result));
}
}
return result;
......@@ -219,7 +219,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
if (null != performanceStatus) {
data.setStatus(performanceStatus.getStatus());
}
log.info(UserPathDto.setPartnerData("0","getStep1", "performancesId="+performancesId,data));
log.info(UserPathDto.setPartnerData("0", "getStep1", "performancesId=" + performancesId, data));
return ResponseDto.success(data);
}
......@@ -232,10 +232,10 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
KylinPerformanceStatus performanceStatus = performanceStatusMapper.selectOne(Wrappers.lambdaQuery(KylinPerformanceStatus.class).eq(KylinPerformanceStatus::getPerformanceId, step2Param.getPerformancesId()));
if (performanceStatus == null || performanceStatus.getStatus() == 0 || performanceStatus.getStatus() == 4) {
result = createStep2(step2Param);
log.info(UserPathDto.setPartnerData("0","createStep2", step2Param,result));
log.info(UserPathDto.setPartnerData("0", "createStep2", step2Param, result));
} else if (performanceStatus.getStatus() == 1 || performanceStatus.getStatus() == 3 || performanceStatus.getStatus() == 6 || performanceStatus.getStatus() == 7 || performanceStatus.getStatus() == 8 || performanceStatus.getStatus() == 9) {// 修改
result = updateStep2(step2Param);
log.info(UserPathDto.setPartnerData("0","updateStep2(step2Param", step2Param,result));
log.info(UserPathDto.setPartnerData("0", "updateStep2(step2Param", step2Param, result));
} else if (performanceStatus.getStatus() == 10) {
result = ResponseDto.failure("演出已结束不可修改");
}
......@@ -384,7 +384,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
performanceStatus.setLimitCount(step2Param.getLimitCount());
performanceStatusMapper.update(performanceStatus, Wrappers.lambdaQuery(KylinPerformanceStatus.class).eq(KylinPerformanceStatus::getPerformanceId, performanceId));
dataUtils.setPerformanceIsTrueName(performanceId,step2Param.getIsTrueName());
dataUtils.setPerformanceIsTrueName(performanceId, step2Param.getIsTrueName());
//提示:票种价格、售票时间、票种购票限制 直接生效 (演出购票限制,购票须知 演出是否实名 票种缺货登记 票种是否电子票 票种是否快递票 票种最低购买张数 票种是否显示二维码)
List<TicketTimesTicketCreatePartnerVo> timeList = kylinPerformanceMisVo.getTicketTimes();
......@@ -477,7 +477,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
}
performanceStep2Param.setTicketTimes(ticketTimesTicketCreatePartnerVoList);
log.info(UserPathDto.setPartnerData("0","getStep2", "performancesId="+performancesId,performanceStep2Param));
log.info(UserPathDto.setPartnerData("0", "getStep2", "performancesId=" + performancesId, performanceStep2Param));
return ResponseDto.success(performanceStep2Param);
}
......@@ -524,7 +524,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
}
// 判断状态
performanceVoTask.performanceVoStatus(performancesId);
log.info(UserPathDto.setPartnerData("0","onLinePerformance", "performancesId="+performancesId,"上线成功"));
log.info(UserPathDto.setPartnerData("0", "onLinePerformance", "performancesId=" + performancesId, "上线成功"));
return ResponseDto.success("上线成功");
} catch (Exception e) {
log.debug("上线失败", e);
......@@ -546,7 +546,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
, Wrappers.lambdaQuery(KylinPerformanceStatus.class).eq(KylinPerformanceStatus::getPerformanceId, performancesId));
performanceVoTask.performanceVoStatus(performancesId);
log.info(UserPathDto.setPartnerData("0","outLinePerformance", "performancesId="+performancesId,"下线成功"));
log.info(UserPathDto.setPartnerData("0", "outLinePerformance", "performancesId=" + performancesId, "下线成功"));
return ResponseDto.success("下线成功");
} else {
return ResponseDto.failure(ErrorMapping.get(20111));
......@@ -585,7 +585,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
mongoTemplate.insert(ticketItem, KylinTicketPartnerVo.class.getSimpleName());
}
}
log.info(UserPathDto.setPartnerData("0","copyPerformance", "performancesId="+performancesId,performancePartnerVo.getPerformancesId()));
log.info(UserPathDto.setPartnerData("0", "copyPerformance", "performancesId=" + performancesId, performancePartnerVo.getPerformancesId()));
return performancePartnerVo.getPerformancesId();
} catch (Exception e) {
e.printStackTrace();
......@@ -673,7 +673,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
Query.query(Criteria.where("performancesId").is(performancesId)).getQueryObject(),
object
);
log.info(UserPathDto.setPartnerData("0","withdraw", "performancesId="+performancesId,"撤回成功"));
log.info(UserPathDto.setPartnerData("0", "withdraw", "performancesId=" + performancesId, "撤回成功"));
return ResponseDto.success("撤回成功");
} else {
return ResponseDto.failure(ErrorMapping.get(20116));
......
......@@ -440,6 +440,28 @@ CREATE TABLE `sweet_wechat_user`
COLLATE utf8mb4_unicode_ci
ROW_FORMAT = DYNAMIC COMMENT '正在现场服务号关注事件储存用户信息表';
-- 小程序登录记录用户解密后信息表
drop TABLE if exists `sweet_applet_user`;
CREATE TABLE `sweet_applet_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',
`getPhoneNumber` varchar(200) NOT NULL DEFAULT '' COMMENT '手机号',
`getPurePhoneNumber` varchar(200) NOT NULL DEFAULT '' COMMENT '手机号',
`getCountryCode` varchar(200) NOT NULL DEFAULT '' COMMENT '地区码',
`type` tinyint NOT NULL DEFAULT 0 COMMENT '1草莓 2五百里 3mdsk 4正在',
`created_at` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_at` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`mid`),
KEY `sweet_applet_user_user_id` (`user_id`),
UNIQUE KEY (openId, unionId, getPurePhoneNumber)
) ENGINE = InnoDB
DEFAULT CHARSET utf8mb4
COLLATE utf8mb4_unicode_ci
ROW_FORMAT = DYNAMIC COMMENT '小程序登录记录用户解密后信息表';
-- 答题表
drop TABLE if exists `sweet_answer`;
CREATE TABLE `sweet_answer`
......
......@@ -19,4 +19,8 @@ XGROUP CREATE sweet:stream:rk.sweetUserInsert group.sweetUserInsert 0
-- 提醒记录 --
XADD sweet:stream:rk.remindInsert * 0 0
XGROUP CREATE sweet:stream:rk.remindInsert group.remindInsert 0
\ No newline at end of file
XGROUP CREATE sweet:stream:rk.remindInsert group.remindInsert 0
-- 小程序登录记录用户解密后信息 --
XADD sweet:stream:rk.sweetAppletUserInsert * 0 0
XGROUP CREATE sweet:stream:rk.sweetAppletUserInsert group.sweetAppletUserInsert 0
\ No newline at end of file
......@@ -4,8 +4,12 @@ import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.HttpUtil;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.sweet.utils.QueueUtils;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.bean.oauth2.WxOAuth2AccessToken;
import org.apache.commons.lang3.StringUtils;
......@@ -16,7 +20,9 @@ import org.springframework.stereotype.Service;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Objects;
/**
......@@ -34,6 +40,9 @@ public class SweetWechatLoginServiceImpl {
@Autowired
private SweetWechatService sweetWechatService;
@Autowired
QueueUtils queueUtils;
@Value("${liquidnet.service.adam.url}")
private String adamUrl;
......@@ -56,8 +65,6 @@ public class SweetWechatLoginServiceImpl {
return ResponseDto.failure("解密手机号码信息错误");
}
registerByMobile(wxMaPhoneNumberInfo.getPurePhoneNumber());
String unionId = sessionInfo.getUnionid();
String openId = sessionInfo.getOpenid();
......@@ -68,6 +75,18 @@ public class SweetWechatLoginServiceImpl {
userInfo.put("getPurePhoneNumber", wxMaPhoneNumberInfo.getPurePhoneNumber());
userInfo.put("getCountryCode", wxMaPhoneNumberInfo.getCountryCode());
registerByMobile(wxMaPhoneNumberInfo.getPurePhoneNumber());
LinkedList<String> sqls = CollectionUtil.linkedListString();
LinkedList<Object[]> sqlsDataA = CollectionUtil.linkedListObjectArr();
sqls.add(SqlMapping.get("sweet_applet_user.insert"));
sqlsDataA.add(new Object[]{
IDGenerator.nextSnowId(), openId, unionId, wxMaPhoneNumberInfo.getPhoneNumber(), wxMaPhoneNumberInfo.getPurePhoneNumber()
, wxMaPhoneNumberInfo.getCountryCode(), type
});
queueUtils.sendMsgByRedis(MQConst.SweetQueue.SWEET_APPLET_USER_INSERT_DRAW.getKey(),
SqlMapping.gets(sqls, sqlsDataA));
return ResponseDto.success(userInfo);
} catch (Exception e) {
log.error("WechatUserInfoError", e);
......
......@@ -66,4 +66,6 @@ sweet_answer.insert=INSERT INTO sweet_answer (answer_id,phone,answer_json,img_ur
sweet_user.insert=INSERT INTO sweet_wechat_user (user_id,openId,unionId,nickname,sexDesc,sex,headImgUrl,language,country,province,city,subscribeTime,subscribeScene) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)
sweet_user.update=UPDATE sweet_wechat_user SET is_cancel = ?, updated_at = ? WHERE unionId = ?
# --------------------------提醒记录--------------------------
sweet_remind.insert=INSERT INTO sweet_remind (remind_id,openId,unionId,performancesId) VALUES (?,?,?,?)
\ No newline at end of file
sweet_remind.insert=INSERT INTO sweet_remind (remind_id,openId,unionId,performancesId) VALUES (?,?,?,?)
# --------------------------小程序登录记录用户解密后信息--------------------------
sweet_applet_user.insert=INSERT INTO sweet_applet_user (user_id,openId,unionId,getPhoneNumber,getPurePhoneNumber,getCountryCode,type) VALUES (?,?,?,?,?,?,?)
\ No newline at end of file
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