提交 0c1b8b2b 作者: 张小凤

Rental(add)

上级 141eeb5e
......@@ -18,6 +18,11 @@
</properties>
<dependencies>
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>3.10.2</version>
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-base</artifactId>
<version>4.1.0</version>
......
......@@ -11,6 +11,7 @@ import com.mmc.oms.model.vo.PriceAcquisition;
import com.mmc.oms.model.vo.RentalOrderVO;
import com.mmc.oms.service.RentalOrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -32,6 +33,8 @@ public class RentalOrdersServiceImpl implements RentalOrdersService {
@Autowired private RentalOrdersDao rentalOrdersDao;
@Autowired private StringRedisTemplate stringRedisTemplate;
@Override
public OrderInfoDTO feignAddLease(LeaseOrderVO param) {
OrderInfoDO orderInfo = new OrderInfoDO(param);
......@@ -52,8 +55,9 @@ public class RentalOrdersServiceImpl implements RentalOrdersService {
receipt.setCreateTime(cdate);
rentalOrdersDao.insertOrderReceipt(receipt);
orderInfo.setBalance(getRemainingBalance(param.getRepoAccountId()));
// 将当前的用户id及订单编号存入redis
OrderInfoDTO dto = orderInfo.buildOrderInfoDTO();
stringRedisTemplate.opsForValue().set(orderInfo.getOrderNo(), JsonUtil.parseObjToJson(dto));
return dto;
}
......
......@@ -6,8 +6,8 @@ spring:
username: tmj
password: MMC@2022&MYSQL
redis:
database: 3
host: r-wz9ke310fs684hacn1.redis.rds.aliyuncs.com
database: 0
host: r-wz9ke310fs684hacn1pd.redis.rds.aliyuncs.com
port: 6379
password: MMC@2022&REDIS
jedis:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论