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

Commit 2c6bc603 authored by jiangxiulong's avatar jiangxiulong

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

parents 7f60e133 ab9c4433
package com.liquidnet.service.base.codec.aspect;
import com.alibaba.fastjson.JSON;
import com.liquidnet.common.exception.constant.ErrorCode;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.codec.annotation.DecryptAndVerify;
import com.liquidnet.service.base.codec.exception.DecryptAndVerifyException;
......@@ -31,7 +32,7 @@ public class DecryptAndVerifyAspect {
public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
Object[] args = joinPoint.getArgs();
if (args == null || args.length == 0) {
throw new DecryptAndVerifyException(joinPoint.getSignature().getName() + ",参数为空");
throw new DecryptAndVerifyException(ErrorCode.HTTP_PARAM_ERROR.getCode(),joinPoint.getSignature().getName() + ",参数为空");
}
EncryptedReq encryptedReq = null;
for (Object obj : args) {
......@@ -41,7 +42,7 @@ public class DecryptAndVerifyAspect {
}
}
if (encryptedReq == null) {
throw new DecryptAndVerifyException(joinPoint.getSignature().getName() + ",参数中无待解密类");
throw new DecryptAndVerifyException(ErrorCode.HTTP_PARAM_ERROR.getCode(),joinPoint.getSignature().getName() + ",参数中无待解密类");
}
log.info("DecryptAndVerifyAspect 解密前 下单request:{}", JsonUtils.toJson(encryptedReq));
String decryptedData = decryptAndVerify(encryptedReq);
......@@ -49,7 +50,7 @@ public class DecryptAndVerifyAspect {
MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
DecryptAndVerify annotation = methodSignature.getMethod().getAnnotation(DecryptAndVerify.class);
if (annotation == null || annotation.decryptedClass() == null) {
throw new DecryptAndVerifyException(joinPoint.getSignature().getName() + ",未指定解密类型");
throw new DecryptAndVerifyException(ErrorCode.HTTP_PARAM_ERROR.getCode(),joinPoint.getSignature().getName() + ",未指定解密类型");
}
encryptedReq.setData(JSON.parseObject(decryptedData, annotation.decryptedClass()));
return joinPoint.proceed();
......@@ -60,7 +61,7 @@ public class DecryptAndVerifyAspect {
if (sign.equals(encryptedReq.getSign())) {
return CodecUtil.aesDecrypt(encryptedReq.getEncryptedData());
} else {
throw new DecryptAndVerifyException("验签失败:" + JSON.toJSONString(encryptedReq));
throw new DecryptAndVerifyException(ErrorCode.HTTP_PARAM_ERROR.getCode(),"验签失败:");
}
}
}
package com.liquidnet.service.base.codec.exception;
import com.liquidnet.common.exception.LiquidnetServiceException;
/**
* @description: 解密验证异常
* @author: DFY
* @time: 2020/3/30 13:58
*/
public class DecryptAndVerifyException extends RuntimeException {
public class DecryptAndVerifyException extends LiquidnetServiceException {
public DecryptAndVerifyException(String message) {
super(message);
public DecryptAndVerifyException(String code,String message) {
super(code,message);
}
}
......@@ -87,9 +87,11 @@ public class AdamEntersController {
List<AdamEntersVo> vos = adamRdmService.getEntersVoByUid(CurrentUtil.getCurrentUid());
Optional<AdamEntersVo> any = vos.stream().filter(r -> (r.getIdCard().equals(parameter.getIdCard())) && r.getType().equals(parameter.getType())).findAny();
if (any.isPresent()) {
return ResponseDto.failure(ErrorMapping.get("10019"));
if (!CollectionUtils.isEmpty(vos)) {
Optional<AdamEntersVo> any = vos.stream().filter(r -> (r.getIdCard().equals(parameter.getIdCard())) && r.getType().equals(parameter.getType())).findAny();
if (any.isPresent()) {
return ResponseDto.failure(ErrorMapping.get("10019"));
}
}
String entersId = adamEntersService.add(parameter);
......
......@@ -525,7 +525,7 @@ public class AdamRdmService {
redisUtil.del(AdamRedisConst.INFO_MEMBER_CODE.concat(memberCode));
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | <AdamMemberCodeVo::buyOrderNo, MEMBER_CODE + STATE> */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | <AdamMemberCodeVo::buyOrderNo, MEMBER_CODE> */
public boolean setMemberCodeByBuyOrderNo(String buyOrderNo, String memberCode) {
return redisUtil.set(buyOrderNo, memberCode);
......@@ -549,7 +549,10 @@ public class AdamRdmService {
// );
// log.debug("#MDB耗时:{}ms", System.currentTimeMillis() - s);
// return vo;
return this.getMemberCodeVoByCode(this.getMemberCodeByBuyOrderNo(buyOrderNo));
// TODO: 2021/7/30 存在购买会员兑换码功能时,按需调整
AdamMemberCodeVo vo = AdamMemberCodeVo.getNew();
vo.setCode(this.getMemberCodeByBuyOrderNo(buyOrderNo));
return vo;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | TAGS:List<AdamTagVo> */
......
......@@ -51,7 +51,7 @@ public class AdamAddressesServiceImpl implements IAdamAddressesService {
AdamAddressesVo vo = AdamAddressesVo.getNew();
BeanUtils.copyProperties(parameter, vo);
vo.setAddressesId(String.valueOf(IDGenerator.nextSnowId()));
vo.setAddressesId(IDGenerator.nextSnowId());
vo.setUid(currentUid);
vo.setIsDefault(CollectionUtils.isEmpty(vos));
vo.setState(1);
......@@ -62,7 +62,9 @@ public class AdamAddressesServiceImpl implements IAdamAddressesService {
// log.debug("#MDB耗时:{}ms", System.currentTimeMillis() - s);
long s = System.currentTimeMillis();
adamRdmService.delAddressesVoByUid(currentUid);
// adamRdmService.delAddressesVoByUid(currentUid);
vos.add(vo);
adamRdmService.setAddressesVoByUid(currentUid, vos);
log.debug("#RDS耗时:{}ms", System.currentTimeMillis() - s);
s = System.currentTimeMillis();
......
......@@ -56,6 +56,8 @@ 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());
}
}
......@@ -64,7 +66,7 @@ public class AdamEntersServiceImpl implements IAdamEntersService {
AdamEntersVo vo = AdamEntersVo.getNew();
BeanUtils.copyProperties(parameter, vo);
vo.setEntersId(String.valueOf(IDGenerator.nextSnowId()));
vo.setEntersId(IDGenerator.nextSnowId());
vo.setUid(currentUid);
vo.setIsDefault(CollectionUtils.isEmpty(vos));
vo.setState(1);
......@@ -75,10 +77,9 @@ public class AdamEntersServiceImpl implements IAdamEntersService {
// log.debug("#MDB耗时:{}ms", System.currentTimeMillis() - s);
long s = System.currentTimeMillis();
adamRdmService.delEntersVoByUid(currentUid);
if (1 == parameter.getType()) {
adamRdmService.setCertification(1, parameter.getIdCard(), parameter.getName());
}
// adamRdmService.delEntersVoByUid(currentUid);
vos.add(vo);
adamRdmService.setEntersVoByUid(currentUid, vos);
log.debug("#RDS耗时:{}ms", System.currentTimeMillis() - s);
s = System.currentTimeMillis();
......
......@@ -404,6 +404,7 @@ public class AdamUserServiceImpl implements IAdamUserService {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("10102");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
}
adamRdmService.setCertification(1, idCard, name);
}
AdamRealName realName = new AdamRealName();
......@@ -425,7 +426,6 @@ public class AdamUserServiceImpl implements IAdamUserService {
long s = System.currentTimeMillis();
adamRdmService.setRealInfoVoByUid(uid, vo);
adamRdmService.setCertification(1, idCard, name);
log.debug("#RDS耗时:{}ms", System.currentTimeMillis() - s);
// }
// RedisLockUtil.unlock(AdamRedisConst.LOCK_KEY_UIDENTITY + uid);
......
......@@ -234,18 +234,18 @@ public class KylinRefundsStatusServiceImpl {
entitiesTable.setIsPayment(KylinTableStatusConst.ENTITIES_IS_PAYMENT2);
entitiesTable.setUpdatedAt(time);
BigDecimal oldRefundPrice = BigDecimal.valueOf(0);
for (KylinOrderTicketEntitiesVo item :orderInfo.getEntitiesVoList()) {
if(item.getOrderTicketEntitiesId().equalsIgnoreCase(orderEntitiesId)){
oldRefundPrice = item.getRefundPrice();
break;
}
}
// BigDecimal oldRefundPrice = BigDecimal.valueOf(0);
// for (KylinOrderTicketEntitiesVo item :orderInfo.getEntitiesVoList()) {
// if(item.getOrderTicketEntitiesId().equalsIgnoreCase(orderEntitiesId)){
// oldRefundPrice = item.getRefundPrice();
// break;
// }
// }
KylinOrderTicketEntitiesVo kylinOrderTicketEntitiesVo = KylinOrderTicketEntitiesVo.getNew();
kylinOrderTicketEntitiesVo.setIsPayment(KylinTableStatusConst.ENTITIES_IS_PAYMENT2);
kylinOrderTicketEntitiesVo.setRefundPrice(oldRefundPrice.add(BigDecimal.valueOf(refundPrice)));
// kylinOrderTicketEntitiesVo.setRefundPrice(oldRefundPrice.add(BigDecimal.valueOf(refundPrice)));
kylinOrderTicketEntitiesVo.setUpdatedAt(strTime);
BasicDBObject entitiesObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(kylinOrderTicketEntitiesVo)));
mongoTemplate.getCollection(KylinOrderTicketEntitiesVo.class.getSimpleName()).updateOne(
......
......@@ -167,7 +167,7 @@ CREATE TABLE `sweet_manual_shop`
`manual_id` varchar(200) NOT NULL DEFAULT '' COMMENT '电子宣传手册id',
`title` varchar(200) NOT NULL DEFAULT '' COMMENT '商家名称',
`pic_url` varchar(200) NOT NULL DEFAULT '' COMMENT '商家图片',
`describe` longtext NULL COMMENT '商家介绍',
`describes` longtext NULL COMMENT '商家介绍',
`type` tinyint NOT NULL DEFAULT 1 COMMENT '1吃喝 2玩乐',
`is_recommend` tinyint NOT NULL DEFAULT 1 COMMENT '0不推荐 1推荐',
`sort` tinyint NOT NULL DEFAULT 0 COMMENT '排序字段 数字越大越靠前',
......@@ -181,4 +181,4 @@ CREATE TABLE `sweet_manual_shop`
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci
ROW_FORMAT = DYNAMIC COMMENT '电子宣传手册商铺表';
\ No newline at end of file
ROW_FORMAT = DYNAMIC COMMENT '电子宣传手册商铺表';
......@@ -36,13 +36,24 @@ public class SweetManualShopController {
@ApiOperation("列表")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "manualId", value = "手册id", required = true),
@ApiImplicitParam(type = "query", dataType = "Integer", name = "type", value = "类型 1吃喝 2玩乐", required = true),
})
public ResponseDto<List<SweetManualShop>> getList(@RequestParam String manualId,
@RequestParam Integer type) {
return sweetManualShopService.getList(manualId, type);
}
@GetMapping("details")
@ApiOperation("详情")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "manualShopId", value = "商铺id", required = true),
})
public ResponseDto<List<SweetManualShop>> getList(@RequestParam() String manualId) {
return sweetManualShopService.getList(manualId);
public ResponseDto<SweetManualShop> details(@RequestParam String manualShopId) {
return sweetManualShopService.details(manualShopId);
}
@PostMapping("add")
@ApiOperation("添加列表")
@ApiOperation("添加")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "manualId", value = "手册iid", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "title", value = "标题", required = true),
......@@ -63,7 +74,7 @@ public class SweetManualShopController {
}
@PostMapping("change")
@ApiOperation("通知列表")
@ApiOperation("修改")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "manualShopId", value = "商铺id", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "title", value = "标题", required = true),
......@@ -74,12 +85,12 @@ public class SweetManualShopController {
@ApiImplicitParam(type = "query", dataType = "Integer", name = "sort", value = "排序", required = true),
})
public ResponseDto<Boolean> change(@RequestParam String manualShopId,
@RequestParam String title,
@RequestParam String picUrl,
@RequestParam String describe,
@RequestParam Integer type,
@RequestParam Integer isRecommend,
@RequestParam Integer sort) {
@RequestParam String title,
@RequestParam String picUrl,
@RequestParam String describe,
@RequestParam Integer type,
@RequestParam Integer isRecommend,
@RequestParam Integer sort) {
return sweetManualShopService.change(manualShopId, title, picUrl, describe, type, isRecommend, sort);
}
......
......@@ -41,7 +41,7 @@ public class SweetRichtextController {
return sweetRichtextService.get(manualId, type);
}
@GetMapping("list")
@PostMapping("add")
@ApiOperation("添加富文本")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "Integer", name = "manualId", value = "页数", required = true),
......
......@@ -47,7 +47,7 @@ public class SweetManualShop implements Serializable,Cloneable {
/**
* 商家介绍
*/
private String describe;
private String describes;
/**
* 1吃喝 2玩乐
......
......@@ -16,7 +16,9 @@ import java.util.List;
*/
public interface ISweetManualShopService extends IService<SweetManualShop> {
ResponseDto<List<SweetManualShop>> getList(String manualId);
ResponseDto<List<SweetManualShop>> getList(String manualId,Integer type);
ResponseDto<SweetManualShop> details(String manualShopId);
ResponseDto<Boolean> add(String manualId,String title,String picUrl,String describe,Integer type,Integer isRecommend,Integer sort);
......
......@@ -31,9 +31,19 @@ public class SweetManualShopServiceImpl extends ServiceImpl<SweetManualShopMappe
private SweetManualShopMapper sweetManualShopMapper;
@Override
public ResponseDto<List<SweetManualShop>> getList(String manualId) {
public ResponseDto<List<SweetManualShop>> getList(String manualId, Integer type) {
try {
List<SweetManualShop> data = sweetManualShopMapper.selectList(Wrappers.lambdaQuery(SweetManualShop.class).eq(SweetManualShop::getManualId, manualId).eq(SweetManualShop::getStatus, 1));
List<SweetManualShop> data = sweetManualShopMapper.selectList(Wrappers.lambdaQuery(SweetManualShop.class).eq(SweetManualShop::getManualId, manualId).eq(SweetManualShop::getType, type).eq(SweetManualShop::getStatus, 1));
return ResponseDto.success(data);
} catch (Exception e) {
return ResponseDto.failure();
}
}
@Override
public ResponseDto<SweetManualShop> details(String manualShopId) {
try {
SweetManualShop data = sweetManualShopMapper.selectOne(Wrappers.lambdaQuery(SweetManualShop.class).eq(SweetManualShop::getManualShopId, manualShopId).eq(SweetManualShop::getStatus, 1));
return ResponseDto.success(data);
} catch (Exception e) {
return ResponseDto.failure();
......@@ -48,7 +58,7 @@ public class SweetManualShopServiceImpl extends ServiceImpl<SweetManualShopMappe
sweetManualShop.setManualId(manualId);
sweetManualShop.setTitle(title);
sweetManualShop.setPicUrl(picUrl);
sweetManualShop.setDescribe(describe);
sweetManualShop.setDescribes(describe);
sweetManualShop.setType(type);
sweetManualShop.setIsRecommend(isRecommend);
sweetManualShop.setSort(sort);
......@@ -56,6 +66,7 @@ public class SweetManualShopServiceImpl extends ServiceImpl<SweetManualShopMappe
sweetManualShopMapper.insert(sweetManualShop);
return ResponseDto.success();
} catch (Exception e) {
e.printStackTrace();
return ResponseDto.failure();
}
}
......@@ -66,11 +77,11 @@ public class SweetManualShopServiceImpl extends ServiceImpl<SweetManualShopMappe
SweetManualShop sweetManualShop = SweetManualShop.getNew();
sweetManualShop.setTitle(title);
sweetManualShop.setPicUrl(picUrl);
sweetManualShop.setDescribe(describe);
sweetManualShop.setDescribes(describe);
sweetManualShop.setType(type);
sweetManualShop.setIsRecommend(isRecommend);
sweetManualShop.setSort(sort);
sweetManualShopMapper.update(sweetManualShop,Wrappers.lambdaUpdate(SweetManualShop.class).eq(SweetManualShop::getManualShopId, manualShopId));
sweetManualShopMapper.update(sweetManualShop, Wrappers.lambdaUpdate(SweetManualShop.class).eq(SweetManualShop::getManualShopId, manualShopId));
return ResponseDto.success();
} catch (Exception e) {
return ResponseDto.failure();
......@@ -82,7 +93,7 @@ public class SweetManualShopServiceImpl extends ServiceImpl<SweetManualShopMappe
try {
SweetManualShop sweetManualShop = SweetManualShop.getNew();
sweetManualShop.setStatus(0);
sweetManualShopMapper.update(sweetManualShop,Wrappers.lambdaUpdate(SweetManualShop.class).eq(SweetManualShop::getManualShopId, manualShopId));
sweetManualShopMapper.update(sweetManualShop, Wrappers.lambdaUpdate(SweetManualShop.class).eq(SweetManualShop::getManualShopId, manualShopId));
return ResponseDto.success();
} catch (Exception e) {
return ResponseDto.failure();
......
......@@ -39,7 +39,9 @@
<select id="getManualDetails" parameterType="java.util.Map" resultMap="getManualListResult">
select manual_relation_id,
sa.`name`,
sa.`artists_id`,
ss.title,
ss.stage_id,
performance_start,
performance_end,
signature_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