更新代码

This commit is contained in:
xiao-fajia 2024-09-24 20:54:24 +08:00
parent 1097aba239
commit 33d9ba5ecc
30 changed files with 378 additions and 29 deletions

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.app.company.admin;
package cn.iocoder.yudao.module.app.company.controller;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.company.entity.Company;
@ -24,7 +24,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
* @date 14:04 2024/9/23
**/
@RestController
@RequestMapping("/api/base/company")
@RequestMapping("/userClient/base/company")
@Tag(name = "API - BASE 企业管理")
@Validated
public class CompanyAPI {
@ -50,4 +50,16 @@ public class CompanyAPI {
return success(companyService.getCompanyPageByServer(company, page));
}
/**
* 查企业能提供的业务
*
* @author 小李
* @date 10:21 2024/9/24
* @param id 企业ID
**/
@GetMapping("/get")
@Operation(summary = "查企业能提供的业务")
public CommonResult<?> getCompanyServerById(@RequestParam("id") String id){
return success(companyService.getCompanyServerById(id));
}
}

View File

@ -0,0 +1,19 @@
package cn.iocoder.yudao.module.app.company.vo;
import cn.iocoder.yudao.module.company.entity.Company;
import cn.iocoder.yudao.module.system.api.service.dto.ServicePackageDto;
import lombok.Data;
import java.util.List;
/**
* 企业和企业的服务
*
* @author 小李
* @date 10:22 2024/9/24
**/
@Data
public class CompanyToServerVO extends Company {
private List<ServicePackageDto> servicePackages;
}

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.app.conf.admin;
package cn.iocoder.yudao.module.app.conf.controller;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.conf.entity.BaseType;
@ -20,7 +20,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
* @date 14:21 2024/9/23
**/
@RestController
@RequestMapping("/api/base/type")
@RequestMapping("/userClient/base/type")
public class BaseTypeAPI {
@Resource

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.company.service;
import cn.iocoder.yudao.module.app.company.vo.CompanyToServerVO;
import cn.iocoder.yudao.module.company.entity.Company;
import cn.iocoder.yudao.module.company.vo.CompanyReqVO;
import cn.iocoder.yudao.module.company.vo.CompanyRespVO;
@ -67,4 +68,13 @@ public interface CompanyService extends IService<Company> {
* @param company 企业对象主要是serverCodes
**/
IPage<Company> getCompanyPageByServer(Company company, Page<Company> page);
/**
* 查企业能提供的业务
*
* @author 小李
* @date 10:21 2024/9/24
* @param id 企业ID
**/
CompanyToServerVO getCompanyServerById(String id);
}

View File

@ -1,15 +1,19 @@
package cn.iocoder.yudao.module.company.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
import cn.iocoder.yudao.framework.common.exception.ServiceException;
import cn.iocoder.yudao.module.app.company.vo.CompanyToServerVO;
import cn.iocoder.yudao.module.company.entity.Company;
import cn.iocoder.yudao.module.company.vo.CompanyRespVO;
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
import cn.iocoder.yudao.module.system.api.permission.RoleApi;
import cn.iocoder.yudao.module.system.api.service.ServicePackageApi;
import cn.iocoder.yudao.module.system.api.service.dto.ServicePackageDto;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
@ -26,10 +30,7 @@ import cn.iocoder.yudao.module.company.service.CompanyService;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.*;
import static cn.iocoder.yudao.framework.common.config.CommonStr.USER_TYPE_STAFF;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
@ -53,6 +54,9 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
private PermissionApi permissionApi;
@Resource
private DeptApi deptApi;
@Resource
@Lazy
private ServicePackageApi servicePackageApi;
/**
@ -182,4 +186,23 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
public IPage<Company> getCompanyPageByServer(Company company, Page<Company> page){
return baseMapper.getCompanyPageByServer(company, page);
}
/**
* 查企业能提供的业务
*
* @author 小李
* @date 10:21 2024/9/24
* @param id 企业ID
**/
@Override
public CompanyToServerVO getCompanyServerById(String id){
// 查企业信息
Company company = baseMapper.selectById(id);
CompanyToServerVO result = BeanUtil.toBean(company, CompanyToServerVO.class);
// 查服务
List<String> services = Arrays.asList(company.getServiceCodes().split(","));
List<ServicePackageDto> servicePackageByIds = servicePackageApi.getServicePackageByIds(services);
Optional.ofNullable(servicePackageByIds).ifPresent(result::setServicePackages);
return result;
}
}

View File

@ -146,6 +146,7 @@ public class BaseTypeServiceImpl extends ServiceImpl<BaseTypeMapper, BaseType> i
* @date 14:29 2024/9/23
* @param baseType 查询条件
**/
@Deprecated // 写错了先弃用
@Override
public List<BaseType> getListByTypeAndCorpId(BaseType baseType){
return baseTypeMapper.getListByTypeAndCorpId(baseType);

View File

@ -113,5 +113,11 @@ public interface RepairOrderInfoService extends IService<RepairOrderInfo> {
*/
Map<String,Object> payTransactions(String orderId);
/**
* 获得已经评价的订单
*
* @author 小李
* @date 15:50 2024/9/24
**/
IPage<RepairOrderInfo> getAppraisePage(Page<RepairOrderInfo> page);
}

View File

@ -4,6 +4,8 @@ import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.company.service.CompanyService;
import cn.iocoder.yudao.module.custom.service.CustomerBalanceService;
import cn.iocoder.yudao.module.order.entity.RepairOrderInfo;
import cn.iocoder.yudao.module.order.service.RepairOrderInfoService;
@ -28,7 +30,10 @@ import javax.annotation.Resource;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.common.BaseConstants.GENERAL_YES;
import static cn.iocoder.yudao.common.BaseConstants.ORDER_HYCZ;
@ -141,6 +146,8 @@ public class RepairOrderInfoServiceImpl extends ServiceImpl<RepairOrderInfoMappe
**/
@Override
public IPage<RepairOrderInfoRespVO> getOrderPageByStatus(RepairOrderInfoRespVO respVO, Page<RepairOrderInfo> page){
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
Optional.ofNullable(loginUserId).ifPresent(respVO::setUserId);
return baseMapper.getOrderPageByStatus(respVO, page);
}
@ -206,4 +213,19 @@ public class RepairOrderInfoServiceImpl extends ServiceImpl<RepairOrderInfoMappe
return JSONObject.parseObject(resStr, new TypeReference<Map<String, Object>>(){});
}
/**
* 获得已经评价的订单
*
* @author 小李
* @date 15:50 2024/9/24
**/
@Override
public IPage<RepairOrderInfo> getAppraisePage(Page<RepairOrderInfo> page){
// 查订单
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
return baseMapper.selectPage(page, new LambdaQueryWrapper<RepairOrderInfo>().and(item -> {
item.eq(RepairOrderInfo::getUserId, loginUserId)
.isNotNull(RepairOrderInfo::getCommentDesc);
}));
}
}

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.order.vo;
import cn.iocoder.yudao.module.company.entity.Company;
import cn.iocoder.yudao.module.order.entity.RepairOrderInfo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import io.swagger.v3.oas.annotations.media.Schema;
@ -13,8 +14,6 @@ public class RepairOrderInfoRespVO extends RepairOrderInfo {
/** 订单状态(工单的状态) */
private String status;
//订单描述
private String description;
}

View File

@ -43,7 +43,7 @@
and dbt.type = #{map.type}
</if>
<if test="map.corpId != null and map.corpId != ''">
and dbt.corp_id = #{map.corpId}
and find_in_set(#{map.corpId}, dbt.corp_id) > 0
</if>
</select>
</mapper>

View File

@ -35,7 +35,7 @@
<resultMap id="QueryResultMap" type="cn.iocoder.yudao.module.company.vo.CompanyRespVO">
<id property="id" column="c_id" jdbcType="VARCHAR"/>
<association property="userDTO" javaType="cn.iocoder.yudao.module.system.api.user.dto.UserDTO">
<id property="id" column="u_id" jdbcType="BIGINT" />
<id property="id" column="u_id" jdbcType="BIGINT"/>
</association>
</resultMap>
<select id="getCompanyAndManager" resultMap="QueryResultMap">
@ -46,8 +46,9 @@
</select>
<select id="getCompanyPageByServer" resultType="cn.iocoder.yudao.module.company.entity.Company">
select *
from base_company
where FIND_IN_SET(#{map.serviceCodes}, service_codes) > 0
select bc.*
from base_company bc
left join system_tenant st on bc.tenant_id = st.id
where FIND_IN_SET(#{map.serviceCodes}, bc.service_codes) > 0
</select>
</mapper>

View File

@ -44,10 +44,10 @@
<if test="map.status != null and map.status != ''">
<choose>
<when test="map.status != '00'">
drt.tickets_work_status = #{map.status}
and drt.tickets_work_status = #{map.status}
</when>
<when test="map.status == '00'">
roi.comment_time is null
and roi.comment_time is null and roi.order_status = '1'
</when>
</choose>
</if>

View File

@ -1,16 +1,20 @@
package cn.iocoder.yudao.module.app.booking.admin;
package cn.iocoder.yudao.module.app.booking.controller;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.booking.entity.DlRepairBooking;
import cn.iocoder.yudao.module.booking.service.DlRepairBookingService;
import cn.iocoder.yudao.module.booking.vo.DlRepairBookingReqVO;
import cn.iocoder.yudao.module.booking.vo.DlRepairBookingRespVO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
/**
@ -20,7 +24,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
* @date 11:04 2024/9/23
**/
@RestController
@RequestMapping("/api/repair/booking")
@RequestMapping("/userClient/repair/booking")
public class BookingAPI {
/**
@ -88,4 +92,17 @@ public class BookingAPI {
public CommonResult<?> getBookingById(@RequestParam("id") String id){
return success(dlRepairBookingService.getBookingById(id));
}
/**
* 维修预约表 映射
*
* @author 小李
* @date 13:32 2024/9/24
* @param ids 预约记录ID
**/
@GetMapping("/map")
@Operation(summary = "维修预约表 映射")
public CommonResult<?> getBookingMap(@RequestParam("ids") List<String> ids){
return success(dlRepairBookingService.getBookingMap(ids));
}
}

View File

@ -0,0 +1,23 @@
package cn.iocoder.yudao.module.app.booking.vo;
import cn.iocoder.yudao.module.booking.entity.DlRepairBooking;
import cn.iocoder.yudao.module.company.entity.Company;
import cn.iocoder.yudao.module.system.api.service.dto.ServicePackageDto;
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO;
import lombok.Data;
/**
* 预约信息查询
*
* @author 小李
* @date 13:25 2024/9/24
**/
@Data
public class BookingQueryVO extends DlRepairBooking {
/** 企业信息 */
private Company company;
/** 服务信息 */
private ServicePackageDto servicePackage;
}

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.app.order.admin;
package cn.iocoder.yudao.module.app.order.controller;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.order.entity.RepairOrderInfo;
@ -20,7 +20,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
* @date 17:20 2024/9/23
**/
@RestController
@RequestMapping("/api/repair/order")
@RequestMapping("/userClient/repair/order")
public class RepairOrderAPI {
@Resource
@ -71,4 +71,19 @@ public class RepairOrderAPI {
repairOrderInfoService.appraiseOrder(respVO);
return CommonResult.ok();
}
/**
* 获得已经评价的订单
*
* @author 小李
* @date 15:50 2024/9/24
* @param pageNo 页码
* @param pageSize 条数
**/
@GetMapping("/getAppraise")
@Operation(summary = "获得已经评价的订单")
public CommonResult<?> getAppraisePage(@RequestParam(value = "pageNo", defaultValue = "1")Integer pageNo,@RequestParam(value = "pageSize",defaultValue = "1")Integer pageSize){
Page<RepairOrderInfo> page = new Page<>(pageNo, pageSize);
return success(repairOrderInfoService.getAppraisePage(page));
}
}

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.app.tickets.admin;
package cn.iocoder.yudao.module.app.tickets.controller;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.tickets.service.DlRepairTicketsService;
@ -18,7 +18,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
* @date 18:21 2024/9/13
**/
@RestController
@RequestMapping("/api/repair/tickets")
@RequestMapping("/userClient/repair/tickets")
public class TicketsAPI {
/**

View File

@ -5,6 +5,7 @@ import cn.iocoder.yudao.module.booking.entity.DlRepairBooking;
import cn.iocoder.yudao.module.booking.service.DlRepairBookingService;
import cn.iocoder.yudao.module.booking.vo.DlRepairBookingReqVO;
import cn.iocoder.yudao.module.booking.vo.DlRepairBookingRespVO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.web.bind.annotation.*;
@ -87,5 +88,13 @@ public class DlRepairBookingController {
public CommonResult<?> getBookingById(@RequestParam("id") String id){
return success(dlRepairBookingService.getBookingById(id));
}
@GetMapping("/list")
@Operation(summary = "维修预约表 不分页")
public CommonResult<?> getBookingList(@RequestParam("userId")Integer userId){
return success(dlRepairBookingService.list(new LambdaQueryWrapper<DlRepairBooking>()
.eq(DlRepairBooking::getUserId,userId)
.orderByDesc(DlRepairBooking::getBookingTime)));
}
}

View File

@ -63,8 +63,8 @@ public class DlRepairBooking extends TenantBaseDO {
/**
* 预约时间
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern="yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern="yyyy-MM-dd hh:mm:ss")
private Date bookingTime;
/**

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.booking.service;
import cn.iocoder.yudao.module.app.booking.vo.BookingQueryVO;
import cn.iocoder.yudao.module.booking.entity.DlRepairBooking;
import cn.iocoder.yudao.module.booking.vo.DlRepairBookingReqVO;
import cn.iocoder.yudao.module.booking.vo.DlRepairBookingRespVO;
@ -7,6 +8,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* 针对表dl_repair_booking(维修预约表)的数据库操作Service
*
@ -50,4 +53,13 @@ public interface DlRepairBookingService extends IService<DlRepairBooking> {
* @param id id
**/
DlRepairBooking getBookingById(String id);
/**
* 维修预约表 映射
*
* @author 小李
* @date 13:32 2024/9/24
* @param ids 预约记录ID
**/
List<BookingQueryVO> getBookingMap(List<String> ids);
}

View File

@ -1,16 +1,29 @@
package cn.iocoder.yudao.module.booking.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.app.booking.vo.BookingQueryVO;
import cn.iocoder.yudao.module.booking.entity.DlRepairBooking;
import cn.iocoder.yudao.module.booking.mapper.DlRepairBookingMapper;
import cn.iocoder.yudao.module.booking.service.DlRepairBookingService;
import cn.iocoder.yudao.module.booking.vo.DlRepairBookingReqVO;
import cn.iocoder.yudao.module.booking.vo.DlRepairBookingRespVO;
import cn.iocoder.yudao.module.company.entity.Company;
import cn.iocoder.yudao.module.company.service.CompanyService;
import cn.iocoder.yudao.module.system.api.service.ServicePackageApi;
import cn.iocoder.yudao.module.system.api.service.dto.ServicePackageDto;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0;
/**
@ -23,6 +36,14 @@ import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionU
public class DlRepairBookingServiceImpl extends ServiceImpl<DlRepairBookingMapper, DlRepairBooking>
implements DlRepairBookingService {
@Resource
@Lazy
private CompanyService companyService;
@Resource
@Lazy
private ServicePackageApi servicePackageApi;
/**
* 维修预约表 新增修改
*
@ -56,6 +77,8 @@ public class DlRepairBookingServiceImpl extends ServiceImpl<DlRepairBookingMappe
**/
@Override
public IPage<DlRepairBooking> getBookingPage(DlRepairBookingReqVO repairBookingReqVO, Page<DlRepairBooking> page){
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
Optional.ofNullable(loginUserId).ifPresent(repairBookingReqVO::setUserId);
return baseMapper.getBookingPage(repairBookingReqVO, page);
}
@ -70,6 +93,32 @@ public class DlRepairBookingServiceImpl extends ServiceImpl<DlRepairBookingMappe
public DlRepairBooking getBookingById(String id){
return baseMapper.selectById(id);
}
/**
* 维修预约表 映射
*
* @author 小李
* @date 13:32 2024/9/24
* @param ids 预约记录ID
**/
@Override
public List<BookingQueryVO> getBookingMap(List<String> ids){
// 查预约记录
List<DlRepairBooking> dlRepairBookings = baseMapper.selectBatchIds(ids);
List<BookingQueryVO> result = dlRepairBookings.stream().map(item -> BeanUtil.toBean(item, BookingQueryVO.class)).collect(Collectors.toList());
// 查企业
Set<String> companyIds = result.stream().map(BookingQueryVO::getCorpId).collect(Collectors.toSet());
List<Company> companies = companyService.list(new LambdaQueryWrapper<Company>().in(Company::getId, companyIds));
// 查服务
Set<String> serviceIds = result.stream().map(BookingQueryVO::getProjectId).collect(Collectors.toSet());
List<ServicePackageDto> servicePackageByIds = servicePackageApi.getServicePackageByIds(new ArrayList<>(serviceIds));
// 映射
result.forEach(item -> {
companies.stream().filter(i -> i.getId().equals(item.getCorpId())).findFirst().ifPresent(item::setCompany);
servicePackageByIds.stream().filter(i -> i.getId().equals(item.getProjectId())).findFirst().ifPresent(item::setServicePackage);
});
return result.stream().sorted(Comparator.comparing(BookingQueryVO::getCreateTime).reversed()).collect(Collectors.toList());
}
}

View File

@ -1,6 +1,9 @@
package cn.iocoder.yudao.module.booking.vo;
import cn.iocoder.yudao.module.booking.entity.DlRepairBooking;
import cn.iocoder.yudao.module.company.entity.Company;
import cn.iocoder.yudao.module.system.api.service.dto.ServicePackageDto;
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

View File

@ -5,6 +5,8 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.common.RepairErrorCodeConstants;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.booking.entity.DlRepairBooking;
import cn.iocoder.yudao.module.booking.service.DlRepairBookingService;
import cn.iocoder.yudao.module.custom.service.CustomerMainService;
import cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO;
import cn.iocoder.yudao.module.order.service.RepairOrderInfoService;
@ -79,6 +81,10 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
@Lazy
private RepairOrderInfoService repairOrderInfoService;
@Resource
@Lazy
private DlRepairBookingService bookingService;
/**
* 维修工单表 新增
*
@ -147,7 +153,17 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
repairOrderInfo.setGoodsPrice(ticketsRespVO.getTotalPrice());
repairOrderInfo.setOrderTime(ticketsRespVO.getCreateTime());
repairOrderInfo.setOrderStatus("0");
repairOrderInfo.setPayMoney(ticketsRespVO.getTotalPrice());
repairOrderInfo.setDeptId(Integer.parseInt(deptId + ""));
// 如果选择了预约还要更新预约记录
if (ObjectUtil.isNotEmpty(ticketsRespVO.getBookingId())){
DlRepairBooking dlRepairBooking = new DlRepairBooking();
dlRepairBooking.setId(ticketsRespVO.getBookingId());
dlRepairBooking.setTicketsId(ticketsRespVO.getId());
dlRepairBooking.setBookingStatus("02");
bookingService.updateById(dlRepairBooking);
}
repairOrderInfoService.saveOrderInfo(repairOrderInfo);
}

View File

@ -19,4 +19,7 @@ public class DlRepairTicketsRespVO extends DlRepairTickets {
/** 上面有地方在用,只能新用一个了,子表数组 */
private List<DlRepairTitemReqVO> items;
/** 预约记录ID */
private String bookingId;
}

View File

@ -45,8 +45,8 @@
and (drb.booking_time between #{map.searchTimeArray[0]} and #{map.searchTimeArray[1]})
</if>
<if test="map.carNo != null and map.carNo != ''">
and drp.car_no = #{map.carNo}
and drb.car_no = #{map.carNo}
</if>
order by drp_create_time desc
order by drb.create_time desc
</select>
</mapper>

View File

@ -0,0 +1,24 @@
package cn.iocoder.yudao.module.system.api.service;
import cn.iocoder.yudao.module.system.api.service.dto.ServicePackageDto;
import java.util.List;
/**
* 查租户服务的
*
* @author 小李
* @date 10:33 2024/9/24
**/
public interface ServicePackageApi {
/**
* 查租户服务的详情通过id
*
* @author 小李
* @date 10:37 2024/9/24
* @param ids ids
**/
List<ServicePackageDto> getServicePackageByIds(List<String> ids);
}

View File

@ -0,0 +1,23 @@
package cn.iocoder.yudao.module.system.api.service.dto;
import lombok.Data;
/**
* 查租户服务的
*
* @author 小李
* @date 10:36 2024/9/24
**/
@Data
public class ServicePackageDto {
/** 套餐编号 */
private String id;
/** 套餐名 */
private String name;
/** 备注 */
private String remark;
}

View File

@ -22,5 +22,4 @@ public interface TenantApi {
* @param id 租户编号
*/
void validateTenant(Long id);
}

View File

@ -0,0 +1,39 @@
package cn.iocoder.yudao.module.system.api.service;
import cn.hutool.core.bean.BeanUtil;
import cn.iocoder.yudao.module.system.api.service.dto.ServicePackageDto;
import cn.iocoder.yudao.module.system.dal.dataobject.service.ServicePackageDO;
import cn.iocoder.yudao.module.system.service.service.ServicePackageService;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
/**
* 查租户服务的接口实现
*
* @author 小李
* @date 10:39 2024/9/24
**/
@Service
public class ServicePackageApiImpl implements ServicePackageApi{
@Resource
@Lazy
private ServicePackageService servicePackageService;
/**
* 查租户服务的详情通过id
*
* @author 小李
* @date 10:37 2024/9/24
* @param ids ids
**/
@Override
public List<ServicePackageDto> getServicePackageByIds(List<String> ids) {
List<ServicePackageDO> servicePackageByIds = servicePackageService.getServicePackageByIds(ids);
return servicePackageByIds.stream().map(item -> BeanUtil.toBean(item, ServicePackageDto.class)).collect(Collectors.toList());
}
}

View File

@ -2,6 +2,8 @@ package cn.iocoder.yudao.module.system.service.service;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.module.system.api.service.dto.ServicePackageDto;
import cn.iocoder.yudao.module.system.controller.admin.service.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.service.ServicePackageDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
@ -67,4 +69,13 @@ public interface ServicePackageService {
* @return 服务套餐
*/
List<ServicePackageDO> getServicePackageListByStatus(Integer status);
/**
* 查租户服务的详情通过id
*
* @author 小李
* @date 10:37 2024/9/24
* @param ids ids
**/
List<ServicePackageDO> getServicePackageByIds(List<String> ids);
}

View File

@ -3,7 +3,9 @@ package cn.iocoder.yudao.module.system.service.service;
import cn.iocoder.yudao.framework.common.config.CommonStr;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.datapermission.core.rule.DataPermissionRule;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
import cn.iocoder.yudao.module.system.api.service.dto.ServicePackageDto;
import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RoleSaveReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO;
import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantPackageDO;
@ -142,4 +144,15 @@ public class ServicePackageServiceImpl implements ServicePackageService {
return servicePackageMapper.selectListByStatus(status);
}
/**
* 查租户服务的详情通过id
*
* @author 小李
* @date 10:37 2024/9/24
* @param ids ids
**/
@Override
public List<ServicePackageDO> getServicePackageByIds(List<String> ids){
return servicePackageMapper.selectList(new LambdaQueryWrapperX<ServicePackageDO>().in(ServicePackageDO::getId, ids));
}
}