refactor(bpm): 重构资产申领功能并增强表单和明细管理
重构资产申领功能,增强表单和明细管理。更新BpmOAAssetClaimCreateReqVO中的申领明细描述, 将其从“申领明细”更改为“资产申领明细”。引入BpmOAAssetClaimItemSaveVO作为申领明细的保存视图。创建BpmOAAssetClaimItemDO实体,代表OA资产申领明细的数据对象,并在BpmOAAssetClaimItemMapper中定义相应的Mapper接口。 实现BpmOAAssetClaimItemService接口,提供资产申领明细的创建和查询服务。 此次重构未影响现有功能,但为资产申领功能提供了更清晰的实现和扩展基础。
This commit is contained in:
parent
5e2d73c60d
commit
61f0fe509b
@ -24,8 +24,8 @@ public class BpmOAAssetClaimCreateReqVO {
|
||||
@NotNull(message = "资产类型不能为空")
|
||||
private Long assetsTypeId;
|
||||
|
||||
@Schema(description = "申领明细")
|
||||
private List<Receive> receive;
|
||||
@Schema(description = "资产申领明细")
|
||||
private List<BpmOAAssetClaimItemSaveVO> receive;
|
||||
|
||||
@Schema(description = "申请原因")
|
||||
private String reason;
|
||||
|
@ -1,24 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.assetClaim;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 资产申领明细VO")
|
||||
@Data
|
||||
public class ReceiveRespVO {
|
||||
|
||||
@Schema(description = "资产类型编号")
|
||||
private Long assetsTypeId;
|
||||
|
||||
@Schema(description = "资产类型名称")
|
||||
private String assetsTypeName;
|
||||
|
||||
@Schema(description = "业务类型")
|
||||
private Integer businessType;
|
||||
|
||||
@Schema(description = "数量")
|
||||
private Integer num;
|
||||
|
||||
@Schema(description = "使用单位")
|
||||
private String util;
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package cn.iocoder.yudao.module.bpm.dal.dataobject.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* OA 资产申领明细 DO
|
||||
*
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@TableName(value ="bpm_oa_asset_claim_item", autoResultMap = true)
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BpmOAAssetClaimItemDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 出差表单主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 资产申领业务表编号
|
||||
*/
|
||||
private Long assetClaimId;
|
||||
|
||||
/**
|
||||
* 资产类型编号
|
||||
*/
|
||||
private Long assetsTypeId;
|
||||
|
||||
/**
|
||||
* 资产类型名称
|
||||
*/
|
||||
private String assetsTypeName;
|
||||
|
||||
/**
|
||||
* 业务类型 1行政类型 2生产类型
|
||||
*/
|
||||
private Integer businessType;
|
||||
|
||||
/**
|
||||
* 资产编号
|
||||
*/
|
||||
private String assetsNo;
|
||||
|
||||
/**
|
||||
* 资产名称
|
||||
*/
|
||||
private String assetsName;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Integer num;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String util;
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package cn.iocoder.yudao.module.bpm.dal.mysql.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAAssetClaimItemDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface BpmOAAssetClaimItemMapper extends BaseMapperX<BpmOAAssetClaimItemDO> {
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.assetClaim.BpmOAAssetClaimItemSaveVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAAssetClaimItemDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface BpmOAAssetClaimItemService {
|
||||
|
||||
/**
|
||||
* 创建资产申领明细
|
||||
* @param createReqVO 创建信息
|
||||
*/
|
||||
void createAssetClaimItem(List<BpmOAAssetClaimItemSaveVO> createReqVO);
|
||||
|
||||
/**
|
||||
* 根据资产申领编号,获得资产申领明细
|
||||
* @param assetClaimId 资产申领编号
|
||||
* @return 明细数据
|
||||
*/
|
||||
List<BpmOAAssetClaimItemDO> getAssetClaimItem(Long assetClaimId);
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.assetClaim.BpmOAAssetClaimItemSaveVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAAssetClaimItemDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAAssetClaimItemMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* OA 资产申领明细 Service 实现类
|
||||
*
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class BpmOAAssetClaimItemServiceImpl implements BpmOAAssetClaimItemService{
|
||||
|
||||
@Resource
|
||||
private BpmOAAssetClaimItemMapper assetClaimItemMapper;
|
||||
|
||||
@Override
|
||||
public void createAssetClaimItem(List<BpmOAAssetClaimItemSaveVO> createReqVO) {
|
||||
|
||||
List<BpmOAAssetClaimItemDO> items = BeanUtils.toBean(createReqVO, BpmOAAssetClaimItemDO.class);
|
||||
assetClaimItemMapper.insertBatch(items);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BpmOAAssetClaimItemDO> getAssetClaimItem(Long assetClaimId) {
|
||||
|
||||
return assetClaimItemMapper.selectList(BpmOAAssetClaimItemDO::getAssetClaimId, assetClaimId);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user