diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/CarMain.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/CarMain.java index 94511e1f..0c553c98 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/CarMain.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/CarMain.java @@ -147,5 +147,14 @@ public class CarMain extends TenantBaseDO { @ExcelProperty("最近业务时间") private LocalDateTime recentlyHandleBusinessTime; - + /** 保险公司名称 */ + private String insuranceName; + /** 承保险种,多个英文逗号隔开 */ + private String insuranceType; + /** 交强险保费 */ + private BigDecimal jiaoqiang; + /** 商业险保费 */ + private BigDecimal shangye; + /** 车龄 */ + private Double carYear; } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/CustomerMain.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/CustomerMain.java index 00e583fd..6bea5c33 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/CustomerMain.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/entity/CustomerMain.java @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.custom.entity; import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; @@ -113,4 +114,10 @@ public class CustomerMain extends TenantBaseDO { */ private String isHangAccount; + /** + * 客户来源text + */ + @TableField(exist = false) + private String dataFromText; + } diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/tickets/entity/Tickets.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/tickets/entity/Tickets.java index 8c9af228..14b3632c 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/tickets/entity/Tickets.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/tickets/entity/Tickets.java @@ -180,4 +180,7 @@ public class Tickets extends TenantBaseDO { /** 工单完成情况(0:未完成,1:已完成) */ private String isFinish; + + /** 是否交车(0未交车|1已交车) */ + private String isHandover; } diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/TicketsServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/TicketsServiceImpl.java index b6db061e..4fa7ec5c 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/TicketsServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/TicketsServiceImpl.java @@ -4,7 +4,6 @@ import cn.iocoder.yudao.module.tickets.entity.Tickets; import cn.iocoder.yudao.module.tickets.mapper.TicketsMapper; import cn.iocoder.yudao.module.tickets.service.BaseRepairRecordsService; import cn.iocoder.yudao.module.tickets.service.TicketsService; -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -21,7 +20,7 @@ public class TicketsServiceImpl extends ServiceImpl impl private BaseRepairRecordsService baseRepairRecordsService; /** - * 更新工单状态为已结账 + * 更新工单状态为已结账-----小程序结算工单 * 考虑可能有批量操作的情况,采用批量更新的方式 * * @author 小李 @@ -30,15 +29,17 @@ public class TicketsServiceImpl extends ServiceImpl impl **/ @Override public void updateTickets(List ticketIds){ - baseMapper.update(new LambdaUpdateWrapper() - .in(Tickets::getId, ticketIds) - .set(Tickets::getTicketsStatus, "02") - // 不在这儿结束 -// .set(Tickets::getIsFinish, "1") - ); - // 记录日志 - if(!ticketIds.isEmpty()){ - baseRepairRecordsService.saveRepairRecord(ticketIds.get(0), null, "js", "线上支付结算", null); + for (String id:ticketIds){ + Tickets tickets = this.getById(id); + if("1".equals(tickets.getIsHandover())){ + //已交车,已结算,那么需要把工单状态置为已完成 + tickets.setTicketsStatus("08"); + tickets.setIsFinish("1"); + }else{ + tickets.setTicketsStatus("02"); + } + this.updateById(tickets); + baseRepairRecordsService.saveRepairRecord(id, null, "js", "线上支付结算", null); } } } 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 cfaff6de..e5babda7 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 @@ -15,6 +15,10 @@ public enum RecordTypeEnum { * 创建工单 */ CJGD("cjgd","创建工单"), + /** + * 修改工单 + */ + XGGD("xggd","修改工单"), /** * 指派施工 */ diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairCons.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairCons.java index f5ec35cc..c7ad482c 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairCons.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairCons.java @@ -16,6 +16,10 @@ public class RepairCons { public static final String DICT_REPAIR_RECORDS_TYPE = "repair_records_type"; /**数据字典常量-repair_type-*/ public static final String DICT_REPAIR_TYPE = "repair_type"; + /**数据字典常量-cus_data_from-*/ + public static final String DICT_CUS_DATA_FROM = "cus_data_from"; + /**数据字典常量-insurance_type-*/ + public static final String DICT_INSURANCE_TYPE = "insurance_type"; /**数据字典常量-repair_unit-*/ public static final String DICT_REPAIR_UNIT = "repair_unit"; /**数据字典常量-repair_unit-*/ 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 960db751..97a75fb3 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 @@ -36,9 +36,9 @@ public enum TicketsStatusEnum { */ CHECK_OUT("02","已结账"), /** - * 已交车 + * 已完成 */ - OVER("08","已交车"), + 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 e01b9d76..dcf83fc4 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 @@ -3,10 +3,16 @@ package cn.iocoder.yudao.module.tickets.controller.admin; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.date.DateUtil; +import cn.iocoder.yudao.common.RecordTypeEnum; import cn.iocoder.yudao.common.RepairCons; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; +import cn.iocoder.yudao.module.base.service.RepairRecordsService; +import cn.iocoder.yudao.module.custom.entity.CarMain; +import cn.iocoder.yudao.module.custom.entity.CustomerMain; +import cn.iocoder.yudao.module.custom.service.CarMainService; +import cn.iocoder.yudao.module.custom.service.CustomerMainService; import cn.iocoder.yudao.module.tickets.entity.DlRepairTickets; import cn.iocoder.yudao.module.tickets.service.DlRepairTicketsService; import cn.iocoder.yudao.module.tickets.vo.*; @@ -19,6 +25,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.time.ZoneId; import java.util.*; import java.util.stream.Collectors; @@ -39,6 +46,12 @@ public class DlRepairTicketsController { */ @Resource private DlRepairTicketsService dlRepairTicketsService; + @Resource + private CustomerMainService customerMainService; + @Resource + private CarMainService carMainService; + @Resource + private RepairRecordsService repairRecordsService; /** @@ -86,6 +99,80 @@ public class DlRepairTicketsController { return success(dlRepairTicketsService.getTicketsById(id,ifApp)); } + /** + * 查工单主表信息 + * @author vinjor-M + * @date 14:12 2025/1/8 + * @param id 工单ID + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + **/ + @GetMapping("/getById") + @Operation(summary = "查工单主表信息") + public CommonResult getById(@RequestParam("id") String id) { + DlRepairTickets repairTickets = dlRepairTicketsService.getById(id); + DlRepairTicketsRespVO respVO = new DlRepairTicketsRespVO(); + org.springframework.beans.BeanUtils.copyProperties(repairTickets,respVO); + CustomerMain customerMain = customerMainService.getById(repairTickets.getUserId()); + respVO.setCustomerInfo(customerMain); + return success(respVO); + } + + /** + * 维修工单表 更新 + * @author vinjor-M + * @date 14:42 2025/1/8 + * @param repairTickets 工单ID + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + **/ + @PostMapping("/updateById") + @Operation(summary = "维修工单表 更新") + public CommonResult updateById(@RequestBody DlRepairTicketsRespVO repairTickets) { + //更新客户表 + CustomerMain customerMain = new CustomerMain(); + customerMain.setId(repairTickets.getUserId()); + customerMain.setCusName(repairTickets.getUserName()); + customerMain.setDataFrom(repairTickets.getCusFrom()); + customerMain.setPhoneNumber(repairTickets.getUserMobile()); + customerMainService.updateById(customerMain); + //更新车辆表 + CarMain carMain = new CarMain(); + carMain.setId(repairTickets.getCarId()); + //保养日期 + if(null!=repairTickets.getMaintenanceDate()){ + carMain.setMaintenanceDate(repairTickets.getMaintenanceDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); + } + //保养里程 + if(null!=repairTickets.getMaintenanceMileage()) { + carMain.setMaintenanceMileage(repairTickets.getMaintenanceMileage()); + } + //下次年检日期 + if(null!=repairTickets.getNextInspectionDate()) { + carMain.setNextInspectionDate(repairTickets.getNextInspectionDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); + } + //保险到期日期 + if(null!=repairTickets.getInsuranceExpiryDate()) { + carMain.setInsuranceExpiryDate(repairTickets.getInsuranceExpiryDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); + } + //保险公司名称 + if(null!=repairTickets.getInsuranceName()) { + carMain.setInsuranceName(repairTickets.getInsuranceName()); + } + //承保险种,多个英文逗号隔开 + if(null!=repairTickets.getInsuranceType()) { + carMain.setInsuranceType(repairTickets.getInsuranceType()); + } + if(null!=repairTickets.getJiaoqiang()) { + carMain.setJiaoqiang(repairTickets.getJiaoqiang()); + } + if(null!=repairTickets.getShangye()) { + carMain.setShangye(repairTickets.getShangye()); + } + carMainService.updateById(carMain); + //最后记录操作日志--创建工单 + repairRecordsService.saveRepairRecord(repairTickets.getId(), null, RecordTypeEnum.XGGD.getCode(), "修改工单", repairTickets.getImage()); + return CommonResult.success(dlRepairTicketsService.updateById(repairTickets)); + } + /** * 维修工单表 作废 * diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlTicketWaresController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlTicketWaresController.java index 90b32486..6c389473 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlTicketWaresController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlTicketWaresController.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.stream.Collectors; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.ok; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; /** @@ -221,6 +222,22 @@ public class DlTicketWaresController { return success(dlTicketWaresService.getByIds(ids)); } + /** + * 确认申领完成配件申请单 + * @author vinjor-M + * @date 11:26 2025/1/3 + * @param id 配件申请单Id + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + **/ + @GetMapping("/confirmOver") + @Operation(summary = "确认申领完成") + public CommonResult confirmOver(@RequestParam("id") String id){ + DlTicketWares ticketWares = dlTicketWaresService.getById(id); + ticketWares.setIsEnd("1"); + dlTicketWaresService.updateById(ticketWares); + return ok(); + } + /** * 导出数据 * diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/entity/DlRepairTickets.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/entity/DlRepairTickets.java index c74fee06..1ae5ef98 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/entity/DlRepairTickets.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/entity/DlRepairTickets.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.tickets.entity; import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; @@ -88,6 +89,10 @@ public class DlRepairTickets extends TenantBaseDO { * 车辆品牌类型(base_car_brand表的brand_type) */ private String carBrandType; + /** + * 业务来源(字典:repair_busi_from) + */ + private String busiFrom; /** * 最近保养日期 */ @@ -195,6 +200,8 @@ public class DlRepairTickets extends TenantBaseDO { /** 工单完成情况(0:未完成,1:已完成) */ private String isFinish; + /** 是否交车(0未交车|1已交车) */ + private String isHandover; /** 工单当前施工人id */ private Long nowRepairId; @@ -228,4 +235,25 @@ public class DlRepairTickets extends TenantBaseDO { /** 结算备注 */ private String billingRemark; + + /** 年检到期时间 */ + private Date nextInspectionDate; + /** 保险到期时间 */ + private Date insuranceExpiryDate; + /** 承保险种,多个英文逗号隔开 */ + private String insuranceType; + /** 交强险保费 */ + private BigDecimal jiaoqiang; + /** 商业险保费 */ + private BigDecimal shangye; + + /** 更新时上传的图片 */ + @TableField(exist = false) + private String image; + /** 维修类型文本 */ + @TableField(exist = false) + private String repairTypeText; + /** 支付方式文本 */ + @TableField(exist = false) + private String payTypeText; } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/entity/DlTicketWares.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/entity/DlTicketWares.java index 7a76be51..45c9dbcc 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/entity/DlTicketWares.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/entity/DlTicketWares.java @@ -7,8 +7,6 @@ import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; - /** * 工单配件申请/退回表 * @@ -80,4 +78,6 @@ public class DlTicketWares extends TenantBaseDO { /** 保险公司联系电话 */ private String safeMobile; + /** 是否已完成申领(0未完成|1已完成) */ + private String isEnd; } \ No newline at end of file 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 274079a0..f041ce63 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 @@ -60,6 +60,7 @@ import cn.iocoder.yudao.module.tickets.service.DlRepairTitemService; import cn.iocoder.yudao.module.tickets.service.DlTicketWaresService; import cn.iocoder.yudao.module.tickets.service.DlTwItemService; import cn.iocoder.yudao.module.tickets.tools.WordUtil; +import cn.iocoder.yudao.module.tickets.utils.TicketsOperateUtil; import cn.iocoder.yudao.module.tickets.vo.*; import cn.iocoder.yudao.util.CreateQRCodeUtil; import cn.iocoder.yudao.util.SendSmsUtil; @@ -195,6 +196,8 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl repairTypeMap = repairTypeList.stream().collect(Collectors.toMap(DictDataRespDTO::getValue,DictDataRespDTO::getLabel)); DlRepairTicketsRespVO result = BeanUtil.toBean(dlRepairTickets, DlRepairTicketsRespVO.class); result.setRepairTypeText(repairTypeMap.getOrDefault(dlRepairTickets.getRepairType(),"")); - //查是否存在总检完成的记录,取出他的时间 LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() .eq(RepairRecords::getTicketId,id) @@ -390,11 +425,29 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl dataFromList = dictDataApi.getDictDataList(DICT_CUS_DATA_FROM); + Map dataFromMap = dataFromList.stream().collect(Collectors.toMap(DictDataRespDTO::getValue,DictDataRespDTO::getLabel)); + customerInfo.setDataFromText(dataFromMap.get(customerInfo.getDataFrom())); + } result.setCustomerInfo(customerInfo); // 查工单子表 List itemList = titemService.list(new LambdaQueryWrapper().eq(DlRepairTitem::getTicketId, id)); @@ -570,6 +623,13 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl + **/ + private IPage dealDictText(IPage dlRepairTicketsIPage){ + //维修类型 + List repairTypeList = dictDataApi.getDictDataList(DICT_REPAIR_TYPE); + Map repairTypeMap = repairTypeList.stream().collect(Collectors.toMap(DictDataRespDTO::getValue,DictDataRespDTO::getLabel)); + //支付方式 + List payTypeList = dictDataApi.getDictDataList(DICT_REPAIR_PAY_TYPE); + + dlRepairTicketsIPage.getRecords().forEach(item->{ + if(StringUtils.isNotEmpty(item.getRepairType())){ + item.setRepairTypeText(repairTypeMap.get(item.getRepairType())); + } + if(StringUtils.isNotEmpty(item.getPayType())){ + payTypeList.forEach(payType->{ + if(item.getPayType().contains(payType.getValue())){ + if(StringUtils.isEmpty(item.getPayTypeText())){ + item.setPayTypeText(payType.getLabel()); + }else{ + item.setPayTypeText(item.getPayTypeText()+","+payType.getLabel()); + } + } + }); + } + }); + return dlRepairTicketsIPage; + } + /** * 分类查询工单分页 * @@ -982,7 +1075,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl noPayIdList = new ArrayList<>(); List repairTickets = this.list(); if (!repairTickets.isEmpty()) { + //维修中 workingIdList = repairTickets.stream().filter(item -> TicketsStatusEnum.WORKING.getCode().equals(item.getTicketsStatus())).map(DlRepairTickets::getId).collect(Collectors.toList()); workingNum = workingIdList.size(); //只要没交车都算在厂 - List inCompanyCodeList = Arrays.asList("04","05","07","01","06","02"); - inCompanyIdList = repairTickets.stream().filter(item -> inCompanyCodeList.contains(item.getTicketsStatus())).map(DlRepairTickets::getId).collect(Collectors.toList()); + inCompanyIdList = repairTickets.stream().filter(item -> "0".equals(item.getIsHandover())).map(DlRepairTickets::getId).collect(Collectors.toList()); inCompanyNum = inCompanyIdList.size(); //只要没结算,都是未结算 List noPayCodeList = Arrays.asList("04","05","07","01"); @@ -1655,10 +1750,11 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl overCodeList = Arrays.asList("07","01","06","02","08"); + overIdList = repairTickets.stream().filter(item -> overCodeList.contains(item.getTicketsStatus())).map(DlRepairTickets::getId).collect(Collectors.toList()); overNum = overIdList.size(); - //查累计已交车的(已结算的) - giveCusIdList = repairTicketsMapper.selectTicketIdByParams(null,RecordTypeEnum.JC.getCode(),null,null); + //查累计已交车的 + giveCusIdList = repairTickets.stream().filter(item -> "1".equals(item.getIsHandover())).map(DlRepairTickets::getId).collect(Collectors.toList()); giveCusNum = giveCusIdList.size(); }else { //查某个时间范围内进厂数、已完成、已交车 @@ -2018,18 +2114,21 @@ 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()) - ); - + this.updateById(repairTickets); // 记录日志 repairRecordsService.saveRepairRecord(respVO.getId(), null, RecordTypeEnum.JC.getCode(), respVO.getRemark(), respVO.getImage()); - refreshUpdateTime(respVO.getId()); } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/utils/TicketsOperateUtil.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/utils/TicketsOperateUtil.java index acf32660..3eb78601 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/utils/TicketsOperateUtil.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/utils/TicketsOperateUtil.java @@ -1,9 +1,10 @@ package cn.iocoder.yudao.module.tickets.utils; -import cn.iocoder.yudao.module.base.service.RepairRecordsService; -import org.springframework.beans.factory.annotation.Autowired; +import cn.hutool.core.date.DateUtil; import org.springframework.stereotype.Component; +import java.util.Date; + /** * 工单操作常用util * @author vinjor-M @@ -11,8 +12,17 @@ import org.springframework.stereotype.Component; **/ @Component public class TicketsOperateUtil { - @Autowired - private RepairRecordsService repairRecordsService; - + /** + * 计算车龄 + * @author vinjor-M + * @date 14:47 2025/1/9 + * @param registerDate 车辆注册日期 + * @return java.lang.Double + **/ + public Double computeCarYear(Date registerDate){ + long betweenMonth = DateUtil.betweenMonth(registerDate, new Date(), true); + String carYear = String.format("%.2f", (double) betweenMonth / 12); + return Double.parseDouble(carYear); + } } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/DlRepairTicketsRespVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/DlRepairTicketsRespVO.java index 3042b811..f2db5780 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/DlRepairTicketsRespVO.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/DlRepairTicketsRespVO.java @@ -72,4 +72,7 @@ public class DlRepairTicketsRespVO extends DlRepairTickets { private String repairTypeText; /** 车辆实际竣工(总检完成)时间 */ private String realOverDate; + + /** 客户来源 */ + private String cusFrom; } 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 c6bb5534..412a8f17 100644 --- a/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml +++ b/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml @@ -17,6 +17,7 @@ + @@ -54,6 +55,11 @@ + + + + + @@ -69,6 +75,7 @@ + @@ -106,6 +113,11 @@ + + + + + @@ -126,6 +138,7 @@ car_brand_id, car_brand_name, car_brand_type, + busi_from, adviser_id, adviser_name, pay_type, @@ -164,7 +177,12 @@ confirm_fault_money, billing_remark, handle_name, - handle_mobile + handle_mobile, + nextInspection_date, + insuranceExpiry_date, + insurance_type, + jiaoqiang, + shangye from dl_repair_tickets drt where drt.deleted = '0' @@ -353,7 +371,7 @@ left join base_customer_main bcm ON drt.user_id = bcm.id left join dl_repair_titem drti - on drt.id = drti.ticket_id AND drti.deleted = '0' + on drt.id = drti.ticket_id AND drti.deleted = '0' AND drti.item_type='01' where drt.deleted = '0' and ( @@ -366,6 +384,12 @@ drt.user_mobile like concat('%', #{map.ticketNo}, '%') or drt.remark like concat('%', #{map.ticketNo}, '%') + or + drt.car_brand_name like concat('%', #{map.ticketNo}, '%') + or + drt.handle_name like concat('%', #{map.ticketNo}, '%') + or + drti.item_name like concat('%', #{map.ticketNo}, '%') ) @@ -411,6 +435,10 @@ -- 服务顾问查所有的就是服务顾问是自己的 -- and drt.adviser_id = #{map.adviserId} + + -- 是否交车 -- + and drt.is_handover = #{map.isHandover} + -- 维修工或维修厂长查所有的就是维修人是自己的或者是自己班组内的 -- and ( diff --git a/dl-module-repair/src/main/resources/mapper/tickets/DlTicketWaresMapper.xml b/dl-module-repair/src/main/resources/mapper/tickets/DlTicketWaresMapper.xml index 25bdb30d..c0efaf3d 100644 --- a/dl-module-repair/src/main/resources/mapper/tickets/DlTicketWaresMapper.xml +++ b/dl-module-repair/src/main/resources/mapper/tickets/DlTicketWaresMapper.xml @@ -54,7 +54,7 @@ from dl_ticket_wares dtw left join dl_repair_tickets drt on dtw.ticket_id = drt.id - where dtw.deleted = '0' + where dtw.deleted = '0' AND dtw.is_end='0'