Commit d02233ef authored by 徐州's avatar 徐州

需求新增部分需求

parent 9df15cf1
......@@ -54,6 +54,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
......@@ -3040,6 +3041,8 @@ public class CustomerController extends BaseController {
}
}
System.out.println(getBackSeaTime(request, customerEntity));
//查询回访记录
cpMap.put("customerId", customerEntity.getId());
List<CustomerCallbackLogEntity> backLogList = customerCallbackLog.queryByConditions(cpMap);
......@@ -3177,35 +3180,35 @@ public class CustomerController extends BaseController {
*/
@RequestMapping(value = "batchQuery", method = RequestMethod.GET)
public String batchQuery(Model model, HttpServletRequest request) {
UserEntity userEntity = (UserEntity) request.getSession().getAttribute(SessionConstants.THREAD_USER_KEY);
String mobilesStr = request.getParameter("mobiles");
if(TextUtils.isEmpty(mobilesStr)) {
return getAutoUrl();
}
String[] mobiles = mobilesStr.split("\r\n");
System.out.println(mobilesStr + "----------------------------" + mobiles.length);
List<String> phoneList = Arrays.stream(mobiles).filter(i -> !TextUtils.isEmpty(i)).collect(Collectors.toList());
List<String> phoneList = Arrays.stream(mobiles).distinct().filter(i -> !TextUtils.isEmpty(i)).collect(Collectors.toList());
/**
* 公海
*/
// List<String> ghPhones = customer.getExistByPhone(phoneList,0);
List<String> ghPhones = new ArrayList<>();
List<String> ghPhones = customer.getExistByPhone(phoneList,0).stream().map(i-> i.getPhone()).collect(Collectors.toList());
/**
* 待派
*/
List<String> dpPhones = new ArrayList<>();
//待派1:客户营销
// List<String> dpKhyx = marketCustomer.getExistPhone(phoneList);
// dpPhones.addAll(dpKhyx);
List<String> dpKhyx = marketCustomer.getExistPhone(phoneList);
dpPhones.addAll(dpKhyx);
//待派2:云迹
// List<String> dpYj = cloudCustomerInterface.getExistByPhone(phoneList,0);
// dpPhones.addAll(dpYj);
List<String> dpYj = cloudCustomerInterface.getExistByPhone(phoneList,0);
dpPhones.addAll(dpYj);
// 待派3:公海CRM导入
List<String> dpGh = customer.getExistByPhone(phoneList,1);
List<String> dpGh = customer.getExistByPhone(phoneList,1).stream().map(i-> i.getPhone()).collect(Collectors.toList());
dpPhones.addAll(dpGh);
dpPhones = dpPhones.stream().distinct().collect(Collectors.toList());
......@@ -3213,16 +3216,33 @@ public class CustomerController extends BaseController {
* 私客
*/
List<String> skPhones = new ArrayList<>();
List<CustomerEntity> skkh = customer.getExistByPhone(phoneList, 3);
List<CustomerEntity> skdhf = customer.getExistByPhone(phoneList, 2);
skPhones.addAll(skkh.stream().filter(i-> getBackSeaTime(request,i) < System.currentTimeMillis()).map(i-> i.getPhone()).collect(Collectors.toList()));
skPhones.addAll(skdhf.stream().filter(i-> getBackSeaTime(request,i) < System.currentTimeMillis()).map(i-> i.getPhone()).collect(Collectors.toList()));
// skPhones.addAll(customer.getExistByPhone(phoneList,3));
// 待回访
skPhones.addAll(customer.getExistByPhone(phoneList,2));
// skPhones.addAll(customer.getExistByPhone(phoneList,2));
skPhones = skPhones.stream().distinct().collect(Collectors.toList());
/**
* 判断重复数据
*/
final List<String> sk = new ArrayList<>(skPhones);
final List<String> gh = new ArrayList<>(ghPhones);
final List<String> dp = new ArrayList<>(dpPhones);
dpPhones = dpPhones.stream().filter(i-> sk.contains(i) || gh.contains(i)).map(i-> i+ "(多客户池)").collect(Collectors.toList());
skPhones = skPhones.stream().filter(i-> dp.contains(i) || gh.contains(i)).map(i-> i+ "(多客户池)").collect(Collectors.toList());
ghPhones = ghPhones.stream().filter(i-> sk.contains(i) || dp.contains(i)).map(i-> i+ "(多客户池)").collect(Collectors.toList());
if(dpPhones != null) {
StringBuilder dpSb = new StringBuilder();
dpPhones.stream().forEach(i-> {
dpSb.append(i).append("\r\n");
});
phoneList.removeAll(dpPhones);
phoneList.removeAll(dp);
model.addAttribute("dpPhones",dpSb.toString());
}
......@@ -3231,7 +3251,7 @@ public class CustomerController extends BaseController {
skPhones.stream().forEach(i-> {
skSb.append(i).append("\r\n");
});
phoneList.removeAll(skPhones);
phoneList.removeAll(sk);
model.addAttribute("skPhones",skSb.toString());
}
......@@ -3240,7 +3260,7 @@ public class CustomerController extends BaseController {
ghPhones.stream().forEach(i-> {
ghSb.append(i).append("\r\n");
});
phoneList.removeAll(ghPhones);
phoneList.removeAll(gh);
model.addAttribute("ghPhones",ghSb.toString());
}
......@@ -3289,4 +3309,54 @@ public class CustomerController extends BaseController {
return restResponse;
}
public long getBackSeaTime(HttpServletRequest request,CustomerEntity customerEntity) {
UserEntity userEntity = (UserEntity) request.getSession().getAttribute(SessionConstants.THREAD_USER_KEY);
DepartmentEntity departmentEntity = (DepartmentEntity) request.getSession().getAttribute(
SessionConstants.SESSION_CURRNET_DEPT_KEY);
String cityId = departmentEntity.getCityID();
DepartmentResponse departmentResponse = department.getDepartmentById(Integer.valueOf(cityId));
String cityCode = departmentResponse.getEntity().getDescripition();
customerEntity = customer.getCustomerMerge(customerEntity.getPhone(),customerEntity.getManagerId());
if(customerEntity == null) return 0;
//根据新的客户id获取旧表中的id
Map<String, Object> idMap = new HashMap<>(10);
idMap.put("phone", customerEntity.getPhone());
idMap.put("managerId", customerEntity.getManagerId());
idMap.put("isPrivate", 1);
List<CustomerEntity> oldList = customer.queryByConditions(idMap);
List<Integer> customerIdList = new ArrayList<>();
customerIdList.add(Integer.valueOf(customerEntity.getId()));
if (CollectionUtils.isNotEmpty(oldList)) {
for (CustomerEntity e : oldList) {
customerIdList.add(e.getId());
}
}
//查询约看项目
Map<String, Object> cpMap = new HashMap<>(10);
cpMap.put("idList", customerIdList);
List<CustomerProjectEntity> cpList = customerProject.queryList(cpMap);
//查询回访记录
List<CustomerCallbackLogEntity> backLogList = customerCallbackLog.queryByConditions(cpMap);
// 客户详情展示退回公海时间
boolean displayBackToSeaDate = false;
Calendar backToSeaCal = Calendar.getInstance();
userEntity.setCity(cityCode);
int visitCount = 0;
displayBackToSeaDate = DictUtil.getBackToSeaTime(customerEntity, userEntity, cpList, backToSeaCal, visitCount, backLogList, displayBackToSeaDate);
if (displayBackToSeaDate) {
return backToSeaCal.getTime().getTime();
}
return 0;
}
}
......@@ -3,7 +3,55 @@
<html>
<head>
<title>客户查询</title>
<style>
.frm{
}
.frm label{
display: flex;
align-items: center;
justify-content: flex-end;
}
.frm label .ico{
width:16px;
height:16px;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACB0lEQVQ4T6WTMWhUQRCG/9mrtbIwamEnimgRQQUTsMkVoqiolRGtRLB8O3tX6VX3dvfBERDEKmKsVIJoFZuIChowhSKKnYWihZXKdbsj+3grz0sjuMXbnZ3Zf4aZ7xH+c9Hk++FwuLPT6Vwhot0iMp38RLQuIh9CCDf7/f6n9pu/BJxzFwHcIKJlEXksIi8bgcNEdFxETgO4ysy3s8gfAefcDIBnAM4x8/0U4Jw7m/YJ+x6AWWZ+XounT1VVW2KMH5VSc0VRrDePV0VkU1PBT2Y+2sROxxifKKV2FUXxvRZwznkAm5n5crKttfNEdIqZU8nJvxpCGPT7/aeNfQvAD2bWWWBFRO4aY5ZSwGg0mgohbMvVWGtfA1jI/ibBeWbu1gLW2m8xxkOTHU4+7/21GOPceDzuDgaDX+kuTUop9coYszVX8EVEDhpjPrdHVJblrFJqmYiOaa3Xss9au4OI1ph5ey3gvX8kIku5263A6+lsjKn3vNJ0iGhea30iV2CJaEprfaEdWFXVnmQXRfG+fe+9vyMiX5nZ1AINfe8AXGpXUZZlN/l7vd5KOzuAxRDC3tSzNkiJwkWl1IHcfe99DZTWugaqqqrEQJpISlTTOIlyovEhgAci8iLGWNOmlJohoiMAzgA4mSncINBkSVQaAPtEZH9D4hsAb5VSNtHX7seGv7Ht/Jfzb2MR+RGfG8h4AAAAAElFTkSuQmCC');
background-size: 16px 16px;
position: relative;
margin:0 10px;
}
.frm label .ico text{
display: none;
position: absolute;
background-color: rgba(0,0,0,.7);
color:#fff;
font-size:14px;
white-space:nowrap;
left:50%;
top:-36px;
transform: translate3d(-50%,0,0);
padding:5px;
border-radius: 2px;
}
.frm label .ico:hover text{
display: inline-block;
}
.frm label .ico text::after{
left:50%;
margin-left:-6px;
bottom:-6px;
content: '';
position: absolute;
width: 0;
height: 0;
border-top: 6px solid rgba(0,0,0,.7);
border-right: 6px solid transparent;
border-left: 6px solid transparent;
}
</style>
</head>
<body>
<div class="container" style="width: 1200px;">
<form id="input_form" class="form-horizontal valid"
......@@ -78,12 +126,15 @@
<div class="row-fluid">
<div class="span6 control-group">
<label class="control-label">其他(${qtSize}):<br/>未进入系统的用户</label>
<div class="span6 control-group frm">
<label class="control-label">其他(${qtSize}):<div class="ico"><text>未进入系统的用户</text></div></label>
<div class="controls">
<textarea rows="5" id="qtmobiles" style="width: 200%"
name="qtmobiles" class="required">${qtPhones}</textarea>
</div>
</div>
</div>
......
......@@ -274,5 +274,5 @@ public interface ICustomer extends IService {
int queryCountById(Integer userId);
List<String> getExistByPhone(List<String> phoneList,int type);
List<CustomerEntity> getExistByPhone(List<String> phoneList,int type);
}
......@@ -102,5 +102,5 @@ public interface CustomerMapper {
int queryCountById(Integer userId);
List<String> getExistByPhone(Map<String, Object> map);
List<CustomerEntity> getExistByPhone(Map<String, Object> map);
}
......@@ -83,6 +83,6 @@ public interface CustomerMergeMapper {
List<CustomerEntity> getAllCustomer4(Map<String, Object> map);
List<String> getExistByPhone(Map<String, Object> map);
List<CustomerEntity> getExistByPhone(Map<String, Object> map);
}
......@@ -3237,7 +3237,7 @@ public class CustomerImpl implements ICustomer {
* @return
*/
@Override
public List<String> getExistByPhone(List<String> phoneList, int type) {
public List<CustomerEntity> getExistByPhone(List<String> phoneList, int type) {
Map<String, Object> map = new HashMap<>( 10 );
map.put("phoneList",phoneList);
map.put("is_delete",0);
......
......@@ -891,8 +891,8 @@
and creater=#{userId}
</select>
<select id="getExistByPhone" parameterType="map" resultType="String">
SELECT DISTINCT phone FROM customer where 1=1
<select id="getExistByPhone" parameterType="map" resultMap="infoMap">
SELECT * FROM customer where 1=1
<if test="status != null and status != '' ">
AND status = #{status}
......@@ -924,6 +924,7 @@
#{item}
</foreach>
</if>
group by phone
</select>
</mapper>
\ No newline at end of file
......@@ -1233,8 +1233,8 @@
</select>
<select id="getExistByPhone" parameterType="map" resultType="String">
SELECT DISTINCT phone FROM customer_merge where is_delete = 0 and
<select id="getExistByPhone" parameterType="map" resultMap="infoMap">
SELECT * FROM customer_merge where is_delete = 0 and
STATUS IN ( 11, 0, 99 ) AND
( isWaitCall = 0 OR isWaitCall IS NULL )
......@@ -1261,6 +1261,7 @@
)
</if>
group by phone
</select>
</mapper>
......@@ -68,7 +68,7 @@
</update>
<select id="getExistByPhone" parameterType="map" resultType="String">
SELECT DISTINCT phone FROM market_customer where (a.manager_id is null or a.manager_id = '')
SELECT DISTINCT phone FROM market_customer where (manager_id is null or manager_id = '')
<if test="phoneList != null and phoneList.size() > 0 ">
and phone IN
......
......@@ -869,8 +869,8 @@
and creater=#{userId}
</select>
<select id="getExistByPhone" parameterType="map" resultType="String">
SELECT DISTINCT phone FROM customer where 1=1
<select id="getExistByPhone" parameterType="map" resultMap="infoMap">
SELECT * FROM customer where 1=1
<if test="status != null and status != '' ">
AND status = #{status}
......@@ -902,5 +902,6 @@
#{item}
</foreach>
</if>
group by phone
</select>
</mapper>
\ No newline at end of file
......@@ -1235,8 +1235,8 @@
</if>
</select>
<select id="getExistByPhone" parameterType="map" resultType="String">
SELECT DISTINCT phone FROM customer_merge where is_delete = 0 and
<select id="getExistByPhone" parameterType="map" resultMap="infoMap">
SELECT * FROM customer_merge where is_delete = 0 and
STATUS IN ( 11, 0, 99 ) AND
( isWaitCall = 0 OR isWaitCall IS NULL )
......@@ -1263,6 +1263,7 @@
)
</if>
group by phone
</select>
</mapper>
......@@ -67,7 +67,7 @@
WHERE id = #{id}
</update>
<select id="getExistByPhone" parameterType="map" resultType="String">
SELECT DISTINCT phone FROM market_customer where (a.manager_id is null or a.manager_id = '')
SELECT DISTINCT phone FROM market_customer where (manager_id is null or manager_id = '')
<if test="phoneList != null and phoneList.size() > 0 ">
and phone IN
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment