```
feat(gear-oa): 新增OA需求管理模块及相关功能 - 新增GearRequirements实体类、业务对象及视图对象 - 实现需求的增删改查、分页查询与导出功能 - 添加GearOrderVo继承BaseEntity并引入相关依赖 - 修改GearOrderServiceImpl中订单编码查询方式为模糊匹配 ```
This commit is contained in:
@@ -0,0 +1,100 @@
|
|||||||
|
package com.gear.oa.controller;
|
||||||
|
|
||||||
|
import com.gear.common.annotation.Log;
|
||||||
|
import com.gear.common.annotation.RepeatSubmit;
|
||||||
|
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.page.TableDataInfo;
|
||||||
|
import com.gear.common.core.validate.AddGroup;
|
||||||
|
import com.gear.common.core.validate.EditGroup;
|
||||||
|
import com.gear.common.enums.BusinessType;
|
||||||
|
import com.gear.common.utils.poi.ExcelUtil;
|
||||||
|
import com.gear.oa.domain.bo.GearRequirementsBo;
|
||||||
|
import com.gear.oa.domain.vo.GearRequirementsVo;
|
||||||
|
import com.gear.oa.service.IGearRequirementsService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 需求
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-06-27
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/oa/requirements")
|
||||||
|
public class GearRequirementsController extends BaseController {
|
||||||
|
|
||||||
|
private final IGearRequirementsService iGearRequirementsService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询OA 需求列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<GearRequirementsVo> list(GearRequirementsBo bo, PageQuery pageQuery) {
|
||||||
|
return iGearRequirementsService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出OA 需求列表
|
||||||
|
*/
|
||||||
|
@Log(title = "OA 需求", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(GearRequirementsBo bo, HttpServletResponse response) {
|
||||||
|
List<GearRequirementsVo> list = iGearRequirementsService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "OA 需求", GearRequirementsVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取OA 需求详细信息
|
||||||
|
*
|
||||||
|
* @param requirementId 主键
|
||||||
|
*/
|
||||||
|
@GetMapping("/{requirementId}")
|
||||||
|
public R<GearRequirementsVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long requirementId) {
|
||||||
|
return R.ok(iGearRequirementsService.queryById(requirementId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增OA 需求
|
||||||
|
*/
|
||||||
|
@Log(title = "OA 需求", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody GearRequirementsBo bo) {
|
||||||
|
return toAjax(iGearRequirementsService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改OA 需求
|
||||||
|
*/
|
||||||
|
@Log(title = "OA 需求", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody GearRequirementsBo bo) {
|
||||||
|
return toAjax(iGearRequirementsService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除OA 需求
|
||||||
|
*
|
||||||
|
* @param requirementIds 主键串
|
||||||
|
*/
|
||||||
|
@Log(title = "OA 需求", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{requirementIds}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] requirementIds) {
|
||||||
|
return toAjax(iGearRequirementsService.deleteWithValidByIds(Arrays.asList(requirementIds), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
package com.gear.oa.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.gear.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 需求对象 oa_requirements
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-06-27
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("oa_requirements")
|
||||||
|
public class GearRequirements extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(value = "requirement_id")
|
||||||
|
private Long requirementId;
|
||||||
|
/**
|
||||||
|
* 需求标题
|
||||||
|
*/
|
||||||
|
private String title;
|
||||||
|
/**
|
||||||
|
* 需求方用户 ID
|
||||||
|
*/
|
||||||
|
private Long requesterId;
|
||||||
|
/**
|
||||||
|
* 负责人用户 ID
|
||||||
|
*/
|
||||||
|
private Long ownerId;
|
||||||
|
/**
|
||||||
|
* 挂接项目 ID,可选
|
||||||
|
*/
|
||||||
|
private Long orderId;
|
||||||
|
/**
|
||||||
|
* 需求描述
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
/**
|
||||||
|
* 截止日期(最终时间)
|
||||||
|
*/
|
||||||
|
private Date deadline;
|
||||||
|
/**
|
||||||
|
* 状态:0=未完成,1=已完成
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 附件(路径或 URL),多附件逗号分隔
|
||||||
|
*/
|
||||||
|
private String accessory;
|
||||||
|
/**
|
||||||
|
* 删除标志:0=正常,1=已删除
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
package com.gear.oa.domain.bo;
|
||||||
|
|
||||||
|
import com.gear.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 需求业务对象 oa_requirements
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-06-27
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class GearRequirementsBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private Long requirementId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 需求标题
|
||||||
|
*/
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 需求方用户 ID
|
||||||
|
*/
|
||||||
|
private Long requesterId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负责人用户 ID
|
||||||
|
*/
|
||||||
|
private Long ownerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 挂接项目 ID,可选
|
||||||
|
*/
|
||||||
|
private Long orderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 需求描述
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 截止日期(最终时间)
|
||||||
|
*/
|
||||||
|
private Date deadline;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态:0=未完成,1=已完成
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附件(路径或 URL),多附件逗号分隔
|
||||||
|
*/
|
||||||
|
private String accessory;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
|||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import com.gear.common.annotation.ExcelDictFormat;
|
import com.gear.common.annotation.ExcelDictFormat;
|
||||||
import com.gear.common.convert.ExcelDictConvert;
|
import com.gear.common.convert.ExcelDictConvert;
|
||||||
|
import com.gear.common.core.domain.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
@@ -20,7 +21,7 @@ import org.springframework.format.annotation.DateTimeFormat;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
public class GearOrderVo {
|
public class GearOrderVo extends BaseEntity {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,93 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 需求视图对象 oa_requirements
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-06-27
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class GearRequirementsVo {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "主键")
|
||||||
|
private Long requirementId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 需求标题
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "需求标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 需求方用户 ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "需求方用户 ID")
|
||||||
|
private Long requesterId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负责人用户 ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "负责人用户 ID")
|
||||||
|
private Long ownerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 挂接项目 ID,可选
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "挂接项目 ID,可选")
|
||||||
|
private Long orderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 需求描述
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "需求描述")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 截止日期(最终时间)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "截止日期", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(readConverterExp = "最=终时间")
|
||||||
|
private Date deadline;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态:0=未完成,1=已完成
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "状态:0=未完成,1=已完成")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附件(路径或 URL),多附件逗号分隔
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "附件", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(readConverterExp = "路=径或,U=RL")
|
||||||
|
private String accessory;
|
||||||
|
private String requesterNickName;
|
||||||
|
private String ownerNickName;
|
||||||
|
private String projectName;
|
||||||
|
//订单编号
|
||||||
|
@ExcelProperty(value = "订单编号")
|
||||||
|
private String orderCode;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.gear.oa.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.gear.common.core.mapper.BaseMapperPlus;
|
||||||
|
import com.gear.oa.domain.GearRequirements;
|
||||||
|
import com.gear.oa.domain.vo.GearRequirementsVo;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 需求Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-06-27
|
||||||
|
*/
|
||||||
|
public interface GearRequirementsMapper extends BaseMapperPlus<GearRequirementsMapper, GearRequirements, GearRequirementsVo> {
|
||||||
|
Page<GearRequirementsVo> selectVoListPage(Page<?> page, @Param("ew") Object lqw);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询需求列表(用于导出)
|
||||||
|
*/
|
||||||
|
List<GearRequirementsVo> selectVoListForExport(@Param("ew") Object lqw);
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package com.gear.oa.service;
|
||||||
|
|
||||||
|
import com.gear.common.core.domain.PageQuery;
|
||||||
|
import com.gear.common.core.page.TableDataInfo;
|
||||||
|
import com.gear.oa.domain.bo.GearRequirementsBo;
|
||||||
|
import com.gear.oa.domain.vo.GearRequirementsVo;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 需求Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-06-27
|
||||||
|
*/
|
||||||
|
public interface IGearRequirementsService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询OA 需求
|
||||||
|
*/
|
||||||
|
GearRequirementsVo queryById(Long requirementId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询OA 需求列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<GearRequirementsVo> queryPageList(GearRequirementsBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询OA 需求列表
|
||||||
|
*/
|
||||||
|
List<GearRequirementsVo> queryList(GearRequirementsBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增OA 需求
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(GearRequirementsBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改OA 需求
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(GearRequirementsBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除OA 需求信息
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
||||||
@@ -62,7 +62,7 @@ public class GearOrderServiceImpl implements IGearOrderService {
|
|||||||
private LambdaQueryWrapper<GearOrder> buildQueryWrapper(GearOrderBo bo) {
|
private LambdaQueryWrapper<GearOrder> buildQueryWrapper(GearOrderBo bo) {
|
||||||
Map<String, Object> params = bo.getParams();
|
Map<String, Object> params = bo.getParams();
|
||||||
LambdaQueryWrapper<GearOrder> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<GearOrder> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getOrderCode()), GearOrder::getOrderCode, bo.getOrderCode());
|
lqw.like(StringUtils.isNotBlank(bo.getOrderCode()), GearOrder::getOrderCode, bo.getOrderCode());
|
||||||
lqw.eq(bo.getCustomerId() != null, GearOrder::getCustomerId, bo.getCustomerId());
|
lqw.eq(bo.getCustomerId() != null, GearOrder::getCustomerId, bo.getCustomerId());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getSalesManager()), GearOrder::getSalesManager, bo.getSalesManager());
|
lqw.eq(StringUtils.isNotBlank(bo.getSalesManager()), GearOrder::getSalesManager, bo.getSalesManager());
|
||||||
lqw.eq(bo.getOrderStatus() != null, GearOrder::getOrderStatus, bo.getOrderStatus());
|
lqw.eq(bo.getOrderStatus() != null, GearOrder::getOrderStatus, bo.getOrderStatus());
|
||||||
|
|||||||
@@ -0,0 +1,114 @@
|
|||||||
|
package com.gear.oa.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.gear.common.core.domain.PageQuery;
|
||||||
|
import com.gear.common.core.page.TableDataInfo;
|
||||||
|
import com.gear.common.utils.StringUtils;
|
||||||
|
import com.gear.oa.domain.GearRequirements;
|
||||||
|
import com.gear.oa.domain.bo.GearRequirementsBo;
|
||||||
|
import com.gear.oa.domain.vo.GearRequirementsVo;
|
||||||
|
import com.gear.oa.mapper.GearRequirementsMapper;
|
||||||
|
import com.gear.oa.service.IGearRequirementsService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 需求Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-06-27
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class GearRequirementsServiceImpl implements IGearRequirementsService {
|
||||||
|
|
||||||
|
private final GearRequirementsMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询OA 需求
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public GearRequirementsVo queryById(Long requirementId){
|
||||||
|
return baseMapper.selectVoById(requirementId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询OA 需求列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<GearRequirementsVo> queryPageList(GearRequirementsBo bo, PageQuery pageQuery) {
|
||||||
|
QueryWrapper<GearRequirements> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<GearRequirementsVo> result = baseMapper.selectVoListPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询OA 需求列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<GearRequirementsVo> queryList(GearRequirementsBo bo) {
|
||||||
|
QueryWrapper<GearRequirements> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoListForExport(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private QueryWrapper<GearRequirements> buildQueryWrapper(GearRequirementsBo bo) {
|
||||||
|
QueryWrapper<GearRequirements> qw = new QueryWrapper<>();
|
||||||
|
qw.eq(StringUtils.isNotBlank(bo.getTitle()), "r.title", bo.getTitle());
|
||||||
|
qw.eq(bo.getRequesterId() != null, "r.requester_id", bo.getRequesterId());
|
||||||
|
qw.eq(bo.getOwnerId() != null, "r.owner_id", bo.getOwnerId());
|
||||||
|
qw.eq(bo.getOrderId() != null, "r.order_id", bo.getOrderId());
|
||||||
|
qw.eq(StringUtils.isNotBlank(bo.getDescription()), "r.description", bo.getDescription());
|
||||||
|
qw.eq(bo.getDeadline() != null, "r.deadline", bo.getDeadline());
|
||||||
|
qw.eq(bo.getStatus() != null, "r.status", bo.getStatus());
|
||||||
|
qw.eq(StringUtils.isNotBlank(bo.getAccessory()), "r.accessory", bo.getAccessory());
|
||||||
|
qw.eq("r.del_flag", 0);
|
||||||
|
return qw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增OA 需求
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(GearRequirementsBo bo) {
|
||||||
|
GearRequirements add = BeanUtil.toBean(bo, GearRequirements.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setRequirementId(add.getRequirementId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改OA 需求
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(GearRequirementsBo bo) {
|
||||||
|
GearRequirements update = BeanUtil.toBean(bo, GearRequirements.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(GearRequirements entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除OA 需求
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
<?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="com.gear.oa.mapper.GearRequirementsMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.gear.oa.domain.GearRequirements" id="GearRequirementsResult">
|
||||||
|
<result property="requirementId" column="requirement_id"/>
|
||||||
|
<result property="title" column="title"/>
|
||||||
|
<result property="requesterId" column="requester_id"/>
|
||||||
|
<result property="ownerId" column="owner_id"/>
|
||||||
|
<result property="projectId" column="project_id"/>
|
||||||
|
<result property="description" column="description"/>
|
||||||
|
<result property="deadline" column="deadline"/>
|
||||||
|
<result property="status" column="status"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
<result property="accessory" column="accessory"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="delFlag" column="del_flag"/>
|
||||||
|
|
||||||
|
</resultMap>
|
||||||
|
<select id="selectVoListPage" resultType="com.gear.oa.domain.vo.GearRequirementsVo">
|
||||||
|
SELECT
|
||||||
|
r.*,
|
||||||
|
u1.nick_name AS requester_nick_name,
|
||||||
|
u2.nick_name AS owner_nick_name,
|
||||||
|
g.order_code AS order_code
|
||||||
|
FROM oa_requirements r
|
||||||
|
LEFT JOIN sys_user u1 ON r.requester_id = u1.user_id
|
||||||
|
LEFT JOIN sys_user u2 ON r.owner_id = u2.user_id
|
||||||
|
LEFT JOIN gear_order g ON r.order_id = g.order_id
|
||||||
|
${ew.customSqlSegment}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectVoListForExport" resultType="com.gear.oa.domain.vo.GearRequirementsVo">
|
||||||
|
SELECT
|
||||||
|
r.*,
|
||||||
|
u1.nick_name AS requester_nick_name,
|
||||||
|
u2.nick_name AS owner_nick_name,
|
||||||
|
g.order_code AS order_code
|
||||||
|
FROM oa_requirements r
|
||||||
|
LEFT JOIN sys_user u1 ON r.requester_id = u1.user_id
|
||||||
|
LEFT JOIN sys_user u2 ON r.owner_id = u2.user_id
|
||||||
|
LEFT JOIN gear_order g ON r.order_id = g.order_id
|
||||||
|
${ew.customSqlSegment}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user