Merge remote-tracking branch 'origin/master'
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
package org.dromara.property.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.property.domain.vo.CapitalApplicationVo;
|
||||
import org.dromara.property.domain.bo.CapitalApplicationBo;
|
||||
import org.dromara.property.service.ICapitalApplicationService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 资产申请
|
||||
* 前端访问路由地址为:/domain/application
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-07-25
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/capitalApplication")
|
||||
public class CapitalApplicationController extends BaseController {
|
||||
|
||||
private final ICapitalApplicationService capitalApplicationService;
|
||||
|
||||
/**
|
||||
* 查询资产申请列表
|
||||
*/
|
||||
@SaCheckPermission("domain:application:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<CapitalApplicationVo> list(CapitalApplicationBo bo, PageQuery pageQuery) {
|
||||
return capitalApplicationService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出资产申请列表
|
||||
*/
|
||||
@SaCheckPermission("domain:application:export")
|
||||
@Log(title = "资产申请", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(CapitalApplicationBo bo, HttpServletResponse response) {
|
||||
List<CapitalApplicationVo> list = capitalApplicationService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "资产申请", CapitalApplicationVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取资产申请详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("domain:application:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<CapitalApplicationVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
return R.ok(capitalApplicationService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增资产申请
|
||||
*/
|
||||
@SaCheckPermission("domain:application:add")
|
||||
@Log(title = "资产申请", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody CapitalApplicationBo bo) {
|
||||
return toAjax(capitalApplicationService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改资产申请
|
||||
*/
|
||||
@SaCheckPermission("domain:application:edit")
|
||||
@Log(title = "资产申请", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody CapitalApplicationBo bo) {
|
||||
return toAjax(capitalApplicationService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除资产申请
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("domain:application:remove")
|
||||
@Log(title = "资产申请", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable("ids") Long[] ids) {
|
||||
return toAjax(capitalApplicationService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
@@ -0,0 +1,106 @@
|
||||
package org.dromara.property.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.property.domain.vo.MaintainKnowledgeVo;
|
||||
import org.dromara.property.domain.bo.MaintainKnowledgeBo;
|
||||
import org.dromara.property.service.IMaintainKnowledgeService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 维保知识
|
||||
* 前端访问路由地址为:/domain/knowledge
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-07-24
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/knowledge")
|
||||
public class MaintainKnowledgeController extends BaseController {
|
||||
|
||||
private final IMaintainKnowledgeService maintainKnowledgeService;
|
||||
|
||||
/**
|
||||
* 查询维保知识列表
|
||||
*/
|
||||
@SaCheckPermission("domain:knowledge:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<MaintainKnowledgeVo> list(MaintainKnowledgeBo bo, PageQuery pageQuery) {
|
||||
return maintainKnowledgeService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出维保知识列表
|
||||
*/
|
||||
@SaCheckPermission("domain:knowledge:export")
|
||||
@Log(title = "维保知识", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(MaintainKnowledgeBo bo, HttpServletResponse response) {
|
||||
List<MaintainKnowledgeVo> list = maintainKnowledgeService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "维保知识", MaintainKnowledgeVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取维保知识详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("domain:knowledge:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<MaintainKnowledgeVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
return R.ok(maintainKnowledgeService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增维保知识
|
||||
*/
|
||||
@SaCheckPermission("domain:knowledge:add")
|
||||
@Log(title = "维保知识", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody MaintainKnowledgeBo bo) {
|
||||
return toAjax(maintainKnowledgeService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改维保知识
|
||||
*/
|
||||
@SaCheckPermission("domain:knowledge:edit")
|
||||
@Log(title = "维保知识", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody MaintainKnowledgeBo bo) {
|
||||
return toAjax(maintainKnowledgeService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除维保知识
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("domain:knowledge:remove")
|
||||
@Log(title = "维保知识", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable("ids") Long[] ids) {
|
||||
return toAjax(maintainKnowledgeService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
@@ -0,0 +1,95 @@
|
||||
package org.dromara.property.domain;
|
||||
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 资产申请对象 capital_application
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-07-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("capital_application")
|
||||
public class CapitalApplication extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 审核人意见
|
||||
*/
|
||||
private String auditOpinion;
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
private Long audit;
|
||||
/**
|
||||
* 仓库id
|
||||
*/
|
||||
private Long depotId;
|
||||
|
||||
/**
|
||||
* 申请人id
|
||||
*/
|
||||
private Long applicat;
|
||||
|
||||
/**
|
||||
* 申请人手机号
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 供应商id
|
||||
*/
|
||||
private Long supplier;
|
||||
|
||||
/**
|
||||
* 采购方式
|
||||
*/
|
||||
private String buyType;
|
||||
|
||||
/**
|
||||
* 采购单价
|
||||
*/
|
||||
private BigDecimal buyUnitPrice;
|
||||
|
||||
/**
|
||||
* 采购金额
|
||||
*/
|
||||
private BigDecimal buyAmount;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 申请时间
|
||||
*/
|
||||
private Date applicationTime;
|
||||
|
||||
}
|
@@ -0,0 +1,77 @@
|
||||
package org.dromara.property.domain;
|
||||
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 资产信息对象 capital_info
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-07-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("capital_info")
|
||||
public class CapitalInfo extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 资产名称
|
||||
*/
|
||||
private String capitalName;
|
||||
|
||||
/**
|
||||
* 资产类型
|
||||
*/
|
||||
private String capitalType;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String spec;
|
||||
|
||||
/**
|
||||
* 资产申请id
|
||||
*/
|
||||
private Long capitalApplicationId;
|
||||
|
||||
/**
|
||||
* 购买数量
|
||||
*/
|
||||
private Integer buyQuantity;
|
||||
|
||||
/**
|
||||
* 采购单价
|
||||
*/
|
||||
private BigDecimal buyUnitPrice;
|
||||
|
||||
/**
|
||||
* 金额小计
|
||||
*/
|
||||
private BigDecimal buyAmount;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
private String searchValue;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,68 @@
|
||||
package org.dromara.property.domain;
|
||||
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 维保知识对象 maintain_knowledge
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-07-24
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("maintain_knowledge")
|
||||
public class MaintainKnowledge extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 状态(0草稿1状态2已发布)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 封面
|
||||
*/
|
||||
private String covers;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String depict;
|
||||
|
||||
/**
|
||||
* 发布时间
|
||||
*/
|
||||
private Date releaseTime;
|
||||
|
||||
/**
|
||||
* 位置类型(0操作指引,1处理案例2常见问题)
|
||||
*/
|
||||
private String type;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,102 @@
|
||||
package org.dromara.property.domain.bo;
|
||||
|
||||
import org.dromara.property.domain.CapitalApplication;
|
||||
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.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 资产申请业务对象 capital_application
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-07-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = CapitalApplication.class, reverseConvertGenerate = false)
|
||||
public class CapitalApplicationBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@NotBlank(message = "标题不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String title;
|
||||
/**
|
||||
* 仓库id
|
||||
*/
|
||||
private Long depotId;
|
||||
/**
|
||||
* 申请人id
|
||||
*/
|
||||
@NotNull(message = "申请人id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long applicat;
|
||||
|
||||
/**
|
||||
* 申请人手机号
|
||||
*/
|
||||
@NotBlank(message = "申请人手机号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 供应商id
|
||||
*/
|
||||
@NotNull(message = "供应商id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long supplier;
|
||||
|
||||
/**
|
||||
* 采购方式
|
||||
*/
|
||||
@NotBlank(message = "采购方式不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String buyType;
|
||||
|
||||
/**
|
||||
* 采购单价
|
||||
*/
|
||||
private BigDecimal buyUnitPrice;
|
||||
|
||||
/**
|
||||
* 采购金额
|
||||
*/
|
||||
private BigDecimal buyAmount;
|
||||
/**
|
||||
* 审核人意见
|
||||
*/
|
||||
private String auditOpinion;
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
private Long audit;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 申请时间
|
||||
*/
|
||||
private Date applicationTime;
|
||||
@NotEmpty(message = "资产不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private List<CapitalInfoBo> capitalInfoBolist;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,81 @@
|
||||
package org.dromara.property.domain.bo;
|
||||
|
||||
import org.dromara.property.domain.CapitalInfo;
|
||||
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.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 资产信息业务对象 capital_info
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-07-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = CapitalInfo.class, reverseConvertGenerate = false)
|
||||
public class CapitalInfoBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@NotNull(message = "id不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 资产名称
|
||||
*/
|
||||
@NotBlank(message = "资产名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String capitalName;
|
||||
|
||||
/**
|
||||
* 资产类型
|
||||
*/
|
||||
@NotBlank(message = "资产类型不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String capitalType;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
@NotBlank(message = "规格不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String spec;
|
||||
|
||||
/**
|
||||
* 资产申请id
|
||||
*/
|
||||
private Long capitalApplicationId;
|
||||
|
||||
/**
|
||||
* 购买数量
|
||||
*/
|
||||
@NotNull(message = "购买数量不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Integer buyQuantity;
|
||||
|
||||
/**
|
||||
* 采购单价
|
||||
*/
|
||||
@NotNull(message = "采购单价不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private BigDecimal buyUnitPrice;
|
||||
|
||||
/**
|
||||
* 金额小计
|
||||
*/
|
||||
private BigDecimal buyAmount;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
private String searchValue;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,78 @@
|
||||
package org.dromara.property.domain.bo;
|
||||
|
||||
import org.dromara.property.domain.MaintainKnowledge;
|
||||
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.*;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 维保知识业务对象 maintain_knowledge
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-07-24
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = MaintainKnowledge.class, reverseConvertGenerate = false)
|
||||
public class MaintainKnowledgeBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@NotBlank(message = "标题不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 状态(0草稿1状态2已发布)
|
||||
*/
|
||||
@NotBlank(message = "状态(0草稿1状态2已发布)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 封面
|
||||
*/
|
||||
//@NotBlank(message = "封面不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String covers;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@NotBlank(message = "描述不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String depict;
|
||||
|
||||
/**
|
||||
* 发布时间
|
||||
*/
|
||||
@NotNull(message = "发布时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date releaseTime;
|
||||
|
||||
/**
|
||||
* 位置类型(0操作指引,1处理案例2常见问题)
|
||||
*/
|
||||
@NotBlank(message = "位置类型(0操作指引,1处理案例2常见问题)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
private String searchValue;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,118 @@
|
||||
package org.dromara.property.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.property.domain.CapitalApplication;
|
||||
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;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 资产申请视图对象 capital_application
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-07-25
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = CapitalApplication.class)
|
||||
public class CapitalApplicationVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@ExcelProperty(value = "标题")
|
||||
private String title;
|
||||
/**
|
||||
* 仓库id
|
||||
*/
|
||||
private Long depotId;
|
||||
/**
|
||||
* 申请人id
|
||||
*/
|
||||
@ExcelProperty(value = "申请人id")
|
||||
private Long applicat;
|
||||
|
||||
/**
|
||||
* 申请人手机号
|
||||
*/
|
||||
@ExcelProperty(value = "申请人手机号")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 供应商id
|
||||
*/
|
||||
@ExcelProperty(value = "供应商id")
|
||||
private Long supplier;
|
||||
|
||||
|
||||
/**
|
||||
* 采购方式
|
||||
*/
|
||||
@ExcelProperty(value = "采购方式")
|
||||
private String buyType;
|
||||
|
||||
/**
|
||||
* 采购单价
|
||||
*/
|
||||
@ExcelProperty(value = "采购单价")
|
||||
private BigDecimal buyUnitPrice;
|
||||
|
||||
/**
|
||||
* 采购金额
|
||||
*/
|
||||
@ExcelProperty(value = "采购金额")
|
||||
private BigDecimal buyAmount;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@ExcelProperty(value = "状态")
|
||||
private String state;
|
||||
/**
|
||||
* 审核人意见
|
||||
*/
|
||||
private String auditOpinion;
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
private Long audit;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 申请时间
|
||||
*/
|
||||
@ExcelProperty(value = "申请时间")
|
||||
private Date applicationTime;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
@ExcelProperty(value = "搜索值")
|
||||
private String searchValue;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,93 @@
|
||||
package org.dromara.property.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.dromara.property.domain.CapitalInfo;
|
||||
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;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 资产信息视图对象 capital_info
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-07-25
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = CapitalInfo.class)
|
||||
public class CapitalInfoVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@ExcelProperty(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 资产名称
|
||||
*/
|
||||
@ExcelProperty(value = "资产名称")
|
||||
private String capitalName;
|
||||
|
||||
/**
|
||||
* 资产类型
|
||||
*/
|
||||
@ExcelProperty(value = "资产类型")
|
||||
private String capitalType;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
@ExcelProperty(value = "规格")
|
||||
private String spec;
|
||||
|
||||
/**
|
||||
* 资产申请id
|
||||
*/
|
||||
@ExcelProperty(value = "资产申请id")
|
||||
private Long capitalApplicationId;
|
||||
|
||||
/**
|
||||
* 购买数量
|
||||
*/
|
||||
@ExcelProperty(value = "购买数量")
|
||||
private Integer buyQuantity;
|
||||
|
||||
/**
|
||||
* 采购单价
|
||||
*/
|
||||
@ExcelProperty(value = "采购单价")
|
||||
private BigDecimal buyUnitPrice;
|
||||
|
||||
/**
|
||||
* 金额小计
|
||||
*/
|
||||
@ExcelProperty(value = "金额小计")
|
||||
private BigDecimal buyAmount;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
@ExcelProperty(value = "搜索值")
|
||||
private String searchValue;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,88 @@
|
||||
package org.dromara.property.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.property.domain.MaintainKnowledge;
|
||||
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;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 维保知识视图对象 maintain_knowledge
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-07-24
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = MaintainKnowledge.class)
|
||||
public class MaintainKnowledgeVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ExcelProperty(value = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@ExcelProperty(value = "标题")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 状态(0草稿1状态2已发布)
|
||||
*/
|
||||
@ExcelProperty(value = "状态(0草稿1状态2已发布)")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 封面
|
||||
*/
|
||||
@ExcelProperty(value = "封面")
|
||||
private String covers;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
@ExcelProperty(value = "内容")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@ExcelProperty(value = "描述")
|
||||
private String depict;
|
||||
|
||||
/**
|
||||
* 发布时间
|
||||
*/
|
||||
@ExcelProperty(value = "发布时间")
|
||||
private Date releaseTime;
|
||||
|
||||
/**
|
||||
* 位置类型(0操作指引,1处理案例2常见问题)
|
||||
*/
|
||||
@ExcelProperty(value = "位置类型(0操作指引,1处理案例2常见问题)")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
@ExcelProperty(value = "搜索值")
|
||||
private String searchValue;
|
||||
|
||||
|
||||
}
|
@@ -34,6 +34,10 @@ public class ServiceWorkOrderAnalysisVo {
|
||||
public static class BarChartVo {
|
||||
private String month; // 月份,如 "2025-02"
|
||||
private int orderCount; // 工单数量
|
||||
public BarChartVo(String month, int orderCount) {
|
||||
this.month = month;
|
||||
this.orderCount = orderCount;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 满意度图表数据对象
|
||||
@@ -44,6 +48,13 @@ public class ServiceWorkOrderAnalysisVo {
|
||||
private String name; // 满意度名称:如“满意”
|
||||
private Long value; // 数量
|
||||
private Double rate; // 占比(百分比)
|
||||
|
||||
public SatisfactionChartVo(String name, Long value,Double rate) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
this.rate = rate;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -53,10 +64,12 @@ public class ServiceWorkOrderAnalysisVo {
|
||||
@Accessors(chain = true)
|
||||
public static class PieChartVo {
|
||||
private String type; // 工单类型
|
||||
private Long quantity; // 工单数量
|
||||
private double percentage; // 占比
|
||||
private Integer quantity; // 工单数量
|
||||
|
||||
public PieChartVo(String type, Integer quantity) {
|
||||
this.type = type;
|
||||
this.quantity = quantity;
|
||||
|
||||
public PieChartVo(String string, Long count, double percentage) {
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,17 @@
|
||||
package org.dromara.property.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.dromara.property.domain.CapitalApplication;
|
||||
import org.dromara.property.domain.vo.CapitalApplicationVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 资产申请Mapper接口
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-07-25
|
||||
*/
|
||||
@Mapper
|
||||
public interface CapitalApplicationMapper extends BaseMapperPlus<CapitalApplication, CapitalApplicationVo> {
|
||||
|
||||
}
|
@@ -0,0 +1,17 @@
|
||||
package org.dromara.property.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.dromara.property.domain.CapitalInfo;
|
||||
import org.dromara.property.domain.vo.CapitalInfoVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 资产信息Mapper接口
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-07-25
|
||||
*/
|
||||
@Mapper
|
||||
public interface CapitalInfoMapper extends BaseMapperPlus<CapitalInfo, CapitalInfoVo> {
|
||||
|
||||
}
|
@@ -0,0 +1,17 @@
|
||||
package org.dromara.property.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.dromara.property.domain.MaintainKnowledge;
|
||||
import org.dromara.property.domain.vo.MaintainKnowledgeVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 维保知识Mapper接口
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-07-24
|
||||
*/
|
||||
@Mapper
|
||||
public interface MaintainKnowledgeMapper extends BaseMapperPlus<MaintainKnowledge, MaintainKnowledgeVo> {
|
||||
|
||||
}
|
@@ -0,0 +1,69 @@
|
||||
package org.dromara.property.service;
|
||||
|
||||
import org.dromara.property.domain.CapitalApplication;
|
||||
import org.dromara.property.domain.vo.CapitalApplicationVo;
|
||||
import org.dromara.property.domain.bo.CapitalApplicationBo;
|
||||
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 mocheng
|
||||
* @date 2025-07-25
|
||||
*/
|
||||
public interface ICapitalApplicationService {
|
||||
|
||||
/**
|
||||
* 查询资产申请
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 资产申请
|
||||
*/
|
||||
CapitalApplicationVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询资产申请列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 资产申请分页列表
|
||||
*/
|
||||
TableDataInfo<CapitalApplicationVo> queryPageList(CapitalApplicationBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的资产申请列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 资产申请列表
|
||||
*/
|
||||
List<CapitalApplicationVo> queryList(CapitalApplicationBo bo);
|
||||
|
||||
/**
|
||||
* 新增资产申请
|
||||
*
|
||||
* @param bo 资产申请
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(CapitalApplicationBo bo);
|
||||
|
||||
/**
|
||||
* 修改资产申请
|
||||
*
|
||||
* @param bo 资产申请
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(CapitalApplicationBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除资产申请信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@@ -0,0 +1,69 @@
|
||||
package org.dromara.property.service;
|
||||
|
||||
import org.dromara.property.domain.MaintainKnowledge;
|
||||
import org.dromara.property.domain.vo.MaintainKnowledgeVo;
|
||||
import org.dromara.property.domain.bo.MaintainKnowledgeBo;
|
||||
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 mocheng
|
||||
* @date 2025-07-24
|
||||
*/
|
||||
public interface IMaintainKnowledgeService {
|
||||
|
||||
/**
|
||||
* 查询维保知识
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 维保知识
|
||||
*/
|
||||
MaintainKnowledgeVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询维保知识列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 维保知识分页列表
|
||||
*/
|
||||
TableDataInfo<MaintainKnowledgeVo> queryPageList(MaintainKnowledgeBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的维保知识列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 维保知识列表
|
||||
*/
|
||||
List<MaintainKnowledgeVo> queryList(MaintainKnowledgeBo bo);
|
||||
|
||||
/**
|
||||
* 新增维保知识
|
||||
*
|
||||
* @param bo 维保知识
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(MaintainKnowledgeBo bo);
|
||||
|
||||
/**
|
||||
* 修改维保知识
|
||||
*
|
||||
* @param bo 维保知识
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(MaintainKnowledgeBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除维保知识信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@@ -0,0 +1,218 @@
|
||||
package org.dromara.property.service.impl;
|
||||
|
||||
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.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.property.domain.Asset;
|
||||
import org.dromara.property.domain.CapitalInfo;
|
||||
import org.dromara.property.domain.DepotLog;
|
||||
import org.dromara.property.mapper.AssetMapper;
|
||||
import org.dromara.property.mapper.CapitalInfoMapper;
|
||||
import org.dromara.property.mapper.DepotLogMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.property.domain.bo.CapitalApplicationBo;
|
||||
import org.dromara.property.domain.vo.CapitalApplicationVo;
|
||||
import org.dromara.property.domain.CapitalApplication;
|
||||
import org.dromara.property.mapper.CapitalApplicationMapper;
|
||||
import org.dromara.property.service.ICapitalApplicationService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 资产申请Service业务层处理
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-07-25
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class CapitalApplicationServiceImpl implements ICapitalApplicationService {
|
||||
|
||||
private final CapitalApplicationMapper baseMapper;
|
||||
private final CapitalInfoMapper capitalMapper;
|
||||
private final AssetMapper assetsMapper;
|
||||
private final DepotLogMapper depotLogMapper;
|
||||
|
||||
/**
|
||||
* 查询资产申请
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 资产申请
|
||||
*/
|
||||
@Override
|
||||
public CapitalApplicationVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询资产申请列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 资产申请分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<CapitalApplicationVo> queryPageList(CapitalApplicationBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<CapitalApplication> lqw = buildQueryWrapper(bo);
|
||||
Page<CapitalApplicationVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的资产申请列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 资产申请列表
|
||||
*/
|
||||
@Override
|
||||
public List<CapitalApplicationVo> queryList(CapitalApplicationBo bo) {
|
||||
LambdaQueryWrapper<CapitalApplication> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<CapitalApplication> buildQueryWrapper(CapitalApplicationBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<CapitalApplication> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(CapitalApplication::getId);
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTitle()), CapitalApplication::getTitle, bo.getTitle());
|
||||
lqw.eq(bo.getApplicat() != null, CapitalApplication::getApplicat, bo.getApplicat());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPhone()), CapitalApplication::getPhone, bo.getPhone());
|
||||
lqw.eq(bo.getSupplier() != null, CapitalApplication::getSupplier, bo.getSupplier());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBuyType()), CapitalApplication::getBuyType, bo.getBuyType());
|
||||
lqw.eq(bo.getBuyUnitPrice() != null, CapitalApplication::getBuyUnitPrice, bo.getBuyUnitPrice());
|
||||
lqw.eq(bo.getBuyAmount() != null, CapitalApplication::getBuyAmount, bo.getBuyAmount());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getState()), CapitalApplication::getState, bo.getState());
|
||||
lqw.eq(bo.getApplicationTime() != null, CapitalApplication::getApplicationTime, bo.getApplicationTime());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSearchValue()), CapitalApplication::getSearchValue, bo.getSearchValue());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增资产申请
|
||||
*
|
||||
* @param bo 资产申请
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insertByBo(CapitalApplicationBo bo) {
|
||||
CapitalApplication add = MapstructUtils.convert(bo, CapitalApplication.class);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
bo.getCapitalInfoBolist().stream().forEach(s -> {
|
||||
s.setCapitalApplicationId(add.getId());
|
||||
CapitalInfo capitalInfo = MapstructUtils.convert(s, CapitalInfo.class);
|
||||
capitalMapper.insert(capitalInfo);
|
||||
//validCapitalInfoBefore(add,capitalInfo);
|
||||
validEntityBeforeSave(add);
|
||||
});
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改资产申请
|
||||
*
|
||||
* @param bo 资产申请
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean updateByBo(CapitalApplicationBo bo) {
|
||||
CapitalApplication update = MapstructUtils.convert(bo, CapitalApplication.class);
|
||||
validEntityBeforeUpdate(update);
|
||||
bo.getCapitalInfoBolist().stream().forEach(s -> {
|
||||
CapitalInfo capitalInfo = MapstructUtils.convert(s, CapitalInfo.class);
|
||||
capitalMapper.deleteById(capitalInfo);
|
||||
capitalMapper.insert(capitalInfo);
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
CapitalApplication capitalApplication = baseMapper.selectById(bo.getId());
|
||||
if (bo.getState().equals("1") && !bo.getState().equals(capitalApplication.getState())) {
|
||||
validCapitalInfoBefore(update, capitalInfo);
|
||||
}
|
||||
});
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验资产类型和仓库
|
||||
*/
|
||||
private void validCapitalInfoBefore(CapitalApplication capitalApplication, CapitalInfo capitalInfo) {
|
||||
LambdaQueryWrapper<Asset> assetQueryWrapper = new LambdaQueryWrapper<>();
|
||||
assetQueryWrapper.eq(Asset::getModel, capitalInfo.getCapitalType());
|
||||
assetQueryWrapper.eq(Asset::getName, capitalInfo.getCapitalName());
|
||||
assetQueryWrapper.eq(Asset::getSpecs, capitalInfo.getSpec());
|
||||
List<Asset> assets = assetsMapper.selectList(assetQueryWrapper);
|
||||
if (assets.isEmpty()) {
|
||||
Asset asset = new Asset();
|
||||
asset.setModel(capitalInfo.getCapitalType());
|
||||
asset.setName(capitalInfo.getCapitalName());
|
||||
asset.setSpecs(capitalInfo.getSpec());
|
||||
asset.setSpecs(capitalInfo.getSpec());
|
||||
asset.setPrice(capitalInfo.getBuyUnitPrice().longValue());
|
||||
asset.setSuppliersId(capitalApplication.getSupplier());
|
||||
asset.setStorageTime(new Date());
|
||||
asset.setType(0L);
|
||||
assetsMapper.insert(asset);
|
||||
} else {
|
||||
// 如果查询到多个结果,默认使用第一个
|
||||
Asset asset = assets.get(0);
|
||||
LambdaQueryWrapper<DepotLog> depotLogWrapper = new LambdaQueryWrapper<>();
|
||||
depotLogWrapper.eq(DepotLog::getAssetId, asset.getId());
|
||||
depotLogWrapper.eq(DepotLog::getDepotId, asset.getDepotId());
|
||||
if (!depotLogMapper.exists(depotLogWrapper)) {
|
||||
DepotLog depotLog = new DepotLog();
|
||||
depotLog.setAssetId(asset.getId());
|
||||
depotLog.setDepotId(capitalApplication.getDepotId());
|
||||
depotLogMapper.insert(depotLog);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(CapitalApplication entity) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeUpdate(CapitalApplication entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除资产申请信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
ids.forEach(s -> {
|
||||
LambdaQueryWrapper<CapitalInfo> objectLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
objectLambdaQueryWrapper.eq(CapitalInfo::getCapitalApplicationId, s);
|
||||
capitalMapper.delete(objectLambdaQueryWrapper);
|
||||
});
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
@@ -0,0 +1,139 @@
|
||||
package org.dromara.property.service.impl;
|
||||
|
||||
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.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.property.domain.bo.MaintainKnowledgeBo;
|
||||
import org.dromara.property.domain.vo.MaintainKnowledgeVo;
|
||||
import org.dromara.property.domain.MaintainKnowledge;
|
||||
import org.dromara.property.mapper.MaintainKnowledgeMapper;
|
||||
import org.dromara.property.service.IMaintainKnowledgeService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 维保知识Service业务层处理
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-07-24
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class MaintainKnowledgeServiceImpl implements IMaintainKnowledgeService {
|
||||
|
||||
private final MaintainKnowledgeMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询维保知识
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 维保知识
|
||||
*/
|
||||
@Override
|
||||
public MaintainKnowledgeVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询维保知识列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 维保知识分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<MaintainKnowledgeVo> queryPageList(MaintainKnowledgeBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<MaintainKnowledge> lqw = buildQueryWrapper(bo);
|
||||
Page<MaintainKnowledgeVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的维保知识列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 维保知识列表
|
||||
*/
|
||||
@Override
|
||||
public List<MaintainKnowledgeVo> queryList(MaintainKnowledgeBo bo) {
|
||||
LambdaQueryWrapper<MaintainKnowledge> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<MaintainKnowledge> buildQueryWrapper(MaintainKnowledgeBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<MaintainKnowledge> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(MaintainKnowledge::getId);
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTitle()), MaintainKnowledge::getTitle, bo.getTitle());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), MaintainKnowledge::getStatus, bo.getStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCovers()), MaintainKnowledge::getCovers, bo.getCovers());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContent()), MaintainKnowledge::getContent, bo.getContent());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDepict()), MaintainKnowledge::getDepict, bo.getDepict());
|
||||
lqw.eq(bo.getReleaseTime() != null, MaintainKnowledge::getReleaseTime, bo.getReleaseTime());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getType()), MaintainKnowledge::getType, bo.getType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSearchValue()), MaintainKnowledge::getSearchValue, bo.getSearchValue());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增维保知识
|
||||
*
|
||||
* @param bo 维保知识
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(MaintainKnowledgeBo bo) {
|
||||
MaintainKnowledge add = MapstructUtils.convert(bo, MaintainKnowledge.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改维保知识
|
||||
*
|
||||
* @param bo 维保知识
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(MaintainKnowledgeBo bo) {
|
||||
MaintainKnowledge update = MapstructUtils.convert(bo, MaintainKnowledge.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(MaintainKnowledge entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除维保知识信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
@@ -363,10 +363,7 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService {
|
||||
default -> "未知";
|
||||
};
|
||||
|
||||
satisfactionRateList.add(new ServiceWorkOrderAnalysisVo.SatisfactionChartVo()
|
||||
.setName(name)
|
||||
.setValue((long) count)
|
||||
.setRate(rate));
|
||||
satisfactionRateList.add(new ServiceWorkOrderAnalysisVo.SatisfactionChartVo(name,count,rate));
|
||||
}
|
||||
|
||||
return satisfactionRateList;
|
||||
@@ -404,6 +401,7 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService {
|
||||
|
||||
} catch (Exception e) {
|
||||
// 忽略格式错误的日期
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -431,24 +429,24 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService {
|
||||
Map<Long, Long> workOrderTypeCounts = serviceWorkOrdersList.stream()
|
||||
.collect(Collectors.groupingBy(ServiceWorkOrders::getType, Collectors.counting()));
|
||||
|
||||
long total = serviceWorkOrdersList.size();
|
||||
List<ServiceWorkOrderAnalysisVo.PieChartVo> result = new ArrayList<>();
|
||||
|
||||
for (Map.Entry<Long, Long> entry : workOrderTypeCounts.entrySet()) {
|
||||
Long typeId = entry.getKey();
|
||||
Long count = entry.getValue();
|
||||
Integer count = entry.getValue().intValue();
|
||||
|
||||
// 查询类型名称
|
||||
ServiceWorkOrdersType serviceWorkOrdersType = serviceWorkOrdersTypeMapper.selectById(typeId);
|
||||
String typeName = serviceWorkOrdersType != null ? serviceWorkOrdersType.getOrderTypeName() : "未知类型";
|
||||
// 计算占比(保留两位小数)
|
||||
double percentage = Math.round(((double) count / total) * 10000) / 100.0;
|
||||
result.add(new ServiceWorkOrderAnalysisVo.PieChartVo(typeName.toString(), count, percentage));
|
||||
String type = serviceWorkOrdersType != null ? serviceWorkOrdersType.getOrderTypeName() : "未知类型";
|
||||
|
||||
// 添加到结果中
|
||||
result.add(new ServiceWorkOrderAnalysisVo.PieChartVo(type, count));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
private List<ServiceWorkOrderAnalysisVo.BarChartVo> getRecentSixMonthsWorkOrders(List<ServiceWorkOrders> ordersList) {
|
||||
LocalDate today = LocalDate.now();
|
||||
|
||||
// 获取近6个月的日期范围(含当月)
|
||||
List<String> months = new ArrayList<>();
|
||||
for (int i = 5; i >= 0; i--) {
|
||||
@@ -463,10 +461,7 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService {
|
||||
|
||||
// 构建柱状图数据
|
||||
return months.stream()
|
||||
.map(month -> new ServiceWorkOrderAnalysisVo.BarChartVo()
|
||||
.setMonth(month)
|
||||
.setOrderCount(Math.toIntExact(orderCountMap.getOrDefault(month, 0L)))
|
||||
)
|
||||
.map(month -> new ServiceWorkOrderAnalysisVo.BarChartVo(month,Math.toIntExact(orderCountMap.getOrDefault(month, 0L))))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,7 @@
|
||||
<?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.property.mapper.CapitalApplicationMapper">
|
||||
|
||||
</mapper>
|
@@ -0,0 +1,7 @@
|
||||
<?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.property.mapper.CapitalInfoMapper">
|
||||
|
||||
</mapper>
|
@@ -0,0 +1,7 @@
|
||||
<?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.property.mapper.MaintainKnowledgeMapper">
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user