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

Commit 2383fce7 authored by jiangxiulong's avatar jiangxiulong

Merge branch 'dev' into test

parents fd18c58e 7d93f6b4
...@@ -31,6 +31,8 @@ public class AdamRedisConst { ...@@ -31,6 +31,8 @@ public class AdamRedisConst {
public static final String INFO_MEMBER_RIGHTS = INFO.concat("member:rights:"); public static final String INFO_MEMBER_RIGHTS = INFO.concat("member:rights:");
public static final String INFO_MEMBER_AGREEMENT = INFO.concat("member:agreement"); public static final String INFO_MEMBER_AGREEMENT = INFO.concat("member:agreement");
public static final String INFO_MEMBER_CODE = INFO.concat("member:code:"); public static final String INFO_MEMBER_CODE = INFO.concat("member:code:");
public static final String INFO_MEMBER_ORDER = INFO.concat("morder:");
public static final String INFO_BUY_MEMBER_ORDER_CODE = INFO.concat("mordercode:");
public static final String INFO_LIBRARY_NKNAME = INFO.concat("library:nkname"); public static final String INFO_LIBRARY_NKNAME = INFO.concat("library:nkname");
......
...@@ -45,8 +45,6 @@ public final class RedisUtil { ...@@ -45,8 +45,6 @@ public final class RedisUtil {
public boolean expire(String key, long time) { public boolean expire(String key, long time) {
try {
if (time > 0) { if (time > 0) {
redisTemplate.expire(key, time, TimeUnit.SECONDS); redisTemplate.expire(key, time, TimeUnit.SECONDS);
...@@ -55,14 +53,6 @@ public final class RedisUtil { ...@@ -55,14 +53,6 @@ public final class RedisUtil {
return true; return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
} }
...@@ -95,18 +85,8 @@ public final class RedisUtil { ...@@ -95,18 +85,8 @@ public final class RedisUtil {
public boolean hasKey(String key) { public boolean hasKey(String key) {
try {
return redisTemplate.hasKey(key); return redisTemplate.hasKey(key);
} catch (Exception e) {
e.printStackTrace();
return false;
}
} }
/** /**
...@@ -187,19 +167,11 @@ public final class RedisUtil { ...@@ -187,19 +167,11 @@ public final class RedisUtil {
public boolean set(String key, Object value) { public boolean set(String key, Object value) {
try {
redisTemplate.opsForValue().set(key, value); redisTemplate.opsForValue().set(key, value);
return true; return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
} }
...@@ -221,7 +193,6 @@ public final class RedisUtil { ...@@ -221,7 +193,6 @@ public final class RedisUtil {
public boolean set(String key, Object value, long time) { public boolean set(String key, Object value, long time) {
try {
if (time > 0) { if (time > 0) {
...@@ -235,13 +206,6 @@ public final class RedisUtil { ...@@ -235,13 +206,6 @@ public final class RedisUtil {
return true; return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
} }
...@@ -350,19 +314,11 @@ public final class RedisUtil { ...@@ -350,19 +314,11 @@ public final class RedisUtil {
public boolean hmset(String key, Map<String, Object> map) { public boolean hmset(String key, Map<String, Object> map) {
try {
redisTemplate.opsForHash().putAll(key, map); redisTemplate.opsForHash().putAll(key, map);
return true; return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
} }
...@@ -383,7 +339,6 @@ public final class RedisUtil { ...@@ -383,7 +339,6 @@ public final class RedisUtil {
public boolean hmset(String key, Map<String, Object> map, long time) { public boolean hmset(String key, Map<String, Object> map, long time) {
try {
redisTemplate.opsForHash().putAll(key, map); redisTemplate.opsForHash().putAll(key, map);
...@@ -395,13 +350,6 @@ public final class RedisUtil { ...@@ -395,13 +350,6 @@ public final class RedisUtil {
return true; return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
} }
...@@ -422,19 +370,11 @@ public final class RedisUtil { ...@@ -422,19 +370,11 @@ public final class RedisUtil {
public boolean hset(String key, String item, Object value) { public boolean hset(String key, String item, Object value) {
try {
redisTemplate.opsForHash().put(key, item, value); redisTemplate.opsForHash().put(key, item, value);
return true; return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
} }
...@@ -457,7 +397,6 @@ public final class RedisUtil { ...@@ -457,7 +397,6 @@ public final class RedisUtil {
public boolean hset(String key, String item, Object value, long time) { public boolean hset(String key, String item, Object value, long time) {
try {
redisTemplate.opsForHash().put(key, item, value); redisTemplate.opsForHash().put(key, item, value);
...@@ -469,13 +408,6 @@ public final class RedisUtil { ...@@ -469,13 +408,6 @@ public final class RedisUtil {
return true; return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
} }
...@@ -572,17 +504,9 @@ public final class RedisUtil { ...@@ -572,17 +504,9 @@ public final class RedisUtil {
public Set<Object> sGet(String key) { public Set<Object> sGet(String key) {
try {
return redisTemplate.opsForSet().members(key); return redisTemplate.opsForSet().members(key);
} catch (Exception e) {
e.printStackTrace();
return null;
}
} }
...@@ -601,17 +525,9 @@ public final class RedisUtil { ...@@ -601,17 +525,9 @@ public final class RedisUtil {
public boolean sHasKey(String key, Object value) { public boolean sHasKey(String key, Object value) {
try {
return redisTemplate.opsForSet().isMember(key, value); return redisTemplate.opsForSet().isMember(key, value);
} catch (Exception e) {
e.printStackTrace();
return false;
}
} }
...@@ -630,17 +546,9 @@ public final class RedisUtil { ...@@ -630,17 +546,9 @@ public final class RedisUtil {
public long sSet(String key, Object... values) { public long sSet(String key, Object... values) {
try {
return redisTemplate.opsForSet().add(key, values); return redisTemplate.opsForSet().add(key, values);
} catch (Exception e) {
e.printStackTrace();
return 0;
}
} }
...@@ -661,7 +569,6 @@ public final class RedisUtil { ...@@ -661,7 +569,6 @@ public final class RedisUtil {
public long sSetAndTime(String key, long time, Object... values) { public long sSetAndTime(String key, long time, Object... values) {
try {
Long count = redisTemplate.opsForSet().add(key, values); Long count = redisTemplate.opsForSet().add(key, values);
...@@ -671,13 +578,6 @@ public final class RedisUtil { ...@@ -671,13 +578,6 @@ public final class RedisUtil {
return count; return count;
} catch (Exception e) {
e.printStackTrace();
return 0;
}
} }
...@@ -694,17 +594,9 @@ public final class RedisUtil { ...@@ -694,17 +594,9 @@ public final class RedisUtil {
public long sGetSetSize(String key) { public long sGetSetSize(String key) {
try {
return redisTemplate.opsForSet().size(key); return redisTemplate.opsForSet().size(key);
} catch (Exception e) {
e.printStackTrace();
return 0;
}
} }
...@@ -723,19 +615,11 @@ public final class RedisUtil { ...@@ -723,19 +615,11 @@ public final class RedisUtil {
public long setRemove(String key, Object... values) { public long setRemove(String key, Object... values) {
try {
Long count = redisTemplate.opsForSet().remove(key, values); Long count = redisTemplate.opsForSet().remove(key, values);
return count; return count;
} catch (Exception e) {
e.printStackTrace();
return 0;
}
} }
...@@ -758,17 +642,9 @@ public final class RedisUtil { ...@@ -758,17 +642,9 @@ public final class RedisUtil {
public List<Object> lGet(String key, long start, long end) { public List<Object> lGet(String key, long start, long end) {
try {
return redisTemplate.opsForList().range(key, start, end); return redisTemplate.opsForList().range(key, start, end);
} catch (Exception e) {
e.printStackTrace();
return null;
}
} }
...@@ -785,17 +661,9 @@ public final class RedisUtil { ...@@ -785,17 +661,9 @@ public final class RedisUtil {
public long lGetListSize(String key) { public long lGetListSize(String key) {
try {
return redisTemplate.opsForList().size(key); return redisTemplate.opsForList().size(key);
} catch (Exception e) {
e.printStackTrace();
return 0;
}
} }
...@@ -814,17 +682,9 @@ public final class RedisUtil { ...@@ -814,17 +682,9 @@ public final class RedisUtil {
public Object lGetIndex(String key, long index) { public Object lGetIndex(String key, long index) {
try {
return redisTemplate.opsForList().index(key, index); return redisTemplate.opsForList().index(key, index);
} catch (Exception e) {
e.printStackTrace();
return null;
}
} }
...@@ -837,19 +697,11 @@ public final class RedisUtil { ...@@ -837,19 +697,11 @@ public final class RedisUtil {
*/ */
public boolean lSet(String key, Object value) { public boolean lSet(String key, Object value) {
try {
redisTemplate.opsForList().rightPush(key, value); redisTemplate.opsForList().rightPush(key, value);
return true; return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
} }
...@@ -870,7 +722,6 @@ public final class RedisUtil { ...@@ -870,7 +722,6 @@ public final class RedisUtil {
public boolean lSet(String key, Object value, long time) { public boolean lSet(String key, Object value, long time) {
try {
redisTemplate.opsForList().rightPush(key, value); redisTemplate.opsForList().rightPush(key, value);
...@@ -880,13 +731,6 @@ public final class RedisUtil { ...@@ -880,13 +731,6 @@ public final class RedisUtil {
return true; return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
} }
...@@ -899,19 +743,11 @@ public final class RedisUtil { ...@@ -899,19 +743,11 @@ public final class RedisUtil {
*/ */
public boolean lSet(String key, List<Object> value) { public boolean lSet(String key, List<Object> value) {
try {
redisTemplate.opsForList().rightPushAll(key, value); redisTemplate.opsForList().rightPushAll(key, value);
return true; return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
} }
...@@ -934,7 +770,6 @@ public final class RedisUtil { ...@@ -934,7 +770,6 @@ public final class RedisUtil {
public boolean lSet(String key, List<Object> value, long time) { public boolean lSet(String key, List<Object> value, long time) {
try {
redisTemplate.opsForList().rightPushAll(key, value); redisTemplate.opsForList().rightPushAll(key, value);
...@@ -944,13 +779,6 @@ public final class RedisUtil { ...@@ -944,13 +779,6 @@ public final class RedisUtil {
return true; return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
} }
...@@ -971,19 +799,11 @@ public final class RedisUtil { ...@@ -971,19 +799,11 @@ public final class RedisUtil {
public boolean lUpdateIndex(String key, long index, Object value) { public boolean lUpdateIndex(String key, long index, Object value) {
try {
redisTemplate.opsForList().set(key, index, value); redisTemplate.opsForList().set(key, index, value);
return true; return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
} }
...@@ -1004,19 +824,11 @@ public final class RedisUtil { ...@@ -1004,19 +824,11 @@ public final class RedisUtil {
public long lRemove(String key, long count, Object value) { public long lRemove(String key, long count, Object value) {
try {
Long remove = redisTemplate.opsForList().remove(key, count, value); Long remove = redisTemplate.opsForList().remove(key, count, value);
return remove; return remove;
} catch (Exception e) {
e.printStackTrace();
return 0;
}
} }
......
...@@ -28,6 +28,12 @@ public class SmsEnum { ...@@ -28,6 +28,12 @@ public class SmsEnum {
* 短信模版 * 短信模版
*/ */
public enum ADTemplate { public enum ADTemplate {
/**
* 验证码:验证码
* - 您的验证码是:${code}。该验证码1分钟内有效,请不要把验证码泄露给其他人。
* - "{\"code\":\"?1\"}"
*/
SMS_221055862,
/** /**
* 验证码:验证码 * 验证码:验证码
* - 您的验证码是:${code}。该验证码15分钟内有效,请不要把验证码泄露给其他人。 * - 您的验证码是:${code}。该验证码15分钟内有效,请不要把验证码泄露给其他人。
......
...@@ -172,7 +172,7 @@ public class AdamLoginController { ...@@ -172,7 +172,7 @@ public class AdamLoginController {
// rabbitTemplate.convertAndSend(MQConst.EX_LNS_SMS_SENDER, MQConst.RK_SMS_CODE, smsMessage.toJson()); // rabbitTemplate.convertAndSend(MQConst.EX_LNS_SMS_SENDER, MQConst.RK_SMS_CODE, smsMessage.toJson());
ObjectNode msgNode = JsonUtils.OM().createObjectNode(); ObjectNode msgNode = JsonUtils.OM().createObjectNode();
msgNode.put("code", smsCode); msgNode.put("code", smsCode);
boolean sendRst = smsProcessor.send(mobile, SmsEnum.ADSignName.M02.getVal(), SmsEnum.ADTemplate.SMS_109535335.name(), msgNode.toString()); boolean sendRst = smsProcessor.send(mobile, SmsEnum.ADSignName.M02.getVal(), SmsEnum.ADTemplate.SMS_221055862.name(), msgNode.toString());
if (sendRst) { if (sendRst) {
adamRdmService.setSmsCodeByMobile(mobile, smsCode); adamRdmService.setSmsCodeByMobile(mobile, smsCode);
......
...@@ -14,10 +14,7 @@ import org.springframework.util.CollectionUtils; ...@@ -14,10 +14,7 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Slf4j @Slf4j
...@@ -51,7 +48,7 @@ public class AdamRdmService { ...@@ -51,7 +48,7 @@ public class AdamRdmService {
public boolean setSmsCodeByMobile(String mobile, String smsCode) { public boolean setSmsCodeByMobile(String mobile, String smsCode) {
// TODO: 2021/7/29 改为1分钟 // TODO: 2021/7/29 改为1分钟
return redisUtil.set(AdamRedisConst.VALID_SMS_CODE_MOBILE + mobile, smsCode, 1 * 60); return redisUtil.set(AdamRedisConst.VALID_SMS_CODE_MOBILE + mobile, smsCode, 60);
} }
public String getSmsCodeByMobile(String mobile) { public String getSmsCodeByMobile(String mobile) {
...@@ -240,6 +237,23 @@ public class AdamRdmService { ...@@ -240,6 +237,23 @@ public class AdamRdmService {
return vos; return vos;
} }
public boolean addEntersVoByUid(String uid, List<AdamEntersVo> vos, AdamEntersVo vo) {
if (CollectionUtils.isEmpty(vos)) {
vos = Collections.singletonList(vo);
} else {
vos.add(vo);
}
return redisUtil.set(AdamRedisConst.INFO_ENTERS + uid, vos);
}
public boolean rmvEntersVoByUid(String uid, List<AdamEntersVo> vos, String entersId) {
if (CollectionUtils.isEmpty(vos)) {
return true;
}
vos.removeIf(r -> r.getEntersId().equals(entersId));
return redisUtil.set(AdamRedisConst.INFO_ENTERS + uid, vos);
}
public AdamEntersVo getEntersVoByUidEntersId(List<AdamEntersVo> vos, String entersId) { public AdamEntersVo getEntersVoByUidEntersId(List<AdamEntersVo> vos, String entersId) {
return vos.stream().filter(r -> r.getEntersId().equals(entersId)).findAny().orElse(null); return vos.stream().filter(r -> r.getEntersId().equals(entersId)).findAny().orElse(null);
} }
...@@ -281,6 +295,23 @@ public class AdamRdmService { ...@@ -281,6 +295,23 @@ public class AdamRdmService {
return vos; return vos;
} }
public boolean addAddressesVoByUid(String uid, List<AdamAddressesVo> vos, AdamAddressesVo vo) {
if (CollectionUtils.isEmpty(vos)) {
vos = Collections.singletonList(vo);
} else {
vos.add(vo);
}
return redisUtil.set(AdamRedisConst.INFO_ADDRESSES + uid, vos);
}
public boolean rmvAddressesVoByUid(String uid, List<AdamAddressesVo> vos, String addressesId) {
if (CollectionUtils.isEmpty(vos)) {
return true;
}
vos.removeIf(r -> r.getAddressesId().equals(addressesId));
return redisUtil.set(AdamRedisConst.INFO_ADDRESSES + uid, vos);
}
public AdamAddressesVo getAddressesVoByUidAddressesId(List<AdamAddressesVo> vos, String addressesId) { public AdamAddressesVo getAddressesVoByUidAddressesId(List<AdamAddressesVo> vos, String addressesId) {
return vos.stream().filter(r -> r.getAddressesId().equals(addressesId)).findAny().orElse(null); return vos.stream().filter(r -> r.getAddressesId().equals(addressesId)).findAny().orElse(null);
} }
...@@ -455,6 +486,40 @@ public class AdamRdmService { ...@@ -455,6 +486,40 @@ public class AdamRdmService {
return val; return val;
} }
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | <UID, MEMBER_ORDER_LIST(SUCC)> */
public boolean setMemberOrderVosByUid(String uid, List<AdamMemberOrderVo> vos) {
return redisUtil.set(AdamRedisConst.INFO_MEMBER_ORDER + uid, vos);
}
public ArrayList<AdamMemberOrderVo> getMemberOrderVosByUid(String uid) {
long s = System.currentTimeMillis();
ArrayList<AdamMemberOrderVo> vos = (ArrayList<AdamMemberOrderVo>) redisUtil.get(AdamRedisConst.INFO_MEMBER_ORDER + uid);
log.debug("#RDM耗时:{}ms", System.currentTimeMillis() - s);
return vos;
}
public boolean addMemberOrderVoByUid(String uid, List<AdamMemberOrderVo> vos, AdamMemberOrderVo vo) {
if (CollectionUtils.isEmpty(vos)) {
vos = Collections.singletonList(vo);
} else {
vos.add(vo);
}
return redisUtil.set(AdamRedisConst.INFO_MEMBER_ORDER + uid, vos);
}
public boolean rmvMemberOrderVoByUid(String uid, List<AdamMemberOrderVo> vos, String orderNo) {
if (CollectionUtils.isEmpty(vos)) {
return true;
}
vos.removeIf(r -> r.getOrderNo().equals(orderNo));
return redisUtil.set(AdamRedisConst.INFO_MEMBER_ORDER + uid, vos);
}
public void delMemberOrderVoByUid(String uid) {
redisUtil.del(AdamRedisConst.INFO_MEMBER_ORDER + uid);
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | <ORDER_NO, MEMBER_ORDER_INFO> */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | <ORDER_NO, MEMBER_ORDER_INFO> */
public boolean setShotMemberOrderVoByOrderNo(String orderNo, AdamMemberOrderVo vo) { public boolean setShotMemberOrderVoByOrderNo(String orderNo, AdamMemberOrderVo vo) {
...@@ -528,11 +593,15 @@ public class AdamRdmService { ...@@ -528,11 +593,15 @@ public class AdamRdmService {
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | <AdamMemberCodeVo::buyOrderNo, MEMBER_CODE> */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | <AdamMemberCodeVo::buyOrderNo, MEMBER_CODE> */
public boolean setMemberCodeByBuyOrderNo(String buyOrderNo, String memberCode) { public boolean setMemberCodeByBuyOrderNo(String buyOrderNo, String memberCode) {
return redisUtil.set(buyOrderNo, memberCode); return redisUtil.set(AdamRedisConst.INFO_BUY_MEMBER_ORDER_CODE + buyOrderNo, memberCode);
} }
public String getMemberCodeByBuyOrderNo(String buyOrderNo) { public String getMemberCodeByBuyOrderNo(String buyOrderNo) {
return (String) redisUtil.get(buyOrderNo); return (String) redisUtil.get(AdamRedisConst.INFO_BUY_MEMBER_ORDER_CODE + buyOrderNo);
}
public void delMemberCodeByBuyOrderNo(String buyOrderNo) {
redisUtil.del(AdamRedisConst.INFO_BUY_MEMBER_ORDER_CODE + buyOrderNo);
} }
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | */
......
...@@ -63,8 +63,7 @@ public class AdamAddressesServiceImpl implements IAdamAddressesService { ...@@ -63,8 +63,7 @@ public class AdamAddressesServiceImpl implements IAdamAddressesService {
long s = System.currentTimeMillis(); long s = System.currentTimeMillis();
// adamRdmService.delAddressesVoByUid(currentUid); // adamRdmService.delAddressesVoByUid(currentUid);
vos.add(vo); adamRdmService.addAddressesVoByUid(currentUid, vos, vo);
adamRdmService.setAddressesVoByUid(currentUid, vos);
log.debug("#RDS耗时:{}ms", System.currentTimeMillis() - s); log.debug("#RDS耗时:{}ms", System.currentTimeMillis() - s);
s = System.currentTimeMillis(); s = System.currentTimeMillis();
...@@ -201,13 +200,14 @@ public class AdamAddressesServiceImpl implements IAdamAddressesService { ...@@ -201,13 +200,14 @@ public class AdamAddressesServiceImpl implements IAdamAddressesService {
// Query.query(Criteria.where("uid").is(currentUid).and("addressesId").is(addressesId)), AdamAddressesVo.class.getSimpleName() // Query.query(Criteria.where("uid").is(currentUid).and("addressesId").is(addressesId)), AdamAddressesVo.class.getSimpleName()
// ); // );
// log.debug("#MDB耗时:{}ms", System.currentTimeMillis() - s); // log.debug("#MDB耗时:{}ms", System.currentTimeMillis() - s);
List<AdamAddressesVo> vos = adamRdmService.getAddressesVoByUid(uid); // List<AdamAddressesVo> vos = adamRdmService.getAddressesVoByUid(uid);
vos.removeIf(r -> r.getAddressesId().equals(addressesId)); // vos.removeIf(r -> r.getAddressesId().equals(addressesId));
long s = System.currentTimeMillis(); // s = System.currentTimeMillis();
adamRdmService.setAddressesVoByUid(uid, vos); // adamRdmService.setAddressesVoByUid(uid, vos);
log.debug("#RDS耗时:{}ms", System.currentTimeMillis() - s); // log.debug("#RDS耗时:{}ms", System.currentTimeMillis() - s);
adamRdmService.rmvAddressesVoByUid(uid, adamRdmService.getAddressesVoByUid(uid), addressesId);
s = System.currentTimeMillis(); long s = System.currentTimeMillis();
queueUtils.sendMsgByRedis( queueUtils.sendMsgByRedis(
MQConst.AdamQueue.SQL_UCENTER.getKey(), MQConst.AdamQueue.SQL_UCENTER.getKey(),
SqlMapping.get("adam_addresses.remove", now, now, addressesId) SqlMapping.get("adam_addresses.remove", now, now, addressesId)
......
...@@ -78,8 +78,7 @@ public class AdamEntersServiceImpl implements IAdamEntersService { ...@@ -78,8 +78,7 @@ public class AdamEntersServiceImpl implements IAdamEntersService {
long s = System.currentTimeMillis(); long s = System.currentTimeMillis();
// adamRdmService.delEntersVoByUid(currentUid); // adamRdmService.delEntersVoByUid(currentUid);
vos.add(vo); adamRdmService.addEntersVoByUid(currentUid, vos, vo);
adamRdmService.setEntersVoByUid(currentUid, vos);
log.debug("#RDS耗时:{}ms", System.currentTimeMillis() - s); log.debug("#RDS耗时:{}ms", System.currentTimeMillis() - s);
s = System.currentTimeMillis(); s = System.currentTimeMillis();
...@@ -220,13 +219,14 @@ public class AdamEntersServiceImpl implements IAdamEntersService { ...@@ -220,13 +219,14 @@ public class AdamEntersServiceImpl implements IAdamEntersService {
// Query.query(Criteria.where("uid").is(currentUid).and("entersId").is(entersId)), AdamEntersVo.class.getSimpleName() // Query.query(Criteria.where("uid").is(currentUid).and("entersId").is(entersId)), AdamEntersVo.class.getSimpleName()
// ); // );
// log.debug("#MDB耗时:{}ms", System.currentTimeMillis() - s); // log.debug("#MDB耗时:{}ms", System.currentTimeMillis() - s);
List<AdamEntersVo> vos = adamRdmService.getEntersVoByUid(uid); // List<AdamEntersVo> vos = adamRdmService.getEntersVoByUid(uid);
vos.removeIf(r -> r.getEntersId().equals(entersId)); // vos.removeIf(r -> r.getEntersId().equals(entersId));
long s = System.currentTimeMillis(); // s = System.currentTimeMillis();
adamRdmService.setEntersVoByUid(uid, vos); // adamRdmService.setEntersVoByUid(uid, vos);
log.debug("#RDS耗时:{}ms", System.currentTimeMillis() - s); // log.debug("#RDS耗时:{}ms", System.currentTimeMillis() - s);
adamRdmService.rmvEntersVoByUid(uid, adamRdmService.getEntersVoByUid(uid), entersId);
s = System.currentTimeMillis(); long s = System.currentTimeMillis();
queueUtils.sendMsgByRedis( queueUtils.sendMsgByRedis(
MQConst.AdamQueue.SQL_UCENTER.getKey(), MQConst.AdamQueue.SQL_UCENTER.getKey(),
SqlMapping.get("adam_enters.remove", now, now, entersId) SqlMapping.get("adam_enters.remove", now, now, entersId)
......
...@@ -18,6 +18,7 @@ import org.springframework.stereotype.Component; ...@@ -18,6 +18,7 @@ import org.springframework.stereotype.Component;
import org.springframework.util.MultiValueMap; import org.springframework.util.MultiValueMap;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -90,7 +91,7 @@ public class DragonPayBiz { ...@@ -90,7 +91,7 @@ public class DragonPayBiz {
params.add("price", payNotifyDto.getPrice().toString()); params.add("price", payNotifyDto.getPrice().toString());
params.add("paymentType", payNotifyDto.getPaymentType()); params.add("paymentType", payNotifyDto.getPaymentType());
params.add("paymentAt", payNotifyDto.getPaymentAt()); params.add("paymentAt", payNotifyDto.getPaymentAt());
jsonData = JsonUtils.toJson(params); jsonData = JsonUtils.toJson(covertNVPS2Params(params));
log.info("dragon:notify:post url:{}",payNotifyReqBo.getNotifyUrl()); log.info("dragon:notify:post url:{}",payNotifyReqBo.getNotifyUrl());
log.info("dragon:notify:post data:{}",jsonData); log.info("dragon:notify:post data:{}",jsonData);
...@@ -205,4 +206,12 @@ public class DragonPayBiz { ...@@ -205,4 +206,12 @@ public class DragonPayBiz {
} }
return rsMap; return rsMap;
} }
private static Map<String, Object> covertNVPS2Params(MultiValueMap<String, String> params) {
Map<String, Object> rsMap = new HashMap<>();
for (Map.Entry<String, List<String>> param : params.entrySet()) {
rsMap.put(param.getKey(), param.getValue().get(0));
}
return rsMap;
}
} }
//package com.liquidnet.service; package com.liquidnet.service;
//
//import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
//import com.liquidnet.commons.lang.util.JsonUtils; import com.liquidnet.commons.lang.util.JsonUtils;
//import com.liquidnet.service.dragon.utils.ObjectUtil; import com.liquidnet.service.dragon.utils.ObjectUtil;
//import org.apache.http.NameValuePair; import org.apache.http.NameValuePair;
//import org.apache.http.message.BasicNameValuePair; import org.apache.http.message.BasicNameValuePair;
//import org.springframework.util.MultiValueMap; import org.springframework.util.MultiValueMap;
//
//import java.util.ArrayList; import java.util.ArrayList;
//import java.util.HashMap; import java.util.HashMap;
//import java.util.List; import java.util.List;
//import java.util.Map; import java.util.Map;
//
///** /**
// * @author AnJiabin <anjiabin@zhengzai.tv> * @author AnJiabin <anjiabin@zhengzai.tv>
// * @version V1.0 * @version V1.0
// * @Description: TODO * @Description: TODO
// * @class: DragonPayTest * @class: DragonPayTest
// * @Package com.liquidnet.service * @Package com.liquidnet.service
// * @Copyright: LightNet @ Copyright (c) 2021 * @Copyright: LightNet @ Copyright (c) 2021
// * @date 2021/7/27 13:47 * @date 2021/7/27 13:47
// */ */
////@RunWith(SpringJUnit4ClassRunner.class) //@RunWith(SpringJUnit4ClassRunner.class)
////@SpringBootTest //@SpringBootTest
//public class DragonPayTest { public class DragonPayTest {
//
// public static void testMap(){ public static void testMap(){
// List<NameValuePair> nvps = new ArrayList<NameValuePair>(); List<NameValuePair> nvps = new ArrayList<NameValuePair>();
// nvps.add(new BasicNameValuePair("status", "1")); nvps.add(new BasicNameValuePair("status", "1"));
// nvps.add(new BasicNameValuePair("type", "TICKET")); nvps.add(new BasicNameValuePair("type", "TICKET"));
// nvps.add(new BasicNameValuePair("code", "PAY20210727111746415639688")); nvps.add(new BasicNameValuePair("code", "PAY20210727111746415639688"));
// nvps.add(new BasicNameValuePair("paymentId", "4200001121202107274119605305")); nvps.add(new BasicNameValuePair("paymentId", "4200001121202107274119605305"));
// nvps.add(new BasicNameValuePair("orderCode", "11766977997930496418880635")); nvps.add(new BasicNameValuePair("orderCode", "11766977997930496418880635"));
// nvps.add(new BasicNameValuePair("price", "0.01")); nvps.add(new BasicNameValuePair("price", "0.01"));
// nvps.add(new BasicNameValuePair("paymentType", "APPWEPAY")); nvps.add(new BasicNameValuePair("paymentType", "APPWEPAY"));
// nvps.add(new BasicNameValuePair("paymentAt", "2021-07-27 11:18:03")); nvps.add(new BasicNameValuePair("paymentAt", "2021-07-27 11:18:03"));
// String jsonData = JSON.toJSONString(nvps); String jsonData = JSON.toJSONString(nvps);
// System.out.println("jsonDate === "+jsonData); System.out.println("jsonDate === "+jsonData);
// System.out.println("covertNVPS2Params jsonDate === "+covertNVPS2Params(nvps)); System.out.println("covertNVPS2Params jsonDate === "+covertNVPS2Params(nvps));
// System.out.println("covertNVPS2Params jsonDate === "+ JsonUtils.toJson(covertNVPS2Params(nvps))); System.out.println("covertNVPS2Params jsonDate === "+ JsonUtils.toJson(covertNVPS2Params(nvps)));
// System.out.println("covertNVPS2KeyValue jsonDate === "+ covertNVPS2KeyValue(nvps)); System.out.println("covertNVPS2KeyValue jsonDate === "+ covertNVPS2KeyValue(nvps));
// } }
//
// public static void testMap2() { public static void testMap2() {
// MultiValueMap<String, String> params = ObjectUtil.cloneLinkedMultiValueMapStringAndString(); MultiValueMap<String, String> params = ObjectUtil.cloneLinkedMultiValueMapStringAndString();
// params.add("status", "1"); params.add("status", "1");
// params.add("type", "TICKET"); params.add("type", "TICKET");
// params.add("code","PAY20210727111746415639688"); params.add("code","PAY20210727111746415639688");
// params.add("paymentId", "4200001121202107274119605305"); params.add("paymentId", "4200001121202107274119605305");
// params.add("orderCode", "11766977997930496418880635"); params.add("orderCode", "11766977997930496418880635");
// params.add("price", "0.01"); params.add("price", "0.01");
// params.add("paymentType", "APPWEPAY"); params.add("paymentType", "APPWEPAY");
// params.add("paymentAt", "2021-07-27 11:18:03"); params.add("paymentAt", "2021-07-27 11:18:03");
// String jsonData = JsonUtils.toJson(params); String jsonData = JsonUtils.toJson(params);
// System.out.println("jsonData === "+jsonData); System.out.println("jsonData === "+jsonData);
// System.out.println("jsonData === " + covertNVPS2KeyValue(params)); System.out.println("jsonData === " + JsonUtils.toJson(covertNVPS2Params(params)));
// } }
// private static ArrayList<NameValuePair> covertParams2NVPS(Map<String, Object> params) { private static ArrayList<NameValuePair> covertParams2NVPS(Map<String, Object> params) {
// ArrayList<NameValuePair> pairs = new ArrayList<NameValuePair>(); ArrayList<NameValuePair> pairs = new ArrayList<NameValuePair>();
// for (Map.Entry<String, Object> param : params.entrySet()) { for (Map.Entry<String, Object> param : params.entrySet()) {
// pairs.add(new BasicNameValuePair(param.getKey(), String.valueOf(param.getValue()))); pairs.add(new BasicNameValuePair(param.getKey(), String.valueOf(param.getValue())));
// } }
//
// return pairs; return pairs;
// } }
// private static ArrayList<NameValuePair> covertParams2NVPS(MultiValueMap<String, String> params) { private static ArrayList<NameValuePair> covertParams2NVPS(MultiValueMap<String, String> params) {
// ArrayList<NameValuePair> pairs = new ArrayList<NameValuePair>(); ArrayList<NameValuePair> pairs = new ArrayList<NameValuePair>();
// for (Map.Entry<String, List<String>>param : params.entrySet()) { for (Map.Entry<String, List<String>> param : params.entrySet()) {
// pairs.add(new BasicNameValuePair(param.getKey(), param.getValue())); pairs.add(new BasicNameValuePair(param.getKey(), param.getValue().get(0)));
// } }
//
// return pairs; return pairs;
// } }
// private static Map<String, Object> covertNVPS2Params(List<NameValuePair> nvpList) { private static Map<String, Object> covertNVPS2Params(List<NameValuePair> nvpList) {
// Map<String, Object> rsMap = new HashMap<>(); Map<String, Object> rsMap = new HashMap<>();
// for (NameValuePair nameValuePair : nvpList) { for (NameValuePair nameValuePair : nvpList) {
// rsMap.put(nameValuePair.getName(),nameValuePair.getValue()); rsMap.put(nameValuePair.getName(),nameValuePair.getValue());
// } }
// return rsMap; return rsMap;
// } }
//
// private static String covertNVPS2KeyValue(List<NameValuePair> nvpList) { private static String covertNVPS2KeyValue(List<NameValuePair> nvpList) {
// StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
// for (NameValuePair nameValuePair : nvpList) { for (NameValuePair nameValuePair : nvpList) {
// sb.append(nameValuePair.getName()+":"+nameValuePair.getValue()+"\n"); sb.append(nameValuePair.getName()+":"+nameValuePair.getValue()+"\n");
// } }
// return sb.toString(); return sb.toString();
// } }
//
// private static String covertNVPS2KeyValue(Map<String, String> mapParam) { private static String covertNVPS2KeyValue(MultiValueMap<String, String> mapParam) {
// ArrayList<NameValuePair> pairs = covertParams2NVPS(mapParam); ArrayList<NameValuePair> pairs = covertParams2NVPS(mapParam);
// return covertNVPS2KeyValue(pairs); return covertNVPS2KeyValue(pairs);
// } }
//
// public static void main(String[] args) { private static Map<String, Object> covertNVPS2Params(MultiValueMap<String, String> params) {
// Map<String, Object> rsMap = new HashMap<>();
for (Map.Entry<String, List<String>> param : params.entrySet()) {
rsMap.put(param.getKey(), param.getValue().get(0));
}
return rsMap;
}
public static void main(String[] args) {
// testMap(); // testMap();
// testMap2(); testMap2();
// } }
//} }
...@@ -52,7 +52,8 @@ public class BannersServiceImpl implements IKylinBannersService { ...@@ -52,7 +52,8 @@ public class BannersServiceImpl implements IKylinBannersService {
// 时间 // 时间
String StartTime = bannerInfo.getOnlineStartTime(); String StartTime = bannerInfo.getOnlineStartTime();
String endTime = bannerInfo.getOnlineEndTime(); String endTime = bannerInfo.getOnlineEndTime();
if (!StartTime.isEmpty() && !endTime.isEmpty()) {
if (null != StartTime && null != endTime && !StartTime.isEmpty() && !endTime.isEmpty()) {
if (DateUtil.compareStrDay(nowTime, StartTime) < 0) { // 当前时间小雨开始时间 还未开始呢 if (DateUtil.compareStrDay(nowTime, StartTime) < 0) { // 当前时间小雨开始时间 还未开始呢
itBannerList.remove(); itBannerList.remove();
} }
......
...@@ -18,6 +18,7 @@ import org.springframework.stereotype.Component; ...@@ -18,6 +18,7 @@ import org.springframework.stereotype.Component;
import org.springframework.util.MultiValueMap; import org.springframework.util.MultiValueMap;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -90,7 +91,7 @@ public class DragonPayBiz { ...@@ -90,7 +91,7 @@ public class DragonPayBiz {
params.add("price", payNotifyDto.getPrice().toString()); params.add("price", payNotifyDto.getPrice().toString());
params.add("paymentType", payNotifyDto.getPaymentType()); params.add("paymentType", payNotifyDto.getPaymentType());
params.add("paymentAt", payNotifyDto.getPaymentAt()); params.add("paymentAt", payNotifyDto.getPaymentAt());
jsonData = JsonUtils.toJson(params); jsonData = JsonUtils.toJson(covertNVPS2Params(params));
log.info("dragon:notify:post url:{}",payNotifyReqBo.getNotifyUrl()); log.info("dragon:notify:post url:{}",payNotifyReqBo.getNotifyUrl());
log.info("dragon:notify:post data:{}",jsonData); log.info("dragon:notify:post data:{}",jsonData);
...@@ -205,4 +206,12 @@ public class DragonPayBiz { ...@@ -205,4 +206,12 @@ public class DragonPayBiz {
} }
return rsMap; return rsMap;
} }
private static Map<String, Object> covertNVPS2Params(MultiValueMap<String, String> params) {
Map<String, Object> rsMap = new HashMap<>();
for (Map.Entry<String, List<String>> param : params.entrySet()) {
rsMap.put(param.getKey(), param.getValue().get(0));
}
return rsMap;
}
} }
...@@ -58,7 +58,7 @@ public class SweetManualShopController { ...@@ -58,7 +58,7 @@ public class SweetManualShopController {
@ApiImplicitParam(type = "query", dataType = "String", name = "manualId", value = "手册iid", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "manualId", value = "手册iid", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "title", value = "标题", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "title", value = "标题", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "picUrl", value = "图片地址", required = false), @ApiImplicitParam(type = "query", dataType = "String", name = "picUrl", value = "图片地址", required = false),
@ApiImplicitParam(type = "query", dataType = "String", name = "describe", value = "描述", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "describes", value = "描述", required = true),
@ApiImplicitParam(type = "query", dataType = "Integer", name = "type", value = "类型 1吃喝 2玩乐", required = true), @ApiImplicitParam(type = "query", dataType = "Integer", name = "type", value = "类型 1吃喝 2玩乐", required = true),
@ApiImplicitParam(type = "query", dataType = "Integer", name = "isRecommend", value = "是否推荐", required = true), @ApiImplicitParam(type = "query", dataType = "Integer", name = "isRecommend", value = "是否推荐", required = true),
@ApiImplicitParam(type = "query", dataType = "Integer", name = "sort", value = "排序", required = true), @ApiImplicitParam(type = "query", dataType = "Integer", name = "sort", value = "排序", required = true),
...@@ -66,11 +66,11 @@ public class SweetManualShopController { ...@@ -66,11 +66,11 @@ public class SweetManualShopController {
public ResponseDto<Boolean> add(@RequestParam String manualId, public ResponseDto<Boolean> add(@RequestParam String manualId,
@RequestParam String title, @RequestParam String title,
@RequestParam String picUrl, @RequestParam String picUrl,
@RequestParam String describe, @RequestParam String describes,
@RequestParam Integer type, @RequestParam Integer type,
@RequestParam Integer isRecommend, @RequestParam Integer isRecommend,
@RequestParam Integer sort) { @RequestParam Integer sort) {
return sweetManualShopService.add(manualId, title, picUrl, describe, type, isRecommend, sort); return sweetManualShopService.add(manualId, title, picUrl, describes, type, isRecommend, sort);
} }
@PostMapping("change") @PostMapping("change")
...@@ -79,7 +79,7 @@ public class SweetManualShopController { ...@@ -79,7 +79,7 @@ public class SweetManualShopController {
@ApiImplicitParam(type = "query", dataType = "String", name = "manualShopId", value = "商铺id", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "manualShopId", value = "商铺id", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "title", value = "标题", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "title", value = "标题", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "picUrl", value = "图片地址", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "picUrl", value = "图片地址", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "describe", value = "描述", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "describes", value = "描述", required = true),
@ApiImplicitParam(type = "query", dataType = "Integer", name = "type", value = "类型 1吃喝 2玩乐", required = true), @ApiImplicitParam(type = "query", dataType = "Integer", name = "type", value = "类型 1吃喝 2玩乐", required = true),
@ApiImplicitParam(type = "query", dataType = "Integer", name = "isRecommend", value = "是否推荐", required = true), @ApiImplicitParam(type = "query", dataType = "Integer", name = "isRecommend", value = "是否推荐", required = true),
@ApiImplicitParam(type = "query", dataType = "Integer", name = "sort", value = "排序", required = true), @ApiImplicitParam(type = "query", dataType = "Integer", name = "sort", value = "排序", required = true),
...@@ -87,11 +87,11 @@ public class SweetManualShopController { ...@@ -87,11 +87,11 @@ public class SweetManualShopController {
public ResponseDto<Boolean> change(@RequestParam String manualShopId, public ResponseDto<Boolean> change(@RequestParam String manualShopId,
@RequestParam String title, @RequestParam String title,
@RequestParam String picUrl, @RequestParam String picUrl,
@RequestParam String describe, @RequestParam String describes,
@RequestParam Integer type, @RequestParam Integer type,
@RequestParam Integer isRecommend, @RequestParam Integer isRecommend,
@RequestParam Integer sort) { @RequestParam Integer sort) {
return sweetManualShopService.change(manualShopId, title, picUrl, describe, type, isRecommend, sort); return sweetManualShopService.change(manualShopId, title, picUrl, describes, type, isRecommend, sort);
} }
......
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