7 changed files with 619 additions and 0 deletions
@ -0,0 +1,105 @@ |
|||||
|
package org.dromara.platform.controller; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import jakarta.servlet.http.HttpServletResponse; |
||||
|
import jakarta.validation.constraints.*; |
||||
|
import cn.dev33.satoken.annotation.SaCheckPermission; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.dromara.common.idempotent.annotation.RepeatSubmit; |
||||
|
import org.dromara.common.log.annotation.Log; |
||||
|
import org.dromara.common.web.core.BaseController; |
||||
|
import org.dromara.common.mybatis.core.page.PageQuery; |
||||
|
import org.dromara.common.core.domain.R; |
||||
|
import org.dromara.common.core.validate.AddGroup; |
||||
|
import org.dromara.common.core.validate.EditGroup; |
||||
|
import org.dromara.common.log.enums.BusinessType; |
||||
|
import org.dromara.common.excel.utils.ExcelUtil; |
||||
|
import org.dromara.platform.domain.vo.AgreementInfoVo; |
||||
|
import org.dromara.platform.domain.bo.AgreementInfoBo; |
||||
|
import org.dromara.platform.service.IAgreementInfoService; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
|
||||
|
/** |
||||
|
* 协议信息 |
||||
|
* |
||||
|
* @author gejunhao |
||||
|
* @date 2025-03-10 |
||||
|
*/ |
||||
|
@Validated |
||||
|
@RequiredArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("/platform/agreementInfo") |
||||
|
public class AgreementInfoController extends BaseController { |
||||
|
|
||||
|
private final IAgreementInfoService agreementInfoService; |
||||
|
|
||||
|
/** |
||||
|
* 查询协议信息列表 |
||||
|
*/ |
||||
|
@SaCheckPermission("platform:agreementInfo:list") |
||||
|
@GetMapping("/list") |
||||
|
public TableDataInfo<AgreementInfoVo> list(AgreementInfoBo bo, PageQuery pageQuery) { |
||||
|
return agreementInfoService.queryPageList(bo, pageQuery); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 导出协议信息列表 |
||||
|
*/ |
||||
|
@SaCheckPermission("platform:agreementInfo:export") |
||||
|
@Log(title = "协议信息", businessType = BusinessType.EXPORT) |
||||
|
@PostMapping("/export") |
||||
|
public void export(AgreementInfoBo bo, HttpServletResponse response) { |
||||
|
List<AgreementInfoVo> list = agreementInfoService.queryList(bo); |
||||
|
ExcelUtil.exportExcel(list, "协议信息", AgreementInfoVo.class, response); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取协议信息详细信息 |
||||
|
* |
||||
|
* @param id 主键 |
||||
|
*/ |
||||
|
@SaCheckPermission("platform:agreementInfo:query") |
||||
|
@GetMapping("/{id}") |
||||
|
public R<AgreementInfoVo> getInfo(@NotNull(message = "主键不能为空") |
||||
|
@PathVariable String id) { |
||||
|
return R.ok(agreementInfoService.queryById(id)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增协议信息 |
||||
|
*/ |
||||
|
@SaCheckPermission("platform:agreementInfo:add") |
||||
|
@Log(title = "协议信息", businessType = BusinessType.INSERT) |
||||
|
@RepeatSubmit() |
||||
|
@PostMapping() |
||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody AgreementInfoBo bo) { |
||||
|
return toAjax(agreementInfoService.insertByBo(bo)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改协议信息 |
||||
|
*/ |
||||
|
@SaCheckPermission("platform:agreementInfo:edit") |
||||
|
@Log(title = "协议信息", businessType = BusinessType.UPDATE) |
||||
|
@RepeatSubmit() |
||||
|
@PutMapping() |
||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody AgreementInfoBo bo) { |
||||
|
return toAjax(agreementInfoService.updateByBo(bo)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除协议信息 |
||||
|
* |
||||
|
* @param ids 主键串 |
||||
|
*/ |
||||
|
@SaCheckPermission("platform:agreementInfo:remove") |
||||
|
@Log(title = "协议信息", businessType = BusinessType.DELETE) |
||||
|
@DeleteMapping("/{ids}") |
||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
||||
|
@PathVariable String[] ids) { |
||||
|
return toAjax(agreementInfoService.deleteWithValidByIds(List.of(ids), true)); |
||||
|
} |
||||
|
} |
@ -0,0 +1,92 @@ |
|||||
|
package org.dromara.platform.domain; |
||||
|
|
||||
|
import org.dromara.common.tenant.core.TenantEntity; |
||||
|
import com.baomidou.mybatisplus.annotation.*; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
|
||||
|
/** |
||||
|
* 协议信息对象 agreement_info |
||||
|
* |
||||
|
* @author gejunhao |
||||
|
* @date 2025-03-10 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
@TableName("agreement_info") |
||||
|
public class AgreementInfo extends TenantEntity { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 自增id |
||||
|
*/ |
||||
|
@TableId(value = "id") |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 服务目录id |
||||
|
*/ |
||||
|
private String serviceCategoryId; |
||||
|
|
||||
|
/** |
||||
|
* 交付内容 |
||||
|
*/ |
||||
|
private String deliverContent; |
||||
|
|
||||
|
/** |
||||
|
* 服务项目 |
||||
|
*/ |
||||
|
private String serviceProject; |
||||
|
|
||||
|
/** |
||||
|
* 代码 |
||||
|
*/ |
||||
|
private String code; |
||||
|
|
||||
|
/** |
||||
|
* 服务内容 |
||||
|
*/ |
||||
|
private String serviceContent; |
||||
|
|
||||
|
/** |
||||
|
* 相应级别 |
||||
|
*/ |
||||
|
private String responseLevel; |
||||
|
|
||||
|
/** |
||||
|
* 服务频率 |
||||
|
*/ |
||||
|
private String frequency; |
||||
|
|
||||
|
/** |
||||
|
* 请求类型 |
||||
|
*/ |
||||
|
private String responseType; |
||||
|
|
||||
|
/** |
||||
|
* 交付方式 |
||||
|
*/ |
||||
|
private Long deliverType; |
||||
|
|
||||
|
/** |
||||
|
* 交付成果 |
||||
|
*/ |
||||
|
private String deliverResult; |
||||
|
|
||||
|
/** |
||||
|
* 当前状态 |
||||
|
*/ |
||||
|
private Long status; |
||||
|
|
||||
|
/** |
||||
|
* 删除标志(0代表存在 2代表删除) |
||||
|
*/ |
||||
|
@TableLogic |
||||
|
private String delFlag; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,96 @@ |
|||||
|
package org.dromara.platform.domain.bo; |
||||
|
|
||||
|
import org.dromara.platform.domain.AgreementInfo; |
||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity; |
||||
|
import org.dromara.common.core.validate.AddGroup; |
||||
|
import org.dromara.common.core.validate.EditGroup; |
||||
|
import io.github.linpeilie.annotations.AutoMapper; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import jakarta.validation.constraints.*; |
||||
|
|
||||
|
/** |
||||
|
* 协议信息业务对象 agreement_info |
||||
|
* |
||||
|
* @author gejunhao |
||||
|
* @date 2025-03-10 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
@AutoMapper(target = AgreementInfo.class, reverseConvertGenerate = false) |
||||
|
public class AgreementInfoBo extends BaseEntity { |
||||
|
|
||||
|
/** |
||||
|
* 自增id |
||||
|
*/ |
||||
|
@NotBlank(message = "自增id不能为空", groups = { EditGroup.class }) |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 服务目录id |
||||
|
*/ |
||||
|
@NotBlank(message = "服务目录id不能为空", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private String serviceCategoryId; |
||||
|
|
||||
|
/** |
||||
|
* 交付内容 |
||||
|
*/ |
||||
|
@NotBlank(message = "交付内容不能为空", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private String deliverContent; |
||||
|
|
||||
|
/** |
||||
|
* 服务项目 |
||||
|
*/ |
||||
|
@NotBlank(message = "服务项目不能为空", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private String serviceProject; |
||||
|
|
||||
|
/** |
||||
|
* 代码 |
||||
|
*/ |
||||
|
@NotBlank(message = "代码不能为空", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private String code; |
||||
|
|
||||
|
/** |
||||
|
* 服务内容 |
||||
|
*/ |
||||
|
@NotBlank(message = "服务内容不能为空", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private String serviceContent; |
||||
|
|
||||
|
/** |
||||
|
* 相应级别 |
||||
|
*/ |
||||
|
@NotBlank(message = "相应级别不能为空", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private String responseLevel; |
||||
|
|
||||
|
/** |
||||
|
* 服务频率 |
||||
|
*/ |
||||
|
@NotBlank(message = "服务频率不能为空", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private String frequency; |
||||
|
|
||||
|
/** |
||||
|
* 请求类型 |
||||
|
*/ |
||||
|
@NotBlank(message = "请求类型不能为空", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private String responseType; |
||||
|
|
||||
|
/** |
||||
|
* 交付方式 |
||||
|
*/ |
||||
|
@NotNull(message = "交付方式不能为空", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private Long deliverType; |
||||
|
|
||||
|
/** |
||||
|
* 交付成果 |
||||
|
*/ |
||||
|
@NotBlank(message = "交付成果不能为空", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private String deliverResult; |
||||
|
|
||||
|
/** |
||||
|
* 当前状态 |
||||
|
*/ |
||||
|
@NotNull(message = "当前状态不能为空", groups = { AddGroup.class, EditGroup.class }) |
||||
|
private Long status; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,104 @@ |
|||||
|
package org.dromara.platform.domain.vo; |
||||
|
|
||||
|
import org.dromara.platform.domain.AgreementInfo; |
||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
||||
|
import com.alibaba.excel.annotation.ExcelProperty; |
||||
|
import org.dromara.common.excel.annotation.ExcelDictFormat; |
||||
|
import org.dromara.common.excel.convert.ExcelDictConvert; |
||||
|
import io.github.linpeilie.annotations.AutoMapper; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serial; |
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 协议信息视图对象 agreement_info |
||||
|
* |
||||
|
* @author gejunhao |
||||
|
* @date 2025-03-10 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ExcelIgnoreUnannotated |
||||
|
@AutoMapper(target = AgreementInfo.class) |
||||
|
public class AgreementInfoVo implements Serializable { |
||||
|
|
||||
|
@Serial |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 自增id |
||||
|
*/ |
||||
|
@ExcelProperty(value = "自增id") |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 服务目录id |
||||
|
*/ |
||||
|
@ExcelProperty(value = "服务目录id") |
||||
|
private String serviceCategoryId; |
||||
|
|
||||
|
/** |
||||
|
* 交付内容 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "交付内容") |
||||
|
private String deliverContent; |
||||
|
|
||||
|
/** |
||||
|
* 服务项目 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "服务项目") |
||||
|
private String serviceProject; |
||||
|
|
||||
|
/** |
||||
|
* 代码 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "代码") |
||||
|
private String code; |
||||
|
|
||||
|
/** |
||||
|
* 服务内容 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "服务内容") |
||||
|
private String serviceContent; |
||||
|
|
||||
|
/** |
||||
|
* 相应级别 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "相应级别") |
||||
|
private String responseLevel; |
||||
|
|
||||
|
/** |
||||
|
* 服务频率 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "服务频率") |
||||
|
private String frequency; |
||||
|
|
||||
|
/** |
||||
|
* 请求类型 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "请求类型") |
||||
|
private String responseType; |
||||
|
|
||||
|
/** |
||||
|
* 交付方式 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "交付方式") |
||||
|
private Long deliverType; |
||||
|
|
||||
|
/** |
||||
|
* 交付成果 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "交付成果") |
||||
|
private String deliverResult; |
||||
|
|
||||
|
/** |
||||
|
* 当前状态 |
||||
|
*/ |
||||
|
@ExcelProperty(value = "当前状态") |
||||
|
private Long status; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
package org.dromara.platform.mapper; |
||||
|
|
||||
|
import org.dromara.platform.domain.AgreementInfo; |
||||
|
import org.dromara.platform.domain.vo.AgreementInfoVo; |
||||
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
||||
|
|
||||
|
/** |
||||
|
* 协议信息Mapper接口 |
||||
|
* |
||||
|
* @author gejunhao |
||||
|
* @date 2025-03-10 |
||||
|
*/ |
||||
|
public interface AgreementInfoMapper extends BaseMapperPlus<AgreementInfo, AgreementInfoVo> { |
||||
|
|
||||
|
} |
@ -0,0 +1,68 @@ |
|||||
|
package org.dromara.platform.service; |
||||
|
|
||||
|
import org.dromara.platform.domain.vo.AgreementInfoVo; |
||||
|
import org.dromara.platform.domain.bo.AgreementInfoBo; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
import org.dromara.common.mybatis.core.page.PageQuery; |
||||
|
|
||||
|
import java.util.Collection; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 协议信息Service接口 |
||||
|
* |
||||
|
* @author gejunhao |
||||
|
* @date 2025-03-10 |
||||
|
*/ |
||||
|
public interface IAgreementInfoService { |
||||
|
|
||||
|
/** |
||||
|
* 查询协议信息 |
||||
|
* |
||||
|
* @param id 主键 |
||||
|
* @return 协议信息 |
||||
|
*/ |
||||
|
AgreementInfoVo queryById(String id); |
||||
|
|
||||
|
/** |
||||
|
* 分页查询协议信息列表 |
||||
|
* |
||||
|
* @param bo 查询条件 |
||||
|
* @param pageQuery 分页参数 |
||||
|
* @return 协议信息分页列表 |
||||
|
*/ |
||||
|
TableDataInfo<AgreementInfoVo> queryPageList(AgreementInfoBo bo, PageQuery pageQuery); |
||||
|
|
||||
|
/** |
||||
|
* 查询符合条件的协议信息列表 |
||||
|
* |
||||
|
* @param bo 查询条件 |
||||
|
* @return 协议信息列表 |
||||
|
*/ |
||||
|
List<AgreementInfoVo> queryList(AgreementInfoBo bo); |
||||
|
|
||||
|
/** |
||||
|
* 新增协议信息 |
||||
|
* |
||||
|
* @param bo 协议信息 |
||||
|
* @return 是否新增成功 |
||||
|
*/ |
||||
|
Boolean insertByBo(AgreementInfoBo bo); |
||||
|
|
||||
|
/** |
||||
|
* 修改协议信息 |
||||
|
* |
||||
|
* @param bo 协议信息 |
||||
|
* @return 是否修改成功 |
||||
|
*/ |
||||
|
Boolean updateByBo(AgreementInfoBo bo); |
||||
|
|
||||
|
/** |
||||
|
* 校验并批量删除协议信息信息 |
||||
|
* |
||||
|
* @param ids 待删除的主键集合 |
||||
|
* @param isValid 是否进行有效性校验 |
||||
|
* @return 是否删除成功 |
||||
|
*/ |
||||
|
Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid); |
||||
|
} |
@ -0,0 +1,139 @@ |
|||||
|
package org.dromara.platform.service.impl; |
||||
|
|
||||
|
import org.dromara.common.core.utils.MapstructUtils; |
||||
|
import org.dromara.common.core.utils.StringUtils; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
import org.dromara.common.mybatis.core.page.PageQuery; |
||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.dromara.platform.domain.bo.AgreementInfoBo; |
||||
|
import org.dromara.platform.domain.vo.AgreementInfoVo; |
||||
|
import org.dromara.platform.domain.AgreementInfo; |
||||
|
import org.dromara.platform.mapper.AgreementInfoMapper; |
||||
|
import org.dromara.platform.service.IAgreementInfoService; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
import java.util.Collection; |
||||
|
|
||||
|
/** |
||||
|
* 协议信息Service业务层处理 |
||||
|
* |
||||
|
* @author gejunhao |
||||
|
* @date 2025-03-10 |
||||
|
*/ |
||||
|
@RequiredArgsConstructor |
||||
|
@Service |
||||
|
public class AgreementInfoServiceImpl implements IAgreementInfoService { |
||||
|
|
||||
|
private final AgreementInfoMapper baseMapper; |
||||
|
|
||||
|
/** |
||||
|
* 查询协议信息 |
||||
|
* |
||||
|
* @param id 主键 |
||||
|
* @return 协议信息 |
||||
|
*/ |
||||
|
@Override |
||||
|
public AgreementInfoVo queryById(String id){ |
||||
|
return baseMapper.selectVoById(id); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 分页查询协议信息列表 |
||||
|
* |
||||
|
* @param bo 查询条件 |
||||
|
* @param pageQuery 分页参数 |
||||
|
* @return 协议信息分页列表 |
||||
|
*/ |
||||
|
@Override |
||||
|
public TableDataInfo<AgreementInfoVo> queryPageList(AgreementInfoBo bo, PageQuery pageQuery) { |
||||
|
LambdaQueryWrapper<AgreementInfo> lqw = buildQueryWrapper(bo); |
||||
|
Page<AgreementInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
||||
|
return TableDataInfo.build(result); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询符合条件的协议信息列表 |
||||
|
* |
||||
|
* @param bo 查询条件 |
||||
|
* @return 协议信息列表 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<AgreementInfoVo> queryList(AgreementInfoBo bo) { |
||||
|
LambdaQueryWrapper<AgreementInfo> lqw = buildQueryWrapper(bo); |
||||
|
return baseMapper.selectVoList(lqw); |
||||
|
} |
||||
|
|
||||
|
private LambdaQueryWrapper<AgreementInfo> buildQueryWrapper(AgreementInfoBo bo) { |
||||
|
Map<String, Object> params = bo.getParams(); |
||||
|
LambdaQueryWrapper<AgreementInfo> lqw = Wrappers.lambdaQuery(); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getServiceCategoryId()), AgreementInfo::getServiceCategoryId, bo.getServiceCategoryId()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getDeliverContent()), AgreementInfo::getDeliverContent, bo.getDeliverContent()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getServiceProject()), AgreementInfo::getServiceProject, bo.getServiceProject()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getCode()), AgreementInfo::getCode, bo.getCode()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getServiceContent()), AgreementInfo::getServiceContent, bo.getServiceContent()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getResponseLevel()), AgreementInfo::getResponseLevel, bo.getResponseLevel()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getFrequency()), AgreementInfo::getFrequency, bo.getFrequency()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getResponseType()), AgreementInfo::getResponseType, bo.getResponseType()); |
||||
|
lqw.eq(bo.getDeliverType() != null, AgreementInfo::getDeliverType, bo.getDeliverType()); |
||||
|
lqw.eq(StringUtils.isNotBlank(bo.getDeliverResult()), AgreementInfo::getDeliverResult, bo.getDeliverResult()); |
||||
|
lqw.eq(bo.getStatus() != null, AgreementInfo::getStatus, bo.getStatus()); |
||||
|
return lqw; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增协议信息 |
||||
|
* |
||||
|
* @param bo 协议信息 |
||||
|
* @return 是否新增成功 |
||||
|
*/ |
||||
|
@Override |
||||
|
public Boolean insertByBo(AgreementInfoBo bo) { |
||||
|
AgreementInfo add = MapstructUtils.convert(bo, AgreementInfo.class); |
||||
|
validEntityBeforeSave(add); |
||||
|
boolean flag = baseMapper.insert(add) > 0; |
||||
|
if (flag) { |
||||
|
bo.setId(add.getId()); |
||||
|
} |
||||
|
return flag; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改协议信息 |
||||
|
* |
||||
|
* @param bo 协议信息 |
||||
|
* @return 是否修改成功 |
||||
|
*/ |
||||
|
@Override |
||||
|
public Boolean updateByBo(AgreementInfoBo bo) { |
||||
|
AgreementInfo update = MapstructUtils.convert(bo, AgreementInfo.class); |
||||
|
validEntityBeforeSave(update); |
||||
|
return baseMapper.updateById(update) > 0; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 保存前的数据校验 |
||||
|
*/ |
||||
|
private void validEntityBeforeSave(AgreementInfo entity){ |
||||
|
//TODO 做一些数据校验,如唯一约束
|
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 校验并批量删除协议信息信息 |
||||
|
* |
||||
|
* @param ids 待删除的主键集合 |
||||
|
* @param isValid 是否进行有效性校验 |
||||
|
* @return 是否删除成功 |
||||
|
*/ |
||||
|
@Override |
||||
|
public Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid) { |
||||
|
if(isValid){ |
||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
|
} |
||||
|
return baseMapper.deleteByIds(ids) > 0; |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue