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

Commit 784bb9b1 authored by 胡佳晨's avatar 胡佳晨

Merge branch 'test'

parents fbf96854 e373a1d1
package com.liquidnet.service.dragon.constant;
/**
*
*/
public class DragonConstant {
public enum payChannelEnum{
ALIPAY("alipay","支付宝"),
WEPAY ("wePay","微信"),
CLOUDPAY("cloudPay","云闪付");
private String code;
private String message;
payChannelEnum(String code, String message) {
this.code = code;
this.message = message;
}
}
/**
* 支付状态
*/
public enum payStatusEnum{
STATUS_UNPAID("0","未支付,或支付中"),
STATUS_PAID("1","已支付"),
STATUS_SUCCESS("2","已支付,通知成功,交易结束"),
STATUS_FAIL("3","已支付,通知失败,交易结束"),
STATUS_EXPIRE("4","已支付,通知超时,交易结束");
private String code;
private String message;
payStatusEnum(String code, String message) {
this.code = code;
this.message = message;
}
}
/**
* 支付业务类型
*/
public enum bussinessTypeEnum{
TYPE_TICKET("TICKET","票务购买(实物购买)"),
TYPE_PRODUCT("PRODUCT","商品购买(实物购买)"),
TYPE_COST("COST","活动资费(活动成本费、活动报名费)"),
TYPE_MBEANS("MBEANS","点豆充值(虚拟道具)"),
TYPE_LIVE("LIVE","直播付费(数字资产)"),
TYPE_VIDEO("VIDEO","点播付费(数字资产)"),
TYPE_VIP("VIP","会员购买(数字+实物资产)"),
TYPE_CLUB("CLUB","会员购买(数字+实物资产)"),
TYPE_STRAWBERRY("STRAWBERRY","现场购买 (实物资产)");
private String code;
private String message;
bussinessTypeEnum(String code, String message) {
this.code = code;
this.message = message;
}
}
/**
* 支付类型
*/
public enum payTypeEnum{
PAYMENT_TYPE_APP_ALIPAY("APPALIPAY","App内支付宝支付"),
PAYMENT_TYPE_APP_WEPAY("APPWEPAY","App内微信支付"),
PAYMENT_TYPE_APP_IAP("APPIAP","App内IAP(In-App Purchase)支付,iOS虚拟道具支付"),
PAYMENT_TYPE_WAP_ALIPAY("WAPALIPAY","手机网页内支付宝支付"),
PAYMENT_TYPE_WAP_WEPAY("WAPWEPAY","手机网页调起微信支付"),
PAYMENT_TYPE_WEB_ALIPAY("WEBALIPAY","电脑网页内支付宝即时到账支付"),
PAYMENT_TYPE_WEB_WEPAY("WEBWEPAY","电脑网页内微信二维码支付,用户打开微信扫码支付"),
PAYMENT_TYPE_JS_WEPAY("JSWEPAY","微信内网页、微信公众号"),
PAYMENT_TYPE_APPLET_WEPAY("APPLETWEPAY","微信小程序");
private String code;
private String message;
payTypeEnum(String code, String message) {
this.code = code;
this.message = message;
}
}
}
package com.liquidnet.service.dragon.service; package com.liquidnet.service.dragon.service;
public interface IDragonOrderRefundsService { public interface IDragonOrderRefundsService {
void sendRedisQueue();
} }
...@@ -2,9 +2,13 @@ package com.liquidnet.service.kylin.dto.vo.returns; ...@@ -2,9 +2,13 @@ package com.liquidnet.service.kylin.dto.vo.returns;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
@Data @Data
public class OrderRefundListVo { public class OrderRefundListVo {
private String orderRefundsId; private String orderRefundsId;
private String orderRefundCode; private String orderRefundCode;
private Integer status; private Integer status;
private BigDecimal price;
private String applicantId;
} }
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<modules> <modules>
<module>liquidnet-service-adam-api</module> <module>liquidnet-service-adam-api</module>
<module>liquidnet-service-kylin-api</module> <module>liquidnet-service-kylin-api</module>
<module>liquidnet-bus-dragon-api</module> <module>liquidnet-service-dragon-api</module>
</modules> </modules>
<dependencies> <dependencies>
<dependency> <dependency>
......
...@@ -132,12 +132,16 @@ ...@@ -132,12 +132,16 @@
title: '快递费', title: '快递费',
formatter: function (value, row, index) { formatter: function (value, row, index) {
var expressType = ''; var expressType = '';
var freightPrice = row.freightPrice;
if (row.expressType == 1) { if (row.expressType == 1) {
expressType = "寄付"; expressType = "寄付";
} else { } else {
expressType = "到付"; expressType = "到付";
} }
return '快递方式:'+expressType+'<br>'+'快递费:'+row.priceExpress; if (null == freightPrice) {
freightPrice = '';
}
return '快递方式:'+expressType+'<br>'+'已支付快递费:'+row.priceExpress+'<br>'+'预估快递费:'+freightPrice;
} }
}, },
{ {
......
...@@ -395,7 +395,15 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres ...@@ -395,7 +395,15 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres
String msg = (String) hashMap.get("msg"); String msg = (String) hashMap.get("msg");
return ResponseDto.failure(msg); return ResponseDto.failure(msg);
} else { } else {
// TODO: 2021/6/30 储存金额 HashMap hashMapResult = (HashMap) hashMap.get("result");
KylinOrderExpress kylinOrderExpress = new KylinOrderExpress();
BigDecimal price = dataUtils.getBigDecimal(hashMapResult.get("price"));
kylinOrderExpress.setFreightPrice(price);
kylinOrderExpress.setUpdatedAt(DateUtil.getNowTime());
kylinOrderExpressMapper.update(
kylinOrderExpress
, new UpdateWrapper<KylinOrderExpress>().in("order_express_id", orderExpressInfo.getOrderExpressId())
);
// {"result":{"deliverTime":"2021-07-01 18:00:00,2021-07-01 18:00:00","price":"23元","businessTypeDesc":"顺丰特快","businessType":"1"},"succ":"ok","msg":null} // {"result":{"deliverTime":"2021-07-01 18:00:00,2021-07-01 18:00:00","price":"23元","businessTypeDesc":"顺丰特快","businessType":"1"},"succ":"ok","msg":null}
} }
} }
...@@ -481,6 +489,7 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres ...@@ -481,6 +489,7 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpres
kylinOrderExpressRoute.setOpcode((String) routeInfo.get("opcode")); kylinOrderExpressRoute.setOpcode((String) routeInfo.get("opcode"));
kylinOrderExpressRoute.setCreatedAt(DateUtil.getNowTime()); kylinOrderExpressRoute.setCreatedAt(DateUtil.getNowTime());
kylinOrderExpressRouteMapper.insert(kylinOrderExpressRoute); kylinOrderExpressRouteMapper.insert(kylinOrderExpressRoute);
// 这里没清缓存 推送正常的话这个用不到
} }
} }
} }
......
...@@ -16,6 +16,8 @@ import org.springframework.data.mongodb.core.query.Criteria; ...@@ -16,6 +16,8 @@ import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query; import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -291,4 +293,29 @@ public class DataUtils { ...@@ -291,4 +293,29 @@ public class DataUtils {
redisUtil.del(KylinRedisConst.ORDER_REFUND_BY_ORDER_ID.concat(id)); redisUtil.del(KylinRedisConst.ORDER_REFUND_BY_ORDER_ID.concat(id));
} }
} }
/**
* Object转BigDecimal类型
*
* @param value 要转的object类型
* @return 转成的BigDecimal类型数据
*/
public BigDecimal getBigDecimal(Object value) {
BigDecimal ret = null;
if (value != null) {
if (value instanceof BigDecimal) {
ret = (BigDecimal) value;
} else if (value instanceof String) {
String str = ((String) value).replace("元","");
ret = new BigDecimal(str);
} else if (value instanceof BigInteger) {
ret = new BigDecimal((BigInteger) value);
} else if (value instanceof Number) {
ret = new BigDecimal(((Number) value).doubleValue());
} else {
throw new ClassCastException("Not possible to coerce [" + value + "] from class " + value.getClass() + " into a BigDecimal.");
}
}
return ret;
}
} }
...@@ -24,5 +24,6 @@ public class PerformanceExpressPerformanceOrderListAdminDao { ...@@ -24,5 +24,6 @@ public class PerformanceExpressPerformanceOrderListAdminDao {
String mailno; String mailno;
Integer expressStatus; Integer expressStatus;
Integer freightPrice;
} }
...@@ -6,6 +6,7 @@ import lombok.Data; ...@@ -6,6 +6,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
/** /**
* <p> * <p>
...@@ -37,6 +38,7 @@ public class KylinOrderExpress implements Serializable { ...@@ -37,6 +38,7 @@ public class KylinOrderExpress implements Serializable {
private String printIcon; private String printIcon;
private String twoDimensionCode; private String twoDimensionCode;
private String printFlag; private String printFlag;
private BigDecimal freightPrice;
private String return_tracking_no; private String return_tracking_no;
private String sourceTransferCode; private String sourceTransferCode;
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
AND status = #{status} AND status = #{status}
</if> </if>
</where> </where>
ORDER BY mid DESC
</select> </select>
<select id="selectLastOne" resultType="com.liquidnet.service.kylin.entity.KylinOrderRefundBatches"> <select id="selectLastOne" resultType="com.liquidnet.service.kylin.entity.KylinOrderRefundBatches">
SELECT * SELECT *
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
AND a.status = #{status} AND a.status = #{status}
</if> </if>
</where> </where>
ORDER BY mid DESC
</select> </select>
<select id="selectRefundingCount" resultType="java.lang.Integer"> <select id="selectRefundingCount" resultType="java.lang.Integer">
SELECT COUNT(*) SELECT COUNT(*)
......
...@@ -283,6 +283,7 @@ ...@@ -283,6 +283,7 @@
kots.express_type, kots.express_type,
oe.mailno, oe.mailno,
oe.freight_price,
oe.express_status oe.express_status
FROM kylin_order_tickets kot FROM kylin_order_tickets kot
INNER JOIN kylin_order_ticket_status kots ON kot.order_tickets_id = kots.order_id INNER JOIN kylin_order_ticket_status kots ON kot.order_tickets_id = kots.order_id
......
package com.liquidnet.service.consumer.service.processor; package com.liquidnet.service.consumer.service.processor;
import com.liquidnet.service.consumer.adam.service.processor.ConsumerAdamUCenterProcessor;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
......
...@@ -18,12 +18,6 @@ ...@@ -18,12 +18,6 @@
<artifactId>liquidnet-common-cache-redis</artifactId> <artifactId>liquidnet-common-cache-redis</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-common-cache-redisson</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<!-- other --> <!-- other -->
<dependency> <dependency>
<groupId>com.liquidnet</groupId> <groupId>com.liquidnet</groupId>
......
package com.liquidnet.service.dragon.config;
import com.liquidnet.common.web.config.WebMvcConfig;
import com.liquidnet.common.web.filter.GlobalAuthorityInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
@Configuration
public class DragonWebMvcConfig extends WebMvcConfig {
@Autowired
GlobalAuthorityInterceptor globalAuthorityInterceptor;
@Override
protected void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(globalAuthorityInterceptor).addPathPatterns("/**");
super.addInterceptors(registry);
}
}
package com.liquidnet.service.dragon.config;
import com.liquidnet.service.dragon.receiver.RedisReceiver;
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.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;
@Configuration
public class RedisStreamConfig {
@Autowired
private RedisReceiver redisReceiver;
@Bean
public Subscription subscription(RedisConnectionFactory factory){
var options = StreamMessageListenerContainer
.StreamMessageListenerContainerOptions
.builder()
.pollTimeout(Duration.ofSeconds(1))
.build();
var listenerContainer = StreamMessageListenerContainer.create(factory,options);
var subscription = listenerContainer.receiveAutoAck(Consumer.from("group-1","consumer-1"),
StreamOffset.create("mystream", ReadOffset.lastConsumed()),redisReceiver);
listenerContainer.start();
return subscription;
}
}
package com.liquidnet.service.dragon.controller; package com.liquidnet.service.dragon.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("pay")
public class PayController { public class PayController {
} }
package com.liquidnet.service.dragon.controller; package com.liquidnet.service.dragon.controller;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.dragon.service.IDragonOrderRefundsService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("refund")
public class RefundController { public class RefundController {
@Autowired
IDragonOrderRefundsService orderRefundsService;
@PostMapping("pre")
@ApiOperation("发送测试redis")
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<String> checkCanOrder() {
orderRefundsService.sendRedisQueue();
return ResponseDto.success();
}
} }
package com.liquidnet.service.dragon.receiver;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.connection.stream.MapRecord;
import org.springframework.data.redis.stream.StreamListener;
import org.springframework.stereotype.Component;
@Slf4j
@Component
public class RedisReceiver implements StreamListener<String, MapRecord<String, String, String>> {
@Override
public void onMessage(MapRecord<String, String, String> message) {
log.info("接受到来自redis的消息");
System.out.println("message id "+message.getId());
System.out.println("stream "+message.getStream());
System.out.println("body "+message.getValue());
}
}
package com.liquidnet.service.dragon.service.impl; package com.liquidnet.service.dragon.service.impl;
import com.liquidnet.service.dragon.service.IDragonOrderRefundsService; import com.liquidnet.service.dragon.service.IDragonOrderRefundsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.stream.MapRecord;
import org.springframework.data.redis.connection.stream.StreamRecords;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import java.util.HashMap;
@Service
public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService { public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService {
@Autowired
StringRedisTemplate stringRedisTemplate;
@Override
public void sendRedisQueue() {
try {
HashMap<String ,String> map = new HashMap<>();
map.put("message","测试 redis 订阅信息1");
MapRecord<String, String, String> record = StreamRecords.mapBacked(map).withStreamKey("mystream");
stringRedisTemplate.opsForStream().add(record);
}catch (Exception e){
e.printStackTrace();
}
}
} }
...@@ -811,6 +811,8 @@ CREATE TABLE `kylin_order_express` ...@@ -811,6 +811,8 @@ CREATE TABLE `kylin_order_express`
`origincode` varchar(255) NOT NULL DEFAULT '' COMMENT '原寄地区域代码 可用于顺丰电子面单标签打印', `origincode` varchar(255) NOT NULL DEFAULT '' COMMENT '原寄地区域代码 可用于顺丰电子面单标签打印',
`destcode` varchar(255) NOT NULL DEFAULT '' COMMENT '目的地区域代码 可用于顺丰电子面单标签打印', `destcode` varchar(255) NOT NULL DEFAULT '' COMMENT '目的地区域代码 可用于顺丰电子面单标签打印',
`freight_price` decimal(11, 2) NOT NULL DEFAULT '0.00' COMMENT '估算的运费',
`return_tracking_no` varchar(30) NOT NULL DEFAULT '' COMMENT '顺丰签回单服务运单号', `return_tracking_no` varchar(30) NOT NULL DEFAULT '' COMMENT '顺丰签回单服务运单号',
`source_transfer_code` varchar(60) NOT NULL DEFAULT '' COMMENT '原寄地中转场', `source_transfer_code` varchar(60) NOT NULL DEFAULT '' COMMENT '原寄地中转场',
`source_city_code` varchar(60) NOT NULL DEFAULT '' COMMENT '原寄地城市代码', `source_city_code` varchar(60) NOT NULL DEFAULT '' COMMENT '原寄地城市代码',
......
...@@ -196,7 +196,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -196,7 +196,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
Integer orderExpressStatus = dataUtils.getOrderExpressInfo(orderTicketVo.getOrderTicketsId()); Integer orderExpressStatus = dataUtils.getOrderExpressInfo(orderTicketVo.getOrderTicketsId());
vo.setExpressStatus(orderExpressStatus); vo.setExpressStatus(orderExpressStatus);
List<KylinOrderRefundsOrderCodeVo> orderRefundsVoBaseList = new ArrayList<>();
List<KylinOrderRefundsVo> orderRefundsVoList = dataUtils.getOrderRefundVoByOrderId(orderId); List<KylinOrderRefundsVo> orderRefundsVoList = dataUtils.getOrderRefundVoByOrderId(orderId);
currentTime = System.currentTimeMillis() - currentTime; currentTime = System.currentTimeMillis() - currentTime;
log.debug("获取退款详情 -> time:" + (currentTime) + "毫秒"); log.debug("获取退款详情 -> time:" + (currentTime) + "毫秒");
...@@ -208,6 +207,8 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -208,6 +207,8 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
data.setOrderRefundCode(item.getOrderRefundCode().substring(item.getOrderRefundCode().length() - 10)); data.setOrderRefundCode(item.getOrderRefundCode().substring(item.getOrderRefundCode().length() - 10));
data.setOrderRefundsId(item.getOrderRefundsId()); data.setOrderRefundsId(item.getOrderRefundsId());
data.setStatus(item.getStatus()); data.setStatus(item.getStatus());
data.setPrice(item.getPrice());
data.setApplicantId(uid.equals(item.getApplicantId())?"1":"0");
if (item.getStatus().equals(0) || item.getStatus().equals(1) || item.getStatus().equals(7) || item.getStatus().equals(3) || item.getStatus().equals(4)) { if (item.getStatus().equals(0) || item.getStatus().equals(1) || item.getStatus().equals(7) || item.getStatus().equals(3) || item.getStatus().equals(4)) {
lockPrice = lockPrice.add(item.getPrice()); lockPrice = lockPrice.add(item.getPrice());
} }
...@@ -218,7 +219,8 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -218,7 +219,8 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
LocalDateTime refundOpenDate = DateUtil.Formatter.yyyyMMddHHmmss.parse(performanceVo.getRefundOpenTime()); LocalDateTime refundOpenDate = DateUtil.Formatter.yyyyMMddHHmmss.parse(performanceVo.getRefundOpenTime());
LocalDateTime refundCloseDate = DateUtil.Formatter.yyyyMMddHHmmss.parse(performanceVo.getRefundCloseTime()); LocalDateTime refundCloseDate = DateUtil.Formatter.yyyyMMddHHmmss.parse(performanceVo.getRefundCloseTime());
if (LocalDateTime.now().isAfter(refundOpenDate) && LocalDateTime.now().isBefore(refundCloseDate) && orderTicketVo.getExpressAddress().trim().equals("") if (LocalDateTime.now().isAfter(refundOpenDate) && LocalDateTime.now().isBefore(refundCloseDate) && orderTicketVo.getExpressAddress().trim().equals("")
&& ticketVo.getCounts() == 1 && lockPrice.compareTo(orderTicketVo.getPriceActual()) != 0) { && ticketVo.getCounts() == 1 && lockPrice.compareTo(orderTicketVo.getPriceActual()) != 0
&& (orderTicketVo.getStatus().equals(1) || orderTicketVo.getStatus().equals(3) || orderTicketVo.getStatus().equals(6))) {
vo.setIsCanRefund(1); vo.setIsCanRefund(1);
} else { } else {
vo.setIsCanRefund(0); vo.setIsCanRefund(0);
...@@ -233,7 +235,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -233,7 +235,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
log.debug("循环退款详情 -> time:" + (currentTime) + "毫秒"); log.debug("循环退款详情 -> time:" + (currentTime) + "毫秒");
orderTicketVo.setOrderRefundListVos(orderRefundListVos); orderTicketVo.setOrderRefundListVos(orderRefundListVos);
orderTicketVo.setOrderCode(orderTicketVo.getOrderCode().substring(orderTicketVo.getOrderCode().length() - 10)); orderTicketVo.setOrderCode(orderTicketVo.getOrderCode().substring(orderTicketVo.getOrderCode().length() - 10));
vo.setOrderRefundsVoList(orderRefundsVoBaseList);
vo.setOrderTicketVo(orderTicketVo); vo.setOrderTicketVo(orderTicketVo);
vo.setEnterDescribe(dataUtils.getEnterInfo("1")); vo.setEnterDescribe(dataUtils.getEnterInfo("1"));
} }
......
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