|
|
@@ -1,17 +1,13 @@
|
|
|
package com.goafanti.customer.service.impl;
|
|
|
|
|
|
import java.lang.reflect.InvocationTargetException;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.UUID;
|
|
|
|
|
|
-import javax.security.auth.Subject;
|
|
|
-
|
|
|
import org.apache.commons.beanutils.BeanUtils;
|
|
|
-import org.apache.shiro.SecurityUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.goafanti.core.mybatis.BaseMybatisDao;
|
|
|
@@ -98,8 +94,6 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
|
|
|
public Pagination<CustomerOut> getPublicCustomer(CustomerIn cin, Integer pageSize, Integer pageNumber) {
|
|
|
cin.setShareType("1");
|
|
|
Map<String,Object> params = disposeParams(cin);
|
|
|
- if(pageSize == null || pageSize < 0) pageSize = 10;
|
|
|
- if(pageNumber == null || pageNumber <0 ) pageNumber = 1;
|
|
|
Pagination<CustomerOut> list = (Pagination<CustomerOut>)findPage("selectCustomer","selectCustomerCount",params, pageNumber, pageSize);
|
|
|
list.setList(setResult((List<CustomerOut>)list.getList()));
|
|
|
list.setList(descResult((List<CustomerOut>)list.getList()));
|
|
|
@@ -178,9 +172,14 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
|
|
|
case 6 : co.set_followSituation("面谈中") ;break;
|
|
|
case 7 : co.set_followSituation("已面签") ;break;
|
|
|
}
|
|
|
- String[] temp = co.getCompanyIntention().split(",");
|
|
|
String _companyIntention = "";
|
|
|
- if(temp.length>0){
|
|
|
+ if(StringUtils.isNotBlank(co.getCompanyIntention())){
|
|
|
+ String[] temp ;
|
|
|
+ if(co.getCompanyIntention().contains(",")){
|
|
|
+ temp = co.getCompanyIntention().split(",");
|
|
|
+ }else{
|
|
|
+ temp = new String[]{co.getCompanyIntention()};
|
|
|
+ }
|
|
|
for(String s:temp){
|
|
|
if(s.equals("0")) _companyIntention += "发明专利 ";
|
|
|
if(s.equals("1")) _companyIntention += "实用型新型专利 ";
|
|
|
@@ -191,9 +190,8 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
|
|
|
if(s.equals("6")) _companyIntention += "技术成果 ";
|
|
|
}
|
|
|
_companyIntention = _companyIntention.substring(0, _companyIntention.length()-6);
|
|
|
- }
|
|
|
+ }
|
|
|
co.set_companyIntention(_companyIntention);
|
|
|
-
|
|
|
if(StringUtils.isNotBlank(co.getFollowDate())) co.setFollowDate(co.getFollowDate().substring(0,19));
|
|
|
return co;
|
|
|
}
|
|
|
@@ -203,14 +201,20 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
|
|
|
* @return
|
|
|
*/
|
|
|
private String getCompanyIntention(String intentions){
|
|
|
- String[] list = intentions.split(",");
|
|
|
String result = "";
|
|
|
- if(list.length>0){
|
|
|
+ if(StringUtils.isNotBlank(intentions)){
|
|
|
+ String[] list;
|
|
|
+ if(intentions.contains(",")){
|
|
|
+ list = intentions.split(",");
|
|
|
+ }else{
|
|
|
+ list = new String[]{intentions};
|
|
|
+ }
|
|
|
for(String s:list){
|
|
|
result += CustomerIntentionFiled.getField(Integer.parseInt(s)).getDesc()+",";
|
|
|
}
|
|
|
+ result = result.substring(0, result.length()-1);
|
|
|
}
|
|
|
- return result.substring(0, result.length()-1);
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -221,6 +225,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
|
|
|
log.setCid(cid);
|
|
|
log.setOperatorTime(new Date());
|
|
|
log.setOperatorName(TokenManager.getAdminToken().getName());
|
|
|
+ Customer c = customerMapper.selectByPrimaryKey(cid) ;
|
|
|
if(operatorType.equals(AFTConstants.CUSTOMER_CREATE)){//创建用户
|
|
|
log.setAfterFollowSituation(CustomerFollowFiled.getField(Integer.parseInt(cus.getFollowSituation())).getDesc()); //跟进状态
|
|
|
log.setAfterCustomerIntention(getCompanyIntention(cus.getCompanyIntention())); //跟进意向
|
|
|
@@ -229,16 +234,15 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
|
|
|
log.setOperatorType(AFTConstants.CUSTOMER_CREATE);
|
|
|
}else if(operatorType.equals(AFTConstants.CUSTOMER_MODIFY)){ //修改用户
|
|
|
log.setBeforeAdminName(cus.getBeforeAdminName());//修改前操作人
|
|
|
- log.setBeforeCustomerIntention(getCompanyIntention(cus.getBeforeCompanyIntention())); //修改前跟进意向
|
|
|
- log.setBeforeCustomerStatus(CustomerStatusFiled.getField(Integer.parseInt(cus.getBeforeCustomerStatus())).getDesc()); //修改前跟进状态
|
|
|
- log.setBeforeFollowSituation(CustomerFollowFiled.getField(Integer.parseInt(cus.getBeforeFollowSituation())).getDesc());//修改前跟进进度
|
|
|
- log.setAfterFollowSituation(CustomerFollowFiled.getField(Integer.parseInt(cus.getFollowSituation())).getDesc()); //修改后跟进状态
|
|
|
+ log.setBeforeCustomerIntention(getCompanyIntention(c.getCompanyIntention())); //修改前跟进意向
|
|
|
+ log.setBeforeCustomerStatus(CustomerStatusFiled.getField(c.getCustomerStatus()).getDesc()); //修改前跟进状态
|
|
|
+ log.setBeforeFollowSituation(CustomerFollowFiled.getField(c.getFollowSituation()).getDesc());//修改前跟进进度
|
|
|
+ log.setAfterFollowSituation(CustomerFollowFiled.getField(c.getFollowSituation()).getDesc()); //修改后跟进状态
|
|
|
log.setAfterCustomerIntention(getCompanyIntention(cus.getCompanyIntention())); //修改后跟进意向
|
|
|
log.setAfterCustomerStatus(CustomerStatusFiled.getField(Integer.parseInt(cus.getCustomerStatus())).getDesc()); //修改后客户状态
|
|
|
- log.setAfterAdminName(adminMapper.selectByPrimaryKey(TokenManager.getAdminId()).getName());
|
|
|
log.setOperatorType(AFTConstants.CUSTOMER_MODIFY);
|
|
|
}else if(operatorType.equals(AFTConstants.CUSTOMER_DELETE)){ //删除用户
|
|
|
- log.setBeforeAdminName(cus.getAdminName());
|
|
|
+ log.setBeforeAdminName(cus.getBeforeAdminName());
|
|
|
log.setBeforeCustomerIntention(getCompanyIntention(cus.getBeforeCompanyIntention())); //跟进意向
|
|
|
log.setBeforeCustomerStatus(CustomerStatusFiled.getField(Integer.parseInt(cus.getBeforeCustomerStatus())).getDesc()); //跟进状态
|
|
|
log.setBeforeFollowSituation(CustomerFollowFiled.getField(Integer.parseInt(cus.getBeforeFollowSituation())).getDesc());//跟进进度
|