feat(oa): 添加订单下人员工作及扣款信息功能
- 新增 GearWorkDeduction 实体类 - 创建 GearWorkDeductionBo 业务对象类- 实现 GearWorkDeductionController 控制器 - 编写 GearWorkDeductionMapper Mapper 接口 - 开发 GearWorkDeductionServiceImpl 服务实现类 - 设计 GearWorkDeductionVo 视图对象- 定义 IGearWorkDeductionService 服务接口
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.GearWorkDeductionVo;
|
||||||
|
import com.gear.oa.domain.bo.GearWorkDeductionBo;
|
||||||
|
import com.gear.oa.service.IGearWorkDeductionService;
|
||||||
|
import com.gear.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单下人员工作及扣款信息
|
||||||
|
*
|
||||||
|
* @author Joshi
|
||||||
|
* @date 2025-09-18
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/oa/workDeduction")
|
||||||
|
public class GearWorkDeductionController extends BaseController {
|
||||||
|
|
||||||
|
private final IGearWorkDeductionService iGearWorkDeductionService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单下人员工作及扣款信息列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<GearWorkDeductionVo> list(GearWorkDeductionBo bo, PageQuery pageQuery) {
|
||||||
|
return iGearWorkDeductionService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出订单下人员工作及扣款信息列表
|
||||||
|
*/
|
||||||
|
@Log(title = "订单下人员工作及扣款信息", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(GearWorkDeductionBo bo, HttpServletResponse response) {
|
||||||
|
List<GearWorkDeductionVo> list = iGearWorkDeductionService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "订单下人员工作及扣款信息", GearWorkDeductionVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取订单下人员工作及扣款信息详细信息
|
||||||
|
*
|
||||||
|
* @param deductionId 主键
|
||||||
|
*/
|
||||||
|
@GetMapping("/{deductionId}")
|
||||||
|
public R<GearWorkDeductionVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long deductionId) {
|
||||||
|
return R.ok(iGearWorkDeductionService.queryById(deductionId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增订单下人员工作及扣款信息
|
||||||
|
*/
|
||||||
|
@Log(title = "订单下人员工作及扣款信息", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody GearWorkDeductionBo bo) {
|
||||||
|
return toAjax(iGearWorkDeductionService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改订单下人员工作及扣款信息
|
||||||
|
*/
|
||||||
|
@Log(title = "订单下人员工作及扣款信息", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody GearWorkDeductionBo bo) {
|
||||||
|
return toAjax(iGearWorkDeductionService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除订单下人员工作及扣款信息
|
||||||
|
*
|
||||||
|
* @param deductionIds 主键串
|
||||||
|
*/
|
||||||
|
@Log(title = "订单下人员工作及扣款信息", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{deductionIds}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] deductionIds) {
|
||||||
|
return toAjax(iGearWorkDeductionService.deleteWithValidByIds(Arrays.asList(deductionIds), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
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 java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.gear.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单下人员工作及扣款信息对象 gear_work_deduction
|
||||||
|
*
|
||||||
|
* @author Joshi
|
||||||
|
* @date 2025-09-18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("gear_work_deduction")
|
||||||
|
public class GearWorkDeduction extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 记录唯一标识
|
||||||
|
*/
|
||||||
|
@TableId(value = "deduction_id")
|
||||||
|
private Long deductionId;
|
||||||
|
/**
|
||||||
|
* 订单编号,关联订单表
|
||||||
|
*/
|
||||||
|
private String orderId;
|
||||||
|
/**
|
||||||
|
* 人员名字
|
||||||
|
*/
|
||||||
|
private String personName;
|
||||||
|
/**
|
||||||
|
* 完成的工作内容描述
|
||||||
|
*/
|
||||||
|
private String workContent;
|
||||||
|
/**
|
||||||
|
* 扣款金额
|
||||||
|
*/
|
||||||
|
private BigDecimal deductionAmount;
|
||||||
|
/**
|
||||||
|
* 扣款原因
|
||||||
|
*/
|
||||||
|
private String deductionReason;
|
||||||
|
/**
|
||||||
|
* 工作日期
|
||||||
|
*/
|
||||||
|
private Date workDate;
|
||||||
|
/**
|
||||||
|
* 状态:0-有效,1-无效
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 删除标志(0=正常,1=删除)
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
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 java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.gear.common.core.domain.BaseEntity;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单下人员工作及扣款信息业务对象 gear_work_deduction
|
||||||
|
*
|
||||||
|
* @author Joshi
|
||||||
|
* @date 2025-09-18
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class GearWorkDeductionBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 记录唯一标识
|
||||||
|
*/
|
||||||
|
private Long deductionId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单编号,关联订单表
|
||||||
|
*/
|
||||||
|
private String orderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员名字
|
||||||
|
*/
|
||||||
|
private String personName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成的工作内容描述
|
||||||
|
*/
|
||||||
|
private String workContent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扣款金额
|
||||||
|
*/
|
||||||
|
private BigDecimal deductionAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扣款原因
|
||||||
|
*/
|
||||||
|
private String deductionReason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工作日期
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date workDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态:0-有效,1-无效
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
package com.gear.oa.domain.vo;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
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 org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单下人员工作及扣款信息视图对象 gear_work_deduction
|
||||||
|
*
|
||||||
|
* @author Joshi
|
||||||
|
* @date 2025-09-18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class GearWorkDeductionVo {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 记录唯一标识
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "记录唯一标识")
|
||||||
|
private Long deductionId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单编号,关联订单表
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "订单编号,关联订单表")
|
||||||
|
private String orderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员名字
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "人员名字")
|
||||||
|
private String personName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成的工作内容描述
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "完成的工作内容描述")
|
||||||
|
private String workContent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扣款金额
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "扣款金额")
|
||||||
|
private BigDecimal deductionAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扣款原因
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "扣款原因")
|
||||||
|
private String deductionReason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工作日期
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "工作日期")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date workDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态:0-有效,1-无效
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "状态:0-有效,1-无效")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
//订单名称和订单编号
|
||||||
|
@ExcelProperty(value = "订单名称")
|
||||||
|
private String orderName;
|
||||||
|
@ExcelProperty(value = "订单编号")
|
||||||
|
private String orderCode;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.gear.oa.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.gear.oa.domain.GearWorkDeduction;
|
||||||
|
import com.gear.oa.domain.vo.GearWorkDeductionVo;
|
||||||
|
import com.gear.common.core.mapper.BaseMapperPlus;
|
||||||
|
import org.springframework.data.repository.query.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单下人员工作及扣款信息Mapper接口
|
||||||
|
*
|
||||||
|
* @author Joshi
|
||||||
|
* @date 2025-09-18
|
||||||
|
*/
|
||||||
|
public interface GearWorkDeductionMapper extends BaseMapperPlus<GearWorkDeductionMapper, GearWorkDeduction, GearWorkDeductionVo> {
|
||||||
|
|
||||||
|
Page<GearWorkDeductionVo> selectVoPagePlus(Page<Object> build,@Param("ew") Wrapper<GearWorkDeduction> lqw);
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.gear.oa.service;
|
||||||
|
|
||||||
|
import com.gear.oa.domain.GearWorkDeduction;
|
||||||
|
import com.gear.oa.domain.vo.GearWorkDeductionVo;
|
||||||
|
import com.gear.oa.domain.bo.GearWorkDeductionBo;
|
||||||
|
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-09-18
|
||||||
|
*/
|
||||||
|
public interface IGearWorkDeductionService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单下人员工作及扣款信息
|
||||||
|
*/
|
||||||
|
GearWorkDeductionVo queryById(Long deductionId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单下人员工作及扣款信息列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<GearWorkDeductionVo> queryPageList(GearWorkDeductionBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单下人员工作及扣款信息列表
|
||||||
|
*/
|
||||||
|
List<GearWorkDeductionVo> queryList(GearWorkDeductionBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增订单下人员工作及扣款信息
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(GearWorkDeductionBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改订单下人员工作及扣款信息
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(GearWorkDeductionBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除订单下人员工作及扣款信息信息
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
||||||
@@ -0,0 +1,131 @@
|
|||||||
|
package com.gear.oa.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
|
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.GearWorkDeductionBo;
|
||||||
|
import com.gear.oa.domain.vo.GearWorkDeductionVo;
|
||||||
|
import com.gear.oa.domain.GearWorkDeduction;
|
||||||
|
import com.gear.oa.mapper.GearWorkDeductionMapper;
|
||||||
|
import com.gear.oa.service.IGearWorkDeductionService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单下人员工作及扣款信息Service业务层处理
|
||||||
|
*
|
||||||
|
* @author Joshi
|
||||||
|
* @date 2025-09-18
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class GearWorkDeductionServiceImpl implements IGearWorkDeductionService {
|
||||||
|
|
||||||
|
private final GearWorkDeductionMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单下人员工作及扣款信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public GearWorkDeductionVo queryById(Long deductionId){
|
||||||
|
return baseMapper.selectVoById(deductionId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单下人员工作及扣款信息列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<GearWorkDeductionVo> queryPageList(GearWorkDeductionBo bo, PageQuery pageQuery) {
|
||||||
|
Wrapper<GearWorkDeduction> lqw = buildQueryWrapperPlus(bo);
|
||||||
|
Page<GearWorkDeductionVo> result = baseMapper.selectVoPagePlus(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Wrapper<GearWorkDeduction> buildQueryWrapperPlus(GearWorkDeductionBo bo) {
|
||||||
|
//需要queryWrapper条件以表别名的方式查询
|
||||||
|
QueryWrapper<GearWorkDeduction> qw = Wrappers.query();
|
||||||
|
qw.eq(StringUtils.isNotBlank(bo.getOrderId()), "sr.order_id", bo.getOrderId());
|
||||||
|
qw.like(StringUtils.isNotBlank(bo.getPersonName()), "sr.person_name", bo.getPersonName());
|
||||||
|
qw.like(StringUtils.isNotBlank(bo.getWorkContent()), "sr.work_content", bo.getWorkContent());
|
||||||
|
qw.eq(bo.getDeductionAmount() != null, "sr.deduction_amount", bo.getDeductionAmount());
|
||||||
|
qw.like(StringUtils.isNotBlank(bo.getDeductionReason()), "sr.deduction_reason", bo.getDeductionReason());
|
||||||
|
qw.eq(bo.getWorkDate() != null, "sr.work_date", bo.getWorkDate());
|
||||||
|
qw.eq(bo.getStatus() != null, "sr.status", bo.getStatus());
|
||||||
|
qw.eq("sr.del_flag", 0);
|
||||||
|
return qw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单下人员工作及扣款信息列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<GearWorkDeductionVo> queryList(GearWorkDeductionBo bo) {
|
||||||
|
LambdaQueryWrapper<GearWorkDeduction> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<GearWorkDeduction> buildQueryWrapper(GearWorkDeductionBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<GearWorkDeduction> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getOrderId()), GearWorkDeduction::getOrderId, bo.getOrderId());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getPersonName()), GearWorkDeduction::getPersonName, bo.getPersonName());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getWorkContent()), GearWorkDeduction::getWorkContent, bo.getWorkContent());
|
||||||
|
lqw.eq(bo.getDeductionAmount() != null, GearWorkDeduction::getDeductionAmount, bo.getDeductionAmount());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getDeductionReason()), GearWorkDeduction::getDeductionReason, bo.getDeductionReason());
|
||||||
|
lqw.eq(bo.getWorkDate() != null, GearWorkDeduction::getWorkDate, bo.getWorkDate());
|
||||||
|
lqw.eq(bo.getStatus() != null, GearWorkDeduction::getStatus, bo.getStatus());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增订单下人员工作及扣款信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(GearWorkDeductionBo bo) {
|
||||||
|
GearWorkDeduction add = BeanUtil.toBean(bo, GearWorkDeduction.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setDeductionId(add.getDeductionId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改订单下人员工作及扣款信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(GearWorkDeductionBo bo) {
|
||||||
|
GearWorkDeduction update = BeanUtil.toBean(bo, GearWorkDeduction.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(GearWorkDeduction entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除订单下人员工作及扣款信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
<?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.GearWorkDeductionMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.gear.oa.domain.GearWorkDeduction" id="GearWorkDeductionResult">
|
||||||
|
<result property="deductionId" column="deduction_id"/>
|
||||||
|
<result property="orderId" column="order_id"/>
|
||||||
|
<result property="personName" column="person_name"/>
|
||||||
|
<result property="workContent" column="work_content"/>
|
||||||
|
<result property="deductionAmount" column="deduction_amount"/>
|
||||||
|
<result property="deductionReason" column="deduction_reason"/>
|
||||||
|
<result property="workDate" column="work_date"/>
|
||||||
|
<result property="status" column="status"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="delFlag" column="del_flag"/>
|
||||||
|
</resultMap>
|
||||||
|
<select id="selectVoPagePlus" resultType="com.gear.oa.domain.vo.GearWorkDeductionVo">
|
||||||
|
SELECT
|
||||||
|
sr.*,
|
||||||
|
go.order_name,
|
||||||
|
go.order_code
|
||||||
|
FROM
|
||||||
|
gear_work_deduction sr
|
||||||
|
LEFT JOIN gear_order go ON sr.order_id = go.order_id and go.del_flag = 0
|
||||||
|
${ew.customSqlSegment}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user