src/main/java/com/nathan/crm/service/CustomerReprieveService.java
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
package com.nathan.crm.service;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.nathan.base.BaseService;
import com.nathan.crm.dao.CustomerReprieveMapper;
import com.nathan.crm.utils.AssertUtil;
import com.nathan.crm.vo.CustomerReprieve;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
@Service
public class CustomerReprieveService extends BaseService<CustomerReprieve,Integer> {
@Resource
private CustomerReprieveMapper customerReprieveMapper;
/**
* 添加暂缓措施
* @param customerReprieve
*/
@Transactional
public void addCustomerRep(CustomerReprieve customerReprieve) {
/* 参数校验 */
AssertUtil.isTrue(StringUtils.isBlank(customerReprieve.getMeasure()),"请输入暂缓措施!");
/* 设置默认值 */
customerReprieve.setCreateDate(new Date());
customerReprieve.setUpdateDate(new Date());
/* 执行添加 */
AssertUtil.isTrue(customerReprieveMapper.insertSelective(customerReprieve) != 1,"添加暂缓数据失败!");
}
/**
* 修改暂缓措施
* @param customerReprieve
*/
@Transactional
public void updateCustomerRep(CustomerReprieve customerReprieve) {
/* 参数校验 */
AssertUtil.isTrue(StringUtils.isBlank(customerReprieve.getMeasure()),"请输入暂缓措施!");
AssertUtil.isTrue(customerReprieve.getId() == null,"需要修改的数据不存在!");
/* 执行修改 */
AssertUtil.isTrue(customerReprieveMapper.updateByPrimaryKeySelective(customerReprieve) != 1,"修改暂缓措施失败!");
}
/**
* 根据id删除暂缓数据
* @param id
*/
@Transactional
public void deleteCustomerRepById(Integer id) {
/* 参数校验 */
AssertUtil.isTrue(id == null,"要删除的数据不存在!");
CustomerReprieve customerReprieve = customerReprieveMapper.selectByPrimaryKey(id);
AssertUtil.isTrue(customerReprieve == null,"要删除的数据不存在!");
后面还有 6 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。