| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- package com.goafanti.customer.service.impl;
- import java.lang.reflect.InvocationTargetException;
- import java.util.UUID;
- import org.apache.commons.beanutils.BeanUtils;
- import org.apache.commons.lang3.StringUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
- import com.goafanti.common.dao.CustomerMapper;
- import com.goafanti.common.dao.CustomerUserInfoMapper;
- import com.goafanti.common.dao.FollowUpRecordMapper;
- import com.goafanti.common.model.Customer;
- import com.goafanti.common.model.FollowUpRecord;
- import com.goafanti.core.mybatis.BaseMybatisDao;
- import com.goafanti.core.shiro.token.TokenManager;
- import com.goafanti.customer.bo.CustomerIn;
- import com.goafanti.customer.service.FollowUpService;
- @Service
- public class FollowUpServiceImp extends BaseMybatisDao<CustomerUserInfoMapper> implements FollowUpService{
- @Autowired
- private FollowUpRecordMapper followUpRecordMapper ;
- @Autowired
- private CustomerMapper customerMapper;
- @Override
- public int addFollowUp(FollowUpRecord fur,CustomerIn cusIn) {
- Customer cus = new Customer();
- try {
- BeanUtils.copyProperties(cus, cusIn);
- if(StringUtils.isNotBlank(cusIn.getFollowSituation()))
- cus.setFollowSituation(Integer.parseInt(cusIn.getFollowSituation()));
- if(StringUtils.isNotBlank(cusIn.getCustomerStatus()))
- cus.setCustomerStatus(Integer.parseInt(cusIn.getCustomerStatus()));
- } catch (IllegalAccessException | InvocationTargetException e) {
- e.printStackTrace();
- }
- fur.setCid(cusIn.getId());
- fur.setAid(TokenManager.getAdminId());
- followUpRecordMapper.insert(fur);
- return customerMapper.updateByPrimaryKeySelective(cus);
- }
- }
|