From 43420aa8b2539392505389aac6fc78a5c45cde86 Mon Sep 17 00:00:00 2001 From: Vinjor Date: Wed, 13 Nov 2024 14:48:14 +0800 Subject: [PATCH 1/5] 1 --- .../module/custom/service/CarMainService.java | 9 +++ .../service/impl/CarMainServiceImpl.java | 22 +++++++ .../service/impl/CustomerCarServiceImpl.java | 63 ++++++++++++++----- 3 files changed, 78 insertions(+), 16 deletions(-) diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarMainService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarMainService.java index 9dc07ff2..673fb00d 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarMainService.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarMainService.java @@ -100,5 +100,14 @@ public interface CarMainService extends IService { **/ CarMainRespVO compute(CarMainReqVO reqVO); + /** + * 根据客户信息+车牌号查这个客户是否已有这个车 + * @author vinjor-M + * @date 14:41 2024/11/13 + * @param userId 用户id + * @param carNumber 车牌号 + * @return cn.iocoder.yudao.module.custom.entity.CarMain + **/ + CarMain selectByUserIdAndCarNumber(Long userId,String carNumber); } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java index e0b3901d..74cc104c 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java @@ -309,6 +309,28 @@ public class CarMainServiceImpl extends ServiceImpl impl return respVO; } + /** + * 根据客户信息+车牌号查这个客户是否已有这个车 + * + * @param userId 用户id + * @param carNumber 车牌号 + * @return cn.iocoder.yudao.module.custom.entity.CarMain + * @author vinjor-M + * @date 14:41 2024/11/13 + **/ + @Override + public CarMain selectByUserIdAndCarNumber(Long userId, String carNumber) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() + .eq(CarMain::getUserId,userId) + .eq(CarMain::getLicenseNumber,carNumber); + List rtnList = this.list(queryWrapper); + if(rtnList.isEmpty()){ + return null; + }else{ + return rtnList.get(0); + } + } + /** * 根据品牌型号获取保养规则 * diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerCarServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerCarServiceImpl.java index 5484f799..985f6e72 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerCarServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerCarServiceImpl.java @@ -95,11 +95,12 @@ public class CustomerCarServiceImpl extends ServiceImpl Date: Wed, 13 Nov 2024 15:21:00 +0800 Subject: [PATCH 2/5] 1 --- .../controller/admin/CustomerMainController.java | 5 ++--- .../module/custom/service/CustomerCarService.java | 3 ++- .../service/impl/CustomerCarServiceImpl.java | 14 +++++++++++++- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerMainController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerMainController.java index 252a7cd8..24a68727 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerMainController.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerMainController.java @@ -81,9 +81,8 @@ public class CustomerMainController { @PostMapping("/saveCustomerAndCar") @Operation(summary = "保存客户及车辆信息") - public CommonResult saveCustomerAndCar(@RequestBody CustomerMainSaveReqVO saveReqVO) throws Exception { - customerCarService.saveCustomerAndCar(saveReqVO); - return success(true); + public CommonResult saveCustomerAndCar(@RequestBody CustomerMainSaveReqVO saveReqVO) throws Exception { + return CommonResult.success(customerCarService.saveCustomerAndCar(saveReqVO)); } /** diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CustomerCarService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CustomerCarService.java index 75b63847..390e62b5 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CustomerCarService.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CustomerCarService.java @@ -5,6 +5,7 @@ import cn.iocoder.yudao.module.custom.vo.CustomerMainSaveReqVO; import com.baomidou.mybatisplus.extension.service.IService; import java.util.List; +import java.util.Map; /** * 客户车辆管理关联Service 接口 @@ -34,5 +35,5 @@ public interface CustomerCarService extends IService { * @param saveReqVO CustomerMainSaveReqVO * @return void **/ - void saveCustomerAndCar(CustomerMainSaveReqVO saveReqVO) throws Exception; + Map saveCustomerAndCar(CustomerMainSaveReqVO saveReqVO) throws Exception; } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerCarServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerCarServiceImpl.java index 985f6e72..bf55d2c8 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerCarServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerCarServiceImpl.java @@ -3,6 +3,8 @@ package cn.iocoder.yudao.module.custom.service.impl; import cn.hutool.core.util.ObjectUtil; 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.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.module.custom.entity.CarMain; import cn.iocoder.yudao.module.custom.entity.CustomerCar; import cn.iocoder.yudao.module.custom.entity.CustomerMain; @@ -23,7 +25,9 @@ import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; +import java.util.HashMap; import java.util.List; +import java.util.Map; import static cn.iocoder.yudao.common.BaseConstants.*; import static cn.iocoder.yudao.framework.common.config.CommonStr.USER_TYPE_CUS; @@ -93,8 +97,10 @@ public class CustomerCarServiceImpl extends ServiceImpl saveCustomerAndCar(CustomerMainSaveReqVO saveReqVO) throws Exception { + Map rtnMap = new HashMap<>(); chekData(saveReqVO); + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); saveReqVO.getCar().setLicenseNumber(saveReqVO.getCar().getLicenseNumber().toUpperCase()); //用户信息 AdminUserRespDTO userDTO = adminUserApi.getUserByUsername(saveReqVO.getPhoneNumber()); @@ -108,6 +114,7 @@ public class CustomerCarServiceImpl extends ServiceImpl Date: Wed, 13 Nov 2024 15:25:27 +0800 Subject: [PATCH 3/5] 1 --- .../cn/iocoder/yudao/module/system/api/user/dto/UserDTO.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/dto/UserDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/dto/UserDTO.java index 72414253..bd82ed3e 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/dto/UserDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/dto/UserDTO.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.module.system.api.user.dto; -import cn.iocoder.yudao.module.system.enums.common.SexEnum; import lombok.Data; @Data @@ -51,5 +50,9 @@ public class UserDTO { * 用户openId **/ private String openId; + /** + * 用户openId + **/ + private Long tenantId; } From 95157aa43fd50b4eb4e3bc54062f4052fe6502e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=85=81=E6=9E=9E?= <3422692813@qq.com> Date: Wed, 13 Nov 2024 16:14:32 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/CustomerCarServiceImpl.java | 3 -- .../impl/RescueDriverInfoServiceImpl.java | 38 ++++++++++++++----- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerCarServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerCarServiceImpl.java index bf55d2c8..e85bea31 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerCarServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerCarServiceImpl.java @@ -183,8 +183,5 @@ public class CustomerCarServiceImpl extends ServiceImpl implements IRescueDriverInfoService { +public class RescueDriverInfoServiceImpl extends ServiceImpl implements IRescueDriverInfoService { @Autowired private AdminUserApi userService; @Autowired @@ -81,6 +85,8 @@ public class RescueDriverInfoServiceImpl extends ServiceImpl driverRescueList2(Long id, Page page){ + public IPage driverRescueList2(Long id, Page page) { IPage rescueInfos = baseMapper.driverRescueList2(id, page); for (RescueInfo rescueInfo : rescueInfos.getRecords()) { String dljy_type = dictDataService.getDictDataLabel("dljy_type", rescueInfo.getRescueType()); @@ -698,7 +718,7 @@ public class RescueDriverInfoServiceImpl extends ServiceImpl driverRescuePage2(RescueInfo rescueInfo, Page page){ + public IPage driverRescuePage2(RescueInfo rescueInfo, Page page) { IPage rescueInfos = baseMapper.driverRescuePage2(rescueInfo, page); for (RescueInfo it : rescueInfos.getRecords()) { String dljy_type = dictDataService.getDictDataLabel("dljy_type", it.getRescueType()); From 4920ad7b25254225eb0add076141f9c1eabfdada Mon Sep 17 00:00:00 2001 From: Vinjor Date: Wed, 13 Nov 2024 17:12:28 +0800 Subject: [PATCH 5/5] 1 --- .../iocoder/yudao/common/RecordTypeEnum.java | 3 +++ .../yudao/common/TicketsStatusEnum.java | 4 ++++ .../admin/DlRepairTicketsController.java | 13 +++++++++++ .../service/DlRepairTicketsService.java | 8 +++++++ .../impl/DlRepairTicketsServiceImpl.java | 22 +++++++++++++++++++ .../mapper/tickets/DlRepairTicketsMapper.xml | 9 ++++---- 6 files changed, 55 insertions(+), 4 deletions(-) diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java index 9955cce4..e232af30 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java @@ -76,6 +76,9 @@ public enum RecordTypeEnum { /** 删除工单 */ SCGG("scgg", "删除工单"), + /** 删除工单 */ + JC("jc", "交车"), + /** 内返派工 */ NFPG("nfpg", "内返派工"); diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/TicketsStatusEnum.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/TicketsStatusEnum.java index 26b53e87..ce29b4bb 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/TicketsStatusEnum.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/TicketsStatusEnum.java @@ -27,6 +27,10 @@ public enum TicketsStatusEnum { * 待通知客户取车 */ WAITING_NOTICE("07","待通知客户取车"), + /** + * 已交车 + */ + OVER("08","已交车"), /** * 挂单/记账 */ diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTicketsController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTicketsController.java index b9999f3b..2332f8d5 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTicketsController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTicketsController.java @@ -297,6 +297,19 @@ public class DlRepairTicketsController { return CommonResult.ok(); } + /** + * 服务顾问交车 + * @author vinjor-M + * @date 16:51 2024/11/13 + * @param respVO + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + **/ + @PostMapping("/overOrder") + @Operation(summary = "服务顾问交车") + public CommonResult overOrder(@RequestBody DlRepairTicketsRespVO respVO) { + dlRepairTicketsService.overOrder(respVO); + return CommonResult.ok(); + } /** * 从总检的角度差维修中、已完成的工单数量 * @author vinjor-M diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTicketsService.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTicketsService.java index 1992f8c5..f7d0f273 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTicketsService.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTicketsService.java @@ -235,4 +235,12 @@ public interface DlRepairTicketsService extends IService { * @param id 工单ID **/ void removeTicketById(String id); + + /** + * 服务顾问交车 + * @author vinjor-M + * @date 16:51 2024/11/13 + * @param respVO + **/ + void overOrder(DlRepairTicketsRespVO respVO); } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java index 9f9a64a4..45b02a46 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java @@ -1637,6 +1637,28 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl() + .set(DlRepairTickets::getTicketsWorkStatus, TicketsWorkStatusEnum.END.getCode()) + .set(DlRepairTickets::getTicketsStatus, TicketsStatusEnum.OVER.getCode()) + //交车时才能把工单置为完成 + .set(DlRepairTickets::getIsFinish,"1") + .eq(DlRepairTickets::getId, respVO.getId()) + ); + + // 记录日志 + repairRecordsService.saveRepairRecord(respVO.getId(), null, RecordTypeEnum.JC.getCode(), respVO.getRemark(), respVO.getImage()); + } } diff --git a/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml b/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml index f162f649..ab9ede97 100644 --- a/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml +++ b/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml @@ -216,7 +216,7 @@ from dl_repair_tickets drt left join dl_repair_titem drti on drt.id = drti.ticket_id AND drti.deleted = '0' - where (drt.deleted = '0') AND drt.tickets_status IN ('04','05','01','07') + where (drt.deleted = '0') AND drt.tickets_status IN ('04','05','01','07','06','02') and ( drt.ticket_no like concat('%', #{map.ticketNo}, '%') @@ -255,10 +255,11 @@ ) + -- 服务顾问和仓管查待办都是查未结束的工单 -- + AND drt.is_finish = '0' - -- 查服务顾问 待处理的 工单未完成并且服务顾问是自己的 工单已完成且当前处理人是自己的-- - AND ( drt.is_finish = '0' AND drt.adviser_id = #{map.adviserId} ) - OR (drt.is_finish = '1' AND drt.now_repair_id = #{map.adviserId}) + -- 查服务顾问 当前处理人或服务顾问是自己的-- + AND ( drt.adviser_id = #{map.adviserId} OR drt.now_repair_id = #{map.adviserId}) -- 查总检待处理的 --