src/main/java/com/nathan/crm/service/CustomerServeService.java

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

package com.nathan.crm.service;

import com.nathan.base.BaseService;
import com.nathan.crm.dao.CustomerServeMapper;
import com.nathan.crm.dao.UserMapper;
import com.nathan.crm.enums.CustomerServeStatus;
import com.nathan.crm.utils.AssertUtil;
import com.nathan.crm.vo.CustomerServe;
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 CustomerServeService extends BaseService<CustomerServe,Integer> {

    @Resource
    private CustomerServeMapper customerServeMapper;
    @Resource
    private UserMapper userMapper;

    /**
     * 添加创建服务
     * @param customerServe
     */
    @Transactional(rollbackFor = Exception.class)
    public void addCreateServe(CustomerServe customerServe) {
        /* 参数校验 */
        checkCreateServeParams(customerServe.getCustomer(),customerServe.getServiceRequest(),customerServe.getServeType(),customerServe.getOverview());

        /* 执行添加操作 */
        customerServe.setCreateDate(new Date());
        customerServe.setUpdateDate(new Date());

        customerServeMapper.insertSelective(customerServe);
    }

    /**
     * 参数校验
     * @param customer
     * @param serviceRequest
     * @param serveType
     * @param overview
     */
    private void checkCreateServeParams(String customer, String serviceRequest, String serveType, String overview) {
        AssertUtil.isTrue(StringUtils.isBlank(customer),"请输入客户名!");
        AssertUtil.isTrue(StringUtils.isBlank(serviceRequest),"请输入服务内容!");
        AssertUtil.isTrue(StringUtils.isBlank(overview),"请输入服务概要!");
        AssertUtil.isTrue(StringUtils.isBlank(serveType),"请选择服务类型!");
    }

    /**
     * 更新服务
     *  1、参数校验
     *      客户服务ID  非空,记录必须存在
     *      客户服务状态
     *          如果服务状态为 服务分配状态  fw_002
     *              分配人 非空,分配用户记录存在
后面还有 41 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。