feat(oa/crm): 新增礼品管理模块
- 创建礼品申请实体类CrmGiftApply及其业务对象CrmGiftApplyBo - 创建礼品申请明细实体类CrmGiftApplyDetail及其业务对象CrmGiftApplyDetailBo - 实现礼品申请控制器CrmGiftApplyController提供完整的CRUD操作 - 实现礼品申请明细控制器CrmGiftApplyDetailController提供明细管理功能 - 添加礼品申请及明细的数据访问层映射器和实现服务类 - 集成工作流程相关字段支持礼品申请审批流程 - 实现礼品申请批量发放功能和库存扣减逻辑 - 配置MyBatis映射文件支持数据持久化操作dev
parent
c7507ccaf6
commit
82d2ad7545
@ -0,0 +1,117 @@
|
||||
package org.dromara.oa.crm.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.oa.crm.domain.bo.CrmGiftApplyDetailBo;
|
||||
import org.dromara.oa.crm.domain.vo.CrmGiftApplyDetailVo;
|
||||
import org.dromara.oa.crm.service.ICrmGiftApplyDetailService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 礼品申请明细
|
||||
* 前端访问路由地址为:/oa/crm/crmGiftApplyDetail
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-19
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/crm/crmGiftApplyDetail")
|
||||
public class CrmGiftApplyDetailController extends BaseController {
|
||||
|
||||
private final ICrmGiftApplyDetailService crmGiftApplyDetailService;
|
||||
|
||||
/**
|
||||
* 查询礼品申请明细列表
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmGiftApplyDetail:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<CrmGiftApplyDetailVo> list(CrmGiftApplyDetailBo bo, PageQuery pageQuery) {
|
||||
return crmGiftApplyDetailService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出礼品申请明细列表
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmGiftApplyDetail:export")
|
||||
@Log(title = "礼品申请明细", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(CrmGiftApplyDetailBo bo, HttpServletResponse response) {
|
||||
List<CrmGiftApplyDetailVo> list = crmGiftApplyDetailService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "礼品申请明细", CrmGiftApplyDetailVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取礼品申请明细详细信息
|
||||
*
|
||||
* @param detailId 主键
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmGiftApplyDetail:query")
|
||||
@GetMapping("/{detailId}")
|
||||
public R<CrmGiftApplyDetailVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("detailId") Long detailId) {
|
||||
return R.ok(crmGiftApplyDetailService.queryById(detailId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增礼品申请明细
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmGiftApplyDetail:add")
|
||||
@Log(title = "礼品申请明细", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody CrmGiftApplyDetailBo bo) {
|
||||
return toAjax(crmGiftApplyDetailService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改礼品申请明细
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmGiftApplyDetail:edit")
|
||||
@Log(title = "礼品申请明细", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody CrmGiftApplyDetailBo bo) {
|
||||
return toAjax(crmGiftApplyDetailService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除礼品申请明细
|
||||
*
|
||||
* @param detailIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmGiftApplyDetail:remove")
|
||||
@Log(title = "礼品申请明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{detailIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable("detailIds") Long[] detailIds) {
|
||||
return toAjax(crmGiftApplyDetailService.deleteWithValidByIds(List.of(detailIds), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉框查询礼品申请明细列表
|
||||
*/
|
||||
@GetMapping("/getCrmGiftApplyDetailList")
|
||||
public R<List<CrmGiftApplyDetailVo>> getCrmGiftApplyDetailList(CrmGiftApplyDetailBo bo) {
|
||||
List<CrmGiftApplyDetailVo> list = crmGiftApplyDetailService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,117 @@
|
||||
package org.dromara.oa.crm.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.oa.crm.domain.bo.CrmGiftInfoBo;
|
||||
import org.dromara.oa.crm.domain.vo.CrmGiftInfoVo;
|
||||
import org.dromara.oa.crm.service.ICrmGiftInfoService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 礼品信息
|
||||
* 前端访问路由地址为:/oa/crm/crmGiftInfo
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-19
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/crm/crmGiftInfo")
|
||||
public class CrmGiftInfoController extends BaseController {
|
||||
|
||||
private final ICrmGiftInfoService crmGiftInfoService;
|
||||
|
||||
/**
|
||||
* 查询礼品信息列表
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmGiftInfo:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<CrmGiftInfoVo> list(CrmGiftInfoBo bo, PageQuery pageQuery) {
|
||||
return crmGiftInfoService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出礼品信息列表
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmGiftInfo:export")
|
||||
@Log(title = "礼品信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(CrmGiftInfoBo bo, HttpServletResponse response) {
|
||||
List<CrmGiftInfoVo> list = crmGiftInfoService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "礼品信息", CrmGiftInfoVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取礼品信息详细信息
|
||||
*
|
||||
* @param giftId 主键
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmGiftInfo:query")
|
||||
@GetMapping("/{giftId}")
|
||||
public R<CrmGiftInfoVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("giftId") Long giftId) {
|
||||
return R.ok(crmGiftInfoService.queryById(giftId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增礼品信息
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmGiftInfo:add")
|
||||
@Log(title = "礼品信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody CrmGiftInfoBo bo) {
|
||||
return toAjax(crmGiftInfoService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改礼品信息
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmGiftInfo:edit")
|
||||
@Log(title = "礼品信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody CrmGiftInfoBo bo) {
|
||||
return toAjax(crmGiftInfoService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除礼品信息
|
||||
*
|
||||
* @param giftIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmGiftInfo:remove")
|
||||
@Log(title = "礼品信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{giftIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable("giftIds") Long[] giftIds) {
|
||||
return toAjax(crmGiftInfoService.deleteWithValidByIds(List.of(giftIds), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉框查询礼品信息列表
|
||||
*/
|
||||
@GetMapping("/getCrmGiftInfoList")
|
||||
public R<List<CrmGiftInfoVo>> getCrmGiftInfoList(CrmGiftInfoBo bo) {
|
||||
List<CrmGiftInfoVo> list = crmGiftInfoService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,117 @@
|
||||
package org.dromara.oa.crm.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.oa.crm.domain.bo.CrmGiftIssueRecordBo;
|
||||
import org.dromara.oa.crm.domain.vo.CrmGiftIssueRecordVo;
|
||||
import org.dromara.oa.crm.service.ICrmGiftIssueRecordService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 礼品发放记录
|
||||
* 前端访问路由地址为:/oa/crm/crmGiftIssueRecord
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-19
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/crm/crmGiftIssueRecord")
|
||||
public class CrmGiftIssueRecordController extends BaseController {
|
||||
|
||||
private final ICrmGiftIssueRecordService crmGiftIssueRecordService;
|
||||
|
||||
/**
|
||||
* 查询礼品发放记录列表
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmGiftIssueRecord:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<CrmGiftIssueRecordVo> list(CrmGiftIssueRecordBo bo, PageQuery pageQuery) {
|
||||
return crmGiftIssueRecordService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出礼品发放记录列表
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmGiftIssueRecord:export")
|
||||
@Log(title = "礼品发放记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(CrmGiftIssueRecordBo bo, HttpServletResponse response) {
|
||||
List<CrmGiftIssueRecordVo> list = crmGiftIssueRecordService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "礼品发放记录", CrmGiftIssueRecordVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取礼品发放记录详细信息
|
||||
*
|
||||
* @param issueRecordId 主键
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmGiftIssueRecord:query")
|
||||
@GetMapping("/{issueRecordId}")
|
||||
public R<CrmGiftIssueRecordVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("issueRecordId") Long issueRecordId) {
|
||||
return R.ok(crmGiftIssueRecordService.queryById(issueRecordId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增礼品发放记录
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmGiftIssueRecord:add")
|
||||
@Log(title = "礼品发放记录", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody CrmGiftIssueRecordBo bo) {
|
||||
return toAjax(crmGiftIssueRecordService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改礼品发放记录
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmGiftIssueRecord:edit")
|
||||
@Log(title = "礼品发放记录", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody CrmGiftIssueRecordBo bo) {
|
||||
return toAjax(crmGiftIssueRecordService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除礼品发放记录
|
||||
*
|
||||
* @param issueRecordIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("oa/crm:crmGiftIssueRecord:remove")
|
||||
@Log(title = "礼品发放记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{issueRecordIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable("issueRecordIds") Long[] issueRecordIds) {
|
||||
return toAjax(crmGiftIssueRecordService.deleteWithValidByIds(List.of(issueRecordIds), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉框查询礼品发放记录列表
|
||||
*/
|
||||
@GetMapping("/getCrmGiftIssueRecordList")
|
||||
public R<List<CrmGiftIssueRecordVo>> getCrmGiftIssueRecordList(CrmGiftIssueRecordBo bo) {
|
||||
List<CrmGiftIssueRecordVo> list = crmGiftIssueRecordService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,90 @@
|
||||
package org.dromara.oa.crm.domain.bo;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.oa.crm.domain.CrmGiftApplyDetail;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 礼品申请明细业务对象 crm_gift_apply_detail
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-19
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = CrmGiftApplyDetail.class, reverseConvertGenerate = false)
|
||||
public class CrmGiftApplyDetailBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 礼品申请明细ID
|
||||
*/
|
||||
@NotNull(message = "礼品申请明细ID不能为空", groups = { EditGroup.class })
|
||||
private Long detailId;
|
||||
|
||||
/**
|
||||
* 申请单ID
|
||||
*/
|
||||
@NotNull(message = "申请单ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long applicationId;
|
||||
|
||||
/**
|
||||
* 礼品ID
|
||||
*/
|
||||
@NotNull(message = "礼品ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long giftId;
|
||||
|
||||
/**
|
||||
* 礼品编码
|
||||
*/
|
||||
private String giftCode;
|
||||
|
||||
/**
|
||||
* 礼品名称
|
||||
*/
|
||||
private String giftName;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 单价(含税)
|
||||
*/
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/**
|
||||
* 库存数量
|
||||
*/
|
||||
private Integer inventoryQuantity;
|
||||
|
||||
/**
|
||||
* 申请数量
|
||||
*/
|
||||
@NotNull(message = "申请数量不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Integer applicationQuantity;
|
||||
|
||||
/**
|
||||
* 礼品金额
|
||||
*/
|
||||
private BigDecimal giftAmount;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
private Integer sortOrder;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package org.dromara.oa.crm.domain.bo;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.oa.crm.domain.CrmGiftInfo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 礼品信息业务对象 crm_gift_info
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-19
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = CrmGiftInfo.class, reverseConvertGenerate = false)
|
||||
public class CrmGiftInfoBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 礼品ID
|
||||
*/
|
||||
@NotNull(message = "礼品ID不能为空", groups = { EditGroup.class })
|
||||
private Long giftId;
|
||||
|
||||
/**
|
||||
* 礼品编码
|
||||
*/
|
||||
private String giftCode;
|
||||
|
||||
/**
|
||||
* 礼品名称
|
||||
*/
|
||||
@NotBlank(message = "礼品名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String giftName;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 采购单价(含税)
|
||||
*/
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/**
|
||||
* 单位ID
|
||||
*/
|
||||
private Long unitId;
|
||||
|
||||
/**
|
||||
* 库存数量
|
||||
*/
|
||||
private Integer inventoryQuantity;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,128 @@
|
||||
package org.dromara.oa.crm.domain.bo;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.oa.crm.domain.CrmGiftIssueRecord;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 礼品发放记录业务对象 crm_gift_issue_record
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-19
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = CrmGiftIssueRecord.class, reverseConvertGenerate = false)
|
||||
public class CrmGiftIssueRecordBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 发放记录ID
|
||||
*/
|
||||
@NotNull(message = "发放记录ID不能为空", groups = { EditGroup.class })
|
||||
private Long issueRecordId;
|
||||
|
||||
/**
|
||||
* 申请单ID
|
||||
*/
|
||||
@NotNull(message = "申请单ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long applicationId;
|
||||
|
||||
/**
|
||||
* 申请单编号
|
||||
*/
|
||||
private String applicationCode;
|
||||
|
||||
/**
|
||||
* 申请明细ID
|
||||
*/
|
||||
@NotNull(message = "申请明细ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long detailId;
|
||||
|
||||
/**
|
||||
* 礼品ID
|
||||
*/
|
||||
@NotNull(message = "礼品ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long giftId;
|
||||
|
||||
/**
|
||||
* 礼品编码
|
||||
*/
|
||||
private String giftCode;
|
||||
|
||||
/**
|
||||
* 礼品名称
|
||||
*/
|
||||
private String giftName;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 发放数量
|
||||
*/
|
||||
@NotNull(message = "发放数量不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Integer issueQuantity;
|
||||
|
||||
/**
|
||||
* 发放时间
|
||||
*/
|
||||
@NotNull(message = "发放时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date issueDate;
|
||||
|
||||
/**
|
||||
* 领取人ID
|
||||
*/
|
||||
@NotNull(message = "领取人ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long recipientId;
|
||||
|
||||
/**
|
||||
* 领取人姓名
|
||||
*/
|
||||
private String recipientName;
|
||||
|
||||
/**
|
||||
* 发放人ID
|
||||
*/
|
||||
private Long issueBy;
|
||||
|
||||
/**
|
||||
* 发放人姓名
|
||||
*/
|
||||
private String issueByName;
|
||||
|
||||
/**
|
||||
* 发放部门ID
|
||||
*/
|
||||
private Long issueDeptId;
|
||||
|
||||
/**
|
||||
* 发放部门名称
|
||||
*/
|
||||
private String issueDeptName;
|
||||
|
||||
/**
|
||||
* 发放前库存数量
|
||||
*/
|
||||
private Integer beforeInventory;
|
||||
|
||||
/**
|
||||
* 发放后库存数量
|
||||
*/
|
||||
private Integer afterInventory;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,102 @@
|
||||
package org.dromara.oa.crm.domain.vo;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.oa.crm.domain.CrmGiftApplyDetail;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 礼品申请明细视图对象 crm_gift_apply_detail
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-19
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = CrmGiftApplyDetail.class)
|
||||
public class CrmGiftApplyDetailVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 礼品申请明细ID
|
||||
*/
|
||||
@ExcelProperty(value = "礼品申请明细ID")
|
||||
private Long detailId;
|
||||
|
||||
/**
|
||||
* 申请单ID
|
||||
*/
|
||||
@ExcelProperty(value = "申请单ID")
|
||||
private Long applicationId;
|
||||
|
||||
/**
|
||||
* 礼品ID
|
||||
*/
|
||||
@ExcelProperty(value = "礼品ID")
|
||||
private Long giftId;
|
||||
|
||||
/**
|
||||
* 礼品编码
|
||||
*/
|
||||
@ExcelProperty(value = "礼品编码")
|
||||
private String giftCode;
|
||||
|
||||
/**
|
||||
* 礼品名称
|
||||
*/
|
||||
@ExcelProperty(value = "礼品名称")
|
||||
private String giftName;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
@ExcelProperty(value = "规格型号")
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 单价(含税)
|
||||
*/
|
||||
@ExcelProperty(value = "单价(含税)")
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/**
|
||||
* 库存数量
|
||||
*/
|
||||
@ExcelProperty(value = "库存数量")
|
||||
private Integer inventoryQuantity;
|
||||
|
||||
/**
|
||||
* 申请数量
|
||||
*/
|
||||
@ExcelProperty(value = "申请数量")
|
||||
private Integer applicationQuantity;
|
||||
|
||||
/**
|
||||
* 礼品金额
|
||||
*/
|
||||
@ExcelProperty(value = "礼品金额")
|
||||
private BigDecimal giftAmount;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@ExcelProperty(value = "排序号")
|
||||
private Integer sortOrder;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,153 @@
|
||||
package org.dromara.oa.crm.domain.vo;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.oa.crm.domain.CrmGiftApply;
|
||||
import org.dromara.oa.crm.domain.CrmGiftApplyDetail;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 礼品申请视图对象 crm_gift_apply
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-19
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = CrmGiftApply.class)
|
||||
public class CrmGiftApplyVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 申请单ID
|
||||
*/
|
||||
@ExcelProperty(value = "申请单ID")
|
||||
private Long giftApplyId;
|
||||
|
||||
/**
|
||||
* 礼品申请编号
|
||||
*/
|
||||
@ExcelProperty(value = "礼品申请编号")
|
||||
private String applicationCode;
|
||||
|
||||
/**
|
||||
* 申请人ID
|
||||
*/
|
||||
@ExcelProperty(value = "申请人ID")
|
||||
private Long applicantId;
|
||||
|
||||
/**
|
||||
* 申请人姓名
|
||||
*/
|
||||
@ExcelProperty(value = "申请人姓名")
|
||||
private String applicantName;
|
||||
|
||||
/**
|
||||
* 申请人所属部门ID
|
||||
*/
|
||||
@ExcelProperty(value = "申请人所属部门ID")
|
||||
private Long applicantDeptId;
|
||||
|
||||
/**
|
||||
* 申请人所属部门名称
|
||||
*/
|
||||
@ExcelProperty(value = "申请人所属部门名称")
|
||||
private String applicantDeptName;
|
||||
|
||||
/**
|
||||
* 申请日期
|
||||
*/
|
||||
@ExcelProperty(value = "申请日期")
|
||||
private Date applicationDate;
|
||||
|
||||
/**
|
||||
* 客户ID
|
||||
*/
|
||||
@ExcelProperty(value = "客户ID")
|
||||
private Long customerUnitId;
|
||||
|
||||
/**
|
||||
* 客户名称
|
||||
*/
|
||||
@ExcelProperty(value = "客户名称")
|
||||
private String customerUnitName;
|
||||
|
||||
/**
|
||||
* 客人姓名
|
||||
*/
|
||||
@ExcelProperty(value = "客人姓名")
|
||||
private String guestName;
|
||||
|
||||
/**
|
||||
* 人数
|
||||
*/
|
||||
@ExcelProperty(value = "人数")
|
||||
private Integer peopleCount;
|
||||
|
||||
/**
|
||||
* 申请事由
|
||||
*/
|
||||
@ExcelProperty(value = "申请事由")
|
||||
private String applicationReason;
|
||||
|
||||
/**
|
||||
* 领用人ID
|
||||
*/
|
||||
@ExcelProperty(value = "领用人ID")
|
||||
private Long recipientId;
|
||||
|
||||
/**
|
||||
* 领用人姓名
|
||||
*/
|
||||
@ExcelProperty(value = "领用人姓名")
|
||||
private String recipientName;
|
||||
|
||||
/**
|
||||
* 领用日期
|
||||
*/
|
||||
@ExcelProperty(value = "领用日期")
|
||||
private Date recipientDate;
|
||||
|
||||
/**
|
||||
* 申请总金额
|
||||
*/
|
||||
@ExcelProperty(value = "申请总金额")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 礼品申请状态(1暂存 2审批中 3已审批 4作废)
|
||||
*/
|
||||
@ExcelProperty(value = "礼品申请状态(1暂存 2审批中 3已审批 4作废)")
|
||||
private String applicationStatus;
|
||||
|
||||
/**
|
||||
* 流程状态
|
||||
*/
|
||||
@ExcelProperty(value = "流程状态")
|
||||
private String flowStatus;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
// ==================== 子表数据 ====================
|
||||
|
||||
/**
|
||||
* 礼品申请明细列表
|
||||
*/
|
||||
private List<CrmGiftApplyDetail> detailList;
|
||||
|
||||
}
|
||||
@ -0,0 +1,78 @@
|
||||
package org.dromara.oa.crm.domain.vo;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.oa.crm.domain.CrmGiftInfo;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 礼品信息视图对象 crm_gift_info
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-19
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = CrmGiftInfo.class)
|
||||
public class CrmGiftInfoVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 礼品ID
|
||||
*/
|
||||
@ExcelProperty(value = "礼品ID")
|
||||
private Long giftId;
|
||||
|
||||
/**
|
||||
* 礼品编码
|
||||
*/
|
||||
@ExcelProperty(value = "礼品编码")
|
||||
private String giftCode;
|
||||
|
||||
/**
|
||||
* 礼品名称
|
||||
*/
|
||||
@ExcelProperty(value = "礼品名称")
|
||||
private String giftName;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
@ExcelProperty(value = "规格型号")
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 采购单价(含税)
|
||||
*/
|
||||
@ExcelProperty(value = "采购单价(含税)")
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/**
|
||||
* 单位ID
|
||||
*/
|
||||
@ExcelProperty(value = "单位ID")
|
||||
private Long unitId;
|
||||
|
||||
/**
|
||||
* 库存数量
|
||||
*/
|
||||
@ExcelProperty(value = "库存数量")
|
||||
private Integer inventoryQuantity;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,144 @@
|
||||
package org.dromara.oa.crm.domain.vo;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.oa.crm.domain.CrmGiftIssueRecord;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 礼品发放记录视图对象 crm_gift_issue_record
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-19
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = CrmGiftIssueRecord.class)
|
||||
public class CrmGiftIssueRecordVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 发放记录ID
|
||||
*/
|
||||
@ExcelProperty(value = "发放记录ID")
|
||||
private Long issueRecordId;
|
||||
|
||||
/**
|
||||
* 申请单ID
|
||||
*/
|
||||
@ExcelProperty(value = "申请单ID")
|
||||
private Long applicationId;
|
||||
|
||||
/**
|
||||
* 申请单编号
|
||||
*/
|
||||
@ExcelProperty(value = "申请单编号")
|
||||
private String applicationCode;
|
||||
|
||||
/**
|
||||
* 申请明细ID
|
||||
*/
|
||||
@ExcelProperty(value = "申请明细ID")
|
||||
private Long detailId;
|
||||
|
||||
/**
|
||||
* 礼品ID
|
||||
*/
|
||||
@ExcelProperty(value = "礼品ID")
|
||||
private Long giftId;
|
||||
|
||||
/**
|
||||
* 礼品编码
|
||||
*/
|
||||
@ExcelProperty(value = "礼品编码")
|
||||
private String giftCode;
|
||||
|
||||
/**
|
||||
* 礼品名称
|
||||
*/
|
||||
@ExcelProperty(value = "礼品名称")
|
||||
private String giftName;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
@ExcelProperty(value = "规格型号")
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 发放数量
|
||||
*/
|
||||
@ExcelProperty(value = "发放数量")
|
||||
private Integer issueQuantity;
|
||||
|
||||
/**
|
||||
* 发放时间
|
||||
*/
|
||||
@ExcelProperty(value = "发放时间")
|
||||
private Date issueDate;
|
||||
|
||||
/**
|
||||
* 领取人ID
|
||||
*/
|
||||
@ExcelProperty(value = "领取人ID")
|
||||
private Long recipientId;
|
||||
|
||||
/**
|
||||
* 领取人姓名
|
||||
*/
|
||||
@ExcelProperty(value = "领取人姓名")
|
||||
private String recipientName;
|
||||
|
||||
/**
|
||||
* 发放人ID
|
||||
*/
|
||||
@ExcelProperty(value = "发放人ID")
|
||||
private Long issueBy;
|
||||
|
||||
/**
|
||||
* 发放人姓名
|
||||
*/
|
||||
@ExcelProperty(value = "发放人姓名")
|
||||
private String issueByName;
|
||||
|
||||
/**
|
||||
* 发放部门ID
|
||||
*/
|
||||
@ExcelProperty(value = "发放部门ID")
|
||||
private Long issueDeptId;
|
||||
|
||||
/**
|
||||
* 发放部门名称
|
||||
*/
|
||||
@ExcelProperty(value = "发放部门名称")
|
||||
private String issueDeptName;
|
||||
|
||||
/**
|
||||
* 发放前库存数量
|
||||
*/
|
||||
@ExcelProperty(value = "发放前库存数量")
|
||||
private Integer beforeInventory;
|
||||
|
||||
/**
|
||||
* 发放后库存数量
|
||||
*/
|
||||
@ExcelProperty(value = "发放后库存数量")
|
||||
private Integer afterInventory;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
package org.dromara.oa.crm.service;
|
||||
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.oa.crm.domain.bo.CrmGiftApplyDetailBo;
|
||||
import org.dromara.oa.crm.domain.vo.CrmGiftApplyDetailVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 礼品申请明细Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-19
|
||||
*/
|
||||
public interface ICrmGiftApplyDetailService {
|
||||
|
||||
/**
|
||||
* 查询礼品申请明细
|
||||
*
|
||||
* @param detailId 主键
|
||||
* @return 礼品申请明细
|
||||
*/
|
||||
CrmGiftApplyDetailVo queryById(Long detailId);
|
||||
|
||||
/**
|
||||
* 分页查询礼品申请明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 礼品申请明细分页列表
|
||||
*/
|
||||
TableDataInfo<CrmGiftApplyDetailVo> queryPageList(CrmGiftApplyDetailBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的礼品申请明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 礼品申请明细列表
|
||||
*/
|
||||
List<CrmGiftApplyDetailVo> queryList(CrmGiftApplyDetailBo bo);
|
||||
|
||||
/**
|
||||
* 新增礼品申请明细
|
||||
*
|
||||
* @param bo 礼品申请明细
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(CrmGiftApplyDetailBo bo);
|
||||
|
||||
/**
|
||||
* 修改礼品申请明细
|
||||
*
|
||||
* @param bo 礼品申请明细
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(CrmGiftApplyDetailBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除礼品申请明细信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
package org.dromara.oa.crm.service;
|
||||
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.oa.crm.domain.bo.CrmGiftInfoBo;
|
||||
import org.dromara.oa.crm.domain.vo.CrmGiftInfoVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 礼品信息Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-19
|
||||
*/
|
||||
public interface ICrmGiftInfoService {
|
||||
|
||||
/**
|
||||
* 查询礼品信息
|
||||
*
|
||||
* @param giftId 主键
|
||||
* @return 礼品信息
|
||||
*/
|
||||
CrmGiftInfoVo queryById(Long giftId);
|
||||
|
||||
/**
|
||||
* 分页查询礼品信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 礼品信息分页列表
|
||||
*/
|
||||
TableDataInfo<CrmGiftInfoVo> queryPageList(CrmGiftInfoBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的礼品信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 礼品信息列表
|
||||
*/
|
||||
List<CrmGiftInfoVo> queryList(CrmGiftInfoBo bo);
|
||||
|
||||
/**
|
||||
* 新增礼品信息
|
||||
*
|
||||
* @param bo 礼品信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(CrmGiftInfoBo bo);
|
||||
|
||||
/**
|
||||
* 修改礼品信息
|
||||
*
|
||||
* @param bo 礼品信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(CrmGiftInfoBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除礼品信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
package org.dromara.oa.crm.service;
|
||||
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.oa.crm.domain.bo.CrmGiftIssueRecordBo;
|
||||
import org.dromara.oa.crm.domain.vo.CrmGiftIssueRecordVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 礼品发放记录Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-19
|
||||
*/
|
||||
public interface ICrmGiftIssueRecordService {
|
||||
|
||||
/**
|
||||
* 查询礼品发放记录
|
||||
*
|
||||
* @param issueRecordId 主键
|
||||
* @return 礼品发放记录
|
||||
*/
|
||||
CrmGiftIssueRecordVo queryById(Long issueRecordId);
|
||||
|
||||
/**
|
||||
* 分页查询礼品发放记录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 礼品发放记录分页列表
|
||||
*/
|
||||
TableDataInfo<CrmGiftIssueRecordVo> queryPageList(CrmGiftIssueRecordBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的礼品发放记录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 礼品发放记录列表
|
||||
*/
|
||||
List<CrmGiftIssueRecordVo> queryList(CrmGiftIssueRecordBo bo);
|
||||
|
||||
/**
|
||||
* 新增礼品发放记录
|
||||
*
|
||||
* @param bo 礼品发放记录
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(CrmGiftIssueRecordBo bo);
|
||||
|
||||
/**
|
||||
* 修改礼品发放记录
|
||||
*
|
||||
* @param bo 礼品发放记录
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(CrmGiftIssueRecordBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除礼品发放记录信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -0,0 +1,141 @@
|
||||
package org.dromara.oa.crm.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.toolkit.JoinWrappers;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.oa.crm.domain.CrmGiftApplyDetail;
|
||||
import org.dromara.oa.crm.domain.bo.CrmGiftApplyDetailBo;
|
||||
import org.dromara.oa.crm.domain.vo.CrmGiftApplyDetailVo;
|
||||
import org.dromara.oa.crm.mapper.CrmGiftApplyDetailMapper;
|
||||
import org.dromara.oa.crm.service.ICrmGiftApplyDetailService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 礼品申请明细Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-19
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class CrmGiftApplyDetailServiceImpl implements ICrmGiftApplyDetailService {
|
||||
|
||||
private final CrmGiftApplyDetailMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询礼品申请明细
|
||||
*
|
||||
* @param detailId 主键
|
||||
* @return 礼品申请明细
|
||||
*/
|
||||
@Override
|
||||
public CrmGiftApplyDetailVo queryById(Long detailId){
|
||||
return baseMapper.selectVoById(detailId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询礼品申请明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 礼品申请明细分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<CrmGiftApplyDetailVo> queryPageList(CrmGiftApplyDetailBo bo, PageQuery pageQuery) {
|
||||
MPJLambdaWrapper<CrmGiftApplyDetail> lqw = buildQueryWrapper(bo);
|
||||
Page<CrmGiftApplyDetailVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的礼品申请明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 礼品申请明细列表
|
||||
*/
|
||||
@Override
|
||||
public List<CrmGiftApplyDetailVo> queryList(CrmGiftApplyDetailBo bo) {
|
||||
MPJLambdaWrapper<CrmGiftApplyDetail> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private MPJLambdaWrapper<CrmGiftApplyDetail> buildQueryWrapper(CrmGiftApplyDetailBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
MPJLambdaWrapper<CrmGiftApplyDetail> lqw = JoinWrappers.lambda(CrmGiftApplyDetail.class)
|
||||
.selectAll(CrmGiftApplyDetail.class)
|
||||
.eq(CrmGiftApplyDetail::getDelFlag, "0")
|
||||
.eq(bo.getApplicationId() != null, CrmGiftApplyDetail::getApplicationId, bo.getApplicationId())
|
||||
.eq(bo.getGiftId() != null, CrmGiftApplyDetail::getGiftId, bo.getGiftId())
|
||||
.eq(StringUtils.isNotBlank(bo.getGiftCode()), CrmGiftApplyDetail::getGiftCode, bo.getGiftCode())
|
||||
.like(StringUtils.isNotBlank(bo.getGiftName()), CrmGiftApplyDetail::getGiftName, bo.getGiftName())
|
||||
.eq(StringUtils.isNotBlank(bo.getSpecification()), CrmGiftApplyDetail::getSpecification, bo.getSpecification())
|
||||
.eq(bo.getUnitPrice() != null, CrmGiftApplyDetail::getUnitPrice, bo.getUnitPrice())
|
||||
.eq(bo.getInventoryQuantity() != null, CrmGiftApplyDetail::getInventoryQuantity, bo.getInventoryQuantity())
|
||||
.eq(bo.getApplicationQuantity() != null, CrmGiftApplyDetail::getApplicationQuantity, bo.getApplicationQuantity())
|
||||
.eq(bo.getGiftAmount() != null, CrmGiftApplyDetail::getGiftAmount, bo.getGiftAmount())
|
||||
.eq(bo.getSortOrder() != null, CrmGiftApplyDetail::getSortOrder, bo.getSortOrder())
|
||||
;
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增礼品申请明细
|
||||
*
|
||||
* @param bo 礼品申请明细
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(CrmGiftApplyDetailBo bo) {
|
||||
CrmGiftApplyDetail add = MapstructUtils.convert(bo, CrmGiftApplyDetail.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setDetailId(add.getDetailId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改礼品申请明细
|
||||
*
|
||||
* @param bo 礼品申请明细
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(CrmGiftApplyDetailBo bo) {
|
||||
CrmGiftApplyDetail update = MapstructUtils.convert(bo, CrmGiftApplyDetail.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(CrmGiftApplyDetail entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除礼品申请明细信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,233 @@
|
||||
<?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.oa.crm.mapper.CrmGiftApplyDetailMapper">
|
||||
<resultMap type="org.dromara.oa.crm.domain.vo.CrmGiftApplyDetailVo" id="CrmGiftApplyDetailResult">
|
||||
</resultMap>
|
||||
|
||||
<select id="selectCustomCrmGiftApplyDetailVoList" resultMap="CrmGiftApplyDetailResult">
|
||||
select t.detail_id, t.tenant_id, t.application_id, t.gift_id, t.gift_code, t.gift_name, t.specification, t.unit_price, t.inventory_quantity, t.application_quantity, t.gift_amount, t.sort_order, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time from crm_gift_apply_detail t
|
||||
<where>
|
||||
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
|
||||
AND ${ew.sqlSegment}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 根据ID查询详情 -->
|
||||
<select id="selectCustomCrmGiftApplyDetailVoById" resultMap="CrmGiftApplyDetailResult">
|
||||
select t.detail_id, t.tenant_id, t.application_id, t.gift_id, t.gift_code, t.gift_name, t.specification, t.unit_price, t.inventory_quantity, t.application_quantity, t.gift_amount, t.sort_order, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
|
||||
from crm_gift_apply_detail t
|
||||
where t.detail_id = #{detailId}
|
||||
</select>
|
||||
|
||||
<!-- 批量查询 - 根据ID列表 -->
|
||||
<select id="selectCustomCrmGiftApplyDetailVoByIds" resultMap="CrmGiftApplyDetailResult">
|
||||
select t.detail_id, t.tenant_id, t.application_id, t.gift_id, t.gift_code, t.gift_name, t.specification, t.unit_price, t.inventory_quantity, t.application_quantity, t.gift_amount, t.sort_order, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
|
||||
from crm_gift_apply_detail t
|
||||
where t.detail_id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!-- 统计查询 -->
|
||||
<select id="countCustomCrmGiftApplyDetail" resultType="java.lang.Long">
|
||||
select count(1) from crm_gift_apply_detail t
|
||||
<where>
|
||||
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
|
||||
AND ${ew.sqlSegment}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询(带自定义条件) -->
|
||||
<select id="selectCustomCrmGiftApplyDetailVoPage" resultMap="CrmGiftApplyDetailResult">
|
||||
select t.detail_id, t.tenant_id, t.application_id, t.gift_id, t.gift_code, t.gift_name, t.specification, t.unit_price, t.inventory_quantity, t.application_quantity, t.gift_amount, t.sort_order, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
|
||||
from crm_gift_apply_detail t
|
||||
<where>
|
||||
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
|
||||
AND ${ew.sqlSegment}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 批量插入 -->
|
||||
<insert id="batchInsertCrmGiftApplyDetail">
|
||||
insert into crm_gift_apply_detail(
|
||||
tenant_id,
|
||||
|
||||
application_id,
|
||||
|
||||
gift_id,
|
||||
|
||||
gift_code,
|
||||
|
||||
gift_name,
|
||||
|
||||
specification,
|
||||
|
||||
unit_price,
|
||||
|
||||
inventory_quantity,
|
||||
|
||||
application_quantity,
|
||||
|
||||
gift_amount,
|
||||
|
||||
sort_order,
|
||||
|
||||
remark,
|
||||
|
||||
del_flag,
|
||||
|
||||
create_dept,
|
||||
|
||||
create_by,
|
||||
|
||||
create_time,
|
||||
|
||||
update_by,
|
||||
|
||||
update_time
|
||||
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.tenantId},
|
||||
|
||||
#{item.applicationId},
|
||||
|
||||
#{item.giftId},
|
||||
|
||||
#{item.giftCode},
|
||||
|
||||
#{item.giftName},
|
||||
|
||||
#{item.specification},
|
||||
|
||||
#{item.unitPrice},
|
||||
|
||||
#{item.inventoryQuantity},
|
||||
|
||||
#{item.applicationQuantity},
|
||||
|
||||
#{item.giftAmount},
|
||||
|
||||
#{item.sortOrder},
|
||||
|
||||
#{item.remark},
|
||||
|
||||
#{item.delFlag},
|
||||
|
||||
#{item.createDept},
|
||||
|
||||
#{item.createBy},
|
||||
|
||||
#{item.createTime},
|
||||
|
||||
#{item.updateBy},
|
||||
|
||||
#{item.updateTime}
|
||||
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 批量更新 -->
|
||||
<update id="batchUpdateCrmGiftApplyDetail">
|
||||
<foreach collection="list" item="item" separator=";">
|
||||
update crm_gift_apply_detail t
|
||||
<set>
|
||||
<if test="item.tenantId != null and item.tenantId != ''">
|
||||
t.tenant_id = #{item.tenantId},
|
||||
</if>
|
||||
<if test="item.applicationId != null">
|
||||
t.application_id = #{item.applicationId},
|
||||
</if>
|
||||
<if test="item.giftId != null">
|
||||
t.gift_id = #{item.giftId},
|
||||
</if>
|
||||
<if test="item.giftCode != null and item.giftCode != ''">
|
||||
t.gift_code = #{item.giftCode},
|
||||
</if>
|
||||
<if test="item.giftName != null and item.giftName != ''">
|
||||
t.gift_name = #{item.giftName},
|
||||
</if>
|
||||
<if test="item.specification != null and item.specification != ''">
|
||||
t.specification = #{item.specification},
|
||||
</if>
|
||||
<if test="item.unitPrice != null">
|
||||
t.unit_price = #{item.unitPrice},
|
||||
</if>
|
||||
<if test="item.inventoryQuantity != null">
|
||||
t.inventory_quantity = #{item.inventoryQuantity},
|
||||
</if>
|
||||
<if test="item.applicationQuantity != null">
|
||||
t.application_quantity = #{item.applicationQuantity},
|
||||
</if>
|
||||
<if test="item.giftAmount != null">
|
||||
t.gift_amount = #{item.giftAmount},
|
||||
</if>
|
||||
<if test="item.sortOrder != null">
|
||||
t.sort_order = #{item.sortOrder},
|
||||
</if>
|
||||
<if test="item.remark != null and item.remark != ''">
|
||||
t.remark = #{item.remark},
|
||||
</if>
|
||||
<if test="item.delFlag != null and item.delFlag != ''">
|
||||
t.del_flag = #{item.delFlag},
|
||||
</if>
|
||||
<if test="item.createDept != null">
|
||||
t.create_dept = #{item.createDept},
|
||||
</if>
|
||||
<if test="item.createBy != null">
|
||||
t.create_by = #{item.createBy},
|
||||
</if>
|
||||
<if test="item.createTime != null">
|
||||
t.create_time = #{item.createTime},
|
||||
</if>
|
||||
<if test="item.updateBy != null">
|
||||
t.update_by = #{item.updateBy},
|
||||
</if>
|
||||
<if test="item.updateTime != null">
|
||||
t.update_time = #{item.updateTime}
|
||||
</if>
|
||||
</set>
|
||||
where t.detail_id = #{item.detailId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!-- 根据自定义条件删除 -->
|
||||
<delete id="deleteCustomCrmGiftApplyDetail">
|
||||
delete from crm_gift_apply_detail t
|
||||
<where>
|
||||
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
|
||||
AND ${ew.sqlSegment}
|
||||
</if>
|
||||
</where>
|
||||
</delete>
|
||||
|
||||
<!-- 根据ID列表批量删除 -->
|
||||
<delete id="deleteCustomCrmGiftApplyDetailByIds">
|
||||
delete from crm_gift_apply_detail t
|
||||
where t.detail_id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 检查是否存在 -->
|
||||
<select id="existsCrmGiftApplyDetail" resultType="java.lang.Boolean">
|
||||
select count(1) > 0 from crm_gift_apply_detail t
|
||||
<where>
|
||||
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
|
||||
AND ${ew.sqlSegment}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,297 @@
|
||||
<?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.oa.crm.mapper.CrmGiftApplyMapper">
|
||||
<resultMap type="org.dromara.oa.crm.domain.vo.CrmGiftApplyVo" id="CrmGiftApplyResult">
|
||||
</resultMap>
|
||||
|
||||
<select id="selectCustomCrmGiftApplyVoList" resultMap="CrmGiftApplyResult">
|
||||
select t.gift_apply_id, t.tenant_id, t.application_code, t.applicant_id, t.applicant_name, t.applicant_dept_id, t.applicant_dept_name, t.application_date, t.customer_unit_id, t.customer_unit_name, t.guest_name, t.people_count, t.application_reason, t.recipient_id, t.recipient_name, t.recipient_date, t.total_amount, t.application_status, t.flow_status, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time from crm_gift_apply t
|
||||
<where>
|
||||
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
|
||||
AND ${ew.sqlSegment}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 根据ID查询详情 -->
|
||||
<select id="selectCustomCrmGiftApplyVoById" resultMap="CrmGiftApplyResult">
|
||||
select t.gift_apply_id, t.tenant_id, t.application_code, t.applicant_id, t.applicant_name, t.applicant_dept_id, t.applicant_dept_name, t.application_date, t.customer_unit_id, t.customer_unit_name, t.guest_name, t.people_count, t.application_reason, t.recipient_id, t.recipient_name, t.recipient_date, t.total_amount, t.application_status, t.flow_status, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
|
||||
from crm_gift_apply t
|
||||
where t.gift_apply_id = #{giftApplyId}
|
||||
</select>
|
||||
|
||||
<!-- 批量查询 - 根据ID列表 -->
|
||||
<select id="selectCustomCrmGiftApplyVoByIds" resultMap="CrmGiftApplyResult">
|
||||
select t.gift_apply_id, t.tenant_id, t.application_code, t.applicant_id, t.applicant_name, t.applicant_dept_id, t.applicant_dept_name, t.application_date, t.customer_unit_id, t.customer_unit_name, t.guest_name, t.people_count, t.application_reason, t.recipient_id, t.recipient_name, t.recipient_date, t.total_amount, t.application_status, t.flow_status, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
|
||||
from crm_gift_apply t
|
||||
where t.gift_apply_id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!-- 统计查询 -->
|
||||
<select id="countCustomCrmGiftApply" resultType="java.lang.Long">
|
||||
select count(1) from crm_gift_apply t
|
||||
<where>
|
||||
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
|
||||
AND ${ew.sqlSegment}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询(带自定义条件) -->
|
||||
<select id="selectCustomCrmGiftApplyVoPage" resultMap="CrmGiftApplyResult">
|
||||
select t.gift_apply_id, t.tenant_id, t.application_code, t.applicant_id, t.applicant_name, t.applicant_dept_id, t.applicant_dept_name, t.application_date, t.customer_unit_id, t.customer_unit_name, t.guest_name, t.people_count, t.application_reason, t.recipient_id, t.recipient_name, t.recipient_date, t.total_amount, t.application_status, t.flow_status, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
|
||||
from crm_gift_apply t
|
||||
<where>
|
||||
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
|
||||
AND ${ew.sqlSegment}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 批量插入 -->
|
||||
<insert id="batchInsertCrmGiftApply">
|
||||
insert into crm_gift_apply(
|
||||
tenant_id,
|
||||
|
||||
application_code,
|
||||
|
||||
applicant_id,
|
||||
|
||||
applicant_name,
|
||||
|
||||
applicant_dept_id,
|
||||
|
||||
applicant_dept_name,
|
||||
|
||||
application_date,
|
||||
|
||||
customer_unit_id,
|
||||
|
||||
customer_unit_name,
|
||||
|
||||
guest_name,
|
||||
|
||||
people_count,
|
||||
|
||||
application_reason,
|
||||
|
||||
recipient_id,
|
||||
|
||||
recipient_name,
|
||||
|
||||
recipient_date,
|
||||
|
||||
total_amount,
|
||||
|
||||
application_status,
|
||||
|
||||
flow_status,
|
||||
|
||||
remark,
|
||||
|
||||
del_flag,
|
||||
|
||||
create_dept,
|
||||
|
||||
create_by,
|
||||
|
||||
create_time,
|
||||
|
||||
update_by,
|
||||
|
||||
update_time
|
||||
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.tenantId},
|
||||
|
||||
#{item.applicationCode},
|
||||
|
||||
#{item.applicantId},
|
||||
|
||||
#{item.applicantName},
|
||||
|
||||
#{item.applicantDeptId},
|
||||
|
||||
#{item.applicantDeptName},
|
||||
|
||||
#{item.applicationDate},
|
||||
|
||||
#{item.customerUnitId},
|
||||
|
||||
#{item.customerUnitName},
|
||||
|
||||
#{item.guestName},
|
||||
|
||||
#{item.peopleCount},
|
||||
|
||||
#{item.applicationReason},
|
||||
|
||||
#{item.recipientId},
|
||||
|
||||
#{item.recipientName},
|
||||
|
||||
#{item.recipientDate},
|
||||
|
||||
#{item.totalAmount},
|
||||
|
||||
#{item.applicationStatus},
|
||||
|
||||
#{item.flowStatus},
|
||||
|
||||
#{item.remark},
|
||||
|
||||
#{item.delFlag},
|
||||
|
||||
#{item.createDept},
|
||||
|
||||
#{item.createBy},
|
||||
|
||||
#{item.createTime},
|
||||
|
||||
#{item.updateBy},
|
||||
|
||||
#{item.updateTime}
|
||||
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 批量更新 -->
|
||||
<update id="batchUpdateCrmGiftApply">
|
||||
<foreach collection="list" item="item" separator=";">
|
||||
update crm_gift_apply t
|
||||
<set>
|
||||
<if test="item.tenantId != null and item.tenantId != ''">
|
||||
t.tenant_id = #{item.tenantId},
|
||||
</if>
|
||||
<if test="item.applicationCode != null and item.applicationCode != ''">
|
||||
t.application_code = #{item.applicationCode},
|
||||
</if>
|
||||
<if test="item.applicantId != null">
|
||||
t.applicant_id = #{item.applicantId},
|
||||
</if>
|
||||
<if test="item.applicantName != null and item.applicantName != ''">
|
||||
t.applicant_name = #{item.applicantName},
|
||||
</if>
|
||||
<if test="item.applicantDeptId != null">
|
||||
t.applicant_dept_id = #{item.applicantDeptId},
|
||||
</if>
|
||||
<if test="item.applicantDeptName != null and item.applicantDeptName != ''">
|
||||
t.applicant_dept_name = #{item.applicantDeptName},
|
||||
</if>
|
||||
<if test="item.applicationDate != null">
|
||||
t.application_date = #{item.applicationDate},
|
||||
</if>
|
||||
<if test="item.customerUnitId != null">
|
||||
t.customer_unit_id = #{item.customerUnitId},
|
||||
</if>
|
||||
<if test="item.customerUnitName != null and item.customerUnitName != ''">
|
||||
t.customer_unit_name = #{item.customerUnitName},
|
||||
</if>
|
||||
<if test="item.guestName != null and item.guestName != ''">
|
||||
t.guest_name = #{item.guestName},
|
||||
</if>
|
||||
<if test="item.peopleCount != null">
|
||||
t.people_count = #{item.peopleCount},
|
||||
</if>
|
||||
<if test="item.applicationReason != null and item.applicationReason != ''">
|
||||
t.application_reason = #{item.applicationReason},
|
||||
</if>
|
||||
<if test="item.recipientId != null">
|
||||
t.recipient_id = #{item.recipientId},
|
||||
</if>
|
||||
<if test="item.recipientName != null and item.recipientName != ''">
|
||||
t.recipient_name = #{item.recipientName},
|
||||
</if>
|
||||
<if test="item.recipientDate != null">
|
||||
t.recipient_date = #{item.recipientDate},
|
||||
</if>
|
||||
<if test="item.totalAmount != null">
|
||||
t.total_amount = #{item.totalAmount},
|
||||
</if>
|
||||
<if test="item.applicationStatus != null and item.applicationStatus != ''">
|
||||
t.application_status = #{item.applicationStatus},
|
||||
</if>
|
||||
<if test="item.flowStatus != null and item.flowStatus != ''">
|
||||
t.flow_status = #{item.flowStatus},
|
||||
</if>
|
||||
<if test="item.remark != null and item.remark != ''">
|
||||
t.remark = #{item.remark},
|
||||
</if>
|
||||
<if test="item.delFlag != null and item.delFlag != ''">
|
||||
t.del_flag = #{item.delFlag},
|
||||
</if>
|
||||
<if test="item.createDept != null">
|
||||
t.create_dept = #{item.createDept},
|
||||
</if>
|
||||
<if test="item.createBy != null">
|
||||
t.create_by = #{item.createBy},
|
||||
</if>
|
||||
<if test="item.createTime != null">
|
||||
t.create_time = #{item.createTime},
|
||||
</if>
|
||||
<if test="item.updateBy != null">
|
||||
t.update_by = #{item.updateBy},
|
||||
</if>
|
||||
<if test="item.updateTime != null">
|
||||
t.update_time = #{item.updateTime}
|
||||
</if>
|
||||
</set>
|
||||
where t.gift_apply_id = #{item.giftApplyId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!-- 根据自定义条件删除 -->
|
||||
<delete id="deleteCustomCrmGiftApply">
|
||||
delete from crm_gift_apply t
|
||||
<where>
|
||||
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
|
||||
AND ${ew.sqlSegment}
|
||||
</if>
|
||||
</where>
|
||||
</delete>
|
||||
|
||||
<!-- 根据ID列表批量删除 -->
|
||||
<delete id="deleteCustomCrmGiftApplyByIds">
|
||||
delete from crm_gift_apply t
|
||||
where t.gift_apply_id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 检查是否存在 -->
|
||||
<select id="existsCrmGiftApply" resultType="java.lang.Boolean">
|
||||
select count(1) > 0 from crm_gift_apply t
|
||||
<where>
|
||||
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
|
||||
AND ${ew.sqlSegment}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- ⭐ 查询待审批中相同礼品的数量汇总(用于增强库存校验) -->
|
||||
<select id="selectPendingGiftQuantity" resultType="org.dromara.oa.crm.domain.vo.GiftPendingQuantityVO">
|
||||
SELECT
|
||||
d.gift_id AS giftId,
|
||||
i.gift_name AS giftName,
|
||||
SUM(d.application_quantity) AS pendingQuantity
|
||||
FROM crm_gift_apply a
|
||||
INNER JOIN crm_gift_apply_detail d ON a.gift_apply_id = d.application_id
|
||||
INNER JOIN crm_gift_info i ON d.gift_id = i.gift_id
|
||||
WHERE a.application_status = '2'
|
||||
AND a.flow_status = 'waiting'
|
||||
AND a.del_flag = '0'
|
||||
AND d.del_flag = '0'
|
||||
GROUP BY d.gift_id, i.gift_name
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,214 @@
|
||||
<?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.oa.crm.mapper.CrmGiftInfoMapper">
|
||||
<resultMap type="org.dromara.oa.crm.domain.vo.CrmGiftInfoVo" id="CrmGiftInfoResult">
|
||||
</resultMap>
|
||||
|
||||
<select id="selectCustomCrmGiftInfoVoList" resultMap="CrmGiftInfoResult">
|
||||
select t.gift_id, t.tenant_id, t.gift_code, t.gift_name, t.specification, t.unit_price, t.unit_id, t.inventory_quantity, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time from crm_gift_info t
|
||||
<where>
|
||||
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
|
||||
AND ${ew.sqlSegment}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 根据ID查询详情 -->
|
||||
<select id="selectCustomCrmGiftInfoVoById" resultMap="CrmGiftInfoResult">
|
||||
select t.gift_id, t.tenant_id, t.gift_code, t.gift_name, t.specification, t.unit_price, t.unit_id, t.inventory_quantity, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
|
||||
from crm_gift_info t
|
||||
where t.gift_id = #{giftId}
|
||||
</select>
|
||||
|
||||
<!-- 批量查询 - 根据ID列表 -->
|
||||
<select id="selectCustomCrmGiftInfoVoByIds" resultMap="CrmGiftInfoResult">
|
||||
select t.gift_id, t.tenant_id, t.gift_code, t.gift_name, t.specification, t.unit_price, t.unit_id, t.inventory_quantity, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
|
||||
from crm_gift_info t
|
||||
where t.gift_id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!-- 统计查询 -->
|
||||
<select id="countCustomCrmGiftInfo" resultType="java.lang.Long">
|
||||
select count(1) from crm_gift_info t
|
||||
<where>
|
||||
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
|
||||
AND ${ew.sqlSegment}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询(带自定义条件) -->
|
||||
<select id="selectCustomCrmGiftInfoVoPage" resultMap="CrmGiftInfoResult">
|
||||
select t.gift_id, t.tenant_id, t.gift_code, t.gift_name, t.specification, t.unit_price, t.unit_id, t.inventory_quantity, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
|
||||
from crm_gift_info t
|
||||
<where>
|
||||
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
|
||||
AND ${ew.sqlSegment}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 批量插入 -->
|
||||
<insert id="batchInsertCrmGiftInfo">
|
||||
insert into crm_gift_info(
|
||||
tenant_id,
|
||||
|
||||
gift_code,
|
||||
|
||||
gift_name,
|
||||
|
||||
specification,
|
||||
|
||||
unit_price,
|
||||
|
||||
unit_id,
|
||||
|
||||
inventory_quantity,
|
||||
|
||||
remark,
|
||||
|
||||
del_flag,
|
||||
|
||||
create_dept,
|
||||
|
||||
create_by,
|
||||
|
||||
create_time,
|
||||
|
||||
update_by,
|
||||
|
||||
update_time
|
||||
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.tenantId},
|
||||
|
||||
#{item.giftCode},
|
||||
|
||||
#{item.giftName},
|
||||
|
||||
#{item.specification},
|
||||
|
||||
#{item.unitPrice},
|
||||
|
||||
#{item.unitId},
|
||||
|
||||
#{item.inventoryQuantity},
|
||||
|
||||
#{item.remark},
|
||||
|
||||
#{item.delFlag},
|
||||
|
||||
#{item.createDept},
|
||||
|
||||
#{item.createBy},
|
||||
|
||||
#{item.createTime},
|
||||
|
||||
#{item.updateBy},
|
||||
|
||||
#{item.updateTime}
|
||||
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 批量更新 -->
|
||||
<update id="batchUpdateCrmGiftInfo">
|
||||
<foreach collection="list" item="item" separator=";">
|
||||
update crm_gift_info t
|
||||
<set>
|
||||
<if test="item.tenantId != null and item.tenantId != ''">
|
||||
t.tenant_id = #{item.tenantId},
|
||||
</if>
|
||||
<if test="item.giftCode != null and item.giftCode != ''">
|
||||
t.gift_code = #{item.giftCode},
|
||||
</if>
|
||||
<if test="item.giftName != null and item.giftName != ''">
|
||||
t.gift_name = #{item.giftName},
|
||||
</if>
|
||||
<if test="item.specification != null and item.specification != ''">
|
||||
t.specification = #{item.specification},
|
||||
</if>
|
||||
<if test="item.unitPrice != null">
|
||||
t.unit_price = #{item.unitPrice},
|
||||
</if>
|
||||
<if test="item.unitId != null">
|
||||
t.unit_id = #{item.unitId},
|
||||
</if>
|
||||
<if test="item.inventoryQuantity != null">
|
||||
t.inventory_quantity = #{item.inventoryQuantity},
|
||||
</if>
|
||||
<if test="item.remark != null and item.remark != ''">
|
||||
t.remark = #{item.remark},
|
||||
</if>
|
||||
<if test="item.delFlag != null and item.delFlag != ''">
|
||||
t.del_flag = #{item.delFlag},
|
||||
</if>
|
||||
<if test="item.createDept != null">
|
||||
t.create_dept = #{item.createDept},
|
||||
</if>
|
||||
<if test="item.createBy != null">
|
||||
t.create_by = #{item.createBy},
|
||||
</if>
|
||||
<if test="item.createTime != null">
|
||||
t.create_time = #{item.createTime},
|
||||
</if>
|
||||
<if test="item.updateBy != null">
|
||||
t.update_by = #{item.updateBy},
|
||||
</if>
|
||||
<if test="item.updateTime != null">
|
||||
t.update_time = #{item.updateTime}
|
||||
</if>
|
||||
</set>
|
||||
where t.gift_id = #{item.giftId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!-- 根据自定义条件删除 -->
|
||||
<delete id="deleteCustomCrmGiftInfo">
|
||||
delete from crm_gift_info t
|
||||
<where>
|
||||
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
|
||||
AND ${ew.sqlSegment}
|
||||
</if>
|
||||
</where>
|
||||
</delete>
|
||||
|
||||
<!-- 根据ID列表批量删除 -->
|
||||
<delete id="deleteCustomCrmGiftInfoByIds">
|
||||
delete from crm_gift_info t
|
||||
where t.gift_id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 检查是否存在 -->
|
||||
<select id="existsCrmGiftInfo" resultType="java.lang.Boolean">
|
||||
select count(1) > 0 from crm_gift_info t
|
||||
<where>
|
||||
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
|
||||
AND ${ew.sqlSegment}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 原子扣减库存:库存数量 >= 扣减数量时才执行更新,防止并发超发 -->
|
||||
<update id="deductInventory">
|
||||
update crm_gift_info
|
||||
set inventory_quantity = inventory_quantity - #{deductQuantity},
|
||||
update_time = now()
|
||||
where gift_id = #{giftId}
|
||||
and del_flag = '0'
|
||||
and inventory_quantity >= #{deductQuantity}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,282 @@
|
||||
<?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.oa.crm.mapper.CrmGiftIssueRecordMapper">
|
||||
<resultMap type="org.dromara.oa.crm.domain.vo.CrmGiftIssueRecordVo" id="CrmGiftIssueRecordResult">
|
||||
</resultMap>
|
||||
|
||||
<select id="selectCustomCrmGiftIssueRecordVoList" resultMap="CrmGiftIssueRecordResult">
|
||||
select t.issue_record_id, t.tenant_id, t.application_id, t.application_code, t.detail_id, t.gift_id, t.gift_code, t.gift_name, t.specification, t.issue_quantity, t.issue_date, t.recipient_id, t.recipient_name, t.issue_by, t.issue_by_name, t.issue_dept_id, t.issue_dept_name, t.before_inventory, t.after_inventory, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time from crm_gift_issue_record t
|
||||
<where>
|
||||
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
|
||||
AND ${ew.sqlSegment}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 根据ID查询详情 -->
|
||||
<select id="selectCustomCrmGiftIssueRecordVoById" resultMap="CrmGiftIssueRecordResult">
|
||||
select t.issue_record_id, t.tenant_id, t.application_id, t.application_code, t.detail_id, t.gift_id, t.gift_code, t.gift_name, t.specification, t.issue_quantity, t.issue_date, t.recipient_id, t.recipient_name, t.issue_by, t.issue_by_name, t.issue_dept_id, t.issue_dept_name, t.before_inventory, t.after_inventory, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
|
||||
from crm_gift_issue_record t
|
||||
where t.issue_record_id = #{issueRecordId}
|
||||
</select>
|
||||
|
||||
<!-- 批量查询 - 根据ID列表 -->
|
||||
<select id="selectCustomCrmGiftIssueRecordVoByIds" resultMap="CrmGiftIssueRecordResult">
|
||||
select t.issue_record_id, t.tenant_id, t.application_id, t.application_code, t.detail_id, t.gift_id, t.gift_code, t.gift_name, t.specification, t.issue_quantity, t.issue_date, t.recipient_id, t.recipient_name, t.issue_by, t.issue_by_name, t.issue_dept_id, t.issue_dept_name, t.before_inventory, t.after_inventory, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
|
||||
from crm_gift_issue_record t
|
||||
where t.issue_record_id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!-- 统计查询 -->
|
||||
<select id="countCustomCrmGiftIssueRecord" resultType="java.lang.Long">
|
||||
select count(1) from crm_gift_issue_record t
|
||||
<where>
|
||||
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
|
||||
AND ${ew.sqlSegment}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询(带自定义条件) -->
|
||||
<select id="selectCustomCrmGiftIssueRecordVoPage" resultMap="CrmGiftIssueRecordResult">
|
||||
select t.issue_record_id, t.tenant_id, t.application_id, t.application_code, t.detail_id, t.gift_id, t.gift_code, t.gift_name, t.specification, t.issue_quantity, t.issue_date, t.recipient_id, t.recipient_name, t.issue_by, t.issue_by_name, t.issue_dept_id, t.issue_dept_name, t.before_inventory, t.after_inventory, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
|
||||
from crm_gift_issue_record t
|
||||
<where>
|
||||
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
|
||||
AND ${ew.sqlSegment}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 批量插入 -->
|
||||
<insert id="batchInsertCrmGiftIssueRecord">
|
||||
insert into crm_gift_issue_record(
|
||||
tenant_id,
|
||||
|
||||
application_id,
|
||||
|
||||
application_code,
|
||||
|
||||
detail_id,
|
||||
|
||||
gift_id,
|
||||
|
||||
gift_code,
|
||||
|
||||
gift_name,
|
||||
|
||||
specification,
|
||||
|
||||
issue_quantity,
|
||||
|
||||
issue_date,
|
||||
|
||||
recipient_id,
|
||||
|
||||
recipient_name,
|
||||
|
||||
issue_by,
|
||||
|
||||
issue_by_name,
|
||||
|
||||
issue_dept_id,
|
||||
|
||||
issue_dept_name,
|
||||
|
||||
before_inventory,
|
||||
|
||||
after_inventory,
|
||||
|
||||
remark,
|
||||
|
||||
del_flag,
|
||||
|
||||
create_dept,
|
||||
|
||||
create_by,
|
||||
|
||||
create_time,
|
||||
|
||||
update_by,
|
||||
|
||||
update_time
|
||||
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.tenantId},
|
||||
|
||||
#{item.applicationId},
|
||||
|
||||
#{item.applicationCode},
|
||||
|
||||
#{item.detailId},
|
||||
|
||||
#{item.giftId},
|
||||
|
||||
#{item.giftCode},
|
||||
|
||||
#{item.giftName},
|
||||
|
||||
#{item.specification},
|
||||
|
||||
#{item.issueQuantity},
|
||||
|
||||
#{item.issueDate},
|
||||
|
||||
#{item.recipientId},
|
||||
|
||||
#{item.recipientName},
|
||||
|
||||
#{item.issueBy},
|
||||
|
||||
#{item.issueByName},
|
||||
|
||||
#{item.issueDeptId},
|
||||
|
||||
#{item.issueDeptName},
|
||||
|
||||
#{item.beforeInventory},
|
||||
|
||||
#{item.afterInventory},
|
||||
|
||||
#{item.remark},
|
||||
|
||||
#{item.delFlag},
|
||||
|
||||
#{item.createDept},
|
||||
|
||||
#{item.createBy},
|
||||
|
||||
#{item.createTime},
|
||||
|
||||
#{item.updateBy},
|
||||
|
||||
#{item.updateTime}
|
||||
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 批量更新 -->
|
||||
<update id="batchUpdateCrmGiftIssueRecord">
|
||||
<foreach collection="list" item="item" separator=";">
|
||||
update crm_gift_issue_record t
|
||||
<set>
|
||||
<if test="item.tenantId != null and item.tenantId != ''">
|
||||
t.tenant_id = #{item.tenantId},
|
||||
</if>
|
||||
<if test="item.applicationId != null">
|
||||
t.application_id = #{item.applicationId},
|
||||
</if>
|
||||
<if test="item.applicationCode != null and item.applicationCode != ''">
|
||||
t.application_code = #{item.applicationCode},
|
||||
</if>
|
||||
<if test="item.detailId != null">
|
||||
t.detail_id = #{item.detailId},
|
||||
</if>
|
||||
<if test="item.giftId != null">
|
||||
t.gift_id = #{item.giftId},
|
||||
</if>
|
||||
<if test="item.giftCode != null and item.giftCode != ''">
|
||||
t.gift_code = #{item.giftCode},
|
||||
</if>
|
||||
<if test="item.giftName != null and item.giftName != ''">
|
||||
t.gift_name = #{item.giftName},
|
||||
</if>
|
||||
<if test="item.specification != null and item.specification != ''">
|
||||
t.specification = #{item.specification},
|
||||
</if>
|
||||
<if test="item.issueQuantity != null">
|
||||
t.issue_quantity = #{item.issueQuantity},
|
||||
</if>
|
||||
<if test="item.issueDate != null">
|
||||
t.issue_date = #{item.issueDate},
|
||||
</if>
|
||||
<if test="item.recipientId != null">
|
||||
t.recipient_id = #{item.recipientId},
|
||||
</if>
|
||||
<if test="item.recipientName != null and item.recipientName != ''">
|
||||
t.recipient_name = #{item.recipientName},
|
||||
</if>
|
||||
<if test="item.issueBy != null">
|
||||
t.issue_by = #{item.issueBy},
|
||||
</if>
|
||||
<if test="item.issueByName != null and item.issueByName != ''">
|
||||
t.issue_by_name = #{item.issueByName},
|
||||
</if>
|
||||
<if test="item.issueDeptId != null">
|
||||
t.issue_dept_id = #{item.issueDeptId},
|
||||
</if>
|
||||
<if test="item.issueDeptName != null and item.issueDeptName != ''">
|
||||
t.issue_dept_name = #{item.issueDeptName},
|
||||
</if>
|
||||
<if test="item.beforeInventory != null">
|
||||
t.before_inventory = #{item.beforeInventory},
|
||||
</if>
|
||||
<if test="item.afterInventory != null">
|
||||
t.after_inventory = #{item.afterInventory},
|
||||
</if>
|
||||
<if test="item.remark != null and item.remark != ''">
|
||||
t.remark = #{item.remark},
|
||||
</if>
|
||||
<if test="item.delFlag != null and item.delFlag != ''">
|
||||
t.del_flag = #{item.delFlag},
|
||||
</if>
|
||||
<if test="item.createDept != null">
|
||||
t.create_dept = #{item.createDept},
|
||||
</if>
|
||||
<if test="item.createBy != null">
|
||||
t.create_by = #{item.createBy},
|
||||
</if>
|
||||
<if test="item.createTime != null">
|
||||
t.create_time = #{item.createTime},
|
||||
</if>
|
||||
<if test="item.updateBy != null">
|
||||
t.update_by = #{item.updateBy},
|
||||
</if>
|
||||
<if test="item.updateTime != null">
|
||||
t.update_time = #{item.updateTime}
|
||||
</if>
|
||||
</set>
|
||||
where t.issue_record_id = #{item.issueRecordId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!-- 根据自定义条件删除 -->
|
||||
<delete id="deleteCustomCrmGiftIssueRecord">
|
||||
delete from crm_gift_issue_record t
|
||||
<where>
|
||||
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
|
||||
AND ${ew.sqlSegment}
|
||||
</if>
|
||||
</where>
|
||||
</delete>
|
||||
|
||||
<!-- 根据ID列表批量删除 -->
|
||||
<delete id="deleteCustomCrmGiftIssueRecordByIds">
|
||||
delete from crm_gift_issue_record t
|
||||
where t.issue_record_id in
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 检查是否存在 -->
|
||||
<select id="existsCrmGiftIssueRecord" resultType="java.lang.Boolean">
|
||||
select count(1) > 0 from crm_gift_issue_record t
|
||||
<where>
|
||||
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
|
||||
AND ${ew.sqlSegment}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue