|
|
@@ -43,7 +43,7 @@ public class ErpOrderServiceImpl implements IErpOrderService {
|
|
|
public TableDataInfo<ErpOrderVo> queryPageList(ErpOrderQuery query, PageQuery pageQuery) {
|
|
|
LambdaQueryWrapper<ErpOrder> lqw = buildQueryWrapper(query);
|
|
|
com.baomidou.mybatisplus.extension.plugins.pagination.Page<ErpOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
|
|
-
|
|
|
+
|
|
|
List<ErpOrderVo> list = result.getRecords();
|
|
|
if (ObjectUtil.isNotEmpty(list)) {
|
|
|
fillOrderDetails(list);
|
|
|
@@ -75,7 +75,7 @@ public class ErpOrderServiceImpl implements IErpOrderService {
|
|
|
LambdaQueryWrapper<org.dromara.erp.domain.ErpOrderDetail> detailLqw = Wrappers.lambdaQuery();
|
|
|
detailLqw.in(org.dromara.erp.domain.ErpOrderDetail::getOrderId, orderIds);
|
|
|
List<org.dromara.erp.domain.vo.ErpOrderDetailVo> allDetails = erpOrderDetailMapper.selectVoList(detailLqw);
|
|
|
-
|
|
|
+
|
|
|
for (ErpOrderVo vo : list) {
|
|
|
List<org.dromara.erp.domain.vo.ErpOrderDetailVo> details = allDetails.stream()
|
|
|
.filter(d -> vo.getRowId().equals(d.getOrderId()))
|
|
|
@@ -124,10 +124,10 @@ public class ErpOrderServiceImpl implements IErpOrderService {
|
|
|
log.info("[调试] 开始自动填充 Placer...");
|
|
|
log.info("[调试] 当前是否登录: {}", org.dromara.common.satoken.utils.LoginHelper.isLogin());
|
|
|
log.info("[调试] 当前 Token: {}", cn.dev33.satoken.stp.StpUtil.getTokenValue());
|
|
|
-
|
|
|
+
|
|
|
Long userId = org.dromara.common.satoken.utils.LoginHelper.getUserId();
|
|
|
log.info("[调试] 获取到的用户 ID: {}", userId);
|
|
|
-
|
|
|
+
|
|
|
if (userId != null) {
|
|
|
entity.setPlacer(userId);
|
|
|
log.info("[调试] 自动填充 Placer 成功: {}", userId);
|
|
|
@@ -146,7 +146,7 @@ public class ErpOrderServiceImpl implements IErpOrderService {
|
|
|
}
|
|
|
|
|
|
boolean result = baseMapper.insert(entity) > 0;
|
|
|
-
|
|
|
+
|
|
|
if (result && ObjectUtil.isNotEmpty(bo.getDetailIds())) {
|
|
|
// 根据前端传递的明细 ID 列表,精确更新这批明细关联的订单 ID
|
|
|
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper<org.dromara.erp.domain.ErpOrderDetail> luw = Wrappers.lambdaUpdate();
|
|
|
@@ -165,7 +165,7 @@ public class ErpOrderServiceImpl implements IErpOrderService {
|
|
|
if (order == null) {
|
|
|
throw new org.dromara.common.core.exception.ServiceException("订单不存在");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 根据审核结果设置订单状态
|
|
|
if (ErpAuditResult.PASS.getCode().equals(audit.getAuditResult())) { // 通过 → 待签批
|
|
|
order.setStatus(ErpOrderStatus.WAIT_SIGN.getCode());
|
|
|
@@ -234,7 +234,7 @@ public class ErpOrderServiceImpl implements IErpOrderService {
|
|
|
newStatus = ErpOrderStatus.FINISHED.getCode();
|
|
|
} else if (Integer.valueOf(1).equals(master.getReviewed())) {
|
|
|
// 已签批
|
|
|
- newStatus = ErpOrderStatus.WAIT_SIGN.getCode();
|
|
|
+ newStatus = ErpOrderStatus.PRODUCING.getCode();
|
|
|
} else if (Integer.valueOf(1).equals(master.getApproved())) {
|
|
|
// 已审核
|
|
|
newStatus = ErpOrderStatus.WAIT_SIGN.getCode();
|