Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
78516474a1
@ -0,0 +1,80 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
* this software and associated documentation files (the "Software"), to deal in
|
||||||
|
* the Software without restriction, including without limitation the rights to
|
||||||
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
* subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
package com.aircraft.config.mybatis;
|
||||||
|
|
||||||
|
import com.p6spy.engine.logging.Category;
|
||||||
|
import com.p6spy.engine.spy.appender.FormattedLogger;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* P6spy日志实现
|
||||||
|
* <p>
|
||||||
|
* https://blog.csdn.net/z69183787/article/details/43453581
|
||||||
|
* <p/>
|
||||||
|
*
|
||||||
|
* @see FormattedLogger
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class P6spyLogger extends FormattedLogger {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void logException(Exception e) {
|
||||||
|
log.info("", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void logText(String text) {
|
||||||
|
log.info(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void logSQL(int connectionId, String now, long elapsed,
|
||||||
|
Category category, String prepared, String sql, String url) {
|
||||||
|
final String msg = strategy.formatMessage(connectionId, now, elapsed,
|
||||||
|
category.toString(), prepared, sql, url);
|
||||||
|
|
||||||
|
if (StringUtils.isEmpty(msg)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (Category.ERROR.equals(category)) {
|
||||||
|
log.error(msg);
|
||||||
|
} else if (Category.WARN.equals(category)) {
|
||||||
|
log.warn(msg);
|
||||||
|
} else if (Category.DEBUG.equals(category)) {
|
||||||
|
log.debug(msg);
|
||||||
|
} else {
|
||||||
|
log.info(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isCategoryEnabled(Category category) {
|
||||||
|
if (Category.ERROR.equals(category)) {
|
||||||
|
return log.isErrorEnabled();
|
||||||
|
} else if (Category.WARN.equals(category)) {
|
||||||
|
return log.isWarnEnabled();
|
||||||
|
} else if (Category.DEBUG.equals(category)) {
|
||||||
|
return log.isDebugEnabled();
|
||||||
|
} else {
|
||||||
|
return log.isInfoEnabled();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -5,9 +5,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
|||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.aircraft.exception.BadRequestException;
|
import com.aircraft.exception.BadRequestException;
|
||||||
import com.aircraft.modules.order.domain.OrderDetail;
|
import com.aircraft.modules.order.domain.*;
|
||||||
import com.aircraft.modules.order.domain.OrderMain;
|
|
||||||
import com.aircraft.modules.order.domain.OrderOperator;
|
|
||||||
import com.aircraft.modules.order.domain.constant.OrderConstant;
|
import com.aircraft.modules.order.domain.constant.OrderConstant;
|
||||||
import com.aircraft.modules.order.domain.constant.OrderRedisConstant;
|
import com.aircraft.modules.order.domain.constant.OrderRedisConstant;
|
||||||
import com.aircraft.modules.order.domain.dto.AddOrderDTO;
|
import com.aircraft.modules.order.domain.dto.AddOrderDTO;
|
||||||
@ -17,11 +15,10 @@ import com.aircraft.modules.order.domain.dto.UpdateOrderDTO;
|
|||||||
import com.aircraft.modules.order.domain.enums.MainOrderStatusEnum;
|
import com.aircraft.modules.order.domain.enums.MainOrderStatusEnum;
|
||||||
import com.aircraft.modules.order.domain.enums.OrderSettlementStatusEnum;
|
import com.aircraft.modules.order.domain.enums.OrderSettlementStatusEnum;
|
||||||
import com.aircraft.modules.order.domain.enums.OrderTaskStatusEnum;
|
import com.aircraft.modules.order.domain.enums.OrderTaskStatusEnum;
|
||||||
|
import com.aircraft.modules.order.domain.enums.SettlementStatusEnum;
|
||||||
import com.aircraft.modules.order.domain.vo.OrderAllDetailVO;
|
import com.aircraft.modules.order.domain.vo.OrderAllDetailVO;
|
||||||
import com.aircraft.modules.order.domain.vo.OrderMainPageQueryVO;
|
import com.aircraft.modules.order.domain.vo.OrderMainPageQueryVO;
|
||||||
import com.aircraft.modules.order.service.IOrderDetailService;
|
import com.aircraft.modules.order.service.*;
|
||||||
import com.aircraft.modules.order.service.IOrderMainService;
|
|
||||||
import com.aircraft.modules.order.service.IOrderOperatorService;
|
|
||||||
import com.aircraft.modules.route.domain.CpRoute;
|
import com.aircraft.modules.route.domain.CpRoute;
|
||||||
import com.aircraft.modules.route.service.CpRouteService;
|
import com.aircraft.modules.route.service.CpRouteService;
|
||||||
import com.aircraft.modules.system.domain.AttachmentMaterial;
|
import com.aircraft.modules.system.domain.AttachmentMaterial;
|
||||||
@ -80,6 +77,10 @@ public class OrderBiz {
|
|||||||
private EmEmployeesService emEmployeesService;
|
private EmEmployeesService emEmployeesService;
|
||||||
@Resource
|
@Resource
|
||||||
private CpRouteService cpRouteService;
|
private CpRouteService cpRouteService;
|
||||||
|
@Resource
|
||||||
|
private ISettlementMainService settlementMainService;
|
||||||
|
@Resource
|
||||||
|
private ISettlementDetailService settlementDetailService;
|
||||||
|
|
||||||
public List<OrderMainPageQueryVO> queryAll(OrderMainPageQueryDTO pageQueryDTO) {
|
public List<OrderMainPageQueryVO> queryAll(OrderMainPageQueryDTO pageQueryDTO) {
|
||||||
|
|
||||||
@ -471,4 +472,113 @@ public class OrderBiz {
|
|||||||
}
|
}
|
||||||
orderDetailService.deleteOrderDetailByOrderId(orderTaskId);
|
orderDetailService.deleteOrderDetailByOrderId(orderTaskId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有的结算订单
|
||||||
|
*
|
||||||
|
* @param batchNo 结算批次号
|
||||||
|
* @return List<SettlementMain>
|
||||||
|
*/
|
||||||
|
public List<SettlementMain> allSettlementOrderList(String batchNo) {
|
||||||
|
List<SettlementMain> settlementMainList = settlementMainService.allSettlementOrderList(batchNo);
|
||||||
|
return settlementMainList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成结算订单
|
||||||
|
*
|
||||||
|
* @param orderIds 订单ID集合
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void generateSettlementOrder(List<Long> orderIds) {
|
||||||
|
// 验证这些结算订单是否复处于未结算且订单状态为已完成状态
|
||||||
|
List<OrderMain> orderMainList= orderMainService.obtainOrderListByOrderIds(orderIds);
|
||||||
|
if (CollectionUtil.isEmpty(orderMainList)) {
|
||||||
|
throw new BadRequestException("订单不存在");
|
||||||
|
}
|
||||||
|
// TODO 待优化(提示完整错误信息)
|
||||||
|
for (OrderMain orderMain : orderMainList) {
|
||||||
|
if (!orderIds.contains(orderMain.getId())) {
|
||||||
|
throw new BadRequestException("订单不存在");
|
||||||
|
}
|
||||||
|
// 判断订单是否处于未结算且订单状态为已完成状态
|
||||||
|
if (!OrderSettlementStatusEnum.NOT_SETTLED.getCode().equals(orderMain.getSettlementStatus())
|
||||||
|
|| !MainOrderStatusEnum.COMPLETED.getCode().equals(orderMain.getMainOrderStatus())) {
|
||||||
|
throw new BadRequestException("订单状态错误,无法生成结算订单");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 按照景区ID进行分组
|
||||||
|
Map<Long, List<OrderMain>> attractionGroupMap = orderMainList.stream().collect(Collectors.groupingBy(OrderMain::getAttractionId));
|
||||||
|
List<SettlementMain> settlementMainList = new ArrayList<>();
|
||||||
|
|
||||||
|
// 构建结算订单数据
|
||||||
|
attractionGroupMap.forEach((attractionId, orderList) -> {
|
||||||
|
SettlementMain settlementMain = new SettlementMain();
|
||||||
|
settlementMainList.add(settlementMain);
|
||||||
|
});
|
||||||
|
// 构建结算订单详情数据
|
||||||
|
List<SettlementMain> settlementMains = settlementMainService.batchInsert(settlementMainList);
|
||||||
|
// 构建结算订单明细数据
|
||||||
|
List<SettlementDetail> settlementDetailList = buildSettlementDetail(settlementMains, attractionGroupMap);
|
||||||
|
settlementDetailService.batchInsert(settlementDetailList);
|
||||||
|
// 更新结算订单状态(更新为结算中)
|
||||||
|
orderMainService.updateSettlementStatus(orderIds, OrderSettlementStatusEnum.SETTLING.getCode());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建结算订单明细数据
|
||||||
|
*
|
||||||
|
* @param settlementMains 结算订单集合
|
||||||
|
* @param attractionGroupMap 景区ID分组的订单集合
|
||||||
|
* @return {@link List<SettlementDetail> }
|
||||||
|
*/
|
||||||
|
private List<SettlementDetail> buildSettlementDetail(List<SettlementMain> settlementMains, Map<Long, List<OrderMain>> attractionGroupMap) {
|
||||||
|
List<SettlementDetail> settlementDetailList = new ArrayList<>();
|
||||||
|
for (SettlementMain settlementMain : settlementMains) {
|
||||||
|
List<OrderMain> orderMainList = attractionGroupMap.get(settlementMain.getAttractionId());
|
||||||
|
for (OrderMain orderMain : orderMainList) {
|
||||||
|
SettlementDetail settlementDetail = new SettlementDetail();
|
||||||
|
settlementDetail.setSettlementMainId(settlementMain.getId());
|
||||||
|
settlementDetail.setOrderId(orderMain.getId());
|
||||||
|
settlementDetail.setOrderNo(orderMain.getOrderNo());
|
||||||
|
settlementDetail.setOrderType(orderMain.getOrderType());
|
||||||
|
settlementDetail.setOrderInitiatorId(orderMain.getOrderInitiatorId());
|
||||||
|
settlementDetail.setPhone(orderMain.getPhone());
|
||||||
|
settlementDetail.setAttractionId(orderMain.getAttractionId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return settlementDetailList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打印结算单数据
|
||||||
|
*
|
||||||
|
* @param settlementOrderId 结算订单ID
|
||||||
|
* @return Boolean
|
||||||
|
*/
|
||||||
|
public Boolean printSettlementOrder(Long settlementOrderId) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取结算订单详情
|
||||||
|
*
|
||||||
|
* @param settlementOrderId 结算订单ID
|
||||||
|
* @return List<SettlementDetail>
|
||||||
|
*/
|
||||||
|
public List<SettlementDetail> querySettlementOrderDetail(Long settlementOrderId) {
|
||||||
|
List<SettlementDetail> settlementDetailList = settlementDetailService.obtainDetailBySettlementOrderId(settlementOrderId);
|
||||||
|
return settlementDetailList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新结算订单状态
|
||||||
|
*
|
||||||
|
* @param settlementOrderId 结算订单ID
|
||||||
|
* @param settlementOrderStatus {@link SettlementStatusEnum} 更新的状态枚举值
|
||||||
|
* @return Boolean
|
||||||
|
*/
|
||||||
|
public Boolean updateSettlementOrderStatus(Long settlementOrderId, Integer settlementOrderStatus) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,13 +31,13 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/order")
|
@RequestMapping("/api/order")
|
||||||
@Api(tags = "订单:订单管理")
|
@Api(tags = "订单管理")
|
||||||
public class OrderMainController {
|
public class OrderMainController {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private OrderBiz orderBiz;
|
private OrderBiz orderBiz;
|
||||||
|
|
||||||
@ApiOperation("查询订单列表")
|
@ApiOperation("查询订单列表-多端查询")
|
||||||
@GetMapping("/allOrder")
|
@GetMapping("/allOrder")
|
||||||
public ResponseEntity<PageResult<OrderMainPageQueryVO>> queryOrderList(OrderMainPageQueryDTO pageQueryDTO) {
|
public ResponseEntity<PageResult<OrderMainPageQueryVO>> queryOrderList(OrderMainPageQueryDTO pageQueryDTO) {
|
||||||
List<OrderMainPageQueryVO> orderList = orderBiz.queryAll(pageQueryDTO);
|
List<OrderMainPageQueryVO> orderList = orderBiz.queryAll(pageQueryDTO);
|
||||||
|
@ -1,9 +1,22 @@
|
|||||||
package com.aircraft.modules.order.controller;
|
package com.aircraft.modules.order.controller;
|
||||||
|
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import com.aircraft.modules.order.biz.OrderBiz;
|
||||||
|
import com.aircraft.modules.order.domain.SettlementDetail;
|
||||||
|
import com.aircraft.modules.order.domain.SettlementMain;
|
||||||
|
import com.aircraft.modules.order.domain.dto.OrderMainPageQueryDTO;
|
||||||
|
import com.aircraft.modules.order.domain.vo.OrderMainPageQueryVO;
|
||||||
|
import com.aircraft.utils.PageResult;
|
||||||
|
import com.aircraft.utils.PageUtil;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@ -14,8 +27,55 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
* @since 2025-07-10
|
* @since 2025-07-10
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/fmsOdSettlementMain")
|
@RequestMapping("/api/settlementOrder")
|
||||||
|
@Api(tags = "结算单管理")
|
||||||
public class SettlementMainController {
|
public class SettlementMainController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private OrderBiz orderBiz;
|
||||||
|
|
||||||
|
@ApiOperation("查询结算订单列表")
|
||||||
|
@GetMapping("/allSettlementOrder")
|
||||||
|
public ResponseEntity<PageResult<SettlementMain>> allSettlementOrderList(
|
||||||
|
@ApiParam(value = "结算批次号", required = false, example = "JS_2025072500001")
|
||||||
|
@RequestParam (value = "结算批次号") String batchNo) {
|
||||||
|
List<SettlementMain> orderList = orderBiz.allSettlementOrderList(batchNo);
|
||||||
|
return new ResponseEntity<>(PageUtil.toPage(orderList),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("生成结算订单")
|
||||||
|
@PostMapping("/generateSettlementOrder")
|
||||||
|
public ResponseEntity<String> generateSettlementOrder(
|
||||||
|
@ApiParam(value = "订单ID集合", required = true)
|
||||||
|
@RequestBody List<Long> orderIds) {
|
||||||
|
orderBiz.generateSettlementOrder(orderIds);
|
||||||
|
return new ResponseEntity<>("生成结算订单成功",HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("结算订单详情")
|
||||||
|
@GetMapping("/querySettlementOrderDetail/{settlementOrderId}")
|
||||||
|
public ResponseEntity<List<SettlementDetail>> querySettlementOrderDetail(
|
||||||
|
@ApiParam(value = "结算订单ID", required = true, example = "1946509536383438850")
|
||||||
|
@PathVariable("settlementOrderId") Long settlementOrderId) {
|
||||||
|
return new ResponseEntity<>(orderBiz.querySettlementOrderDetail(settlementOrderId),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("打印结算单数据-返回对应的数据集,前端进行打印PDF")
|
||||||
|
@GetMapping("/printSettlementOrder/{settlementOrderId}")
|
||||||
|
public ResponseEntity<Boolean> printSettlementOrder(
|
||||||
|
@ApiParam(value = "结算订单ID", required = true, example = "1946509536383438850")
|
||||||
|
@PathVariable("settlementOrderId") Long settlementOrderId) {
|
||||||
|
return new ResponseEntity<>(orderBiz.printSettlementOrder(settlementOrderId),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("更新结算单状态")
|
||||||
|
@PutMapping("/updateSettlementOrderStatus/{settlementOrderId}/{settlementOrderStatus}")
|
||||||
|
public ResponseEntity<Boolean> updateSettlementOrderStatus(
|
||||||
|
@ApiParam(value = "结算订单ID", required = true, example = "1946509536383438850")
|
||||||
|
@PathVariable("settlementOrderId") Long settlementOrderId,
|
||||||
|
@ApiParam(value = "结算单状态: 0=结算中, 1=已确认, 2=已完成, 3=结算完成, 4=已取消", required = true, example = "1")
|
||||||
|
@PathVariable("settlementOrderStatus") Integer settlementOrderStatus) {
|
||||||
|
return new ResponseEntity<>(orderBiz.updateSettlementOrderStatus(settlementOrderId, settlementOrderStatus),HttpStatus.OK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,6 +34,11 @@ public class SettlementDetail extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private Long settlementMainId;
|
private Long settlementMainId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单ID
|
||||||
|
*/
|
||||||
|
private Long orderId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单编号
|
* 订单编号
|
||||||
*/
|
*/
|
||||||
@ -42,7 +47,7 @@ public class SettlementDetail extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 订单类型
|
* 订单类型
|
||||||
*/
|
*/
|
||||||
private Boolean orderType;
|
private Integer orderType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单发起人ID
|
* 订单发起人ID
|
||||||
|
@ -33,6 +33,11 @@ public class SettlementMain extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private Integer batchNo;
|
private Integer batchNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 景区ID
|
||||||
|
*/
|
||||||
|
private Long attractionId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 结算状态
|
* 结算状态
|
||||||
*/
|
*/
|
||||||
|
@ -72,4 +72,20 @@ public interface IOrderMainService extends IService<OrderMain> {
|
|||||||
* @return {@link List<OrderMain>}
|
* @return {@link List<OrderMain>}
|
||||||
*/
|
*/
|
||||||
List<OrderMain> obtainOrderList(OrderMainPageQueryDTO pageQueryDTO);
|
List<OrderMain> obtainOrderList(OrderMainPageQueryDTO pageQueryDTO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单ID集合获取
|
||||||
|
*
|
||||||
|
* @param orderIds 订单ID集合
|
||||||
|
* @return List<OrderMain>
|
||||||
|
*/
|
||||||
|
List<OrderMain> obtainOrderListByOrderIds(List<Long> orderIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单ID修改结算状态
|
||||||
|
*
|
||||||
|
* @param orderIds 订单ID集合
|
||||||
|
* @param settlementStatus 结算状态
|
||||||
|
*/
|
||||||
|
void updateSettlementStatus(List<Long> orderIds, Integer settlementStatus);
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,8 @@ package com.aircraft.modules.order.service;
|
|||||||
import com.aircraft.modules.order.domain.SettlementDetail;
|
import com.aircraft.modules.order.domain.SettlementDetail;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 订单结算详情主表 服务类
|
* 订单结算详情主表 服务类
|
||||||
@ -13,4 +15,18 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||||||
*/
|
*/
|
||||||
public interface ISettlementDetailService extends IService<SettlementDetail> {
|
public interface ISettlementDetailService extends IService<SettlementDetail> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入
|
||||||
|
*
|
||||||
|
* @param settlementDetailList {@Link List<SettlementDetail>}
|
||||||
|
*/
|
||||||
|
void batchInsert(List<SettlementDetail> settlementDetailList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询结算单详情
|
||||||
|
*
|
||||||
|
* @param settlementOrderId 结算单ID
|
||||||
|
* @return List<SettlementDetail>
|
||||||
|
*/
|
||||||
|
List<SettlementDetail> obtainDetailBySettlementOrderId(Long settlementOrderId);
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,8 @@ package com.aircraft.modules.order.service;
|
|||||||
import com.aircraft.modules.order.domain.SettlementMain;
|
import com.aircraft.modules.order.domain.SettlementMain;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 订单结算主表 服务类
|
* 订单结算主表 服务类
|
||||||
@ -14,4 +16,19 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||||||
|
|
||||||
public interface ISettlementMainService extends IService<SettlementMain> {
|
public interface ISettlementMainService extends IService<SettlementMain> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据批次号获取数据
|
||||||
|
*
|
||||||
|
* @param batchNo 结算批次号
|
||||||
|
* @return {@link List<SettlementMain>}
|
||||||
|
*/
|
||||||
|
List<SettlementMain> allSettlementOrderList(String batchNo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量新增结算订单
|
||||||
|
*
|
||||||
|
* @param settlementMainList {List<SettlementMain>}
|
||||||
|
*/
|
||||||
|
List<SettlementMain> batchInsert(List<SettlementMain> settlementMainList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.aircraft.modules.order.service.impl;
|
package com.aircraft.modules.order.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.aircraft.modules.order.domain.OrderMain;
|
import com.aircraft.modules.order.domain.OrderMain;
|
||||||
@ -93,4 +94,21 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
|
|||||||
public List<OrderMain> obtainOrderList(OrderMainPageQueryDTO pageQueryDTO) {
|
public List<OrderMain> obtainOrderList(OrderMainPageQueryDTO pageQueryDTO) {
|
||||||
return orderMainMapper.obtainOrderList(pageQueryDTO);
|
return orderMainMapper.obtainOrderList(pageQueryDTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OrderMain> obtainOrderListByOrderIds(List<Long> orderIds) {
|
||||||
|
LambdaQueryWrapper<OrderMain> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.in(OrderMain::getId, orderIds);
|
||||||
|
return list(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateSettlementStatus(List<Long> orderIds, Integer settlementStatus) {
|
||||||
|
if (CollectionUtil.isEmpty(orderIds)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.update(Wrappers.<OrderMain>lambdaUpdate()
|
||||||
|
.in(OrderMain::getId, orderIds)
|
||||||
|
.set(OrderMain::getSettlementStatus, settlementStatus));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,9 +3,12 @@ package com.aircraft.modules.order.service.impl;
|
|||||||
import com.aircraft.modules.order.domain.SettlementDetail;
|
import com.aircraft.modules.order.domain.SettlementDetail;
|
||||||
import com.aircraft.modules.order.mapper.SettlementDetailMapper;
|
import com.aircraft.modules.order.mapper.SettlementDetailMapper;
|
||||||
import com.aircraft.modules.order.service.ISettlementDetailService;
|
import com.aircraft.modules.order.service.ISettlementDetailService;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 订单结算详情主表 服务实现类
|
* 订单结算详情主表 服务实现类
|
||||||
@ -17,4 +20,13 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class SettlementDetailServiceImpl extends ServiceImpl<SettlementDetailMapper, SettlementDetail> implements ISettlementDetailService {
|
public class SettlementDetailServiceImpl extends ServiceImpl<SettlementDetailMapper, SettlementDetail> implements ISettlementDetailService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void batchInsert(List<SettlementDetail> settlementDetailList) {
|
||||||
|
this.saveBatch(settlementDetailList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SettlementDetail> obtainDetailBySettlementOrderId(Long settlementOrderId) {
|
||||||
|
return this.list(Wrappers.lambdaQuery(SettlementDetail.class).eq(SettlementDetail::getSettlementMainId, settlementOrderId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,15 @@
|
|||||||
package com.aircraft.modules.order.service.impl;
|
package com.aircraft.modules.order.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.aircraft.modules.order.domain.SettlementMain;
|
import com.aircraft.modules.order.domain.SettlementMain;
|
||||||
import com.aircraft.modules.order.mapper.SettlementMainMapper;
|
import com.aircraft.modules.order.mapper.SettlementMainMapper;
|
||||||
import com.aircraft.modules.order.service.ISettlementMainService;
|
import com.aircraft.modules.order.service.ISettlementMainService;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 订单结算主表 服务实现类
|
* 订单结算主表 服务实现类
|
||||||
@ -17,4 +21,15 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class SettlementMainServiceImpl extends ServiceImpl<SettlementMainMapper, SettlementMain> implements ISettlementMainService {
|
public class SettlementMainServiceImpl extends ServiceImpl<SettlementMainMapper, SettlementMain> implements ISettlementMainService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SettlementMain> allSettlementOrderList(String batchNo) {
|
||||||
|
return list(Wrappers.lambdaQuery(SettlementMain.class)
|
||||||
|
.eq(StrUtil.isNotBlank(batchNo), SettlementMain::getBatchNo, batchNo));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SettlementMain> batchInsert(List<SettlementMain> settlementMainList) {
|
||||||
|
this.saveBatch(settlementMainList);
|
||||||
|
return settlementMainList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -131,7 +131,7 @@ amz:
|
|||||||
# 地域对应的 endpoint
|
# 地域对应的 endpoint
|
||||||
endPoint: https://oss-cn-wulanchabu.aliyuncs.com
|
endPoint: https://oss-cn-wulanchabu.aliyuncs.com
|
||||||
# 访问的域名
|
# 访问的域名
|
||||||
domain: https://aishangyun.oss-cn-wulanchabu.aliyuncs.com
|
domain: https://oss.aishangfeixing.com
|
||||||
# 账号的认证信息,或者子账号的认证信息
|
# 账号的认证信息,或者子账号的认证信息
|
||||||
accessKey: LTAI5tRK1mszQC82s2rCkowq
|
accessKey: LTAI5tRK1mszQC82s2rCkowq
|
||||||
secretKey: Ns8VAkRBauIuC207s3eGiqMrLbpF4e
|
secretKey: Ns8VAkRBauIuC207s3eGiqMrLbpF4e
|
||||||
|
@ -3,10 +3,10 @@ spring:
|
|||||||
datasource:
|
datasource:
|
||||||
druid:
|
druid:
|
||||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.p6spy.engine.spy.P6SpyDriver
|
||||||
url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:eladmin}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
|
url: jdbc:p6spy:mysql://aishangyun.mysql.polardb.rds.aliyuncs.com:3306/aircraft-mp?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
|
||||||
username: ${DB_USER:root}
|
username: aishangyun_dev
|
||||||
password: ${DB_PWD:123456}
|
password: asyfx@123&dev
|
||||||
# 初始连接数,建议设置为与最小空闲连接数相同
|
# 初始连接数,建议设置为与最小空闲连接数相同
|
||||||
initial-size: 20
|
initial-size: 20
|
||||||
# 最小空闲连接数,保持足够的空闲连接以应对请求
|
# 最小空闲连接数,保持足够的空闲连接以应对请求
|
||||||
@ -54,6 +54,12 @@ spring:
|
|||||||
wall:
|
wall:
|
||||||
config:
|
config:
|
||||||
multi-statement-allow: true
|
multi-statement-allow: true
|
||||||
|
redis:
|
||||||
|
#数据库索引
|
||||||
|
database: ${REDIS_DB:1}
|
||||||
|
host: ${REDIS_HOST:172.31.108.89}
|
||||||
|
port: ${REDIS_PORT:6334}
|
||||||
|
password: ${REDIS_PWD:aircraft.redis.@2025}
|
||||||
|
|
||||||
# 登录相关配置
|
# 登录相关配置
|
||||||
login:
|
login:
|
||||||
@ -133,15 +139,16 @@ file:
|
|||||||
amz:
|
amz:
|
||||||
s3:
|
s3:
|
||||||
# 地域
|
# 地域
|
||||||
region: test
|
region: cn-wulanchabu
|
||||||
# 地域对应的 endpoint
|
# 地域对应的 endpoint
|
||||||
endPoint: https://s3.test.com
|
endPoint: https://oss-cn-wulanchabu.aliyuncs.com
|
||||||
# 访问的域名
|
# 访问的域名
|
||||||
domain: https://s3.test.com
|
domain: https://oss.aishangfeixing.com
|
||||||
# 账号的认证信息,或者子账号的认证信息
|
# 账号的认证信息,或者子账号的认证信息
|
||||||
accessKey: 填写你的AccessKey
|
accessKey: LTAI5tRK1mszQC82s2rCkowq
|
||||||
secretKey: 填写你的SecretKey
|
secretKey: Ns8VAkRBauIuC207s3eGiqMrLbpF4e
|
||||||
# 存储桶(Bucket)
|
# 存储桶(Bucket)
|
||||||
defaultBucket: 填写你的存储桶名称
|
defaultBucket: aishangyun
|
||||||
|
|
||||||
# 文件存储路径
|
# 文件存储路径
|
||||||
timeformat: yyyy-MM
|
timeformat: yyyy-MM
|
@ -2,8 +2,8 @@
|
|||||||
modulelist=com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory,com.p6spy.engine.outage.P6OutageFactory
|
modulelist=com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory,com.p6spy.engine.outage.P6OutageFactory
|
||||||
# 自定义日志打印
|
# 自定义日志打印
|
||||||
logMessageFormat=com.aircraft.config.mybatis.CustomP6SpyLogger
|
logMessageFormat=com.aircraft.config.mybatis.CustomP6SpyLogger
|
||||||
# 日志输出到控制台
|
# 日志输出到文件
|
||||||
appender=com.baomidou.mybatisplus.extension.p6spy.StdoutLogger
|
appender=com.aircraft.config.mybatis.P6spyLogger
|
||||||
# 日期格式
|
# 日期格式
|
||||||
dateformat=yyyy-MM-dd HH:mm:ss
|
dateformat=yyyy-MM-dd HH:mm:ss
|
||||||
# 实际驱动 可多个
|
# 实际驱动 可多个
|
||||||
|
Loading…
Reference in New Issue
Block a user