fix[通用模块]: 泛型校验优化
This commit is contained in:
+19
-14
@@ -28,6 +28,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -72,15 +73,11 @@ public class OrderController {
|
||||
@Autowired
|
||||
private TencentPayProperties tencentPayProperties;
|
||||
|
||||
//// @Value("tencent.appid")
|
||||
// private String appId = "wx30a3c8de94a85584" ;
|
||||
//
|
||||
//// @Value("tencent.merchantId")
|
||||
// private String mchid = "1703796518";
|
||||
//
|
||||
//// @Value("tencent.notifyUrl")
|
||||
// private String notifyUrl = "http://img.goflytec.com/api-order/wechat/pay/notify" ;
|
||||
@Value("cdn.oss-url")
|
||||
private String cdnOssUrl;
|
||||
|
||||
@Value("cdn.url")
|
||||
private String cdnUrl;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
@@ -118,20 +115,19 @@ public class OrderController {
|
||||
|
||||
PageResult<Order> result = orderService.findListByUser(params);
|
||||
if (result.getCount() > 0){
|
||||
List<Map> page = new ArrayList();
|
||||
List<Map<String,Object>> page = new ArrayList<>();
|
||||
for(Order order : result.getData()){
|
||||
Map<String,Object> orderFileMap = new HashMap<>();
|
||||
orderFileMap.put("time", sdf.format(order.getCreateTime()));
|
||||
orderFileMap.put("addr", tourismService.getTourismById(order.getTourismId()).getTourismAddress());
|
||||
orderFileMap.put("orderNo", order.getOrderNo());
|
||||
List<OrderFile> list = orderFileService.getOrderFileByOrderNo(order.getOrderNo());
|
||||
List<Map> resultList = new ArrayList<>();
|
||||
if (list.size() > 0){
|
||||
List<Map<String,String>> resultList = new ArrayList<>();
|
||||
if (!list.isEmpty()){
|
||||
for (OrderFile orderFile : list){
|
||||
Map imgMap = new HashMap();
|
||||
Map<String,String> imgMap = new HashMap<>();
|
||||
String url = fileCenterService.getViewUrlByName(orderFile.getFilePath());
|
||||
url = url.replace("goflyapp.oss-cn-beijing.aliyuncs.com","cdn.goflytec.com");
|
||||
imgMap.put("url", url);
|
||||
imgMap.put("url", url.replace(cdnOssUrl,cdnUrl));
|
||||
//@TODO 待优化file_type获取方式
|
||||
if (url != null && !"".equals(url) ){
|
||||
if (url.contains(".jpeg")){
|
||||
@@ -167,6 +163,7 @@ public class OrderController {
|
||||
public Result<Order> createOrder(@RequestBody Order order) {
|
||||
|
||||
LoginAppUser user = LoginUserContextHolder.getUser();
|
||||
//@TODO 设置价格逻辑优化
|
||||
order.setOrderAmount("1990");
|
||||
order.setUserId(user.getId());
|
||||
if (order.getCodeId() == null){
|
||||
@@ -371,4 +368,12 @@ public class OrderController {
|
||||
}
|
||||
return Result.failed("不满足执行条件");
|
||||
}
|
||||
|
||||
public String getCdnOssUrl() {
|
||||
return cdnOssUrl;
|
||||
}
|
||||
|
||||
public String getCdnUrl() {
|
||||
return cdnUrl;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-1
@@ -40,7 +40,7 @@ public class WxPayController {
|
||||
* @throws IOException
|
||||
*/
|
||||
@PostMapping("/pay/Notify")
|
||||
public String wechatPayNotify(HttpServletRequest request) throws IOException {
|
||||
public void wechatPayNotify(HttpServletRequest request) throws IOException {
|
||||
log.info("------收到微信支付回调通知------");
|
||||
return payNotify(request);
|
||||
}
|
||||
@@ -110,6 +110,9 @@ public class WxPayController {
|
||||
Order order = orderService.getOrderByNumber(transaction.getOutTradeNo());
|
||||
order.setOrderStatus(OrderStatus.PAID.getId());
|
||||
boolean res = orderService.updateOrder(order);
|
||||
|
||||
|
||||
|
||||
if (res){
|
||||
returnMap.put("code", "SUCCESS");
|
||||
returnMap.put("message", "成功");
|
||||
|
||||
@@ -9,7 +9,7 @@ import lombok.Getter;
|
||||
*/
|
||||
@Getter
|
||||
public enum OrderStatus implements ZltEnum {
|
||||
UNPAID(0,"待支付"), PAID(1, "已支付排队中"), CANCELED(2, "已取消"),COMPLETE(3,"服务完成");
|
||||
UNPAID(0,"待支付"), PAID(1, "已支付排队中"), CANCELED(2, "已取消"),DOING(4,"正在服务中"),COMPLETE(3,"服务完成");
|
||||
|
||||
OrderStatus(Integer id, String content) {
|
||||
this.id = id;
|
||||
|
||||
+4
-8
@@ -41,9 +41,6 @@ public class OrderServiceImpl extends SuperServiceImpl<OrderMapper, Order> imple
|
||||
|
||||
private final static String ORDER_LOCK = "order_lock_";
|
||||
|
||||
// 定义分布式锁的键,确保唯一性,这里以固定字符串加上当前时间戳来构造
|
||||
private final static String ORDER_TIMEOUT_LOCK_ = "order_timeout_lock_" + System.currentTimeMillis();
|
||||
|
||||
@Autowired
|
||||
private DistributedLock lock;
|
||||
|
||||
@@ -53,7 +50,6 @@ public class OrderServiceImpl extends SuperServiceImpl<OrderMapper, Order> imple
|
||||
private JsapiServiceExtension service;
|
||||
|
||||
private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
private SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy MMdd");
|
||||
@Autowired
|
||||
private OrderMapper orderMapper;
|
||||
|
||||
@@ -178,10 +174,10 @@ public class OrderServiceImpl extends SuperServiceImpl<OrderMapper, Order> imple
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult findListByUser(Map<String, Object> params) {
|
||||
public PageResult<Order> findListByUser(Map<String, Object> params) {
|
||||
Page<Order> page = new Page<>(MapUtils.getInteger(params, "page"), MapUtils.getInteger(params, "limit"));
|
||||
List<Order> list = baseMapper.findListByUser(page, params);
|
||||
if (list != null && list.size() > 0) {
|
||||
if (list != null && !list.isEmpty()) {
|
||||
for (Order order : list) {
|
||||
order.setCreatedTime(sdf.format(order.getCreateTime()));
|
||||
}
|
||||
@@ -193,7 +189,7 @@ public class OrderServiceImpl extends SuperServiceImpl<OrderMapper, Order> imple
|
||||
public void updateOrderStatus() {
|
||||
|
||||
List<Order> orders = baseMapper.getOrdersByStatus(OrderStatus.UNPAID.getId());
|
||||
if (orders != null && orders.size() > 0) {
|
||||
if (orders != null && !orders.isEmpty()) {
|
||||
for (Order order : orders) {
|
||||
QueryOrderByOutTradeNoRequest request = new QueryOrderByOutTradeNoRequest();
|
||||
// 调用request.setXxx(val)设置所需参数,具体参数可见Request定义
|
||||
@@ -218,7 +214,7 @@ public class OrderServiceImpl extends SuperServiceImpl<OrderMapper, Order> imple
|
||||
public Integer getOrderRankingByOrderId(Long orderId) {
|
||||
|
||||
List<OrderRanking> result = orderMapper.getOrderRanking1();
|
||||
if (result.size() > 0) {
|
||||
if (!result.isEmpty()) {
|
||||
for (OrderRanking order : result) {
|
||||
if (order.getId().equals(orderId)) {
|
||||
return order.getRanking();
|
||||
|
||||
@@ -42,7 +42,9 @@ tencent:
|
||||
appSecret: ${zlt.security.tencent.app-secret}
|
||||
accessTokenUrl: ${zlt.security.tencent.accessTokenUrl}
|
||||
getwxacodeUrl: https://api.weixin.qq.com/wxa/getwxacode?access_token=
|
||||
|
||||
cdn:
|
||||
oss-url: goflyapp.oss-cn-beijing.aliyuncs.com
|
||||
url: cdn.goflytec.com
|
||||
#审计日志
|
||||
# audit-log:
|
||||
# enabled: true
|
||||
|
||||
Reference in New Issue
Block a user