|
|
@@ -18,16 +18,12 @@ import com.goafanti.common.constant.AFTConstants;
|
|
|
import com.goafanti.common.dao.AdminMapper;
|
|
|
import com.goafanti.common.dao.CustomerLogMapper;
|
|
|
import com.goafanti.common.dao.CustomerMapper;
|
|
|
-import com.goafanti.common.dao.CustomerOrganizationInfoMapper;
|
|
|
-import com.goafanti.common.dao.CustomerUserInfoMapper;
|
|
|
import com.goafanti.common.enums.CustomerFollowFiled;
|
|
|
import com.goafanti.common.enums.CustomerIntentionFiled;
|
|
|
import com.goafanti.common.enums.CustomerStatusFiled;
|
|
|
import com.goafanti.common.model.Admin;
|
|
|
import com.goafanti.common.model.Customer;
|
|
|
import com.goafanti.common.model.CustomerLog;
|
|
|
-import com.goafanti.common.model.CustomerOrganizationInfo;
|
|
|
-import com.goafanti.common.model.CustomerUserInfo;
|
|
|
import com.goafanti.common.utils.StringUtils;
|
|
|
@Service
|
|
|
public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implements CustomerService {
|
|
|
@@ -37,13 +33,12 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
|
|
|
private AdminMapper adminMapper;
|
|
|
@Autowired
|
|
|
private CustomerLogMapper CustomerLogMapper;
|
|
|
- @Autowired
|
|
|
- private CustomerOrganizationInfoMapper customerOrganizationInfoMapper;
|
|
|
- @Autowired
|
|
|
- private CustomerUserInfoMapper customerUserInfoMapper;
|
|
|
@Override
|
|
|
public int addCustomer(Customer cus) {
|
|
|
- int res = customerMapper.insertCustomer(cus);
|
|
|
+ Date data =new Date();
|
|
|
+ cus.setCreateTime(data);
|
|
|
+ cus.setAid(TokenManager.getUserId().toString());
|
|
|
+ int res = customerMapper.insert(cus);
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -111,47 +106,51 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
|
|
|
}
|
|
|
private List<CustomerOut> setResult(List<CustomerOut> list){
|
|
|
for(CustomerOut co :list){
|
|
|
- switch(co.getShareType()){
|
|
|
- case 0 : co.set_shareType("个人客户");
|
|
|
- case 1 : co.set_shareType("公共客户");
|
|
|
- }
|
|
|
- switch(co.getCustomerStatus()){
|
|
|
- case 0 : co.set_customerStatus("新客户");
|
|
|
- case 1 : co.set_customerStatus("意向客户");
|
|
|
- case 2 : co.set_customerStatus("重点客户");
|
|
|
- case 3 : co.set_customerStatus("面谈客户");
|
|
|
- case 4 : co.set_customerStatus("签单客户");
|
|
|
- case 5 : co.set_customerStatus("被拒绝客户");
|
|
|
- }
|
|
|
- switch(co.getFollowSituation()){
|
|
|
- case 0 : co.set_followSituation("已发项目介绍资料");
|
|
|
- case 1 : co.set_followSituation("已约面谈");
|
|
|
- case 2 : co.set_followSituation("已发合同计划书");
|
|
|
- case 3 : co.set_followSituation("已报价");
|
|
|
- case 4 : co.set_followSituation("已发合同");
|
|
|
- case 5 : co.set_followSituation("已签合同");
|
|
|
- case 6 : co.set_followSituation("面谈中");
|
|
|
- case 7 : co.set_followSituation("已面签");
|
|
|
- }
|
|
|
- String[] temp = co.getCompanyIntention().split(",");
|
|
|
- String _companyIntention = "";
|
|
|
- if(temp.length>0){
|
|
|
- for(String s:temp){
|
|
|
- if(s.equals("0")) _companyIntention += "发明专利 ";
|
|
|
- if(s.equals("1")) _companyIntention += "实用型新型专利 ";
|
|
|
- if(s.equals("2")) _companyIntention += "外观专利 ";
|
|
|
- if(s.equals("3")) _companyIntention += "软件著作权 ";
|
|
|
- if(s.equals("4")) _companyIntention += "知识产权贯标 ";
|
|
|
- if(s.equals("5")) _companyIntention += "高企认定 ";
|
|
|
- if(s.equals("0")) _companyIntention += "技术成果 ";
|
|
|
- }
|
|
|
- _companyIntention = _companyIntention.substring(0, _companyIntention.length()-6);
|
|
|
- }
|
|
|
- co.set_companyIntention(_companyIntention);
|
|
|
+ setFiled(co);
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
+ private CustomerOut setFiled(CustomerOut co) {
|
|
|
+ switch(co.getShareType()){
|
|
|
+ case 0 : co.set_shareType("个人客户") ;break;
|
|
|
+ case 1 : co.set_shareType("公共客户") ;break;
|
|
|
+ }
|
|
|
+ switch(co.getCustomerStatus()){
|
|
|
+ case 0 : co.set_customerStatus("新客户") ;break;
|
|
|
+ case 1 : co.set_customerStatus("意向客户") ;break;
|
|
|
+ case 2 : co.set_customerStatus("重点客户") ;break;
|
|
|
+ case 3 : co.set_customerStatus("面谈客户") ;break;
|
|
|
+ case 4 : co.set_customerStatus("签单客户") ;break;
|
|
|
+ case 5 : co.set_customerStatus("被拒绝客户") ;break;
|
|
|
+ }
|
|
|
+ switch(co.getFollowSituation()){
|
|
|
+ case 0 : co.set_followSituation("已发项目介绍资料") ;break;
|
|
|
+ case 1 : co.set_followSituation("已约面谈") ;break;
|
|
|
+ case 2 : co.set_followSituation("已发合同计划书") ;break;
|
|
|
+ case 3 : co.set_followSituation("已报价") ;break;
|
|
|
+ case 4 : co.set_followSituation("已发合同") ;break;
|
|
|
+ case 5 : co.set_followSituation("已签合同") ;break;
|
|
|
+ case 6 : co.set_followSituation("面谈中") ;break;
|
|
|
+ case 7 : co.set_followSituation("已面签") ;break;
|
|
|
+ }
|
|
|
+ String[] temp = co.getCompanyIntention().split(",");
|
|
|
+ String _companyIntention = "";
|
|
|
+ if(temp.length>0){
|
|
|
+ for(String s:temp){
|
|
|
+ if(s.equals("0")) _companyIntention += "发明专利 ";
|
|
|
+ if(s.equals("1")) _companyIntention += "实用型新型专利 ";
|
|
|
+ if(s.equals("2")) _companyIntention += "外观专利 ";
|
|
|
+ if(s.equals("3")) _companyIntention += "软件著作权 ";
|
|
|
+ if(s.equals("4")) _companyIntention += "知识产权贯标 ";
|
|
|
+ if(s.equals("5")) _companyIntention += "高企认定 ";
|
|
|
+ if(s.equals("0")) _companyIntention += "技术成果 ";
|
|
|
+ }
|
|
|
+ _companyIntention = _companyIntention.substring(0, _companyIntention.length()-6);
|
|
|
+ }
|
|
|
+ co.set_companyIntention(_companyIntention);
|
|
|
+ return co;
|
|
|
+ }
|
|
|
/**
|
|
|
* 获取客户意向
|
|
|
* @param intentions
|
|
|
@@ -169,18 +168,20 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void saveCustomerLogo(CustomerIn cus,String operatorType){
|
|
|
+ public void saveCustomerLogo(CustomerIn cus,String operatorType,String cid){
|
|
|
/* 记录日志 */
|
|
|
CustomerLog log = new CustomerLog();
|
|
|
log.setId(UUID.randomUUID().toString());
|
|
|
- log.setCid(cus.getId());
|
|
|
+ log.setCid(cid);
|
|
|
log.setOperatorTime(new Date());
|
|
|
log.setOperatorName(TokenManager.getAdminToken().getName());
|
|
|
log.setAfterFollowSituation(CustomerFollowFiled.getField(Integer.parseInt(cus.getFollowSituation())).getDesc()); //跟进状态
|
|
|
log.setAfterCustomerIntention(getCompanyIntention(cus.getCompanyIntention())); //跟进意向
|
|
|
log.setAfterCustomerStatus(CustomerStatusFiled.getField(Integer.parseInt(cus.getCustomerStatus())).getDesc()); //客户状态
|
|
|
if(operatorType.equals(AFTConstants.CUSTOMER_CREATE)){//创建用户
|
|
|
- log.setAfterAdminName(adminMapper.selectByPrimaryKey(cus.getAid()).getName()); //接单人
|
|
|
+ //暂时注释为了测试
|
|
|
+ /*log.setAfterAdminName(adminMapper.selectByPrimaryKey(cus.getAid()).getName());*/ //接单人
|
|
|
+ log.setAfterAdminName(adminMapper.selectByPrimaryKey(TokenManager.getUserId()).getName());
|
|
|
log.setOperatorType(AFTConstants.CUSTOMER_CREATE);
|
|
|
}else if(operatorType.equals(AFTConstants.CUSTOMER_MODIFY)){ //修改用户
|
|
|
|
|
|
@@ -193,12 +194,9 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public int addCustomerUserInfo(CustomerUserInfo cui) {
|
|
|
- return customerUserInfoMapper.insert(cui);
|
|
|
+ public CustomerOut findCustomerDetails(String id) {
|
|
|
+ return setFiled(customerMapper.selectByPrimaryKey(id));
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public int addCustomerOrganizationInfo(CustomerOrganizationInfo coi) {
|
|
|
- return customerOrganizationInfoMapper.insert(coi);
|
|
|
- }
|
|
|
+
|
|
|
}
|