feat:设备全系
This commit is contained in:
1 parent
8d4c772ee8
commit
1327fac21e
16 files changed
+223
-39
No files matched your search
+1
-1
@@ -49,7 +49,7 @@ public class HardInvoiceController {
|
||||
@GetMapping("/page-join")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardInvoice_view')")
|
||||
public R pageJoin(@ParameterObject Page page, @ParameterObject HardInvoiceDto dto) {
|
||||
return R.ok(hardInvoiceService.pageJoin(page, dto));
|
||||
return R.ok(hardInvoiceService.scopePageList(page, dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ public class HardManagerController {
|
||||
@GetMapping("/page-join")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardInvoice_view')")
|
||||
public R pageJoin(@ParameterObject Page page, @ParameterObject HardManagerDto dto) {
|
||||
return R.ok(hardManagerService.pageJoin(page, dto));
|
||||
return R.ok(hardManagerService.scopePageList(page, dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过id查询" , description = "通过id查询" )
|
||||
|
||||
+1
-1
@@ -119,7 +119,7 @@ public class HardAfterSaleController {
|
||||
@GetMapping("/page-join")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardAfterSale_view')")
|
||||
public R pageJoin(@ParameterObject Page page, @ParameterObject HardAfterSaleDto dto) {
|
||||
return R.ok(hardAfterSaleService.pageJoin(page, dto));
|
||||
return R.ok(hardAfterSaleService.scopePageList(page, dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
|
||||
+2
-2
@@ -68,7 +68,7 @@ public class HardOrderController {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
dto.setUserId(user.getId());
|
||||
dto.setIsFindCarList(true);
|
||||
return R.ok(hardwareOrderService.pageJoin(page, dto));
|
||||
return R.ok(hardwareOrderService.pagejoin(page, dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "app查询订单详情", description = "app查询订单详情")
|
||||
@@ -103,7 +103,7 @@ public class HardOrderController {
|
||||
@GetMapping("/page-join")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardwareOrder_view')")
|
||||
public R pageJoin(@ParameterObject Page page, @ParameterObject HardOrderDto dto) {
|
||||
return R.ok(hardwareOrderService.pageJoin(page, dto));
|
||||
return R.ok(hardwareOrderService.scopePageList(page, dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
|
||||
+15
@@ -1,6 +1,10 @@
|
||||
package com.bsd.pjcloud.hard.mapper;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.BeanUtils;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.hard.api.dto.HardInvoiceDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardInvoiceEntity;
|
||||
@@ -10,6 +14,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface HardInvoiceMapper extends PjcloudBaseMapper<HardInvoiceEntity> {
|
||||
|
||||
default Page<HardInvoiceVo> pageJoin(Page page, HardInvoiceDto dto) {
|
||||
MPJLambdaWrapper<HardInvoiceEntity> wrapper = new MPJLambdaWrapper<HardInvoiceEntity>()
|
||||
.selectAll(HardInvoiceEntity.class)
|
||||
@@ -17,4 +22,14 @@ public interface HardInvoiceMapper extends PjcloudBaseMapper<HardInvoiceEntity>
|
||||
.eqIfExists(HardInvoiceEntity::getHardOrderId, dto.getHardOrderId());
|
||||
return selectJoinPage(page, HardInvoiceVo.class, wrapper);
|
||||
}
|
||||
|
||||
default Page<HardInvoiceVo> scopePageList(Page page, HardInvoiceDto dto) {
|
||||
LambdaQueryWrapper<HardInvoiceEntity> wrapper = new LambdaQueryWrapper<HardInvoiceEntity>()
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getHardId()), HardInvoiceEntity::getHardId, dto.getHardId())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getHardOrderId()), HardInvoiceEntity::getHardOrderId, dto.getHardOrderId());
|
||||
Page list = selectPageByScope(page, wrapper, DataScope.of());
|
||||
list.setRecords(BeanUtils.toBean(list.getRecords(), HardInvoiceVo.class));
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
+15
@@ -3,6 +3,8 @@ package com.bsd.pjcloud.hard.mapper;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.BeanUtils;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.hard.api.dto.HardManagerDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardManagerEntity;
|
||||
@@ -33,4 +35,17 @@ public interface HardManagerMapper extends PjcloudBaseMapper<HardManagerEntity>
|
||||
.in(ObjectUtil.isNotEmpty(dto.getIds()), HardManagerEntity::getId, dto.getIds());
|
||||
return selectList(wrapper);
|
||||
}
|
||||
|
||||
default Page<HardManagerVo> scopePageList(Page page, HardManagerDto dto) {
|
||||
LambdaQueryWrapper<HardManagerEntity> wrapper = new LambdaQueryWrapper<HardManagerEntity>()
|
||||
.like(ObjectUtil.isNotEmpty(dto.getName()), HardManagerEntity::getName, dto.getName())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getDeptId()), HardManagerEntity::getDeptId, dto.getDeptId())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getType()), HardManagerEntity::getType, dto.getType())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getType()), HardManagerEntity::getMerchantId, dto.getMerchantId())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getDeptIds()), HardManagerEntity::getDeptId, dto.getDeptIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getMerchantIds()), HardManagerEntity::getMerchantId, dto.getMerchantIds());
|
||||
Page list = selectPageByScope(page, wrapper, DataScope.of());
|
||||
list.setRecords(BeanUtils.toBean(list.getRecords(), HardManagerVo.class));
|
||||
return list;
|
||||
}
|
||||
}
|
||||
+2
-17
@@ -1,9 +1,6 @@
|
||||
package com.bsd.pjcloud.hard.mapper.order;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.BeanUtils;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.HardAfterSaleDto;
|
||||
@@ -11,6 +8,7 @@ import com.bsd.pjcloud.hard.api.entity.order.HardAfterSaleEntity;
|
||||
import com.bsd.pjcloud.hard.api.vo.order.HardAfterSaleVo;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface HardAfterSaleMapper extends PjcloudBaseMapper<HardAfterSaleEntity> {
|
||||
@@ -21,20 +19,7 @@ public interface HardAfterSaleMapper extends PjcloudBaseMapper<HardAfterSaleEnti
|
||||
return selectJoinPage(page, HardAfterSaleVo.class, wrapper);
|
||||
}
|
||||
|
||||
default Page<HardAfterSaleVo> scopePageList(Page page, HardAfterSaleDto dto) {
|
||||
LambdaQueryWrapper<HardAfterSaleEntity> wrapper = new LambdaQueryWrapper<HardAfterSaleEntity>()
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getStatus()), HardAfterSaleEntity::getStatus, dto.getStatus())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), HardAfterSaleEntity::getUserId, dto.getUserIds())
|
||||
.between(
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()),
|
||||
HardAfterSaleEntity::getCreateTime,
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()) ? dto.getCreateTimeList()[0] : null,
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()) ? dto.getCreateTimeList()[1] : null
|
||||
);
|
||||
Page list = selectPageByScope(page, wrapper, DataScope.of());
|
||||
list.setRecords(BeanUtils.toBean(list.getRecords(), HardAfterSaleVo.class));
|
||||
return list;
|
||||
}
|
||||
Page<HardAfterSaleVo> scopePageJoinList(Page page, @Param("dto") HardAfterSaleDto dto, DataScope dataScope);
|
||||
|
||||
default HardAfterSaleVo join(HardAfterSaleDto dto) {
|
||||
MPJLambdaWrapper<HardAfterSaleEntity> wrapper = new MPJLambdaWrapper<HardAfterSaleEntity>()
|
||||
|
||||
+2
@@ -14,6 +14,8 @@ public interface HardAfterSaleService extends IService<HardAfterSaleEntity> {
|
||||
|
||||
Page<HardAfterSaleVo> pageJoin(Page page, HardAfterSaleDto dto);
|
||||
|
||||
Page<HardAfterSaleVo> scopePageList(Page page, HardAfterSaleDto dto);
|
||||
|
||||
HardAfterSaleVo join(HardAfterSaleDto dto);
|
||||
|
||||
/**
|
||||
|
||||
+2
@@ -15,6 +15,8 @@ public interface HardInvoiceService extends IService<HardInvoiceEntity> {
|
||||
|
||||
Page<HardInvoiceVo> pageJoin(Page page, HardInvoiceDto dto);
|
||||
|
||||
Page<HardInvoiceVo> scopePageList(Page page, HardInvoiceDto dto);
|
||||
|
||||
/**
|
||||
* 生成发票
|
||||
* @param order
|
||||
|
||||
+2
@@ -11,6 +11,8 @@ public interface HardManagerService extends IService<HardManagerEntity> {
|
||||
|
||||
Page<HardManagerVo> pageJoin(Page page, HardManagerDto dto);
|
||||
|
||||
Page<HardManagerVo> scopePageList(Page page, HardManagerDto dto);
|
||||
|
||||
Long create(HardManagerDto dto);
|
||||
|
||||
void edit(HardManagerDto dto);
|
||||
|
||||
+3
-2
@@ -2,7 +2,6 @@ package com.bsd.pjcloud.hard.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.hard.api.constant.HardTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.dto.hard.HandCancelCodeDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.hard.HardCreateOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.HardOrderDto;
|
||||
@@ -13,7 +12,9 @@ import jakarta.validation.Valid;
|
||||
|
||||
public interface HardOrderService extends IService<HardOrderEntity> {
|
||||
|
||||
Page<HardOrderVo> pageJoin(Page page, HardOrderDto dto);
|
||||
Page<HardOrderVo> pagejoin(Page page, HardOrderDto dto);
|
||||
|
||||
Page<HardOrderVo> scopePageList(Page page, HardOrderDto dto);
|
||||
|
||||
HardOrderVo join(Long id);
|
||||
|
||||
|
||||
+6
@@ -72,6 +72,12 @@ public class HardInvoiceServiceImpl extends ServiceImpl<HardInvoiceMapper, HardI
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<HardInvoiceVo> scopePageList(Page page, HardInvoiceDto dto) {
|
||||
Page<HardInvoiceVo> list = baseMapper.scopePageList(page, dto);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateInvoice(HardOrderEntity order) {
|
||||
return generateInvoice(order, null);
|
||||
|
||||
+34
-6
@@ -55,15 +55,43 @@ public class HardManagerServiceImpl extends ServiceImpl<HardManagerMapper, HardM
|
||||
if (ObjectUtil.isNotEmpty(list.getRecords())) {
|
||||
// 部门
|
||||
List<Long> deptIds = list.getRecords().stream().map(HardManagerVo::getDeptId).distinct().toList();
|
||||
R<Map<Long, SysDept>> deptList = deptService.getDeptByDeptIds(deptIds);
|
||||
if (ObjectUtil.isNotEmpty(deptList.getData())) {
|
||||
DataUtil.convertDeptList(list.getRecords(), deptList.getData());
|
||||
if (ObjectUtil.isNotEmpty(deptIds)) {
|
||||
R<Map<Long, SysDept>> deptList = deptService.getDeptByDeptIds(deptIds);
|
||||
if (ObjectUtil.isNotEmpty(deptList.getData())) {
|
||||
DataUtil.convertDeptList(list.getRecords(), deptList.getData());
|
||||
}
|
||||
}
|
||||
// 商户
|
||||
List<Long> mchIds = list.getRecords().stream().map(HardManagerVo::getMerchantId).distinct().toList();
|
||||
R<List<MchManageVo>> mchList = mchService.getByIds(mchIds);
|
||||
if (ObjectUtil.isNotEmpty(mchList.getData())) {
|
||||
WalletDataUtil.convertMchList(list.getRecords(), CollectionUtils.convertMap(mchList.getData(), MchManageVo::getId));
|
||||
if (ObjectUtil.isNotEmpty(mchIds)) {
|
||||
R<List<MchManageVo>> mchList = mchService.getByIds(mchIds);
|
||||
if (ObjectUtil.isNotEmpty(mchList.getData())) {
|
||||
WalletDataUtil.convertMchList(list.getRecords(), CollectionUtils.convertMap(mchList.getData(), MchManageVo::getId));
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<HardManagerVo> scopePageList(Page page, HardManagerDto dto) {
|
||||
Page<HardManagerVo> list = baseMapper.scopePageList(page, dto);
|
||||
if (ObjectUtil.isNotEmpty(list.getRecords())) {
|
||||
// 部门
|
||||
List<Long> deptIds = list.getRecords().stream().map(HardManagerVo::getDeptId).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(deptIds)) {
|
||||
R<Map<Long, SysDept>> deptList = deptService.getDeptByDeptIds(deptIds);
|
||||
if (ObjectUtil.isNotEmpty(deptList.getData())) {
|
||||
DataUtil.convertDeptList(list.getRecords(), deptList.getData());
|
||||
}
|
||||
}
|
||||
// 商户
|
||||
List<Long> mchIds = list.getRecords().stream().map(HardManagerVo::getMerchantId).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(mchIds)) {
|
||||
R<List<MchManageVo>> mchList = mchService.getByIds(mchIds);
|
||||
if (ObjectUtil.isNotEmpty(mchList.getData())) {
|
||||
WalletDataUtil.convertMchList(list.getRecords(), CollectionUtils.convertMap(mchList.getData(), MchManageVo::getId));
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
|
||||
+34
-1
@@ -15,6 +15,7 @@ import com.bsd.pjcloud.admin.api.utils.DataUtil;
|
||||
import com.bsd.pjcloud.common.core.util.BeanUtils;
|
||||
import com.bsd.pjcloud.common.core.util.CollectionUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.hard.api.constant.order.HardOrderStatusEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.order.HardOrderTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.refund.HardAfterSaleOperateTypeEnum;
|
||||
@@ -75,7 +76,39 @@ public class HardAfterSaleServiceImpl extends ServiceImpl<HardAfterSaleMapper, H
|
||||
|
||||
@Override
|
||||
public Page<HardAfterSaleVo> pageJoin(Page page, HardAfterSaleDto dto) {
|
||||
Page<HardAfterSaleVo> list = baseMapper.scopePageList(page, dto);
|
||||
Page<HardAfterSaleVo> list = baseMapper.pageJoin(page, dto);
|
||||
if (ObjectUtil.isNotEmpty(list.getRecords())) {
|
||||
// 用户
|
||||
List<Long> userIds = list.getRecords().stream().map(HardAfterSaleVo::getUserId).filter(ObjectUtil::isNotEmpty).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(userIds)) {
|
||||
R<List<SysUser>> userList = userService.getUserById(new ArrayList<>(userIds));
|
||||
if (ObjectUtil.isNotEmpty(userList.getData())) {
|
||||
DataUtil.convertUserList(list.getRecords(), CollectionUtils.convertMap(userList.getData(), SysUser::getUserId));
|
||||
}
|
||||
}
|
||||
// 部门
|
||||
List<Long> deptIds = list.getRecords().stream().map(HardAfterSaleVo::getDeptId).filter(ObjectUtil::isNotEmpty).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(deptIds)) {
|
||||
R<Map<Long, SysDept>> deptList = deptService.getDeptByDeptIds(deptIds);
|
||||
if (ObjectUtil.isNotEmpty(deptList.getData())) {
|
||||
DataUtil.convertDeptList(list.getRecords(), deptList.getData());
|
||||
}
|
||||
}
|
||||
// 订单
|
||||
List<Long> orderIds = list.getRecords().stream().map(HardAfterSaleVo::getOrderId).filter(ObjectUtil::isNotEmpty).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(orderIds)) {
|
||||
HardOrderDto hardOrderDto = new HardOrderDto();
|
||||
hardOrderDto.setOrderIds(orderIds);
|
||||
List<HardOrderEntity> orderList = hardOrderMapper.list(hardOrderDto);
|
||||
HardUtil.convertOrderList(list.getRecords(), CollectionUtils.convertMap(orderList, HardOrderEntity::getId));
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<HardAfterSaleVo> scopePageList(Page page, HardAfterSaleDto dto) {
|
||||
Page<HardAfterSaleVo> list = baseMapper.scopePageJoinList(page, dto, new DataScope());
|
||||
if (ObjectUtil.isNotEmpty(list.getRecords())) {
|
||||
// 用户
|
||||
List<Long> userIds = list.getRecords().stream().map(HardAfterSaleVo::getUserId).filter(ObjectUtil::isNotEmpty).distinct().toList();
|
||||
|
||||
+53
-5
@@ -10,7 +10,6 @@ import com.bsd.pjcloud.admin.api.entity.SysUser;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteDeptService;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteUserService;
|
||||
import com.bsd.pjcloud.admin.api.utils.DataUtil;
|
||||
import com.bsd.pjcloud.canteen.api.feign.RemoteCanteenSpuService;
|
||||
import com.bsd.pjcloud.canteen.api.feign.RemoteOnlineCanteenSpuService;
|
||||
import com.bsd.pjcloud.canteen.dto.CanteenSpuUpdateStockReqDTO;
|
||||
import com.bsd.pjcloud.common.core.constant.enums.YesNoEnum;
|
||||
@@ -40,7 +39,6 @@ import com.bsd.pjcloud.hard.service.HardCarService;
|
||||
import com.bsd.pjcloud.hard.service.HardManagerService;
|
||||
import com.bsd.pjcloud.hard.service.HardOrderService;
|
||||
import com.bsd.pjcloud.supermarket.api.feign.RemoteSupermarketSpuService;
|
||||
import com.bsd.pjcloud.supermarket.api.feign.RemoteSupermarketUnitSkuService;
|
||||
import com.bsd.pjcloud.supermarket.dto.SupermarketSpuUpdateStockReqDTO;
|
||||
import com.bsd.pjcloud.wallet.api.constant.WalletBizEnum;
|
||||
import com.bsd.pjcloud.wallet.api.constant.WalletCodeBizEnum;
|
||||
@@ -79,7 +77,7 @@ import java.util.Optional;
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class HardwareOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrderEntity> implements HardOrderService {
|
||||
public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrderEntity> implements HardOrderService {
|
||||
|
||||
static private final String TAG = "订单";
|
||||
|
||||
@@ -101,7 +99,57 @@ public class HardwareOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardO
|
||||
private final HardManagerMapper hardManagerMapper;
|
||||
|
||||
@Override
|
||||
public Page<HardOrderVo> pageJoin(Page page, HardOrderDto dto) {
|
||||
public Page<HardOrderVo> pagejoin(Page page, HardOrderDto dto) {
|
||||
Page<HardOrderVo> list = baseMapper.pageJoin(page, dto);
|
||||
if (ObjectUtil.isNotEmpty(list.getRecords())) {
|
||||
// 用户
|
||||
List<Long> userIds = list.getRecords().stream().map(HardOrderVo::getUserId).filter(ObjectUtil::isNotEmpty).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(userIds)) {
|
||||
R<List<SysUser>> userList = userService.getUserById(new ArrayList<>(userIds));
|
||||
if (ObjectUtil.isNotEmpty(userList.getData())) {
|
||||
DataUtil.convertUserList(list.getRecords(), CollectionUtils.convertMap(userList.getData(), SysUser::getUserId));
|
||||
}
|
||||
}
|
||||
// 部门
|
||||
List<Long> deptIds = list.getRecords().stream().map(HardOrderVo::getDeptId).filter(ObjectUtil::isNotEmpty).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(deptIds)) {
|
||||
R<Map<Long, SysDept>> deptList = deptService.getDeptByDeptIds(deptIds);
|
||||
if (ObjectUtil.isNotEmpty(deptList.getData())) {
|
||||
DataUtil.convertDeptList(list.getRecords(), deptList.getData());
|
||||
}
|
||||
}
|
||||
// 商户
|
||||
List<Long> mchIds = list.getRecords().stream().map(HardOrderVo::getMerchantId).filter(ObjectUtil::isNotEmpty).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(mchIds)) {
|
||||
R<List<MchManageVo>> mchList = remoteMchService.getByIds(mchIds);
|
||||
if (ObjectUtil.isNotEmpty(mchList.getData())) {
|
||||
WalletDataUtil.convertMchList(list.getRecords(), CollectionUtils.convertMap(mchList.getData(), MchManageVo::getId));
|
||||
}
|
||||
}
|
||||
// 设备
|
||||
List<Long> hardIds = list.getRecords().stream().map(HardOrderVo::getHardId).filter(ObjectUtil::isNotEmpty).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(mchIds)) {
|
||||
HardManagerDto hardManagerDto = new HardManagerDto();
|
||||
hardManagerDto.setIds(hardIds);
|
||||
List<HardManagerEntity> hardList = hardManagerMapper.list(hardManagerDto);
|
||||
if (ObjectUtil.isNotEmpty(hardList)) {
|
||||
HardUtil.convertHardList(list.getRecords(), CollectionUtils.convertMap(hardList, HardManagerEntity::getId));
|
||||
}
|
||||
}
|
||||
// 购物车
|
||||
if (dto.getIsFindCarList()) {
|
||||
for (HardOrderVo v : list.getRecords()) {
|
||||
List<HardCarEntity> carList = hardCarService.getByParentCarId(v.getParentCarId());
|
||||
List<HardCarVo> carVoList = BeanUtils.toBean(carList, HardCarVo.class);
|
||||
v.setCarList(carVoList);
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<HardOrderVo> scopePageList(Page page, HardOrderDto dto) {
|
||||
Page<HardOrderVo> list = baseMapper.scopePageList(page, dto);
|
||||
if (ObjectUtil.isNotEmpty(list.getRecords())) {
|
||||
// 用户
|
||||
@@ -503,7 +551,7 @@ public class HardwareOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardO
|
||||
|
||||
/* ************************************* end 支付相关 end ************************************* */
|
||||
|
||||
private HardwareOrderServiceImpl getSelf() {
|
||||
private HardOrderServiceImpl getSelf() {
|
||||
return SpringUtil.getBean(getClass());
|
||||
}
|
||||
}
|
||||
+50
-3
@@ -2,8 +2,7 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.bsd.pjcloud.hard.mapper.order.HardAfterSaleMapper">
|
||||
|
||||
<resultMap id="hardAfterSaleMap" type="com.bsd.pjcloud.hard.api.entity.order.HardAfterSaleEntity">
|
||||
<resultMap id="hardAfterSaleMap" type="com.bsd.pjcloud.hard.api.entity.order.HardAfterSaleEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="no" column="no"/>
|
||||
<result property="type" column="type"/>
|
||||
@@ -28,5 +27,53 @@
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
</resultMap>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectA">
|
||||
select a.id,
|
||||
a.no,
|
||||
a.type,
|
||||
a.status,
|
||||
a.way,
|
||||
a.user_id,
|
||||
a.apply_reason,
|
||||
a.apply_description,
|
||||
a.apply_pic_urls,
|
||||
a.order_id,
|
||||
a.order_no,
|
||||
a.audit_time,
|
||||
a.audit_user_id,
|
||||
a.audit_reason,
|
||||
a.refund_price,
|
||||
a.pay_refund_id,
|
||||
a.refund_time,
|
||||
a.delivery_time,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.del_flag,
|
||||
a.tenant_id
|
||||
</sql>
|
||||
|
||||
<sql id="whereA">
|
||||
a.del_flag = '0'
|
||||
<if test="dto.id != null">
|
||||
and a.id = #{dto.id}
|
||||
</if>
|
||||
<if test="dto.orderId != null">
|
||||
and a.order_id = #{dto.orderId}
|
||||
</if>
|
||||
<if test="dto.createTimeList != null and dto.createTimeList.length == 2">
|
||||
and a.create_time between #{dto.createTimeList[0]} and #{pa.createTimeList[1]}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="scopePageJoinList" resultType="com.bsd.pjcloud.hard.api.vo.order.HardAfterSaleVo">
|
||||
<include refid="selectA"/>
|
||||
from hard_after_sale a
|
||||
<where>
|
||||
<include refid="whereA"/>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in new issue
Block a user