feat(oa): 新增月度记账、采购计划明细和供应商信息功能
- 添加了月度记账、采购计划明细和供应商信息的实体类、BO类、控制器、Mapper接口和XML文件- 实现了基本的CRUD操作,包括列表查询、导出、详情获取、新增、修改和删除 - 为采购计划明细和供应商信息添加了关联查询
This commit is contained in:
@@ -0,0 +1,102 @@
|
||||
package com.gear.oa.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.gear.common.annotation.RepeatSubmit;
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.PageQuery;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.core.validate.AddGroup;
|
||||
import com.gear.common.core.validate.EditGroup;
|
||||
import com.gear.common.core.validate.QueryGroup;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.common.utils.poi.ExcelUtil;
|
||||
import com.gear.oa.domain.vo.GearMonthlyAccountVo;
|
||||
import com.gear.oa.domain.bo.GearMonthlyAccountBo;
|
||||
import com.gear.oa.service.IGearMonthlyAccountService;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 月度记账
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/oa/monthlyAccount")
|
||||
public class GearMonthlyAccountController extends BaseController {
|
||||
|
||||
private final IGearMonthlyAccountService iGearMonthlyAccountService;
|
||||
|
||||
/**
|
||||
* 查询月度记账列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<GearMonthlyAccountVo> list(GearMonthlyAccountBo bo, PageQuery pageQuery) {
|
||||
return iGearMonthlyAccountService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出月度记账列表
|
||||
*/
|
||||
@Log(title = "月度记账", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(GearMonthlyAccountBo bo, HttpServletResponse response) {
|
||||
List<GearMonthlyAccountVo> list = iGearMonthlyAccountService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "月度记账", GearMonthlyAccountVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取月度记账详细信息
|
||||
*
|
||||
* @param accountId 主键
|
||||
*/
|
||||
@GetMapping("/{accountId}")
|
||||
public R<GearMonthlyAccountVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long accountId) {
|
||||
return R.ok(iGearMonthlyAccountService.queryById(accountId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增月度记账
|
||||
*/
|
||||
@Log(title = "月度记账", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody GearMonthlyAccountBo bo) {
|
||||
return toAjax(iGearMonthlyAccountService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改月度记账
|
||||
*/
|
||||
@Log(title = "月度记账", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody GearMonthlyAccountBo bo) {
|
||||
return toAjax(iGearMonthlyAccountService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除月度记账
|
||||
*
|
||||
* @param accountIds 主键串
|
||||
*/
|
||||
@Log(title = "月度记账", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{accountIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] accountIds) {
|
||||
return toAjax(iGearMonthlyAccountService.deleteWithValidByIds(Arrays.asList(accountIds), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.gear.oa.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.gear.common.annotation.RepeatSubmit;
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.PageQuery;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.core.validate.AddGroup;
|
||||
import com.gear.common.core.validate.EditGroup;
|
||||
import com.gear.common.core.validate.QueryGroup;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.common.utils.poi.ExcelUtil;
|
||||
import com.gear.oa.domain.vo.GearPurchasePlanDetailVo;
|
||||
import com.gear.oa.domain.bo.GearPurchasePlanDetailBo;
|
||||
import com.gear.oa.service.IGearPurchasePlanDetailService;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 采购计划明细
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/oa/purchasePlanDetail")
|
||||
public class GearPurchasePlanDetailController extends BaseController {
|
||||
|
||||
private final IGearPurchasePlanDetailService iGearPurchasePlanDetailService;
|
||||
|
||||
/**
|
||||
* 查询采购计划明细列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<GearPurchasePlanDetailVo> list(GearPurchasePlanDetailBo bo, PageQuery pageQuery) {
|
||||
return iGearPurchasePlanDetailService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出采购计划明细列表
|
||||
*/
|
||||
@Log(title = "采购计划明细", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(GearPurchasePlanDetailBo bo, HttpServletResponse response) {
|
||||
List<GearPurchasePlanDetailVo> list = iGearPurchasePlanDetailService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "采购计划明细", GearPurchasePlanDetailVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取采购计划明细详细信息
|
||||
*
|
||||
* @param detailId 主键
|
||||
*/
|
||||
@GetMapping("/{detailId}")
|
||||
public R<GearPurchasePlanDetailVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long detailId) {
|
||||
return R.ok(iGearPurchasePlanDetailService.queryById(detailId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增采购计划明细
|
||||
*/
|
||||
@Log(title = "采购计划明细", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody GearPurchasePlanDetailBo bo) {
|
||||
return toAjax(iGearPurchasePlanDetailService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改采购计划明细
|
||||
*/
|
||||
@Log(title = "采购计划明细", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody GearPurchasePlanDetailBo bo) {
|
||||
return toAjax(iGearPurchasePlanDetailService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除采购计划明细
|
||||
*
|
||||
* @param detailIds 主键串
|
||||
*/
|
||||
@Log(title = "采购计划明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{detailIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] detailIds) {
|
||||
return toAjax(iGearPurchasePlanDetailService.deleteWithValidByIds(Arrays.asList(detailIds), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.gear.oa.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.gear.common.annotation.RepeatSubmit;
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.PageQuery;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.core.validate.AddGroup;
|
||||
import com.gear.common.core.validate.EditGroup;
|
||||
import com.gear.common.core.validate.QueryGroup;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.common.utils.poi.ExcelUtil;
|
||||
import com.gear.oa.domain.vo.GearSupplierVo;
|
||||
import com.gear.oa.domain.bo.GearSupplierBo;
|
||||
import com.gear.oa.service.IGearSupplierService;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 供应商信息
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/oa/supplier")
|
||||
public class GearSupplierController extends BaseController {
|
||||
|
||||
private final IGearSupplierService iGearSupplierService;
|
||||
|
||||
/**
|
||||
* 查询供应商信息列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<GearSupplierVo> list(GearSupplierBo bo, PageQuery pageQuery) {
|
||||
return iGearSupplierService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出供应商信息列表
|
||||
*/
|
||||
@Log(title = "供应商信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(GearSupplierBo bo, HttpServletResponse response) {
|
||||
List<GearSupplierVo> list = iGearSupplierService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "供应商信息", GearSupplierVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取供应商信息详细信息
|
||||
*
|
||||
* @param supplierId 主键
|
||||
*/
|
||||
@GetMapping("/{supplierId}")
|
||||
public R<GearSupplierVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long supplierId) {
|
||||
return R.ok(iGearSupplierService.queryById(supplierId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增供应商信息
|
||||
*/
|
||||
@Log(title = "供应商信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody GearSupplierBo bo) {
|
||||
return toAjax(iGearSupplierService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改供应商信息
|
||||
*/
|
||||
@Log(title = "供应商信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody GearSupplierBo bo) {
|
||||
return toAjax(iGearSupplierService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除供应商信息
|
||||
*
|
||||
* @param supplierIds 主键串
|
||||
*/
|
||||
@Log(title = "供应商信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{supplierIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] supplierIds) {
|
||||
return toAjax(iGearSupplierService.deleteWithValidByIds(Arrays.asList(supplierIds), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.gear.oa.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.gear.common.annotation.RepeatSubmit;
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.PageQuery;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.core.validate.AddGroup;
|
||||
import com.gear.common.core.validate.EditGroup;
|
||||
import com.gear.common.core.validate.QueryGroup;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.common.utils.poi.ExcelUtil;
|
||||
import com.gear.oa.domain.vo.GearSupplyTypeVo;
|
||||
import com.gear.oa.domain.bo.GearSupplyTypeBo;
|
||||
import com.gear.oa.service.IGearSupplyTypeService;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 供货类型管理
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/oa/supplyType")
|
||||
public class GearSupplyTypeController extends BaseController {
|
||||
|
||||
private final IGearSupplyTypeService iGearSupplyTypeService;
|
||||
|
||||
/**
|
||||
* 查询供货类型管理列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<GearSupplyTypeVo> list(GearSupplyTypeBo bo, PageQuery pageQuery) {
|
||||
return iGearSupplyTypeService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出供货类型管理列表
|
||||
*/
|
||||
@Log(title = "供货类型管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(GearSupplyTypeBo bo, HttpServletResponse response) {
|
||||
List<GearSupplyTypeVo> list = iGearSupplyTypeService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "供货类型管理", GearSupplyTypeVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取供货类型管理详细信息
|
||||
*
|
||||
* @param typeId 主键
|
||||
*/
|
||||
@GetMapping("/{typeId}")
|
||||
public R<GearSupplyTypeVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long typeId) {
|
||||
return R.ok(iGearSupplyTypeService.queryById(typeId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增供货类型管理
|
||||
*/
|
||||
@Log(title = "供货类型管理", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody GearSupplyTypeBo bo) {
|
||||
return toAjax(iGearSupplyTypeService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改供货类型管理
|
||||
*/
|
||||
@Log(title = "供货类型管理", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody GearSupplyTypeBo bo) {
|
||||
return toAjax(iGearSupplyTypeService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除供货类型管理
|
||||
*
|
||||
* @param typeIds 主键串
|
||||
*/
|
||||
@Log(title = "供货类型管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{typeIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] typeIds) {
|
||||
return toAjax(iGearSupplyTypeService.deleteWithValidByIds(Arrays.asList(typeIds), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.gear.oa.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gear.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 月度记账对象 gear_monthly_account
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("gear_monthly_account")
|
||||
public class GearMonthlyAccount extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 月记账ID
|
||||
*/
|
||||
@TableId(value = "account_id")
|
||||
private Long accountId;
|
||||
/**
|
||||
* 月份 (YYYY-MM)
|
||||
*/
|
||||
private String monthYear;
|
||||
/**
|
||||
* 该月采购总金额
|
||||
*/
|
||||
private BigDecimal totalAmount;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 删除标志(0=正常,1=已删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.gear.oa.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gear.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 采购计划明细对象 gear_purchase_plan_detail
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("gear_purchase_plan_detail")
|
||||
public class GearPurchasePlanDetail extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 明细ID
|
||||
*/
|
||||
@TableId(value = "detail_id")
|
||||
private Long detailId;
|
||||
/**
|
||||
* 详情编码
|
||||
*/
|
||||
private String detailCode;
|
||||
/**
|
||||
* 供应商ID
|
||||
*/
|
||||
private Long supplierId;
|
||||
/**
|
||||
* 原材料名称
|
||||
*/
|
||||
private String rawMaterialName;
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
private String owner;
|
||||
/**
|
||||
* 计划采购数量
|
||||
*/
|
||||
private Long quantity;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
private BigDecimal unitPrice;
|
||||
/**
|
||||
* 总金额
|
||||
*/
|
||||
private BigDecimal totalAmount;
|
||||
/**
|
||||
* 附件
|
||||
*/
|
||||
private String annex;
|
||||
/**
|
||||
* 状态(0=新建,1=在途
|
||||
,2=到货
|
||||
,3=待审核,4=采购完成)
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 删除标志(0=正常,1=已删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
60
gear-oa/src/main/java/com/gear/oa/domain/GearSupplier.java
Normal file
60
gear-oa/src/main/java/com/gear/oa/domain/GearSupplier.java
Normal file
@@ -0,0 +1,60 @@
|
||||
package com.gear.oa.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.gear.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 供应商信息对象 gear_supplier
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("gear_supplier")
|
||||
public class GearSupplier extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 供应商ID(主键)
|
||||
*/
|
||||
@TableId(value = "supplier_id")
|
||||
private Long supplierId;
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
private String contactPerson;
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 供货商类型id
|
||||
*/
|
||||
private Long typeId;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 删除标志(0=正常,1=已删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
48
gear-oa/src/main/java/com/gear/oa/domain/GearSupplyType.java
Normal file
48
gear-oa/src/main/java/com/gear/oa/domain/GearSupplyType.java
Normal file
@@ -0,0 +1,48 @@
|
||||
package com.gear.oa.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.gear.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 供货类型管理对象 gear_supply_type
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("gear_supply_type")
|
||||
public class GearSupplyType extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 供货类型ID
|
||||
*/
|
||||
@TableId(value = "type_id")
|
||||
private Long typeId;
|
||||
/**
|
||||
* 供货类型名称
|
||||
*/
|
||||
private String typeName;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 删除标志(0=正常,1=已删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.gear.oa.domain.bo;
|
||||
|
||||
import com.gear.common.core.validate.AddGroup;
|
||||
import com.gear.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gear.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 月度记账业务对象 gear_monthly_account
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class GearMonthlyAccountBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 月记账ID
|
||||
*/
|
||||
private Long accountId;
|
||||
|
||||
/**
|
||||
* 月份 (YYYY-MM)
|
||||
*/
|
||||
private String monthYear;
|
||||
|
||||
/**
|
||||
* 该月采购总金额
|
||||
*/
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.gear.oa.domain.bo;
|
||||
|
||||
import com.gear.common.core.validate.AddGroup;
|
||||
import com.gear.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gear.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 采购计划明细业务对象 gear_purchase_plan_detail
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class GearPurchasePlanDetailBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 明细ID
|
||||
*/
|
||||
private Long detailId;
|
||||
|
||||
/**
|
||||
* 详情编码
|
||||
*/
|
||||
private String detailCode;
|
||||
|
||||
/**
|
||||
* 供应商ID
|
||||
*/
|
||||
private Long supplierId;
|
||||
|
||||
/**
|
||||
* 原材料名称
|
||||
*/
|
||||
private String rawMaterialName;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
private String owner;
|
||||
|
||||
/**
|
||||
* 计划采购数量
|
||||
*/
|
||||
private Long quantity;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/**
|
||||
* 总金额
|
||||
*/
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 附件
|
||||
*/
|
||||
private String annex;
|
||||
|
||||
/**
|
||||
* 状态(0=新建,1=在途
|
||||
,2=到货
|
||||
,3=待审核,4=采购完成)
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.gear.oa.domain.bo;
|
||||
|
||||
import com.gear.common.core.validate.AddGroup;
|
||||
import com.gear.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.gear.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 供应商信息业务对象 gear_supplier
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class GearSupplierBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 供应商ID(主键)
|
||||
*/
|
||||
private Long supplierId;
|
||||
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
private String contactPerson;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 供货商类型id
|
||||
*/
|
||||
private Long typeId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.gear.oa.domain.bo;
|
||||
|
||||
import com.gear.common.core.validate.AddGroup;
|
||||
import com.gear.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.gear.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 供货类型管理业务对象 gear_supply_type
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class GearSupplyTypeBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 供货类型ID
|
||||
*/
|
||||
private Long typeId;
|
||||
|
||||
/**
|
||||
* 供货类型名称
|
||||
*/
|
||||
private String typeName;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.gear.oa.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.gear.common.annotation.ExcelDictFormat;
|
||||
import com.gear.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 月度记账视图对象 gear_monthly_account
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class GearMonthlyAccountVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 月记账ID
|
||||
*/
|
||||
@ExcelProperty(value = "月记账ID")
|
||||
private Long accountId;
|
||||
|
||||
/**
|
||||
* 月份 (YYYY-MM)
|
||||
*/
|
||||
@ExcelProperty(value = "月份 (YYYY-MM)")
|
||||
private String monthYear;
|
||||
|
||||
/**
|
||||
* 该月采购总金额
|
||||
*/
|
||||
@ExcelProperty(value = "该月采购总金额")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.gear.oa.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.gear.common.annotation.ExcelDictFormat;
|
||||
import com.gear.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 采购计划明细视图对象 gear_purchase_plan_detail
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class GearPurchasePlanDetailVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 明细ID
|
||||
*/
|
||||
@ExcelProperty(value = "明细ID")
|
||||
private Long detailId;
|
||||
|
||||
/**
|
||||
* 详情编码
|
||||
*/
|
||||
@ExcelProperty(value = "详情编码")
|
||||
private String detailCode;
|
||||
|
||||
/**
|
||||
* 供应商ID
|
||||
*/
|
||||
@ExcelProperty(value = "供应商ID")
|
||||
private Long supplierId;
|
||||
|
||||
/**
|
||||
* 原材料名称
|
||||
*/
|
||||
@ExcelProperty(value = "原材料名称")
|
||||
private String rawMaterialName;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
@ExcelProperty(value = "负责人")
|
||||
private String owner;
|
||||
|
||||
/**
|
||||
* 计划采购数量
|
||||
*/
|
||||
@ExcelProperty(value = "计划采购数量")
|
||||
private Long quantity;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@ExcelProperty(value = "单位")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
@ExcelProperty(value = "单价")
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/**
|
||||
* 总金额
|
||||
*/
|
||||
@ExcelProperty(value = "总金额")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 附件
|
||||
*/
|
||||
@ExcelProperty(value = "附件")
|
||||
private String annex;
|
||||
|
||||
/**
|
||||
* 状态(0=新建,1=在途,2=到货,3=待审核,4=采购完成)
|
||||
*/
|
||||
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "0==新建,1=在途,2=到货,3=待审核,4=采购完成")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
//供应商名称
|
||||
private String supplierName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.gear.oa.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.gear.common.annotation.ExcelDictFormat;
|
||||
import com.gear.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 供应商信息视图对象 gear_supplier
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class GearSupplierVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 供应商ID(主键)
|
||||
*/
|
||||
@ExcelProperty(value = "供应商ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "主=键")
|
||||
private Long supplierId;
|
||||
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
@ExcelProperty(value = "供应商名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
@ExcelProperty(value = "联系人")
|
||||
private String contactPerson;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@ExcelProperty(value = "联系电话")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
@ExcelProperty(value = "地址")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 供货商类型id
|
||||
*/
|
||||
@ExcelProperty(value = "供货商类型id")
|
||||
private Long typeId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
//类型名称
|
||||
@ExcelProperty(value = "类型名称")
|
||||
private String typeName;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.gear.oa.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.gear.common.annotation.ExcelDictFormat;
|
||||
import com.gear.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 供货类型管理视图对象 gear_supply_type
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class GearSupplyTypeVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 供货类型ID
|
||||
*/
|
||||
@ExcelProperty(value = "供货类型ID")
|
||||
private Long typeId;
|
||||
|
||||
/**
|
||||
* 供货类型名称
|
||||
*/
|
||||
@ExcelProperty(value = "供货类型名称")
|
||||
private String typeName;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@ExcelProperty(value = "描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.gear.oa.mapper;
|
||||
|
||||
import com.gear.oa.domain.GearMonthlyAccount;
|
||||
import com.gear.oa.domain.vo.GearMonthlyAccountVo;
|
||||
import com.gear.common.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 月度记账Mapper接口
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
public interface GearMonthlyAccountMapper extends BaseMapperPlus<GearMonthlyAccountMapper, GearMonthlyAccount, GearMonthlyAccountVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.gear.oa.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gear.oa.domain.GearPurchasePlanDetail;
|
||||
import com.gear.oa.domain.vo.GearPurchasePlanDetailVo;
|
||||
import com.gear.common.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 采购计划明细Mapper接口
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
public interface GearPurchasePlanDetailMapper extends BaseMapperPlus<GearPurchasePlanDetailMapper, GearPurchasePlanDetail, GearPurchasePlanDetailVo> {
|
||||
|
||||
Page<GearPurchasePlanDetailVo> selectVoPagePlus(Page<Object> build,@Param("ew") LambdaQueryWrapper<GearPurchasePlanDetail> lqw);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.gear.oa.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gear.oa.domain.GearSupplier;
|
||||
import com.gear.oa.domain.vo.GearSupplierVo;
|
||||
import com.gear.common.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 供应商信息Mapper接口
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
public interface GearSupplierMapper extends BaseMapperPlus<GearSupplierMapper, GearSupplier, GearSupplierVo> {
|
||||
|
||||
Page<GearSupplierVo> selectVoPagePlus(Page<Object> build,@Param("ew") QueryWrapper<GearSupplier> lqw);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.gear.oa.mapper;
|
||||
|
||||
import com.gear.oa.domain.GearSupplyType;
|
||||
import com.gear.oa.domain.vo.GearSupplyTypeVo;
|
||||
import com.gear.common.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 供货类型管理Mapper接口
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
public interface GearSupplyTypeMapper extends BaseMapperPlus<GearSupplyTypeMapper, GearSupplyType, GearSupplyTypeVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.gear.oa.service;
|
||||
|
||||
import com.gear.oa.domain.GearMonthlyAccount;
|
||||
import com.gear.oa.domain.vo.GearMonthlyAccountVo;
|
||||
import com.gear.oa.domain.bo.GearMonthlyAccountBo;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 月度记账Service接口
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
public interface IGearMonthlyAccountService {
|
||||
|
||||
/**
|
||||
* 查询月度记账
|
||||
*/
|
||||
GearMonthlyAccountVo queryById(Long accountId);
|
||||
|
||||
/**
|
||||
* 查询月度记账列表
|
||||
*/
|
||||
TableDataInfo<GearMonthlyAccountVo> queryPageList(GearMonthlyAccountBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询月度记账列表
|
||||
*/
|
||||
List<GearMonthlyAccountVo> queryList(GearMonthlyAccountBo bo);
|
||||
|
||||
/**
|
||||
* 新增月度记账
|
||||
*/
|
||||
Boolean insertByBo(GearMonthlyAccountBo bo);
|
||||
|
||||
/**
|
||||
* 修改月度记账
|
||||
*/
|
||||
Boolean updateByBo(GearMonthlyAccountBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除月度记账信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.gear.oa.service;
|
||||
|
||||
import com.gear.oa.domain.GearPurchasePlanDetail;
|
||||
import com.gear.oa.domain.vo.GearPurchasePlanDetailVo;
|
||||
import com.gear.oa.domain.bo.GearPurchasePlanDetailBo;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 采购计划明细Service接口
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
public interface IGearPurchasePlanDetailService {
|
||||
|
||||
/**
|
||||
* 查询采购计划明细
|
||||
*/
|
||||
GearPurchasePlanDetailVo queryById(Long detailId);
|
||||
|
||||
/**
|
||||
* 查询采购计划明细列表
|
||||
*/
|
||||
TableDataInfo<GearPurchasePlanDetailVo> queryPageList(GearPurchasePlanDetailBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询采购计划明细列表
|
||||
*/
|
||||
List<GearPurchasePlanDetailVo> queryList(GearPurchasePlanDetailBo bo);
|
||||
|
||||
/**
|
||||
* 新增采购计划明细
|
||||
*/
|
||||
Boolean insertByBo(GearPurchasePlanDetailBo bo);
|
||||
|
||||
/**
|
||||
* 修改采购计划明细
|
||||
*/
|
||||
Boolean updateByBo(GearPurchasePlanDetailBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除采购计划明细信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.gear.oa.service;
|
||||
|
||||
import com.gear.oa.domain.GearSupplier;
|
||||
import com.gear.oa.domain.vo.GearSupplierVo;
|
||||
import com.gear.oa.domain.bo.GearSupplierBo;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 供应商信息Service接口
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
public interface IGearSupplierService {
|
||||
|
||||
/**
|
||||
* 查询供应商信息
|
||||
*/
|
||||
GearSupplierVo queryById(Long supplierId);
|
||||
|
||||
/**
|
||||
* 查询供应商信息列表
|
||||
*/
|
||||
TableDataInfo<GearSupplierVo> queryPageList(GearSupplierBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询供应商信息列表
|
||||
*/
|
||||
List<GearSupplierVo> queryList(GearSupplierBo bo);
|
||||
|
||||
/**
|
||||
* 新增供应商信息
|
||||
*/
|
||||
Boolean insertByBo(GearSupplierBo bo);
|
||||
|
||||
/**
|
||||
* 修改供应商信息
|
||||
*/
|
||||
Boolean updateByBo(GearSupplierBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除供应商信息信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.gear.oa.service;
|
||||
|
||||
import com.gear.oa.domain.GearSupplyType;
|
||||
import com.gear.oa.domain.vo.GearSupplyTypeVo;
|
||||
import com.gear.oa.domain.bo.GearSupplyTypeBo;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 供货类型管理Service接口
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
public interface IGearSupplyTypeService {
|
||||
|
||||
/**
|
||||
* 查询供货类型管理
|
||||
*/
|
||||
GearSupplyTypeVo queryById(Long typeId);
|
||||
|
||||
/**
|
||||
* 查询供货类型管理列表
|
||||
*/
|
||||
TableDataInfo<GearSupplyTypeVo> queryPageList(GearSupplyTypeBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询供货类型管理列表
|
||||
*/
|
||||
List<GearSupplyTypeVo> queryList(GearSupplyTypeBo bo);
|
||||
|
||||
/**
|
||||
* 新增供货类型管理
|
||||
*/
|
||||
Boolean insertByBo(GearSupplyTypeBo bo);
|
||||
|
||||
/**
|
||||
* 修改供货类型管理
|
||||
*/
|
||||
Boolean updateByBo(GearSupplyTypeBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除供货类型管理信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.gear.oa.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.gear.common.utils.StringUtils;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.gear.oa.domain.bo.GearMonthlyAccountBo;
|
||||
import com.gear.oa.domain.vo.GearMonthlyAccountVo;
|
||||
import com.gear.oa.domain.GearMonthlyAccount;
|
||||
import com.gear.oa.mapper.GearMonthlyAccountMapper;
|
||||
import com.gear.oa.service.IGearMonthlyAccountService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 月度记账Service业务层处理
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class GearMonthlyAccountServiceImpl implements IGearMonthlyAccountService {
|
||||
|
||||
private final GearMonthlyAccountMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询月度记账
|
||||
*/
|
||||
@Override
|
||||
public GearMonthlyAccountVo queryById(Long accountId){
|
||||
return baseMapper.selectVoById(accountId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询月度记账列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<GearMonthlyAccountVo> queryPageList(GearMonthlyAccountBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<GearMonthlyAccount> lqw = buildQueryWrapper(bo);
|
||||
Page<GearMonthlyAccountVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询月度记账列表
|
||||
*/
|
||||
@Override
|
||||
public List<GearMonthlyAccountVo> queryList(GearMonthlyAccountBo bo) {
|
||||
LambdaQueryWrapper<GearMonthlyAccount> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<GearMonthlyAccount> buildQueryWrapper(GearMonthlyAccountBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<GearMonthlyAccount> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMonthYear()), GearMonthlyAccount::getMonthYear, bo.getMonthYear());
|
||||
lqw.eq(bo.getTotalAmount() != null, GearMonthlyAccount::getTotalAmount, bo.getTotalAmount());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增月度记账
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(GearMonthlyAccountBo bo) {
|
||||
GearMonthlyAccount add = BeanUtil.toBean(bo, GearMonthlyAccount.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setAccountId(add.getAccountId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改月度记账
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(GearMonthlyAccountBo bo) {
|
||||
GearMonthlyAccount update = BeanUtil.toBean(bo, GearMonthlyAccount.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(GearMonthlyAccount entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除月度记账
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.gear.oa.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.gear.common.utils.StringUtils;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.gear.oa.domain.bo.GearPurchasePlanDetailBo;
|
||||
import com.gear.oa.domain.vo.GearPurchasePlanDetailVo;
|
||||
import com.gear.oa.domain.GearPurchasePlanDetail;
|
||||
import com.gear.oa.mapper.GearPurchasePlanDetailMapper;
|
||||
import com.gear.oa.service.IGearPurchasePlanDetailService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 采购计划明细Service业务层处理
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class GearPurchasePlanDetailServiceImpl implements IGearPurchasePlanDetailService {
|
||||
|
||||
private final GearPurchasePlanDetailMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询采购计划明细
|
||||
*/
|
||||
@Override
|
||||
public GearPurchasePlanDetailVo queryById(Long detailId){
|
||||
return baseMapper.selectVoById(detailId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询采购计划明细列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<GearPurchasePlanDetailVo> queryPageList(GearPurchasePlanDetailBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<GearPurchasePlanDetail> lqw = buildQueryWrapper(bo);
|
||||
Page<GearPurchasePlanDetailVo> result = baseMapper.selectVoPagePlus(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询采购计划明细列表
|
||||
*/
|
||||
@Override
|
||||
public List<GearPurchasePlanDetailVo> queryList(GearPurchasePlanDetailBo bo) {
|
||||
LambdaQueryWrapper<GearPurchasePlanDetail> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<GearPurchasePlanDetail> buildQueryWrapper(GearPurchasePlanDetailBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<GearPurchasePlanDetail> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDetailCode()), GearPurchasePlanDetail::getDetailCode, bo.getDetailCode());
|
||||
lqw.eq(bo.getSupplierId() != null, GearPurchasePlanDetail::getSupplierId, bo.getSupplierId());
|
||||
lqw.like(bo.getRawMaterialName() != null, GearPurchasePlanDetail::getRawMaterialName, bo.getRawMaterialName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getOwner()), GearPurchasePlanDetail::getOwner, bo.getOwner());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRawMaterialName()), GearPurchasePlanDetail::getQuantity, bo.getQuantity());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getUnit()), GearPurchasePlanDetail::getUnit, bo.getUnit());
|
||||
lqw.eq(bo.getUnitPrice() != null, GearPurchasePlanDetail::getUnitPrice, bo.getUnitPrice());
|
||||
lqw.eq(bo.getTotalAmount() != null, GearPurchasePlanDetail::getTotalAmount, bo.getTotalAmount());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAnnex()), GearPurchasePlanDetail::getAnnex, bo.getAnnex());
|
||||
lqw.eq(bo.getStatus() != null, GearPurchasePlanDetail::getStatus, bo.getStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增采购计划明细
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(GearPurchasePlanDetailBo bo) {
|
||||
GearPurchasePlanDetail add = BeanUtil.toBean(bo, GearPurchasePlanDetail.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setDetailId(add.getDetailId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改采购计划明细
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(GearPurchasePlanDetailBo bo) {
|
||||
GearPurchasePlanDetail update = BeanUtil.toBean(bo, GearPurchasePlanDetail.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(GearPurchasePlanDetail entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除采购计划明细
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.gear.oa.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.gear.common.utils.StringUtils;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.gear.oa.domain.bo.GearSupplierBo;
|
||||
import com.gear.oa.domain.vo.GearSupplierVo;
|
||||
import com.gear.oa.domain.GearSupplier;
|
||||
import com.gear.oa.mapper.GearSupplierMapper;
|
||||
import com.gear.oa.service.IGearSupplierService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 供应商信息Service业务层处理
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class GearSupplierServiceImpl implements IGearSupplierService {
|
||||
|
||||
private final GearSupplierMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询供应商信息
|
||||
*/
|
||||
@Override
|
||||
public GearSupplierVo queryById(Long supplierId){
|
||||
return baseMapper.selectVoById(supplierId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询供应商信息列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<GearSupplierVo> queryPageList(GearSupplierBo bo, PageQuery pageQuery) {
|
||||
QueryWrapper<GearSupplier> lqw = buildQueryWrapperPlus(bo);
|
||||
Page<GearSupplierVo> result = baseMapper.selectVoPagePlus(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
private QueryWrapper<GearSupplier> buildQueryWrapperPlus(GearSupplierBo bo) {
|
||||
QueryWrapper<GearSupplier> query = Wrappers.query();
|
||||
query.like(StringUtils.isNotBlank(bo.getName()), "s.name", bo.getName());
|
||||
query.like(StringUtils.isNotBlank(bo.getContactPerson()), "s.contact_person", bo.getContactPerson());
|
||||
query.like(StringUtils.isNotBlank(bo.getPhone()), "s.phone", bo.getPhone());
|
||||
query.like(StringUtils.isNotBlank(bo.getAddress()), "s.address", bo.getAddress());
|
||||
query.like(StringUtils.isNotBlank(bo.getRemark()), "s.remark", bo.getRemark());
|
||||
query.like(bo.getTypeId()!=null, "s.type_id", bo.getTypeId());
|
||||
//逻辑删除
|
||||
query.eq("s.del_flag", 0);
|
||||
return query;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询供应商信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<GearSupplierVo> queryList(GearSupplierBo bo) {
|
||||
LambdaQueryWrapper<GearSupplier> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<GearSupplier> buildQueryWrapper(GearSupplierBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<GearSupplier> lqw = Wrappers.lambdaQuery();
|
||||
lqw.like(StringUtils.isNotBlank(bo.getName()), GearSupplier::getName, bo.getName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContactPerson()), GearSupplier::getContactPerson, bo.getContactPerson());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPhone()), GearSupplier::getPhone, bo.getPhone());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAddress()), GearSupplier::getAddress, bo.getAddress());
|
||||
lqw.eq(bo.getTypeId() != null, GearSupplier::getTypeId, bo.getTypeId());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增供应商信息
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(GearSupplierBo bo) {
|
||||
GearSupplier add = BeanUtil.toBean(bo, GearSupplier.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setSupplierId(add.getSupplierId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改供应商信息
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(GearSupplierBo bo) {
|
||||
GearSupplier update = BeanUtil.toBean(bo, GearSupplier.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(GearSupplier entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除供应商信息
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.gear.oa.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.gear.common.utils.StringUtils;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.gear.oa.domain.bo.GearSupplyTypeBo;
|
||||
import com.gear.oa.domain.vo.GearSupplyTypeVo;
|
||||
import com.gear.oa.domain.GearSupplyType;
|
||||
import com.gear.oa.mapper.GearSupplyTypeMapper;
|
||||
import com.gear.oa.service.IGearSupplyTypeService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 供货类型管理Service业务层处理
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-08-30
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class GearSupplyTypeServiceImpl implements IGearSupplyTypeService {
|
||||
|
||||
private final GearSupplyTypeMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询供货类型管理
|
||||
*/
|
||||
@Override
|
||||
public GearSupplyTypeVo queryById(Long typeId){
|
||||
return baseMapper.selectVoById(typeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询供货类型管理列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<GearSupplyTypeVo> queryPageList(GearSupplyTypeBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<GearSupplyType> lqw = buildQueryWrapper(bo);
|
||||
Page<GearSupplyTypeVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询供货类型管理列表
|
||||
*/
|
||||
@Override
|
||||
public List<GearSupplyTypeVo> queryList(GearSupplyTypeBo bo) {
|
||||
LambdaQueryWrapper<GearSupplyType> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<GearSupplyType> buildQueryWrapper(GearSupplyTypeBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<GearSupplyType> lqw = Wrappers.lambdaQuery();
|
||||
lqw.like(StringUtils.isNotBlank(bo.getTypeName()), GearSupplyType::getTypeName, bo.getTypeName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDescription()), GearSupplyType::getDescription, bo.getDescription());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增供货类型管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(GearSupplyTypeBo bo) {
|
||||
GearSupplyType add = BeanUtil.toBean(bo, GearSupplyType.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setTypeId(add.getTypeId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改供货类型管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(GearSupplyTypeBo bo) {
|
||||
GearSupplyType update = BeanUtil.toBean(bo, GearSupplyType.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(GearSupplyType entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除供货类型管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user