From 2174faa20a758552e5cd24ef1ae86e026943b29b Mon Sep 17 00:00:00 2001 From: xiao-fajia <1665375861@qq.com> Date: Sat, 21 Sep 2024 20:43:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/DlRepairOtherController.java | 77 +++++++++++++ .../module/other/entity/DlRepairOther.java | 51 +++++++++ .../other/mapper/DlRepairOtherMapper.java | 31 ++++++ .../other/service/DlRepairOtherService.java | 44 ++++++++ .../impl/DlRepairOtherServiceImpl.java | 62 +++++++++++ .../module/other/vo/DlRepairOtherReqVO.java | 14 +++ .../module/other/vo/DlRepairOtherRespVO.java | 14 +++ .../admin/DlRepairTicketsController.java | 13 +++ .../admin/DlRepairTitemController.java | 81 +++++--------- .../tickets/entity/DlRepairTickets.java | 21 +++- .../module/tickets/entity/DlRepairTitem.java | 23 ++-- .../tickets/mapper/DlRepairTitemMapper.java | 12 +++ .../service/DlRepairTicketsService.java | 9 ++ .../tickets/service/DlRepairTitemService.java | 11 ++ .../impl/DlRepairTicketsServiceImpl.java | 67 ++++++++++-- .../impl/DlRepairTitemServiceImpl.java | 14 +++ .../tickets/vo/DlRepairTicketsReqVO.java | 11 ++ .../tickets/vo/DlRepairTitemRespVO.java | 14 +++ .../mapper/other/DlRepairOtherMapper.xml | 32 ++++++ .../mapper/tickets/DlRepairTicketsMapper.xml | 101 ++++++++++++------ .../mapper/tickets/DlRepairTitemMapper.xml | 81 ++++++-------- .../admin/dict/DictDataController.java | 2 +- 22 files changed, 626 insertions(+), 159 deletions(-) create mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/controller/admin/DlRepairOtherController.java create mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/entity/DlRepairOther.java create mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/mapper/DlRepairOtherMapper.java create mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/service/DlRepairOtherService.java create mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/service/impl/DlRepairOtherServiceImpl.java create mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/vo/DlRepairOtherReqVO.java create mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/vo/DlRepairOtherRespVO.java create mode 100644 dl-module-repair/src/main/resources/mapper/other/DlRepairOtherMapper.xml diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/controller/admin/DlRepairOtherController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/controller/admin/DlRepairOtherController.java new file mode 100644 index 00000000..e892afbe --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/controller/admin/DlRepairOtherController.java @@ -0,0 +1,77 @@ +package cn.iocoder.yudao.module.other.controller.admin; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.other.entity.DlRepairOther; +import cn.iocoder.yudao.module.other.service.DlRepairOtherService; +import cn.iocoder.yudao.module.other.vo.DlRepairOtherReqVO; +import cn.iocoder.yudao.module.other.vo.DlRepairOtherRespVO; +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 static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +/** + * 维修附加内容表(DlRepairOther)表控制层 + * + * @author 小李 + * @date 14:29 2024/9/21 +**/ +@RestController +@RequestMapping("/repair/other") +public class DlRepairOtherController { + /** + * 服务对象 + */ + @Resource + private DlRepairOtherService dlRepairOtherService; + + /** + * 新增、修改维修附加内容表 + * + * @author 小李 + * @date 15:16 2024/9/21 + * @param repairOtherRespVO 请求对象 + **/ + @PostMapping("/update") + @Operation(summary = "新增、修改维修附加内容表") + public CommonResult updateOther(@RequestBody DlRepairOtherRespVO repairOtherRespVO){ + dlRepairOtherService.updateOther(repairOtherRespVO); + return CommonResult.ok(); + } + + /** + * 维修附加内容表 分页 + * + * @author 小李 + * @date 15:20 2024/9/21 + * @param repairOtherReqVO 请求对象 + * @param pageNo 页码 + * @param pageSize 条数 + **/ + @GetMapping("/page") + @Operation(summary = "维修附加内容表 分页") + public CommonResult getOtherPage(DlRepairOtherReqVO repairOtherReqVO, + @RequestParam(value = "pageNo", defaultValue = "1")Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "1")Integer pageSize){ + Page page = new Page<>(pageNo, pageSize); + return success(dlRepairOtherService.getOtherPage(repairOtherReqVO, page)); + } + + /** + * 维修附加内容表 删除 + * + * @author 小李 + * @date 15:24 2024/9/21 + * @param id 删除记录ID + **/ + @DeleteMapping("/delete") + @Operation(summary = "维修附加内容表 删除") + public CommonResult deleteOther(@RequestParam("id") String id){ + dlRepairOtherService.deleteOther(id); + return CommonResult.ok(); + } +} + diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/entity/DlRepairOther.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/entity/DlRepairOther.java new file mode 100644 index 00000000..43d8a0cc --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/entity/DlRepairOther.java @@ -0,0 +1,51 @@ +package cn.iocoder.yudao.module.other.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; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 维修附加内容表 + * + * @author 小李 + * @date 14:22 2024/9/21 +**/ +@TableName(value ="dl_repair_other") +@Data +@EqualsAndHashCode(callSuper = true) +public class DlRepairOther extends TenantBaseDO { + /** + * 主键标识 + */ + @TableId(type = IdType.ASSIGN_ID) + private String id; + + /** + * 名称 + */ + private String name; + + /** + * 价格 + */ + private BigDecimal price; + + /** + * 关联供应商 + */ + private String corpId; + + /** + * 部门ID(system_dept表的ID) + */ + private Long deptId; + +} \ No newline at end of file diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/mapper/DlRepairOtherMapper.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/mapper/DlRepairOtherMapper.java new file mode 100644 index 00000000..59f7e1f3 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/mapper/DlRepairOtherMapper.java @@ -0,0 +1,31 @@ +package cn.iocoder.yudao.module.other.mapper; + +import cn.iocoder.yudao.module.other.entity.DlRepairOther; +import cn.iocoder.yudao.module.other.vo.DlRepairOtherReqVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 针对表【dl_repair_other(维修附加内容表)】的数据库操作Mapper + * + * @author 小李 + * @date 14:23 2024/9/21 +**/ +@Mapper +public interface DlRepairOtherMapper extends BaseMapper { + /** + * 维修附加内容表 分页 + * + * @author 小李 + * @date 15:20 2024/9/21 + * @param repairOtherReqVO 请求对象 + **/ + IPage getOtherPage(@Param("map") DlRepairOtherReqVO repairOtherReqVO, Page page); +} + + + + diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/service/DlRepairOtherService.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/service/DlRepairOtherService.java new file mode 100644 index 00000000..e1460c94 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/service/DlRepairOtherService.java @@ -0,0 +1,44 @@ +package cn.iocoder.yudao.module.other.service; + +import cn.iocoder.yudao.module.other.entity.DlRepairOther; +import cn.iocoder.yudao.module.other.vo.DlRepairOtherReqVO; +import cn.iocoder.yudao.module.other.vo.DlRepairOtherRespVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 针对表【dl_repair_other(维修附加内容表)】的数据库操作Service + * + * @author 小李 + * @date 14:27 2024/9/21 +**/ +public interface DlRepairOtherService extends IService { + + /** + * 新增、修改维修附加内容表 + * + * @author 小李 + * @date 15:16 2024/9/21 + * @param repairOtherRespVO 请求对象 + **/ + void updateOther(DlRepairOtherRespVO repairOtherRespVO); + + /** + * 维修附加内容表 分页 + * + * @author 小李 + * @date 15:20 2024/9/21 + * @param repairOtherReqVO 请求对象 + **/ + IPage getOtherPage(DlRepairOtherReqVO repairOtherReqVO, Page page); + + /** + * 维修附加内容表 删除 + * + * @author 小李 + * @date 15:24 2024/9/21 + * @param id 删除记录ID + **/ + void deleteOther(String id); +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/service/impl/DlRepairOtherServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/service/impl/DlRepairOtherServiceImpl.java new file mode 100644 index 00000000..496c9cea --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/service/impl/DlRepairOtherServiceImpl.java @@ -0,0 +1,62 @@ +package cn.iocoder.yudao.module.other.service.impl; + +import cn.iocoder.yudao.module.other.entity.DlRepairOther; +import cn.iocoder.yudao.module.other.mapper.DlRepairOtherMapper; +import cn.iocoder.yudao.module.other.service.DlRepairOtherService; +import cn.iocoder.yudao.module.other.vo.DlRepairOtherReqVO; +import cn.iocoder.yudao.module.other.vo.DlRepairOtherRespVO; +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.stereotype.Service; + +/** + * 针对表【dl_repair_other(维修附加内容表)】的数据库操作Service实现 + * + * @author 小李 + * @date 14:28 2024/9/21 + **/ +@Service +public class DlRepairOtherServiceImpl extends ServiceImpl + implements DlRepairOtherService { + + /** + * 新增、修改维修附加内容表 + * + * @param repairOtherRespVO 请求对象 + * @author 小李 + * @date 15:16 2024/9/21 + **/ + @Override + public void updateOther(DlRepairOtherRespVO repairOtherRespVO) { + baseMapper.insertOrUpdate(repairOtherRespVO); + } + + /** + * 维修附加内容表 分页 + * + * @author 小李 + * @date 15:20 2024/9/21 + * @param repairOtherReqVO 请求对象 + **/ + @Override + public IPage getOtherPage(DlRepairOtherReqVO repairOtherReqVO, Page page){ + return baseMapper.getOtherPage(repairOtherReqVO, page); + } + + /** + * 维修附加内容表 删除 + * + * @author 小李 + * @date 15:24 2024/9/21 + * @param id 删除记录ID + **/ + @Override + public void deleteOther(String id){ + baseMapper.deleteById(id); + } +} + + + + diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/vo/DlRepairOtherReqVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/vo/DlRepairOtherReqVO.java new file mode 100644 index 00000000..a8ef0eec --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/vo/DlRepairOtherReqVO.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.other.vo; + +import cn.iocoder.yudao.module.other.entity.DlRepairOther; +import lombok.Data; + +/** + * 维修附加内容表 请求VO + * + * @author 小李 + * @date 14:26 2024/9/21 +**/ +@Data +public class DlRepairOtherReqVO extends DlRepairOther { +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/vo/DlRepairOtherRespVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/vo/DlRepairOtherRespVO.java new file mode 100644 index 00000000..421224db --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/other/vo/DlRepairOtherRespVO.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.other.vo; + +import cn.iocoder.yudao.module.other.entity.DlRepairOther; +import lombok.Data; + +/** + * 维修附加内容表 响应VO + * + * @author 小李 + * @date 14:26 2024/9/21 +**/ +@Data +public class DlRepairOtherRespVO extends DlRepairOther { +} 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 7739bc4a..1d1b8545 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 @@ -59,5 +59,18 @@ public class DlRepairTicketsController { Page page = new Page<>(pageNo, pageSize); return success(dlRepairTicketsService.getTicketsPage(repairTicketsReqVO, page)); } + + /** + * 获得一个工单的详细信息 + * + * @author 小李 + * @date 16:05 2024/9/21 + * @param id 工单ID + **/ + @GetMapping("/get") + @Operation(summary = "查看一个工单的详细信息") + public CommonResult getTicketsById(@RequestParam("id") String id){ + return success(dlRepairTicketsService.getTicketsById(id)); + } } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTitemController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTitemController.java index d901461e..b6bbc2fa 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTitemController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTitemController.java @@ -1,12 +1,21 @@ package cn.iocoder.yudao.module.tickets.controller.admin; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.module.tickets.service.DlRepairTitemService; +import cn.iocoder.yudao.module.tickets.vo.DlRepairTitemReqVO; +import cn.iocoder.yudao.module.tickets.vo.DlRepairTitemRespVO; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + /** * 维修工单子表(DlRepairTitem)表控制层 * @@ -22,60 +31,22 @@ public class DlRepairTitemController { @Resource private DlRepairTitemService dlRepairTitemService; -// /** -// * 分页查询所有数据 -// * -// * @param page 分页对象 -// * @param dlRepairTitem 查询实体 -// * @return 所有数据 -// */ -// @GetMapping -// public R selectAll(Page page, DlRepairTitem dlRepairTitem) { -// return success(this.dlRepairTitemService.page(page, new QueryWrapper<>(dlRepairTitem))); -// } -// -// /** -// * 通过主键查询单条数据 -// * -// * @param id 主键 -// * @return 单条数据 -// */ -// @GetMapping("{id}") -// public R selectOne(@PathVariable Serializable id) { -// return success(this.dlRepairTitemService.getById(id)); -// } -// -// /** -// * 新增数据 -// * -// * @param dlRepairTitem 实体对象 -// * @return 新增结果 -// */ -// @PostMapping -// public R insert(@RequestBody DlRepairTitem dlRepairTitem) { -// return success(this.dlRepairTitemService.save(dlRepairTitem)); -// } -// -// /** -// * 修改数据 -// * -// * @param dlRepairTitem 实体对象 -// * @return 修改结果 -// */ -// @PutMapping -// public R update(@RequestBody DlRepairTitem dlRepairTitem) { -// return success(this.dlRepairTitemService.updateById(dlRepairTitem)); -// } -// -// /** -// * 删除数据 -// * -// * @param idList 主键结合 -// * @return 删除结果 -// */ -// @DeleteMapping -// public R delete(@RequestParam("idList") List idList) { -// return success(this.dlRepairTitemService.removeByIds(idList)); -// } + /** + * 维修工单子表 分页 + * + * @author 小李 + * @date 10:34 2024/9/21 + * @param repairTitemRespVO 查询对象 + * @param pageNo 页码 + * @param pageSize 条数 + **/ + @GetMapping("/page") + @Operation(summary = "维修工单子表 分页") + public CommonResult getTItemPage(DlRepairTitemRespVO repairTitemRespVO, + @RequestParam(value = "pageNo", defaultValue = "1")Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10")Integer pageSize){ + Page page = new Page<>(pageNo, pageSize); + return success(dlRepairTitemService.getTItemPage(repairTitemRespVO, page)); + } } 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 21646be6..eca56066 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 @@ -8,6 +8,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import java.math.BigDecimal; +import java.util.Date; /** * 维修工单表 @@ -37,7 +38,7 @@ public class DlRepairTickets extends TenantBaseDO { /** * 用户ID(system_users表的ID) */ - private Long userId; + private String userId; /** * 用户名(base_customer_main表的cus_name) @@ -156,4 +157,22 @@ public class DlRepairTickets extends TenantBaseDO { /** 是否已结算 */ private String ticketsStatus; + + /** 进厂时间 */ + private Date inTime; + + /** 预计完工时间 */ + private Date outTime; + + /** 参考成本 */ + private BigDecimal cost; + + /** 参考毛利 */ + private BigDecimal profit; + + /** 领料状态 */ + private String partStatus; + + /** 工单进行状态 */ + private String ticketsWorkStatus; } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/entity/DlRepairTitem.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/entity/DlRepairTitem.java index 6a30f84f..67f175be 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/entity/DlRepairTitem.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/entity/DlRepairTitem.java @@ -2,18 +2,20 @@ 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 java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; import lombok.Data; import lombok.EqualsAndHashCode; -import java.math.BigDecimal; - /** * 维修工单子表 * @author 小李 * @date 17:30 2024/9/13 -**/ + **/ @TableName(value ="dl_repair_titem") @Data @EqualsAndHashCode(callSuper = true) @@ -27,7 +29,7 @@ public class DlRepairTitem extends TenantBaseDO { /** * 工单ID(dl_repair_tickets表的ID) */ - private String tichetId; + private String ticketId; /** * 名称;计划前端写的时候可以监听一下,动态查一下历史的记录推荐给使用者选 @@ -95,19 +97,14 @@ public class DlRepairTitem extends TenantBaseDO { private String partId; /** - * 项目类型(dl_repair_project表的ID);正常是自动回显 + * 其他ID(dl_base_type表的ID) */ - private String projectTypeId; + private String otherId; /** - * 配件类型(dl_base_type表的ID);正常是自动回显 + * 子项类型ID(dl_base_type表的ID) */ - private String partTypeId; - - /** - * 其他类型(dl_base_type表的ID) - */ - private String otherTypeId; + private String itemTypeId; /** * 状态(字典repair_item_status) diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/mapper/DlRepairTitemMapper.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/mapper/DlRepairTitemMapper.java index 5f25da2d..251166c1 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/mapper/DlRepairTitemMapper.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/mapper/DlRepairTitemMapper.java @@ -1,8 +1,12 @@ package cn.iocoder.yudao.module.tickets.mapper; import cn.iocoder.yudao.module.tickets.entity.DlRepairTitem; +import cn.iocoder.yudao.module.tickets.vo.DlRepairTitemRespVO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 针对表【dl_repair_titem(维修工单子表)】的数据库操作Mapper @@ -13,6 +17,14 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface DlRepairTitemMapper extends BaseMapper { + /** + * 维修工单子表 分页 + * + * @author 小李 + * @date 10:34 2024/9/21 + * @param repairTitemRespVO 查询对象 + **/ + IPage getTItemPage(@Param("map") DlRepairTitemRespVO repairTitemRespVO, Page page); } 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 347ee14e..b59a737b 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 @@ -32,4 +32,13 @@ public interface DlRepairTicketsService extends IService { * @param repairTicketsReqVO 查询对象 **/ IPage getTicketsPage(DlRepairTicketsReqVO repairTicketsReqVO, Page page); + + /** + * 获得一个工单的详细信息 + * + * @author 小李 + * @date 16:05 2024/9/21 + * @param id 工单ID + **/ + DlRepairTicketsRespVO getTicketsById(String id); } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTitemService.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTitemService.java index c6fb62a3..fea0013d 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTitemService.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTitemService.java @@ -1,6 +1,9 @@ package cn.iocoder.yudao.module.tickets.service; import cn.iocoder.yudao.module.tickets.entity.DlRepairTitem; +import cn.iocoder.yudao.module.tickets.vo.DlRepairTitemRespVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; /** @@ -11,4 +14,12 @@ import com.baomidou.mybatisplus.extension.service.IService; **/ public interface DlRepairTitemService extends IService { + /** + * 维修工单子表 分页 + * + * @author 小李 + * @date 10:34 2024/9/21 + * @param repairTitemRespVO 查询对象 + **/ + IPage getTItemPage(DlRepairTitemRespVO repairTitemRespVO, Page page); } 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 107496fb..33c5711a 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 @@ -1,7 +1,12 @@ package cn.iocoder.yudao.module.tickets.service.impl; +import cn.hutool.core.bean.BeanUtil; 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.system.api.dept.DeptApi; +import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO; import cn.iocoder.yudao.module.tickets.entity.DlRepairTickets; import cn.iocoder.yudao.module.tickets.entity.DlRepairTitem; import cn.iocoder.yudao.module.tickets.mapper.DlRepairTicketsMapper; @@ -10,6 +15,7 @@ import cn.iocoder.yudao.module.tickets.service.DlRepairTitemService; import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsReqVO; import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO; import com.baomidou.dynamic.datasource.annotation.DSTransactional; +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; @@ -17,7 +23,9 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.math.BigDecimal; import java.util.List; +import java.util.stream.Collectors; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; @@ -34,26 +42,49 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl itemList = ticketsRespVO.getItemList(); + List collect = itemList.stream().filter(item -> item.getItemType().equals("02")).collect(Collectors.toList()); + ticketsRespVO.setPartStatus(CollectionUtil.isEmpty(collect) ? "01" : "02"); + // 工单进行状态 默认是未派工 + ticketsRespVO.setTicketsWorkStatus("04"); + // 新增主表 baseMapper.insert(ticketsRespVO); // 新增子表 - if (CollectionUtil.isEmpty(ticketsRespVO.getItemList())){ - throw exception(RepairErrorCodeConstants.ITEM_IS_EMPTY); - } - List itemList = ticketsRespVO.getItemList(); itemList.forEach(item -> { - item.setTichetId(ticketsRespVO.getId()); + item.setTicketId(ticketsRespVO.getId()); }); titemService.saveBatch(itemList); } @@ -61,14 +92,32 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl getTicketsPage(DlRepairTicketsReqVO repairTicketsReqVO, Page page){ + public IPage getTicketsPage(DlRepairTicketsReqVO repairTicketsReqVO, Page page) { return baseMapper.getTicketsPage(repairTicketsReqVO, page); } + + /** + * 获得一个工单的详细信息 + * + * @author 小李 + * @date 16:05 2024/9/21 + * @param id 工单ID + **/ + @Override + public DlRepairTicketsRespVO getTicketsById(String id){ + // 查工单主表 + DlRepairTickets dlRepairTickets = baseMapper.selectById(id); + DlRepairTicketsRespVO result = BeanUtil.toBean(dlRepairTickets, DlRepairTicketsRespVO.class); + // 工单子表 + List itemList = titemService.list(new LambdaQueryWrapper().eq(DlRepairTitem::getTicketId, id)); + result.setItemList(itemList); + return result; + } } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTitemServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTitemServiceImpl.java index e0850a10..b972b1d2 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTitemServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTitemServiceImpl.java @@ -3,6 +3,9 @@ package cn.iocoder.yudao.module.tickets.service.impl; import cn.iocoder.yudao.module.tickets.entity.DlRepairTitem; import cn.iocoder.yudao.module.tickets.mapper.DlRepairTitemMapper; import cn.iocoder.yudao.module.tickets.service.DlRepairTitemService; +import cn.iocoder.yudao.module.tickets.vo.DlRepairTitemRespVO; +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.stereotype.Service; @@ -16,6 +19,17 @@ import org.springframework.stereotype.Service; public class DlRepairTitemServiceImpl extends ServiceImpl implements DlRepairTitemService { + /** + * 维修工单子表 分页 + * + * @author 小李 + * @date 10:34 2024/9/21 + * @param repairTitemRespVO 查询对象 + **/ + @Override + public IPage getTItemPage(DlRepairTitemRespVO repairTitemRespVO, Page page){ + return baseMapper.getTItemPage(repairTitemRespVO, page); + } } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/DlRepairTicketsReqVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/DlRepairTicketsReqVO.java index 822a2cc5..4ca8a912 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/DlRepairTicketsReqVO.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/DlRepairTicketsReqVO.java @@ -1,7 +1,13 @@ package cn.iocoder.yudao.module.tickets.vo; import cn.iocoder.yudao.module.tickets.entity.DlRepairTickets; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; /** * 维修工单表 请求VO @@ -10,4 +16,9 @@ import lombok.Data; **/ @Data public class DlRepairTicketsReqVO extends DlRepairTickets { + + /** 时间区间 */ + @Schema(pattern = "时间区间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private Date[] searchTimeArray; } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/DlRepairTitemRespVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/DlRepairTitemRespVO.java index ad2149f5..4788e3d4 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/DlRepairTitemRespVO.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/DlRepairTitemRespVO.java @@ -3,6 +3,8 @@ package cn.iocoder.yudao.module.tickets.vo; import cn.iocoder.yudao.module.tickets.entity.DlRepairTitem; import lombok.Data; +import java.util.Date; + /** * 维修工单子表 响应VO * @author 小李 @@ -10,4 +12,16 @@ import lombok.Data; **/ @Data public class DlRepairTitemRespVO extends DlRepairTitem { + + private String carNo; + + private String userName; + + private String userMobile; + + private Date[] searchTimeArray; + + private String corpId; + + private String ticketNo; } diff --git a/dl-module-repair/src/main/resources/mapper/other/DlRepairOtherMapper.xml b/dl-module-repair/src/main/resources/mapper/other/DlRepairOtherMapper.xml new file mode 100644 index 00000000..9a5611f8 --- /dev/null +++ b/dl-module-repair/src/main/resources/mapper/other/DlRepairOtherMapper.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + select id, + name, + price, + corp_id, + dept_id + from dl_repair_other dro + where dro.deleted = '0' + + + + 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 9b95ca65..1ffd84cc 100644 --- a/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml +++ b/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml @@ -5,36 +5,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -67,15 +74,45 @@ part_price, other_price, total_price, - tickets_status + tickets_status, + create_time, + in_time, + out_time, + cost, + profit, + part_status, + tickets_work_status from dl_repair_tickets drt where drt.deleted = '0' diff --git a/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTitemMapper.xml b/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTitemMapper.xml index 1a35bf52..ebdfd86f 100644 --- a/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTitemMapper.xml +++ b/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTitemMapper.xml @@ -3,52 +3,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - - - - - - - - - - - - - - select id, - tichet_id, - item_name, - item_count, - item_unit, - item_price, - item_discount, - item_money, - repair_id, - repair_name, - sale_id, - sale_name, - item_type, - project_id, - part_id, - project_type_id, - part_type_id, - other_type_id, - item_status, - remark - from dl_repair_titem drti - where drti.deleted = '0' - + diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/DictDataController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/DictDataController.java index b1b1242f..8a987f6f 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/DictDataController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/DictDataController.java @@ -11,6 +11,7 @@ import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataPage import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataRespVO; import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataSaveReqVO; import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataSimpleRespVO; +import cn.iocoder.yudao.module.system.controller.app.dict.vo.AppDictDataRespVO; import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; import cn.iocoder.yudao.module.system.service.dict.DictDataService; import io.swagger.v3.oas.annotations.Operation; @@ -100,5 +101,4 @@ public class DictDataController { ExcelUtils.write(response, "字典数据.xls", "数据", DictDataRespVO.class, BeanUtils.toBean(list, DictDataRespVO.class)); } - }