feat(erp/timesheet): 新增工时填报管理模块
parent
26954f9bf7
commit
3ed1dd0829
@ -0,0 +1,116 @@
|
||||
package org.dromara.oa.erp.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.oa.erp.domain.vo.ErpTimesheetDeptVo;
|
||||
import org.dromara.oa.erp.domain.bo.ErpTimesheetDeptBo;
|
||||
import org.dromara.oa.erp.service.IErpTimesheetDeptService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 部门工作明细
|
||||
* 前端访问路由地址为:/oa/erp/timesheetDept
|
||||
*
|
||||
* @author Yangk
|
||||
* @date 2025-12-09
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/erp/timesheetDept")
|
||||
public class ErpTimesheetDeptController extends BaseController {
|
||||
|
||||
private final IErpTimesheetDeptService erpTimesheetDeptService;
|
||||
|
||||
/**
|
||||
* 查询部门工作明细列表
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:timesheetDept:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ErpTimesheetDeptVo> list(ErpTimesheetDeptBo bo, PageQuery pageQuery) {
|
||||
return erpTimesheetDeptService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出部门工作明细列表
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:timesheetDept:export")
|
||||
@Log(title = "部门工作明细", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(ErpTimesheetDeptBo bo, HttpServletResponse response) {
|
||||
List<ErpTimesheetDeptVo> list = erpTimesheetDeptService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "部门工作明细", ErpTimesheetDeptVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门工作明细详细信息
|
||||
*
|
||||
* @param timesheetDeptId 主键
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:timesheetDept:query")
|
||||
@GetMapping("/{timesheetDeptId}")
|
||||
public R<ErpTimesheetDeptVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("timesheetDeptId") Long timesheetDeptId) {
|
||||
return R.ok(erpTimesheetDeptService.queryById(timesheetDeptId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增部门工作明细
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:timesheetDept:add")
|
||||
@Log(title = "部门工作明细", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ErpTimesheetDeptBo bo) {
|
||||
return toAjax(erpTimesheetDeptService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改部门工作明细
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:timesheetDept:edit")
|
||||
@Log(title = "部门工作明细", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ErpTimesheetDeptBo bo) {
|
||||
return toAjax(erpTimesheetDeptService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除部门工作明细
|
||||
*
|
||||
* @param timesheetDeptIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:timesheetDept:remove")
|
||||
@Log(title = "部门工作明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{timesheetDeptIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable("timesheetDeptIds") Long[] timesheetDeptIds) {
|
||||
return toAjax(erpTimesheetDeptService.deleteWithValidByIds(List.of(timesheetDeptIds), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉框查询部门工作明细列表
|
||||
*/
|
||||
@GetMapping("/getErpTimesheetDeptList")
|
||||
public R<List<ErpTimesheetDeptVo>> getErpTimesheetDeptList(ErpTimesheetDeptBo bo) {
|
||||
List<ErpTimesheetDeptVo> list = erpTimesheetDeptService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,116 @@
|
||||
package org.dromara.oa.erp.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.oa.erp.domain.vo.ErpTimesheetInfoVo;
|
||||
import org.dromara.oa.erp.domain.bo.ErpTimesheetInfoBo;
|
||||
import org.dromara.oa.erp.service.IErpTimesheetInfoService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 工时填报
|
||||
* 前端访问路由地址为:/oa/erp/timesheetInfo
|
||||
*
|
||||
* @author Yangk
|
||||
* @date 2025-12-09
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/erp/timesheetInfo")
|
||||
public class ErpTimesheetInfoController extends BaseController {
|
||||
|
||||
private final IErpTimesheetInfoService erpTimesheetInfoService;
|
||||
|
||||
/**
|
||||
* 查询工时填报列表
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:timesheetInfo:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ErpTimesheetInfoVo> list(ErpTimesheetInfoBo bo, PageQuery pageQuery) {
|
||||
return erpTimesheetInfoService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出工时填报列表
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:timesheetInfo:export")
|
||||
@Log(title = "工时填报", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(ErpTimesheetInfoBo bo, HttpServletResponse response) {
|
||||
List<ErpTimesheetInfoVo> list = erpTimesheetInfoService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "工时填报", ErpTimesheetInfoVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工时填报详细信息
|
||||
*
|
||||
* @param timesheetId 主键
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:timesheetInfo:query")
|
||||
@GetMapping("/{timesheetId}")
|
||||
public R<ErpTimesheetInfoVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("timesheetId") Long timesheetId) {
|
||||
return R.ok(erpTimesheetInfoService.queryById(timesheetId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增工时填报
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:timesheetInfo:add")
|
||||
@Log(title = "工时填报", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ErpTimesheetInfoBo bo) {
|
||||
return toAjax(erpTimesheetInfoService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改工时填报
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:timesheetInfo:edit")
|
||||
@Log(title = "工时填报", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ErpTimesheetInfoBo bo) {
|
||||
return toAjax(erpTimesheetInfoService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除工时填报
|
||||
*
|
||||
* @param timesheetIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:timesheetInfo:remove")
|
||||
@Log(title = "工时填报", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{timesheetIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable("timesheetIds") Long[] timesheetIds) {
|
||||
return toAjax(erpTimesheetInfoService.deleteWithValidByIds(List.of(timesheetIds), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉框查询工时填报列表
|
||||
*/
|
||||
@GetMapping("/getErpTimesheetInfoList")
|
||||
public R<List<ErpTimesheetInfoVo>> getErpTimesheetInfoList(ErpTimesheetInfoBo bo) {
|
||||
List<ErpTimesheetInfoVo> list = erpTimesheetInfoService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,116 @@
|
||||
package org.dromara.oa.erp.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.oa.erp.domain.vo.ErpTimesheetProjectVo;
|
||||
import org.dromara.oa.erp.domain.bo.ErpTimesheetProjectBo;
|
||||
import org.dromara.oa.erp.service.IErpTimesheetProjectService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 项目工作明细
|
||||
* 前端访问路由地址为:/oa/erp/timesheetProject
|
||||
*
|
||||
* @author Yangk
|
||||
* @date 2025-12-09
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/erp/timesheetProject")
|
||||
public class ErpTimesheetProjectController extends BaseController {
|
||||
|
||||
private final IErpTimesheetProjectService erpTimesheetProjectService;
|
||||
|
||||
/**
|
||||
* 查询项目工作明细列表
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:timesheetProject:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ErpTimesheetProjectVo> list(ErpTimesheetProjectBo bo, PageQuery pageQuery) {
|
||||
return erpTimesheetProjectService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出项目工作明细列表
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:timesheetProject:export")
|
||||
@Log(title = "项目工作明细", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(ErpTimesheetProjectBo bo, HttpServletResponse response) {
|
||||
List<ErpTimesheetProjectVo> list = erpTimesheetProjectService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "项目工作明细", ErpTimesheetProjectVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目工作明细详细信息
|
||||
*
|
||||
* @param timesheetProjectId 主键
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:timesheetProject:query")
|
||||
@GetMapping("/{timesheetProjectId}")
|
||||
public R<ErpTimesheetProjectVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("timesheetProjectId") Long timesheetProjectId) {
|
||||
return R.ok(erpTimesheetProjectService.queryById(timesheetProjectId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增项目工作明细
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:timesheetProject:add")
|
||||
@Log(title = "项目工作明细", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ErpTimesheetProjectBo bo) {
|
||||
return toAjax(erpTimesheetProjectService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目工作明细
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:timesheetProject:edit")
|
||||
@Log(title = "项目工作明细", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ErpTimesheetProjectBo bo) {
|
||||
return toAjax(erpTimesheetProjectService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除项目工作明细
|
||||
*
|
||||
* @param timesheetProjectIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:timesheetProject:remove")
|
||||
@Log(title = "项目工作明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{timesheetProjectIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable("timesheetProjectIds") Long[] timesheetProjectIds) {
|
||||
return toAjax(erpTimesheetProjectService.deleteWithValidByIds(List.of(timesheetProjectIds), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉框查询项目工作明细列表
|
||||
*/
|
||||
@GetMapping("/getErpTimesheetProjectList")
|
||||
public R<List<ErpTimesheetProjectVo>> getErpTimesheetProjectList(ErpTimesheetProjectBo bo) {
|
||||
List<ErpTimesheetProjectVo> list = erpTimesheetProjectService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package org.dromara.oa.erp.domain.bo;
|
||||
|
||||
import org.dromara.oa.erp.domain.ErpTimesheetDept;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 部门工作明细业务对象 erp_timesheet_dept
|
||||
*
|
||||
* @author Yangk
|
||||
* @date 2025-12-09
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = ErpTimesheetDept.class, reverseConvertGenerate = false)
|
||||
public class ErpTimesheetDeptBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 部门工作ID
|
||||
*/
|
||||
@NotNull(message = "部门工作ID不能为空", groups = { EditGroup.class })
|
||||
private Long timesheetDeptId;
|
||||
|
||||
/**
|
||||
* 工时填报ID
|
||||
*/
|
||||
@NotNull(message = "工时填报ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long timesheetId;
|
||||
|
||||
/**
|
||||
* 序号
|
||||
*/
|
||||
private Long sortOrder;
|
||||
|
||||
/**
|
||||
* 部门工作描述
|
||||
*/
|
||||
private String workDescription;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 部门直线经理ID
|
||||
*/
|
||||
private Long deptManagerId;
|
||||
|
||||
/**
|
||||
* 工时
|
||||
*/
|
||||
private Long hours;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
package org.dromara.oa.erp.domain.bo;
|
||||
|
||||
import org.dromara.oa.erp.domain.ErpTimesheetProject;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 项目工作明细业务对象 erp_timesheet_project
|
||||
*
|
||||
* @author Yangk
|
||||
* @date 2025-12-09
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = ErpTimesheetProject.class, reverseConvertGenerate = false)
|
||||
public class ErpTimesheetProjectBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 项目工作ID
|
||||
*/
|
||||
@NotNull(message = "项目工作ID不能为空", groups = { EditGroup.class })
|
||||
private Long timesheetProjectId;
|
||||
|
||||
/**
|
||||
* 工时填报ID
|
||||
*/
|
||||
@NotNull(message = "工时填报ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long timesheetId;
|
||||
|
||||
/**
|
||||
* 序号
|
||||
*/
|
||||
private Long sortOrder;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 项目号
|
||||
*/
|
||||
private String projectCode;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 项目经理ID
|
||||
*/
|
||||
private Long projectManagerId;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 工时
|
||||
*/
|
||||
private Long hours;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,74 @@
|
||||
package org.dromara.oa.erp.domain.vo;
|
||||
|
||||
import org.dromara.oa.erp.domain.ErpTimesheetDept;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 部门工作明细视图对象 erp_timesheet_dept
|
||||
*
|
||||
* @author Yangk
|
||||
* @date 2025-12-09
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = ErpTimesheetDept.class)
|
||||
public class ErpTimesheetDeptVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 部门工作ID
|
||||
*/
|
||||
@ExcelProperty(value = "部门工作ID")
|
||||
private Long timesheetDeptId;
|
||||
|
||||
/**
|
||||
* 工时填报ID
|
||||
*/
|
||||
@ExcelProperty(value = "工时填报ID")
|
||||
private Long timesheetId;
|
||||
|
||||
/**
|
||||
* 序号
|
||||
*/
|
||||
@ExcelProperty(value = "序号")
|
||||
private Long sortOrder;
|
||||
|
||||
/**
|
||||
* 部门工作描述
|
||||
*/
|
||||
@ExcelProperty(value = "部门工作描述")
|
||||
private String workDescription;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
@ExcelProperty(value = "部门ID")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 部门直线经理ID
|
||||
*/
|
||||
@ExcelProperty(value = "部门直线经理ID")
|
||||
private Long deptManagerId;
|
||||
|
||||
/**
|
||||
* 工时
|
||||
*/
|
||||
@ExcelProperty(value = "工时")
|
||||
private Long hours;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,86 @@
|
||||
package org.dromara.oa.erp.domain.vo;
|
||||
|
||||
import org.dromara.oa.erp.domain.ErpTimesheetProject;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 项目工作明细视图对象 erp_timesheet_project
|
||||
*
|
||||
* @author Yangk
|
||||
* @date 2025-12-09
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = ErpTimesheetProject.class)
|
||||
public class ErpTimesheetProjectVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 项目工作ID
|
||||
*/
|
||||
@ExcelProperty(value = "项目工作ID")
|
||||
private Long timesheetProjectId;
|
||||
|
||||
/**
|
||||
* 工时填报ID
|
||||
*/
|
||||
@ExcelProperty(value = "工时填报ID")
|
||||
private Long timesheetId;
|
||||
|
||||
/**
|
||||
* 序号
|
||||
*/
|
||||
@ExcelProperty(value = "序号")
|
||||
private Long sortOrder;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
@ExcelProperty(value = "项目ID")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 项目号
|
||||
*/
|
||||
@ExcelProperty(value = "项目号")
|
||||
private String projectCode;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
@ExcelProperty(value = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 项目经理ID
|
||||
*/
|
||||
@ExcelProperty(value = "项目经理ID")
|
||||
private Long projectManagerId;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
@ExcelProperty(value = "部门ID")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 工时
|
||||
*/
|
||||
@ExcelProperty(value = "工时")
|
||||
private Long hours;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package org.dromara.oa.erp.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.dromara.oa.erp.domain.ErpTimesheetDept;
|
||||
import org.dromara.oa.erp.domain.vo.ErpTimesheetDeptVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 部门工作明细Mapper接口
|
||||
*
|
||||
* @author Yangk
|
||||
* @date 2025-12-09
|
||||
*/
|
||||
public interface ErpTimesheetDeptMapper extends BaseMapperPlus<ErpTimesheetDept, ErpTimesheetDeptVo> {
|
||||
|
||||
/**
|
||||
* 查询部门工作明细列表
|
||||
*
|
||||
* @param page 分页
|
||||
* @param queryWrapper 条件
|
||||
* @return 部门工作明细集合
|
||||
*/
|
||||
public Page<ErpTimesheetDeptVo> selectCustomErpTimesheetDeptVoList(@Param("page") Page<ErpTimesheetDeptVo> page, @Param(Constants.WRAPPER) MPJLambdaWrapper<ErpTimesheetDept> queryWrapper);
|
||||
|
||||
/**
|
||||
* 查询部门工作明细列表
|
||||
*
|
||||
* @param queryWrapper 条件
|
||||
* @return 部门工作明细集合
|
||||
*/
|
||||
public List<ErpTimesheetDeptVo> selectCustomErpTimesheetDeptVoList(@Param(Constants.WRAPPER) MPJLambdaWrapper<ErpTimesheetDept> queryWrapper);
|
||||
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package org.dromara.oa.erp.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.dromara.oa.erp.domain.ErpTimesheetInfo;
|
||||
import org.dromara.oa.erp.domain.vo.ErpTimesheetInfoVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 工时填报Mapper接口
|
||||
*
|
||||
* @author Yangk
|
||||
* @date 2025-12-09
|
||||
*/
|
||||
public interface ErpTimesheetInfoMapper extends BaseMapperPlus<ErpTimesheetInfo, ErpTimesheetInfoVo> {
|
||||
|
||||
/**
|
||||
* 查询工时填报列表
|
||||
*
|
||||
* @param page 分页
|
||||
* @param queryWrapper 条件
|
||||
* @return 工时填报集合
|
||||
*/
|
||||
public Page<ErpTimesheetInfoVo> selectCustomErpTimesheetInfoVoList(@Param("page") Page<ErpTimesheetInfoVo> page, @Param(Constants.WRAPPER) MPJLambdaWrapper<ErpTimesheetInfo> queryWrapper);
|
||||
|
||||
/**
|
||||
* 查询工时填报列表
|
||||
*
|
||||
* @param queryWrapper 条件
|
||||
* @return 工时填报集合
|
||||
*/
|
||||
public List<ErpTimesheetInfoVo> selectCustomErpTimesheetInfoVoList(@Param(Constants.WRAPPER) MPJLambdaWrapper<ErpTimesheetInfo> queryWrapper);
|
||||
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package org.dromara.oa.erp.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.dromara.oa.erp.domain.ErpTimesheetProject;
|
||||
import org.dromara.oa.erp.domain.vo.ErpTimesheetProjectVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 项目工作明细Mapper接口
|
||||
*
|
||||
* @author Yangk
|
||||
* @date 2025-12-09
|
||||
*/
|
||||
public interface ErpTimesheetProjectMapper extends BaseMapperPlus<ErpTimesheetProject, ErpTimesheetProjectVo> {
|
||||
|
||||
/**
|
||||
* 查询项目工作明细列表
|
||||
*
|
||||
* @param page 分页
|
||||
* @param queryWrapper 条件
|
||||
* @return 项目工作明细集合
|
||||
*/
|
||||
public Page<ErpTimesheetProjectVo> selectCustomErpTimesheetProjectVoList(@Param("page") Page<ErpTimesheetProjectVo> page, @Param(Constants.WRAPPER) MPJLambdaWrapper<ErpTimesheetProject> queryWrapper);
|
||||
|
||||
/**
|
||||
* 查询项目工作明细列表
|
||||
*
|
||||
* @param queryWrapper 条件
|
||||
* @return 项目工作明细集合
|
||||
*/
|
||||
public List<ErpTimesheetProjectVo> selectCustomErpTimesheetProjectVoList(@Param(Constants.WRAPPER) MPJLambdaWrapper<ErpTimesheetProject> queryWrapper);
|
||||
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package org.dromara.oa.erp.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.dromara.oa.erp.domain.ErpTimesheetDept;
|
||||
import org.dromara.oa.erp.domain.vo.ErpTimesheetDeptVo;
|
||||
import org.dromara.oa.erp.domain.bo.ErpTimesheetDeptBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门工作明细Service接口
|
||||
*
|
||||
* @author Yangk
|
||||
* @date 2025-12-09
|
||||
*/
|
||||
public interface IErpTimesheetDeptService extends IService<ErpTimesheetDept> {
|
||||
|
||||
/**
|
||||
* 查询部门工作明细
|
||||
*
|
||||
* @param timesheetDeptId 主键
|
||||
* @return 部门工作明细
|
||||
*/
|
||||
ErpTimesheetDeptVo queryById(Long timesheetDeptId);
|
||||
|
||||
/**
|
||||
* 分页查询部门工作明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 部门工作明细分页列表
|
||||
*/
|
||||
TableDataInfo<ErpTimesheetDeptVo> queryPageList(ErpTimesheetDeptBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的部门工作明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 部门工作明细列表
|
||||
*/
|
||||
List<ErpTimesheetDeptVo> queryList(ErpTimesheetDeptBo bo);
|
||||
|
||||
/**
|
||||
* 新增部门工作明细
|
||||
*
|
||||
* @param bo 部门工作明细
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(ErpTimesheetDeptBo bo);
|
||||
|
||||
/**
|
||||
* 修改部门工作明细
|
||||
*
|
||||
* @param bo 部门工作明细
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(ErpTimesheetDeptBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除部门工作明细信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -0,0 +1,79 @@
|
||||
package org.dromara.oa.erp.service;
|
||||
|
||||
import org.dromara.oa.erp.domain.ErpTimesheetInfo;
|
||||
import org.dromara.oa.erp.domain.bo.ErpAfterSalesBo;
|
||||
import org.dromara.oa.erp.domain.vo.ErpAfterSalesVo;
|
||||
import org.dromara.oa.erp.domain.vo.ErpTimesheetDeptVo;
|
||||
import org.dromara.oa.erp.domain.vo.ErpTimesheetInfoVo;
|
||||
import org.dromara.oa.erp.domain.bo.ErpTimesheetInfoBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工时填报Service接口
|
||||
*
|
||||
* @author Yangk
|
||||
* @date 2025-12-09
|
||||
*/
|
||||
public interface IErpTimesheetInfoService {
|
||||
|
||||
/**
|
||||
* 查询工时填报
|
||||
*
|
||||
* @param timesheetId 主键
|
||||
* @return 工时填报
|
||||
*/
|
||||
ErpTimesheetInfoVo queryById(Long timesheetId);
|
||||
|
||||
/**
|
||||
* 分页查询工时填报列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 工时填报分页列表
|
||||
*/
|
||||
TableDataInfo<ErpTimesheetInfoVo> queryPageList(ErpTimesheetInfoBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的工时填报列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 工时填报列表
|
||||
*/
|
||||
List<ErpTimesheetInfoVo> queryList(ErpTimesheetInfoBo bo);
|
||||
|
||||
/**
|
||||
* 新增工时填报
|
||||
*
|
||||
* @param bo 工时填报
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(ErpTimesheetInfoBo bo);
|
||||
|
||||
/**
|
||||
* 修改工时填报
|
||||
*
|
||||
* @param bo 工时填报
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(ErpTimesheetInfoBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除工时填报信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 提交项目工时并启动流程
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
ErpTimesheetInfoVo submitAndFlowStart(ErpTimesheetInfoBo bo);
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package org.dromara.oa.erp.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.dromara.oa.erp.domain.ErpTimesheetProject;
|
||||
import org.dromara.oa.erp.domain.vo.ErpTimesheetProjectVo;
|
||||
import org.dromara.oa.erp.domain.bo.ErpTimesheetProjectBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目工作明细Service接口
|
||||
*
|
||||
* @author Yangk
|
||||
* @date 2025-12-09
|
||||
*/
|
||||
public interface IErpTimesheetProjectService extends IService<ErpTimesheetProject> {
|
||||
|
||||
/**
|
||||
* 查询项目工作明细
|
||||
*
|
||||
* @param timesheetProjectId 主键
|
||||
* @return 项目工作明细
|
||||
*/
|
||||
ErpTimesheetProjectVo queryById(Long timesheetProjectId);
|
||||
|
||||
/**
|
||||
* 分页查询项目工作明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 项目工作明细分页列表
|
||||
*/
|
||||
TableDataInfo<ErpTimesheetProjectVo> queryPageList(ErpTimesheetProjectBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的项目工作明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 项目工作明细列表
|
||||
*/
|
||||
List<ErpTimesheetProjectVo> queryList(ErpTimesheetProjectBo bo);
|
||||
|
||||
/**
|
||||
* 新增项目工作明细
|
||||
*
|
||||
* @param bo 项目工作明细
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(ErpTimesheetProjectBo bo);
|
||||
|
||||
/**
|
||||
* 修改项目工作明细
|
||||
*
|
||||
* @param bo 项目工作明细
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(ErpTimesheetProjectBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除项目工作明细信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -0,0 +1,141 @@
|
||||
package org.dromara.oa.erp.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.toolkit.JoinWrappers;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.oa.erp.domain.bo.ErpTimesheetDeptBo;
|
||||
import org.dromara.oa.erp.domain.vo.ErpTimesheetDeptVo;
|
||||
import org.dromara.oa.erp.domain.ErpTimesheetDept;
|
||||
import org.dromara.oa.erp.mapper.ErpTimesheetDeptMapper;
|
||||
import org.dromara.oa.erp.service.IErpTimesheetDeptService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 部门工作明细Service业务层处理
|
||||
*
|
||||
* @author Yangk
|
||||
* @date 2025-12-09
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ErpTimesheetDeptServiceImpl
|
||||
extends ServiceImpl<ErpTimesheetDeptMapper, ErpTimesheetDept>
|
||||
implements IErpTimesheetDeptService {
|
||||
|
||||
private final ErpTimesheetDeptMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询部门工作明细
|
||||
*
|
||||
* @param timesheetDeptId 主键
|
||||
* @return 部门工作明细
|
||||
*/
|
||||
@Override
|
||||
public ErpTimesheetDeptVo queryById(Long timesheetDeptId){
|
||||
return baseMapper.selectVoById(timesheetDeptId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询部门工作明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 部门工作明细分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<ErpTimesheetDeptVo> queryPageList(ErpTimesheetDeptBo bo, PageQuery pageQuery) {
|
||||
MPJLambdaWrapper<ErpTimesheetDept> lqw = buildQueryWrapper(bo);
|
||||
Page<ErpTimesheetDeptVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的部门工作明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 部门工作明细列表
|
||||
*/
|
||||
@Override
|
||||
public List<ErpTimesheetDeptVo> queryList(ErpTimesheetDeptBo bo) {
|
||||
MPJLambdaWrapper<ErpTimesheetDept> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private MPJLambdaWrapper<ErpTimesheetDept> buildQueryWrapper(ErpTimesheetDeptBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
MPJLambdaWrapper<ErpTimesheetDept> lqw = JoinWrappers.lambda(ErpTimesheetDept.class)
|
||||
.selectAll(ErpTimesheetDept.class)
|
||||
.eq(ErpTimesheetDept::getDelFlag, "0")
|
||||
.eq(bo.getTimesheetId() != null, ErpTimesheetDept::getTimesheetId, bo.getTimesheetId())
|
||||
.eq(bo.getSortOrder() != null, ErpTimesheetDept::getSortOrder, bo.getSortOrder())
|
||||
.eq(StringUtils.isNotBlank(bo.getWorkDescription()), ErpTimesheetDept::getWorkDescription, bo.getWorkDescription())
|
||||
.eq(bo.getDeptId() != null, ErpTimesheetDept::getDeptId, bo.getDeptId())
|
||||
.eq(bo.getDeptManagerId() != null, ErpTimesheetDept::getDeptManagerId, bo.getDeptManagerId())
|
||||
.eq(bo.getHours() != null, ErpTimesheetDept::getHours, bo.getHours())
|
||||
;
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增部门工作明细
|
||||
*
|
||||
* @param bo 部门工作明细
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(ErpTimesheetDeptBo bo) {
|
||||
ErpTimesheetDept add = MapstructUtils.convert(bo, ErpTimesheetDept.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setTimesheetDeptId(add.getTimesheetDeptId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改部门工作明细
|
||||
*
|
||||
* @param bo 部门工作明细
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(ErpTimesheetDeptBo bo) {
|
||||
ErpTimesheetDept update = MapstructUtils.convert(bo, ErpTimesheetDept.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(ErpTimesheetDept entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除部门工作明细信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,143 @@
|
||||
package org.dromara.oa.erp.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.toolkit.JoinWrappers;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.oa.erp.domain.bo.ErpTimesheetProjectBo;
|
||||
import org.dromara.oa.erp.domain.vo.ErpTimesheetProjectVo;
|
||||
import org.dromara.oa.erp.domain.ErpTimesheetProject;
|
||||
import org.dromara.oa.erp.mapper.ErpTimesheetProjectMapper;
|
||||
import org.dromara.oa.erp.service.IErpTimesheetProjectService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 项目工作明细Service业务层处理
|
||||
*
|
||||
* @author Yangk
|
||||
* @date 2025-12-09
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ErpTimesheetProjectServiceImpl
|
||||
extends ServiceImpl<ErpTimesheetProjectMapper, ErpTimesheetProject>
|
||||
implements IErpTimesheetProjectService {
|
||||
|
||||
private final ErpTimesheetProjectMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询项目工作明细
|
||||
*
|
||||
* @param timesheetProjectId 主键
|
||||
* @return 项目工作明细
|
||||
*/
|
||||
@Override
|
||||
public ErpTimesheetProjectVo queryById(Long timesheetProjectId){
|
||||
return baseMapper.selectVoById(timesheetProjectId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询项目工作明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 项目工作明细分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<ErpTimesheetProjectVo> queryPageList(ErpTimesheetProjectBo bo, PageQuery pageQuery) {
|
||||
MPJLambdaWrapper<ErpTimesheetProject> lqw = buildQueryWrapper(bo);
|
||||
Page<ErpTimesheetProjectVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的项目工作明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 项目工作明细列表
|
||||
*/
|
||||
@Override
|
||||
public List<ErpTimesheetProjectVo> queryList(ErpTimesheetProjectBo bo) {
|
||||
MPJLambdaWrapper<ErpTimesheetProject> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private MPJLambdaWrapper<ErpTimesheetProject> buildQueryWrapper(ErpTimesheetProjectBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
MPJLambdaWrapper<ErpTimesheetProject> lqw = JoinWrappers.lambda(ErpTimesheetProject.class)
|
||||
.selectAll(ErpTimesheetProject.class)
|
||||
.eq(ErpTimesheetProject::getDelFlag, "0")
|
||||
.eq(bo.getTimesheetId() != null, ErpTimesheetProject::getTimesheetId, bo.getTimesheetId())
|
||||
.eq(bo.getSortOrder() != null, ErpTimesheetProject::getSortOrder, bo.getSortOrder())
|
||||
.eq(bo.getProjectId() != null, ErpTimesheetProject::getProjectId, bo.getProjectId())
|
||||
.eq(StringUtils.isNotBlank(bo.getProjectCode()), ErpTimesheetProject::getProjectCode, bo.getProjectCode())
|
||||
.like(StringUtils.isNotBlank(bo.getProjectName()), ErpTimesheetProject::getProjectName, bo.getProjectName())
|
||||
.eq(bo.getProjectManagerId() != null, ErpTimesheetProject::getProjectManagerId, bo.getProjectManagerId())
|
||||
.eq(bo.getDeptId() != null, ErpTimesheetProject::getDeptId, bo.getDeptId())
|
||||
.eq(bo.getHours() != null, ErpTimesheetProject::getHours, bo.getHours())
|
||||
;
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增项目工作明细
|
||||
*
|
||||
* @param bo 项目工作明细
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(ErpTimesheetProjectBo bo) {
|
||||
ErpTimesheetProject add = MapstructUtils.convert(bo, ErpTimesheetProject.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setTimesheetProjectId(add.getTimesheetProjectId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目工作明细
|
||||
*
|
||||
* @param bo 项目工作明细
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(ErpTimesheetProjectBo bo) {
|
||||
ErpTimesheetProject update = MapstructUtils.convert(bo, ErpTimesheetProject.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(ErpTimesheetProject entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除项目工作明细信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.oa.erp.mapper.ErpTimesheetDeptMapper">
|
||||
<resultMap type="org.dromara.oa.erp.domain.vo.ErpTimesheetDeptVo" id="ErpTimesheetDeptResult">
|
||||
</resultMap>
|
||||
|
||||
<select id="selectCustomErpTimesheetDeptVoList" resultMap="ErpTimesheetDeptResult">
|
||||
select timesheet_dept_id, tenant_id, timesheet_id, sort_order, work_description, dept_id, dept_manager_id, hours, del_flag, create_dept, create_by, create_time, update_by, update_time from erp_timesheet_dept t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.oa.erp.mapper.ErpTimesheetInfoMapper">
|
||||
<resultMap type="org.dromara.oa.erp.domain.vo.ErpTimesheetInfoVo" id="ErpTimesheetInfoResult">
|
||||
</resultMap>
|
||||
|
||||
<select id="selectCustomErpTimesheetInfoVoList" resultMap="ErpTimesheetInfoResult">
|
||||
select timesheet_id, tenant_id, timesheet_code, user_id, dept_id, start_time, end_time, total_hours, dept_hours, project_hours, timesheet_status, flow_status, remark, del_flag, create_dept, create_by, create_time, update_by, update_time from erp_timesheet_info t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.oa.erp.mapper.ErpTimesheetProjectMapper">
|
||||
<resultMap type="org.dromara.oa.erp.domain.vo.ErpTimesheetProjectVo" id="ErpTimesheetProjectResult">
|
||||
</resultMap>
|
||||
|
||||
<select id="selectCustomErpTimesheetProjectVoList" resultMap="ErpTimesheetProjectResult">
|
||||
select timesheet_project_id, tenant_id, timesheet_id, sort_order, project_id, project_code, project_name, project_manager_id, dept_id, hours, del_flag, create_dept, create_by, create_time, update_by, update_time from erp_timesheet_project t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue