Merge remote-tracking branch 'origin/dev' into dev
commit
b9a5105734
@ -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>
|
||||
@ -0,0 +1,128 @@
|
||||
package org.dromara.wms.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.wms.domain.bo.WmsShippingBillBo;
|
||||
import org.dromara.wms.domain.vo.WmsShippingBillVo;
|
||||
import org.dromara.wms.service.IWmsShippingBillService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 发货单
|
||||
* 前端访问路由地址为:/wms/wmsShippingBill
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-08
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/wmsShippingBill")
|
||||
public class WmsShippingBillController extends BaseController {
|
||||
|
||||
private final IWmsShippingBillService wmsShippingBillService;
|
||||
|
||||
/**
|
||||
* 查询发货单列表
|
||||
*/
|
||||
@SaCheckPermission("wms:wmsShippingBill:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<WmsShippingBillVo> list(WmsShippingBillBo bo, PageQuery pageQuery) {
|
||||
return wmsShippingBillService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出发货单列表
|
||||
*/
|
||||
@SaCheckPermission("wms:wmsShippingBill:export")
|
||||
@Log(title = "发货单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(WmsShippingBillBo bo, HttpServletResponse response) {
|
||||
List<WmsShippingBillVo> list = wmsShippingBillService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "发货单", WmsShippingBillVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取发货单详细信息
|
||||
*
|
||||
* @param shippingBillId 主键
|
||||
*/
|
||||
@SaCheckPermission("wms:wmsShippingBill:query")
|
||||
@GetMapping("/{shippingBillId}")
|
||||
public R<WmsShippingBillVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("shippingBillId") Long shippingBillId) {
|
||||
return R.ok(wmsShippingBillService.queryById(shippingBillId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增发货单
|
||||
*/
|
||||
@SaCheckPermission("wms:wmsShippingBill:add")
|
||||
@Log(title = "发货单", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsShippingBillBo bo) {
|
||||
return toAjax(wmsShippingBillService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改发货单
|
||||
*/
|
||||
@SaCheckPermission("wms:wmsShippingBill:edit")
|
||||
@Log(title = "发货单", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsShippingBillBo bo) {
|
||||
return toAjax(wmsShippingBillService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除发货单
|
||||
*
|
||||
* @param shippingBillIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("wms:wmsShippingBill:remove")
|
||||
@Log(title = "发货单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{shippingBillIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable("shippingBillIds") Long[] shippingBillIds) {
|
||||
return toAjax(wmsShippingBillService.deleteWithValidByIds(List.of(shippingBillIds), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉框查询发货单列表
|
||||
*/
|
||||
@GetMapping("/getWmsShippingBillList")
|
||||
public R<List<WmsShippingBillVo>> getWmsShippingBillList(WmsShippingBillBo bo) {
|
||||
List<WmsShippingBillVo> list = wmsShippingBillService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交发货单并发起审批流程
|
||||
*/
|
||||
@SaCheckPermission("wms:wmsShippingBill:edit")
|
||||
@Log(title = "发货单", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/shippingBillSubmitAndFlowStart")
|
||||
public R<WmsShippingBillVo> shippingBillSubmitAndFlowStart(@RequestBody WmsShippingBillBo bo) {
|
||||
return R.ok(wmsShippingBillService.shippingBillSubmitAndFlowStart(bo));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,117 @@
|
||||
package org.dromara.wms.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.wms.domain.bo.WmsShippingDetailsBo;
|
||||
import org.dromara.wms.domain.vo.WmsShippingDetailsVo;
|
||||
import org.dromara.wms.service.IWmsShippingDetailsService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 发货单明细
|
||||
* 前端访问路由地址为:/wms/wmsShippingDetails
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-08
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/wmsShippingDetails")
|
||||
public class WmsShippingDetailsController extends BaseController {
|
||||
|
||||
private final IWmsShippingDetailsService wmsShippingDetailsService;
|
||||
|
||||
/**
|
||||
* 查询发货单明细列表
|
||||
*/
|
||||
@SaCheckPermission("wms:wmsShippingDetails:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<WmsShippingDetailsVo> list(WmsShippingDetailsBo bo, PageQuery pageQuery) {
|
||||
return wmsShippingDetailsService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出发货单明细列表
|
||||
*/
|
||||
@SaCheckPermission("wms:wmsShippingDetails:export")
|
||||
@Log(title = "发货单明细", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(WmsShippingDetailsBo bo, HttpServletResponse response) {
|
||||
List<WmsShippingDetailsVo> list = wmsShippingDetailsService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "发货单明细", WmsShippingDetailsVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取发货单明细详细信息
|
||||
*
|
||||
* @param shippingDetailsId 主键
|
||||
*/
|
||||
@SaCheckPermission("wms:wmsShippingDetails:query")
|
||||
@GetMapping("/{shippingDetailsId}")
|
||||
public R<WmsShippingDetailsVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("shippingDetailsId") Long shippingDetailsId) {
|
||||
return R.ok(wmsShippingDetailsService.queryById(shippingDetailsId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增发货单明细
|
||||
*/
|
||||
@SaCheckPermission("wms:wmsShippingDetails:add")
|
||||
@Log(title = "发货单明细", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsShippingDetailsBo bo) {
|
||||
return toAjax(wmsShippingDetailsService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改发货单明细
|
||||
*/
|
||||
@SaCheckPermission("wms:wmsShippingDetails:edit")
|
||||
@Log(title = "发货单明细", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsShippingDetailsBo bo) {
|
||||
return toAjax(wmsShippingDetailsService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除发货单明细
|
||||
*
|
||||
* @param shippingDetailsIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("wms:wmsShippingDetails:remove")
|
||||
@Log(title = "发货单明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{shippingDetailsIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable("shippingDetailsIds") Long[] shippingDetailsIds) {
|
||||
return toAjax(wmsShippingDetailsService.deleteWithValidByIds(List.of(shippingDetailsIds), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉框查询发货单明细列表
|
||||
*/
|
||||
@GetMapping("/getWmsShippingDetailsList")
|
||||
public R<List<WmsShippingDetailsVo>> getWmsShippingDetailsList(WmsShippingDetailsBo bo) {
|
||||
List<WmsShippingDetailsVo> list = wmsShippingDetailsService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
package org.dromara.wms.service;
|
||||
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.wms.domain.bo.WmsShippingBillBo;
|
||||
import org.dromara.wms.domain.vo.WmsShippingBillVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 发货单Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-08
|
||||
*/
|
||||
public interface IWmsShippingBillService {
|
||||
|
||||
/**
|
||||
* 查询发货单
|
||||
*
|
||||
* @param shippingBillId 主键
|
||||
* @return 发货单
|
||||
*/
|
||||
WmsShippingBillVo queryById(Long shippingBillId);
|
||||
|
||||
/**
|
||||
* 分页查询发货单列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 发货单分页列表
|
||||
*/
|
||||
TableDataInfo<WmsShippingBillVo> queryPageList(WmsShippingBillBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的发货单列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 发货单列表
|
||||
*/
|
||||
List<WmsShippingBillVo> queryList(WmsShippingBillBo bo);
|
||||
|
||||
/**
|
||||
* 新增发货单
|
||||
*
|
||||
* @param bo 发货单
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(WmsShippingBillBo bo);
|
||||
|
||||
/**
|
||||
* 修改发货单
|
||||
*
|
||||
* @param bo 发货单
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(WmsShippingBillBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除发货单信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 提交发货单并发起流程
|
||||
*
|
||||
* @param bo 发货单
|
||||
* @return 发货单VO
|
||||
*/
|
||||
WmsShippingBillVo shippingBillSubmitAndFlowStart(WmsShippingBillBo bo);
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
package org.dromara.wms.service;
|
||||
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.wms.domain.bo.WmsShippingDetailsBo;
|
||||
import org.dromara.wms.domain.vo.WmsShippingDetailsVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 发货单明细Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-08
|
||||
*/
|
||||
public interface IWmsShippingDetailsService {
|
||||
|
||||
/**
|
||||
* 查询发货单明细
|
||||
*
|
||||
* @param shippingDetailsId 主键
|
||||
* @return 发货单明细
|
||||
*/
|
||||
WmsShippingDetailsVo queryById(Long shippingDetailsId);
|
||||
|
||||
/**
|
||||
* 分页查询发货单明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 发货单明细分页列表
|
||||
*/
|
||||
TableDataInfo<WmsShippingDetailsVo> queryPageList(WmsShippingDetailsBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的发货单明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 发货单明细列表
|
||||
*/
|
||||
List<WmsShippingDetailsVo> queryList(WmsShippingDetailsBo bo);
|
||||
|
||||
/**
|
||||
* 新增发货单明细
|
||||
*
|
||||
* @param bo 发货单明细
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(WmsShippingDetailsBo bo);
|
||||
|
||||
/**
|
||||
* 修改发货单明细
|
||||
*
|
||||
* @param bo 发货单明细
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(WmsShippingDetailsBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除发货单明细信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -0,0 +1,148 @@
|
||||
package org.dromara.wms.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.toolkit.JoinWrappers;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.wms.domain.WmsShippingDetails;
|
||||
import org.dromara.wms.domain.bo.WmsShippingDetailsBo;
|
||||
import org.dromara.wms.domain.vo.WmsShippingDetailsVo;
|
||||
import org.dromara.wms.mapper.WmsShippingDetailsMapper;
|
||||
import org.dromara.wms.service.IWmsShippingDetailsService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 发货单明细Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-08
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class WmsShippingDetailsServiceImpl implements IWmsShippingDetailsService {
|
||||
|
||||
private final WmsShippingDetailsMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询发货单明细
|
||||
*
|
||||
* @param shippingDetailsId 主键
|
||||
* @return 发货单明细
|
||||
*/
|
||||
@Override
|
||||
public WmsShippingDetailsVo queryById(Long shippingDetailsId){
|
||||
return baseMapper.selectVoById(shippingDetailsId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询发货单明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 发货单明细分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<WmsShippingDetailsVo> queryPageList(WmsShippingDetailsBo bo, PageQuery pageQuery) {
|
||||
MPJLambdaWrapper<WmsShippingDetails> lqw = buildQueryWrapper(bo);
|
||||
Page<WmsShippingDetailsVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的发货单明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 发货单明细列表
|
||||
*/
|
||||
@Override
|
||||
public List<WmsShippingDetailsVo> queryList(WmsShippingDetailsBo bo) {
|
||||
MPJLambdaWrapper<WmsShippingDetails> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private MPJLambdaWrapper<WmsShippingDetails> buildQueryWrapper(WmsShippingDetailsBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
MPJLambdaWrapper<WmsShippingDetails> lqw = JoinWrappers.lambda(WmsShippingDetails.class)
|
||||
.selectAll(WmsShippingDetails.class)
|
||||
.eq(WmsShippingDetails::getDelFlag, "0")
|
||||
.eq(bo.getShippingBillId() != null, WmsShippingDetails::getShippingBillId, bo.getShippingBillId())
|
||||
.eq(StringUtils.isNotBlank(bo.getMaterialSourceType()), WmsShippingDetails::getMaterialSourceType, bo.getMaterialSourceType())
|
||||
.eq(bo.getErpMaterialId() != null, WmsShippingDetails::getErpMaterialId, bo.getErpMaterialId())
|
||||
.eq(bo.getWmsMaterialId() != null, WmsShippingDetails::getWmsMaterialId, bo.getWmsMaterialId())
|
||||
.eq(StringUtils.isNotBlank(bo.getSourceDetailType()), WmsShippingDetails::getSourceDetailType, bo.getSourceDetailType())
|
||||
.eq(bo.getSourceDetailId() != null, WmsShippingDetails::getSourceDetailId, bo.getSourceDetailId())
|
||||
.eq(bo.getWarehouseId() != null, WmsShippingDetails::getWarehouseId, bo.getWarehouseId())
|
||||
.eq(bo.getMaterielId() != null, WmsShippingDetails::getMaterielId, bo.getMaterielId())
|
||||
.eq(StringUtils.isNotBlank(bo.getMaterialCode()), WmsShippingDetails::getMaterialCode, bo.getMaterialCode())
|
||||
.like(StringUtils.isNotBlank(bo.getMaterialName()), WmsShippingDetails::getMaterialName, bo.getMaterialName())
|
||||
.eq(StringUtils.isNotBlank(bo.getMaterielSpecification()), WmsShippingDetails::getMaterielSpecification, bo.getMaterielSpecification())
|
||||
.eq(StringUtils.isNotBlank(bo.getBatchNumber()), WmsShippingDetails::getBatchNumber, bo.getBatchNumber())
|
||||
.eq(bo.getUnitPrice() != null, WmsShippingDetails::getUnitPrice, bo.getUnitPrice())
|
||||
.eq(bo.getShippingStockAmount() != null, WmsShippingDetails::getShippingStockAmount, bo.getShippingStockAmount())
|
||||
.eq(bo.getUnitId() != null, WmsShippingDetails::getUnitId, bo.getUnitId())
|
||||
.like(StringUtils.isNotBlank(bo.getUnitName()), WmsShippingDetails::getUnitName, bo.getUnitName())
|
||||
.eq(bo.getTotalPrice() != null, WmsShippingDetails::getTotalPrice, bo.getTotalPrice())
|
||||
;
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增发货单明细
|
||||
*
|
||||
* @param bo 发货单明细
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(WmsShippingDetailsBo bo) {
|
||||
WmsShippingDetails add = MapstructUtils.convert(bo, WmsShippingDetails.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setShippingDetailsId(add.getShippingDetailsId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改发货单明细
|
||||
*
|
||||
* @param bo 发货单明细
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(WmsShippingDetailsBo bo) {
|
||||
WmsShippingDetails update = MapstructUtils.convert(bo, WmsShippingDetails.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(WmsShippingDetails 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,262 @@
|
||||
<?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.wms.mapper.WmsShippingDetailsMapper">
|
||||
<resultMap type="org.dromara.wms.domain.vo.WmsShippingDetailsVo" id="WmsShippingDetailsResult">
|
||||
</resultMap>
|
||||
|
||||
<select id="selectCustomWmsShippingDetailsVoList" resultMap="WmsShippingDetailsResult">
|
||||
select t.shipping_details_id, t.tenant_id, t.shipping_bill_id, t.material_source_type, t.erp_material_id, t.wms_material_id, t.source_detail_type, t.source_detail_id, t.warehouse_id, t.materiel_id, t.material_code, t.material_name, t.materiel_specification, t.batch_number, t.unit_price, t.shipping_stock_amount, t.unit_id, t.unit_name, t.total_price, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time from wms_shipping_details t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<!-- 根据ID查询详情 -->
|
||||
<select id="selectCustomWmsShippingDetailsVoById" resultMap="WmsShippingDetailsResult">
|
||||
select t.shipping_details_id, t.tenant_id, t.shipping_bill_id, t.material_source_type, t.erp_material_id, t.wms_material_id, t.source_detail_type, t.source_detail_id, t.warehouse_id, t.materiel_id, t.material_code, t.material_name, t.materiel_specification, t.batch_number, t.unit_price, t.shipping_stock_amount, t.unit_id, t.unit_name, t.total_price, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
|
||||
from wms_shipping_details t
|
||||
where t.shipping_details_id = #{shippingDetailsId}
|
||||
</select>
|
||||
|
||||
<!-- 批量查询 - 根据ID列表 -->
|
||||
<select id="selectCustomWmsShippingDetailsVoByIds" resultMap="WmsShippingDetailsResult">
|
||||
select t.shipping_details_id, t.tenant_id, t.shipping_bill_id, t.material_source_type, t.erp_material_id, t.wms_material_id, t.source_detail_type, t.source_detail_id, t.warehouse_id, t.materiel_id, t.material_code, t.material_name, t.materiel_specification, t.batch_number, t.unit_price, t.shipping_stock_amount, t.unit_id, t.unit_name, t.total_price, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
|
||||
from wms_shipping_details t
|
||||
where t.shipping_details_id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!-- 统计查询 -->
|
||||
<select id="countCustomWmsShippingDetails" resultType="java.lang.Long">
|
||||
select count(1) from wms_shipping_details t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<!-- 分页查询(带自定义条件) -->
|
||||
<select id="selectCustomWmsShippingDetailsVoPage" resultMap="WmsShippingDetailsResult">
|
||||
select t.shipping_details_id, t.tenant_id, t.shipping_bill_id, t.material_source_type, t.erp_material_id, t.wms_material_id, t.source_detail_type, t.source_detail_id, t.warehouse_id, t.materiel_id, t.material_code, t.material_name, t.materiel_specification, t.batch_number, t.unit_price, t.shipping_stock_amount, t.unit_id, t.unit_name, t.total_price, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
|
||||
from wms_shipping_details t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<!-- 批量插入 -->
|
||||
<insert id="batchInsertWmsShippingDetails">
|
||||
insert into wms_shipping_details(
|
||||
tenant_id,
|
||||
|
||||
shipping_bill_id,
|
||||
|
||||
material_source_type,
|
||||
|
||||
erp_material_id,
|
||||
|
||||
wms_material_id,
|
||||
|
||||
source_detail_type,
|
||||
|
||||
source_detail_id,
|
||||
|
||||
warehouse_id,
|
||||
|
||||
materiel_id,
|
||||
|
||||
material_code,
|
||||
|
||||
material_name,
|
||||
|
||||
materiel_specification,
|
||||
|
||||
batch_number,
|
||||
|
||||
unit_price,
|
||||
|
||||
shipping_stock_amount,
|
||||
|
||||
unit_id,
|
||||
|
||||
unit_name,
|
||||
|
||||
total_price,
|
||||
|
||||
remark,
|
||||
|
||||
del_flag,
|
||||
|
||||
create_dept,
|
||||
|
||||
create_by,
|
||||
|
||||
create_time,
|
||||
|
||||
update_by,
|
||||
|
||||
update_time
|
||||
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.tenantId},
|
||||
|
||||
#{item.shippingBillId},
|
||||
|
||||
#{item.materialSourceType},
|
||||
|
||||
#{item.erpMaterialId},
|
||||
|
||||
#{item.wmsMaterialId},
|
||||
|
||||
#{item.sourceDetailType},
|
||||
|
||||
#{item.sourceDetailId},
|
||||
|
||||
#{item.warehouseId},
|
||||
|
||||
#{item.materielId},
|
||||
|
||||
#{item.materialCode},
|
||||
|
||||
#{item.materialName},
|
||||
|
||||
#{item.materielSpecification},
|
||||
|
||||
#{item.batchNumber},
|
||||
|
||||
#{item.unitPrice},
|
||||
|
||||
#{item.shippingStockAmount},
|
||||
|
||||
#{item.unitId},
|
||||
|
||||
#{item.unitName},
|
||||
|
||||
#{item.totalPrice},
|
||||
|
||||
#{item.remark},
|
||||
|
||||
#{item.delFlag},
|
||||
|
||||
#{item.createDept},
|
||||
|
||||
#{item.createBy},
|
||||
|
||||
#{item.createTime},
|
||||
|
||||
#{item.updateBy},
|
||||
|
||||
#{item.updateTime}
|
||||
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 批量更新 -->
|
||||
<update id="batchUpdateWmsShippingDetails">
|
||||
<foreach collection="list" item="item" separator=";">
|
||||
update wms_shipping_details t
|
||||
<set>
|
||||
<if test="item.tenantId != null and item.tenantId != ''">
|
||||
t.tenant_id = #{item.tenantId},
|
||||
</if>
|
||||
<if test="item.shippingBillId != null">
|
||||
t.shipping_bill_id = #{item.shippingBillId},
|
||||
</if>
|
||||
<if test="item.materialSourceType != null and item.materialSourceType != ''">
|
||||
t.material_source_type = #{item.materialSourceType},
|
||||
</if>
|
||||
<if test="item.erpMaterialId != null">
|
||||
t.erp_material_id = #{item.erpMaterialId},
|
||||
</if>
|
||||
<if test="item.wmsMaterialId != null">
|
||||
t.wms_material_id = #{item.wmsMaterialId},
|
||||
</if>
|
||||
<if test="item.sourceDetailType != null and item.sourceDetailType != ''">
|
||||
t.source_detail_type = #{item.sourceDetailType},
|
||||
</if>
|
||||
<if test="item.sourceDetailId != null">
|
||||
t.source_detail_id = #{item.sourceDetailId},
|
||||
</if>
|
||||
<if test="item.warehouseId != null">
|
||||
t.warehouse_id = #{item.warehouseId},
|
||||
</if>
|
||||
<if test="item.materielId != null">
|
||||
t.materiel_id = #{item.materielId},
|
||||
</if>
|
||||
<if test="item.materialCode != null and item.materialCode != ''">
|
||||
t.material_code = #{item.materialCode},
|
||||
</if>
|
||||
<if test="item.materialName != null and item.materialName != ''">
|
||||
t.material_name = #{item.materialName},
|
||||
</if>
|
||||
<if test="item.materielSpecification != null and item.materielSpecification != ''">
|
||||
t.materiel_specification = #{item.materielSpecification},
|
||||
</if>
|
||||
<if test="item.batchNumber != null and item.batchNumber != ''">
|
||||
t.batch_number = #{item.batchNumber},
|
||||
</if>
|
||||
<if test="item.unitPrice != null">
|
||||
t.unit_price = #{item.unitPrice},
|
||||
</if>
|
||||
<if test="item.shippingStockAmount != null">
|
||||
t.shipping_stock_amount = #{item.shippingStockAmount},
|
||||
</if>
|
||||
<if test="item.unitId != null">
|
||||
t.unit_id = #{item.unitId},
|
||||
</if>
|
||||
<if test="item.unitName != null and item.unitName != ''">
|
||||
t.unit_name = #{item.unitName},
|
||||
</if>
|
||||
<if test="item.totalPrice != null">
|
||||
t.total_price = #{item.totalPrice},
|
||||
</if>
|
||||
<if test="item.remark != null and item.remark != ''">
|
||||
t.remark = #{item.remark},
|
||||
</if>
|
||||
<if test="item.delFlag != null and item.delFlag != ''">
|
||||
t.del_flag = #{item.delFlag},
|
||||
</if>
|
||||
<if test="item.createDept != null">
|
||||
t.create_dept = #{item.createDept},
|
||||
</if>
|
||||
<if test="item.createBy != null">
|
||||
t.create_by = #{item.createBy},
|
||||
</if>
|
||||
<if test="item.createTime != null">
|
||||
t.create_time = #{item.createTime},
|
||||
</if>
|
||||
<if test="item.updateBy != null">
|
||||
t.update_by = #{item.updateBy},
|
||||
</if>
|
||||
<if test="item.updateTime != null">
|
||||
t.update_time = #{item.updateTime}
|
||||
</if>
|
||||
</set>
|
||||
where t.shipping_details_id = #{item.shippingDetailsId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!-- 根据自定义条件删除 -->
|
||||
<delete id="deleteCustomWmsShippingDetails">
|
||||
delete from wms_shipping_details t
|
||||
${ew.getCustomSqlSegment}
|
||||
</delete>
|
||||
|
||||
<!-- 根据ID列表批量删除 -->
|
||||
<delete id="deleteCustomWmsShippingDetailsByIds">
|
||||
delete from wms_shipping_details t
|
||||
where t.shipping_details_id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 检查是否存在 -->
|
||||
<select id="existsWmsShippingDetails" resultType="java.lang.Boolean">
|
||||
select count(1) > 0 from wms_shipping_details t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue