feat:售后页面
This commit is contained in:
1 parent
2b25aafc15
commit
964b9e87f6
15 files changed
+126
-12
No files matched your search
+1
-1
@@ -21,7 +21,7 @@ public enum HardTypeEnum {
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
public static HardTypeEnum valueOfByType(Integer type) {
|
||||
public static HardTypeEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
|
||||
+2
@@ -13,4 +13,6 @@ public class HardInvoiceVo extends HardInvoiceEntity implements BaseDeptInterfac
|
||||
private Long merchantId;
|
||||
|
||||
private String merchantName;
|
||||
|
||||
private String logoPic;
|
||||
}
|
||||
+2
@@ -13,4 +13,6 @@ public class HardManagerVo extends HardManagerEntity implements BaseDeptInterfac
|
||||
|
||||
private String merchantName;
|
||||
|
||||
private String logoPic;
|
||||
|
||||
}
|
||||
+6
@@ -22,8 +22,14 @@ public class HardOrderVo extends HardOrderEntity implements BaseUserInterface, B
|
||||
*/
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 商户相关
|
||||
*/
|
||||
|
||||
private String merchantName;
|
||||
|
||||
private String logoPic;
|
||||
|
||||
/**
|
||||
* 设备相关
|
||||
*/
|
||||
|
||||
+10
@@ -14,6 +14,8 @@ import com.bsd.pjcloud.hard.api.dto.order.HardAfterSaleDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.HardDisagreeDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardAfterSaleEntity;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardAfterSaleLogEntity;
|
||||
import com.bsd.pjcloud.hard.api.vo.order.HardAfterSaleLogVo;
|
||||
import com.bsd.pjcloud.hard.api.vo.order.HardAfterSaleVo;
|
||||
import com.bsd.pjcloud.hard.service.HardAfterSaleService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
@@ -48,6 +50,14 @@ public class HardAfterSaleController {
|
||||
return R.ok(hardAfterSaleService.getHistory(id));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/detail-by-order-id")
|
||||
@Operation(summary = "查询售后进度")
|
||||
public R<HardAfterSaleVo> getDetailByOrderId(@RequestParam Long orderId) {
|
||||
HardAfterSaleDto dto = new HardAfterSaleDto();
|
||||
dto.setOrderId(orderId);
|
||||
return R.ok(hardAfterSaleService.join(dto));
|
||||
}
|
||||
|
||||
@PutMapping("/agree")
|
||||
@Operation(summary = "同意售后")
|
||||
@Idempotent(expireTime = 10, info = "正在处理中,请勿重复操作")
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ public class HardOrderController {
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardwareOrder_view')")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(hardwareOrderService.getById(id));
|
||||
return R.ok(hardwareOrderService.join(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "新增订单表", description = "新增订单表")
|
||||
|
||||
+9
-2
@@ -11,10 +11,17 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
@Mapper
|
||||
public interface HardAfterSaleMapper extends PjcloudBaseMapper<HardAfterSaleEntity> {
|
||||
|
||||
|
||||
default Page<HardAfterSaleVo> pageJoin(Page page, HardAfterSaleDto dto){
|
||||
default Page<HardAfterSaleVo> pageJoin(Page page, HardAfterSaleDto dto) {
|
||||
MPJLambdaWrapper<HardAfterSaleEntity> wrapper = new MPJLambdaWrapper<HardAfterSaleEntity>()
|
||||
.selectAll(HardAfterSaleEntity.class);
|
||||
return selectJoinPage(page, HardAfterSaleVo.class, wrapper);
|
||||
}
|
||||
|
||||
default HardAfterSaleVo join(HardAfterSaleDto dto) {
|
||||
MPJLambdaWrapper<HardAfterSaleEntity> wrapper = new MPJLambdaWrapper<HardAfterSaleEntity>()
|
||||
.selectAll(HardAfterSaleEntity.class)
|
||||
.eqIfExists(HardAfterSaleEntity::getId, dto.getId())
|
||||
.eqIfExists(HardAfterSaleEntity::getOrderId, dto.getOrderId());
|
||||
return selectJoinOne(HardAfterSaleVo.class, wrapper);
|
||||
}
|
||||
}
|
||||
+5
-1
@@ -28,7 +28,11 @@ public interface HardOrderMapper extends PjcloudBaseMapper<HardOrderEntity> {
|
||||
|
||||
default HardOrderVo join(HardOrderDto dto) {
|
||||
MPJLambdaWrapper<HardOrderEntity> wrapper = new MPJLambdaWrapper<HardOrderEntity>()
|
||||
.selectAll(HardOrderEntity.class);
|
||||
.selectAll(HardOrderEntity.class)
|
||||
.selectAs(HardManagerEntity::getName, HardOrderVo::getHardName)
|
||||
.selectAs(HardManagerEntity::getType, HardOrderVo::getHardType)
|
||||
.leftJoin(HardManagerEntity.class, HardManagerEntity::getId, HardOrderEntity::getHardId)
|
||||
.eqIfExists(HardOrderEntity::getId, dto.getId());
|
||||
return selectJoinOne(HardOrderVo.class, wrapper);
|
||||
}
|
||||
}
|
||||
+2
@@ -14,6 +14,8 @@ public interface HardAfterSaleService extends IService<HardAfterSaleEntity> {
|
||||
|
||||
Page<HardAfterSaleVo> pageJoin(Page page, HardAfterSaleDto dto);
|
||||
|
||||
HardAfterSaleVo join(HardAfterSaleDto dto);
|
||||
|
||||
/**
|
||||
* 获取售后进度
|
||||
*
|
||||
|
||||
+6
@@ -2,6 +2,7 @@ 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;
|
||||
@@ -46,6 +47,11 @@ public interface HardOrderService extends IService<HardOrderEntity> {
|
||||
*/
|
||||
void cancelCode(HardOrderEntity order);
|
||||
|
||||
/**
|
||||
* 扣件库存
|
||||
*/
|
||||
void fastenerInventory(HardOrderEntity order);
|
||||
|
||||
/**
|
||||
* 核销硬件二维码
|
||||
*
|
||||
|
||||
+24
-1
@@ -5,6 +5,7 @@ import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.admin.api.dto.UserInfo;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysDept;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysUser;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteDeptService;
|
||||
@@ -85,6 +86,28 @@ public class HardAfterSaleServiceImpl extends ServiceImpl<HardAfterSaleMapper, H
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HardAfterSaleVo join(HardAfterSaleDto dto) {
|
||||
HardAfterSaleVo detail = baseMapper.join(dto);
|
||||
if (ObjectUtil.isNotEmpty(detail)) {
|
||||
// 用户
|
||||
if (ObjectUtil.isNotEmpty(detail.getUserId())) {
|
||||
R<UserInfo> user = userService.getByUserId(detail.getUserId());
|
||||
if (ObjectUtil.isNotEmpty(user.getData())) {
|
||||
DataUtil.convertUser(detail, user.getData().getSysUser());
|
||||
}
|
||||
}
|
||||
// 部门
|
||||
if (ObjectUtil.isNotEmpty(detail.getDeptId())) {
|
||||
R<SysDept> dept = deptService.getDeptByDeptId(detail.getDeptId());
|
||||
if (ObjectUtil.isNotEmpty(dept.getData())) {
|
||||
DataUtil.convertDept(detail, dept.getData());
|
||||
}
|
||||
}
|
||||
}
|
||||
return detail;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HardAfterSaleLogEntity> getHistory(Long id) {
|
||||
return hardAfterSaleLogMapper.selectList(new LambdaQueryWrapper<HardAfterSaleLogEntity>()
|
||||
@@ -161,7 +184,7 @@ public class HardAfterSaleServiceImpl extends ServiceImpl<HardAfterSaleMapper, H
|
||||
.build();
|
||||
baseMapper.updateById(updateRefundObj);
|
||||
// 记录售后日志
|
||||
HardAfterSaleLogEntity saveLogObj = HardAfterSaleLogEntity.builder()
|
||||
HardAfterSaleLogEntity saveLogObj = HardAfterSaleLogEntity.builder()
|
||||
.afterSaleId(afterSale.getId())
|
||||
.userId(userId)
|
||||
.operateType(HardAfterSaleOperateTypeEnum.ADMIN_DISAGREE_APPLY.getType())
|
||||
|
||||
+47
-6
@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.admin.api.dto.UserInfo;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysDept;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysUser;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteDeptService;
|
||||
@@ -25,7 +26,6 @@ import com.bsd.pjcloud.hard.api.entity.HardManagerEntity;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardCarEntity;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardOrderEntity;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardParentCarEntity;
|
||||
import com.bsd.pjcloud.hard.api.vo.HardManagerVo;
|
||||
import com.bsd.pjcloud.hard.api.vo.order.HardOrderVo;
|
||||
import com.bsd.pjcloud.hard.mapper.order.HardOrderMapper;
|
||||
import com.bsd.pjcloud.hard.service.HardCarService;
|
||||
@@ -40,7 +40,6 @@ import com.bsd.pjcloud.wallet.api.feign.*;
|
||||
import com.bsd.pjcloud.wallet.api.utils.MchDataUtil;
|
||||
import com.bsd.pjcloud.wallet.api.vo.MchManageVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletSettingVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeApplyVo;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -88,7 +87,7 @@ public class HardwareOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardO
|
||||
Page<HardOrderVo> list = baseMapper.pageJoin(page, dto);
|
||||
if (ObjectUtil.isNotEmpty(list.getRecords())) {
|
||||
// 用户
|
||||
List<Long> userIds = list.getRecords().stream().map(HardOrderVo::getUserId).distinct().toList();
|
||||
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())) {
|
||||
@@ -96,7 +95,7 @@ public class HardwareOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardO
|
||||
}
|
||||
}
|
||||
// 部门
|
||||
List<Long> deptIds = list.getRecords().stream().map(HardOrderVo::getDeptId).distinct().toList();
|
||||
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())) {
|
||||
@@ -104,7 +103,7 @@ public class HardwareOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardO
|
||||
}
|
||||
}
|
||||
// 商户
|
||||
List<Long> mchIds = list.getRecords().stream().map(HardOrderVo::getMerchantId).distinct().toList();
|
||||
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())) {
|
||||
@@ -119,7 +118,31 @@ public class HardwareOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardO
|
||||
public HardOrderVo join(Long id) {
|
||||
HardOrderDto dto = new HardOrderDto();
|
||||
dto.setId(id);
|
||||
return baseMapper.join(dto);
|
||||
HardOrderVo detail = baseMapper.join(dto);
|
||||
if (ObjectUtil.isNotEmpty(detail)) {
|
||||
// 用户
|
||||
if (ObjectUtil.isNotEmpty(detail.getUserId())) {
|
||||
R<UserInfo> user = userService.getByUserId(detail.getUserId());
|
||||
if (ObjectUtil.isNotEmpty(user.getData())) {
|
||||
DataUtil.convertUser(detail, user.getData().getSysUser());
|
||||
}
|
||||
}
|
||||
// 部门
|
||||
if (ObjectUtil.isNotEmpty(detail.getDeptId())) {
|
||||
R<SysDept> dept = deptService.getDeptByDeptId(detail.getDeptId());
|
||||
if (ObjectUtil.isNotEmpty(dept.getData())) {
|
||||
DataUtil.convertDept(detail, dept.getData());
|
||||
}
|
||||
}
|
||||
// 商户
|
||||
if (ObjectUtil.isNotEmpty(detail.getMerchantId())) {
|
||||
R<MchManageVo> mch = remoteMchService.getById(detail.getMerchantId());
|
||||
if (ObjectUtil.isNotEmpty(mch.getData())) {
|
||||
MchDataUtil.convertMch(detail, mch.getData());
|
||||
}
|
||||
}
|
||||
}
|
||||
return detail;
|
||||
}
|
||||
|
||||
|
||||
@@ -274,6 +297,7 @@ public class HardwareOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardO
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean handCancelCode(HandCancelCodeDto dto) {
|
||||
// 查询订单
|
||||
HardOrderEntity order = baseMapper.selectById(dto.getOrderId());
|
||||
@@ -307,6 +331,23 @@ public class HardwareOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardO
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fastenerInventory(HardOrderEntity order) {
|
||||
HardTypeEnum hardTypeEnum = HardTypeEnum.valueOfByType(order.getSysType());
|
||||
HardOrderTypeEnum orderTypeEnum = HardOrderTypeEnum.valueOfByType(order.getOrderType());
|
||||
if (!ObjectUtil.isAllNotEmpty(hardTypeEnum, orderTypeEnum)) return;
|
||||
// 食堂预定核销
|
||||
if (ObjectUtil.equals(hardTypeEnum, HardTypeEnum.CANTEEN) && ObjectUtil.equals(orderTypeEnum, HardOrderTypeEnum.RESERVE)) {
|
||||
|
||||
return;
|
||||
}
|
||||
// 超市预定核销
|
||||
if (ObjectUtil.equals(hardTypeEnum, HardTypeEnum.SUPERMARKET) && ObjectUtil.equals(orderTypeEnum, HardOrderTypeEnum.RESERVE)) {
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 二维码类型的订单是否被核销
|
||||
private boolean validateCodeIsCancel(HardOrderTypeEnum orderType, Long orderSourceTypeId) {
|
||||
Boolean flag = switch (orderType) {
|
||||
|
||||
+1
@@ -21,6 +21,7 @@ public class MchDataUtil {
|
||||
public <T extends BaseMchInterface> T convertMch(T v, MchManageVo vo) {
|
||||
if (ObjectUtil.isEmpty(vo)) return v;
|
||||
v.setMerchantName(vo.getName());
|
||||
v.setLogoPic(vo.getLogoPic());
|
||||
return v;
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -27,4 +27,6 @@ public class WalletActiveVo extends WalletActiveEntity implements BaseUserInterf
|
||||
* 商户相关
|
||||
*/
|
||||
private String merchantName;
|
||||
|
||||
private String logoPic;
|
||||
}
|
||||
+8
@@ -16,4 +16,12 @@ public interface BaseMchInterface {
|
||||
|
||||
void setMerchantName(String dchName);
|
||||
|
||||
/**
|
||||
* 商户logo
|
||||
*/
|
||||
String getLogoPic();
|
||||
|
||||
void setLogoPic(String logoPic);
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user