|
@@ -2,6 +2,7 @@ package com.dk.mdm.service.mst;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.dk.common.exception.BaseBusinessException;
|
|
import com.dk.common.exception.BaseBusinessException;
|
|
|
import com.dk.common.infrastructure.annotaiton.Pagination;
|
|
import com.dk.common.infrastructure.annotaiton.Pagination;
|
|
|
import com.dk.common.infrastructure.constant.Constant;
|
|
import com.dk.common.infrastructure.constant.Constant;
|
|
@@ -19,6 +20,7 @@ import com.dk.mdm.infrastructure.convert.mst.CusFollowConvert;
|
|
|
import com.dk.mdm.infrastructure.convert.mst.MeasureReceiptConvert;
|
|
import com.dk.mdm.infrastructure.convert.mst.MeasureReceiptConvert;
|
|
|
import com.dk.mdm.infrastructure.util.AuthUtils;
|
|
import com.dk.mdm.infrastructure.util.AuthUtils;
|
|
|
import com.dk.mdm.mapper.mst.*;
|
|
import com.dk.mdm.mapper.mst.*;
|
|
|
|
|
+import com.dk.mdm.model.pojo.ivt.InboundItem;
|
|
|
import com.dk.mdm.model.pojo.mst.*;
|
|
import com.dk.mdm.model.pojo.mst.*;
|
|
|
import com.dk.common.service.BaseService;
|
|
import com.dk.common.service.BaseService;
|
|
|
import com.dk.common.mapper.BaseMapper;
|
|
import com.dk.common.mapper.BaseMapper;
|
|
@@ -332,10 +334,10 @@ public class CusFollowService extends BaseService<CusFollow> {
|
|
|
public ResponseResultVO customerReminder() {
|
|
public ResponseResultVO customerReminder() {
|
|
|
log.info("@XxlJob(\"customer-reminder\")");
|
|
log.info("@XxlJob(\"customer-reminder\")");
|
|
|
log.info("followPlan id: {}", XxlJobHelper.getJobParam());
|
|
log.info("followPlan id: {}", XxlJobHelper.getJobParam());
|
|
|
- FollowPlan followPlan = followPlanMapper.selectById(Long.valueOf(XxlJobHelper.getJobParam()));
|
|
|
|
|
|
|
+// String planid = "10112024-0715-0000-0000-0004a8b4d1e6";
|
|
|
|
|
+ FollowPlan followPlan = followPlanMapper.selectById(XxlJobHelper.getJobParam());
|
|
|
if (followPlan != null) {
|
|
if (followPlan != null) {
|
|
|
CusFollow follow = cusFollowMapper.selectById(followPlan.getFollowId());
|
|
CusFollow follow = cusFollowMapper.selectById(followPlan.getFollowId());
|
|
|
-
|
|
|
|
|
if (follow != null) {
|
|
if (follow != null) {
|
|
|
FollowPlan plan = new FollowPlan().setPlanId(followPlan.getPlanId());
|
|
FollowPlan plan = new FollowPlan().setPlanId(followPlan.getPlanId());
|
|
|
try {
|
|
try {
|
|
@@ -354,7 +356,9 @@ public class CusFollowService extends BaseService<CusFollow> {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//修改状态
|
|
//修改状态
|
|
|
- followPlanMapper.updateById(plan);
|
|
|
|
|
|
|
+ followPlanMapper.update(plan,
|
|
|
|
|
+ new UpdateWrapper<FollowPlan>().lambda()
|
|
|
|
|
+ .eq(FollowPlan::getPlanId, UUID.fromString(plan.getPlanId())));
|
|
|
|
|
|
|
|
//删除任务
|
|
//删除任务
|
|
|
xxlJobUtils.delete(followPlan.getXxlJobId());
|
|
xxlJobUtils.delete(followPlan.getXxlJobId());
|
|
@@ -374,7 +378,8 @@ public class CusFollowService extends BaseService<CusFollow> {
|
|
|
public void planReminder() {
|
|
public void planReminder() {
|
|
|
log.info("@XxlJob(\"plan-reminder\")");
|
|
log.info("@XxlJob(\"plan-reminder\")");
|
|
|
log.info("followPlan id: {}", XxlJobHelper.getJobParam());
|
|
log.info("followPlan id: {}", XxlJobHelper.getJobParam());
|
|
|
- FollowPlan followPlan = followPlanMapper.selectById(Long.valueOf(XxlJobHelper.getJobParam()));
|
|
|
|
|
|
|
+// String planid = "10112024-0715-0000-0000-0004a8b4d1e6";
|
|
|
|
|
+ FollowPlan followPlan = followPlanMapper.selectById(XxlJobHelper.getJobParam());
|
|
|
if (followPlan != null && followPlan.getFlgValid()) {
|
|
if (followPlan != null && followPlan.getFlgValid()) {
|
|
|
FollowPlan plan = new FollowPlan().setPlanId(followPlan.getPlanId());
|
|
FollowPlan plan = new FollowPlan().setPlanId(followPlan.getPlanId());
|
|
|
try {
|
|
try {
|
|
@@ -410,9 +415,9 @@ public class CusFollowService extends BaseService<CusFollow> {
|
|
|
//查到跟进人
|
|
//查到跟进人
|
|
|
if (followStaff != null) {
|
|
if (followStaff != null) {
|
|
|
log.info("sendFollowMessage:{}", JSONObject.toJSONString(followStaff));
|
|
log.info("sendFollowMessage:{}", JSONObject.toJSONString(followStaff));
|
|
|
- Customer customer = customerMapper.selectById(new CustomerQuery().setCusId(follow.getCusId()));
|
|
|
|
|
|
|
+ Customer customer = customerMapper.selectById(follow.getCusId());
|
|
|
if (customer != null) {
|
|
if (customer != null) {
|
|
|
- String loginType = null;
|
|
|
|
|
|
|
+ String loginType = "1";
|
|
|
List<String> list = new ArrayList<>();
|
|
List<String> list = new ArrayList<>();
|
|
|
if (Constant.BasicDataConstant.FOLLOW_STATUS_4.getValue().equals(follow.getFollowStatus()) ||
|
|
if (Constant.BasicDataConstant.FOLLOW_STATUS_4.getValue().equals(follow.getFollowStatus()) ||
|
|
|
Constant.BasicDataConstant.FOLLOW_STATUS_5.getValue().equals(follow.getFollowStatus())) {
|
|
Constant.BasicDataConstant.FOLLOW_STATUS_5.getValue().equals(follow.getFollowStatus())) {
|
|
@@ -430,7 +435,6 @@ public class CusFollowService extends BaseService<CusFollow> {
|
|
|
} else if (Constant.BasicDataConstant.FOLLOW_STATUS_3.getValue().equals(follow.getFollowStatus())) {
|
|
} else if (Constant.BasicDataConstant.FOLLOW_STATUS_3.getValue().equals(follow.getFollowStatus())) {
|
|
|
list.add("您有客户需要约尺服务");
|
|
list.add("您有客户需要约尺服务");
|
|
|
loginType = "1";
|
|
loginType = "1";
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
list.add(customer.getCusName());
|
|
list.add(customer.getCusName());
|
|
|
list.add(customer.getCusPhone());
|
|
list.add(customer.getCusPhone());
|
|
@@ -529,11 +533,16 @@ public class CusFollowService extends BaseService<CusFollow> {
|
|
|
* @desc : 调用中控服务获取公众号的token
|
|
* @desc : 调用中控服务获取公众号的token
|
|
|
*/
|
|
*/
|
|
|
public String getWxPublicAccountToken() {
|
|
public String getWxPublicAccountToken() {
|
|
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
|
|
+ //有效期30天,最大可设置30天
|
|
|
|
|
+ json.put("appId", config.getWxPublicAccountAppId());
|
|
|
|
|
+ json.put("appSecret", config.getWxPublicAccountAppSecret());
|
|
|
ResponseResultVO<JSONObject> res = HttpUtils.post(config.getWechatUrlToken(),
|
|
ResponseResultVO<JSONObject> res = HttpUtils.post(config.getWechatUrlToken(),
|
|
|
- new HashMap() {{
|
|
|
|
|
|
|
+ new HashMap<String, Object>() {{
|
|
|
put("appId", config.getWxPublicAccountAppId());
|
|
put("appId", config.getWxPublicAccountAppId());
|
|
|
put("appSecret", config.getWxPublicAccountAppSecret());
|
|
put("appSecret", config.getWxPublicAccountAppSecret());
|
|
|
}});
|
|
}});
|
|
|
|
|
+// ResponseResultVO<JSONObject> res = HttpUtils.post(config.getWechatUrlToken(),json);
|
|
|
if (res.getCode() == 200 && JSON.parseObject(JSON.toJSONString(res.getData())).get("code").toString().equals("200")) {
|
|
if (res.getCode() == 200 && JSON.parseObject(JSON.toJSONString(res.getData())).get("code").toString().equals("200")) {
|
|
|
return JSON.parseObject(JSON.toJSONString(res.getData())).get("data").toString();
|
|
return JSON.parseObject(JSON.toJSONString(res.getData())).get("data").toString();
|
|
|
} else {
|
|
} else {
|
|
@@ -574,7 +583,6 @@ public class CusFollowService extends BaseService<CusFollow> {
|
|
|
//设置ID
|
|
//设置ID
|
|
|
Map<String, Object> uniqueNoteCode = commonService.getUniqueNoteCode(Constant.docNameConstant.FOLLOWPLAN.getName(), true);
|
|
Map<String, Object> uniqueNoteCode = commonService.getUniqueNoteCode(Constant.docNameConstant.FOLLOWPLAN.getName(), true);
|
|
|
String nextId = uniqueNoteCode.get("outId").toString();
|
|
String nextId = uniqueNoteCode.get("outId").toString();
|
|
|
- cusFollow.setFollowId(nextId);
|
|
|
|
|
|
|
|
|
|
// 约量尺 && 接受邀约
|
|
// 约量尺 && 接受邀约
|
|
|
// 预约量尺,邀约结果接受,通知设计师提醒时间是(服务时间);邀约结果拒绝,通知创建者提醒时间是(提醒时间)
|
|
// 预约量尺,邀约结果接受,通知设计师提醒时间是(服务时间);邀约结果拒绝,通知创建者提醒时间是(提醒时间)
|
|
@@ -596,7 +604,7 @@ public class CusFollowService extends BaseService<CusFollow> {
|
|
|
.setNextFollowTime(cusFollow.getNextFollowTime())
|
|
.setNextFollowTime(cusFollow.getNextFollowTime())
|
|
|
.setCallStatus(Constant.CallStatus.CALL_STATUS_UN_DONE.getName() + "")
|
|
.setCallStatus(Constant.CallStatus.CALL_STATUS_UN_DONE.getName() + "")
|
|
|
.setXxlJobId(id)
|
|
.setXxlJobId(id)
|
|
|
- .setOpAppCode(Constant.AppCode.WEIXIN.getCode()+"")
|
|
|
|
|
|
|
+ .setOpAppCode(Constant.AppCode.WEIXIN.getCode() + "")
|
|
|
.setCpId(cusFollow.getCpId())
|
|
.setCpId(cusFollow.getCpId())
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|