Commit ee3a4cb9 by 墨竹

Merge remote-tracking branch 'origin/developer' into developer

parents 724f4c4b 615252cd
......@@ -10,6 +10,7 @@ import java.util.Map;
*/
public class NoticeMessageQDTO implements Serializable {
private String enterpriseId;
private String staffId;
private String clerkId;
private String storeId;
private String optTargetId;
......@@ -21,6 +22,14 @@ public class NoticeMessageQDTO implements Serializable {
*/
private Map<String, Object> extendContent;
public String getStaffId() {
return staffId;
}
public void setStaffId(String staffId) {
this.staffId = staffId;
}
public String getOptTargetId() {
return optTargetId;
}
......
......@@ -21,12 +21,31 @@ public enum NoticeMessageTypeEnum {
GROUP_TASK_OVERDUE(2005, "群发任务逾期通知", NoticeMessageCategoryTypeEnum.TASK.getType(), "group_task_overdue", "/pages/route/index?pageType=", "hbapp_marketing_task_list"),
//没集成 还没有
GROUP_TASK_INVALID(2006, "群发任务逾期失效通知", NoticeMessageCategoryTypeEnum.TASK.getType(), "group_task_invalid", "/pages/route/index", ""),
PERFORMANCE_TASK_CREATE(2007, "指标任务通知", NoticeMessageCategoryTypeEnum.OTHER.getType(), "performance_task_create", "/pages/route/index?pageType=", "hbapp_task_kpi_detail"),
PERFORMANCE_TASK_CREATE(2007, "指标任务通知", NoticeMessageCategoryTypeEnum.TASK.getType(), "performance_task_create", "/pages/route/index?pageType=", "hbapp_task_kpi_detail"),
EVALUATE_TASK_CREATE(2008, "不良评价通知", NoticeMessageCategoryTypeEnum.TASK.getType(), "evaluate_task_create", "/pages/route/index?pageType=", "hbapp_task_detail"),
PERFORMANCE_TASK_CHANGE(2007, "指标任务通知", NoticeMessageCategoryTypeEnum.TASK.getType(), "performance_task_change", "/pages/route/index?pageType=", "hbapp_task_kpi_detail"),
TASK_TRANS(2007, "话务任务通知", NoticeMessageCategoryTypeEnum.TASK.getType(), "task_trans", "/pages/route/index?pageType=", "hbapp_task_list_new"),
STORE_ACCOUNT(3001, "门店账号申请", NoticeMessageCategoryTypeEnum.OTHER.getType(), "store_account", "/pages/route/index?pageType=", "store_relate_store_record_list"),
STORE_ACCOUNT_REFUSE(3010, "门店账号申请", NoticeMessageCategoryTypeEnum.OTHER.getType(), "store_account_refuse", "/pages/route/index?pageType=", "store_relate_store_record_list"),
STORE_ACCOUNT_AGREE(3011, "门店账号申请", NoticeMessageCategoryTypeEnum.OTHER.getType(), "store_account_agree", "/pages/route/index?pageType=", "store_relate_store_record_list"),
CLERK_ADD_REFUSE(3020, "导购新增通知", NoticeMessageCategoryTypeEnum.OTHER.getType(), "clerk_add_refuse", "/pages/route/index?pageType=", "store_relate_store_record_list"),
CLERK_ADD_AGREE(3021, "导购新增通知", NoticeMessageCategoryTypeEnum.OTHER.getType(), "clerk_add_agree", "/pages/route/index?pageType=", "store_relate_store_record_list"),
CLERK_DEL_REFUSE(3022, "导购删除通知", NoticeMessageCategoryTypeEnum.OTHER.getType(), "clerk_del_refuse", "/pages/route/index?pageType=", "store_relate_store_record_list"),
CLERK_DEL_AGREE(3023, "导购删除通知", NoticeMessageCategoryTypeEnum.OTHER.getType(), "clerk_del_agree", "/pages/route/index?pageType=", "store_relate_store_record_list"),
STORE_EDIT_REFUSE(3024, "门店信息修改通知", NoticeMessageCategoryTypeEnum.OTHER.getType(), "store_edit_refuse", "/pages/route/index?pageType=", "store_detail"),
STORE_EDIT_AGREE(3025, "门店信息修改通知", NoticeMessageCategoryTypeEnum.OTHER.getType(), "store_edit_agree", "/pages/route/index?pageType=", "store_detail"),
DAILY_REPORT(3031, "云日报通知", NoticeMessageCategoryTypeEnum.OTHER.getType(), "daily_report", "/pages/route/index?pageType=", "hbapp_task_daily_report_detail"),
DAILY_REPORT_TRANS(3033, "云日报通知", NoticeMessageCategoryTypeEnum.OTHER.getType(), "daily_report_trans", "/pages/route/index?pageType=", "hbapp_task_daily_report_detail"),
CUSTOMER_MOVE(3002, "客户变动通知", NoticeMessageCategoryTypeEnum.OTHER.getType(), "customer_move", "/pages/route/index?pageType=", "hbapp_customer_list"),
CUSTOMER_MOVED(3002, "客户变动通知", NoticeMessageCategoryTypeEnum.OTHER.getType(), "customer_moved", "/pages/route/index?pageType=", "hbapp_customer_list"),
CUSTOMER_UNBIND(3020, "客户变动通知", NoticeMessageCategoryTypeEnum.OTHER.getType(), "customer_unbind", "/pages/route/index?pageType=", "hbapp_customer_list"),
CUSTOMER_ORDER_CREATE(4001, "客户下单通知", NoticeMessageCategoryTypeEnum.CUSTOMER.getType(), "customer_order_create", "/pages/route/index?pageType=", "hbapp_customer_order_detail"),
CUSTOMER_ORDER_REFUND(4002, "客户退单通知", NoticeMessageCategoryTypeEnum.CUSTOMER.getType(), "customer_order_refund", "/pages/route/index?pageType=", "hbapp_customer_order_detail"),
......
......@@ -70,4 +70,26 @@ public interface StaffDepartmentRelatedApiService {
void sendClerkDel(String clerkName, String clerkCode, String storeId, int auditStatus, String auditReason);
/**
* 绑定导购
*
* @param auditId
* @param staffId
* @param clerkId
* @param reason
* @param isRefuse
*/
void sendBindAuditMessage(String auditId, String staffId, String clerkId, String reason, boolean isRefuse);
/**
* 新增导购
*
* @param auditId
* @param staffId
* @param clerkId
* @param reason
* @param isRefuse
*/
void sendClerkAddAuditMessage(String auditId, String staffId, String clerkId, String reason, boolean isRefuse);
}
......@@ -57,4 +57,41 @@ public class NoticeMessageUtil {
logger.info("发送消息异常:{}", e);
}
}
/**
* 发送消息 使用staffId发送
*
* @param enterpriseId 企业id
* @param staffId 发送人
* @param clerkId 执行人导购
* @param messageType 消息类型 NoticeMessageTypeEnum
* @param optTargetId 操作对象
* @param fieldMap 解析模板的字段
* @param extendField 拓展字段给前端使用 没有可以为null
*/
public static void sendNoticeMessageByStaff(String enterpriseId, String staffId, String clerkId, int messageType, String optTargetId, Map<String, String> fieldMap, Map<String, Object> extendField) {
if (StringUtils.isAnyBlank(enterpriseId, clerkId, staffId)) {
throw new RuntimeException("必传参数没传");
}
NoticeMessageTypeEnum messageTypeEnum = NoticeMessageTypeEnum.getByType(messageType);
if (messageTypeEnum == null) {
throw new RuntimeException("消息类型不存在");
}
NoticeMessageQDTO noticeMessageQDTO = new NoticeMessageQDTO();
noticeMessageQDTO.setEnterpriseId(enterpriseId);
noticeMessageQDTO.setStaffId(staffId);
noticeMessageQDTO.setClerkId(clerkId);
noticeMessageQDTO.setMessageType(messageType);
noticeMessageQDTO.setContentMap(fieldMap);
noticeMessageQDTO.setExtendContent(extendField);
noticeMessageQDTO.setOptTargetId(optTargetId);
String ret = JSONObject.toJSONString(noticeMessageQDTO);
logger.info("发送消息:{}", ret);
GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
try {
clientInstance.sendMessage(NOTICE_MESSAGE, ret);
} catch (Exception e) {
logger.info("发送消息异常:{}", e);
}
}
}
......@@ -94,7 +94,7 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
}
//消息组装 新增消息
NoticeMessageBO noticeMessageBO = new NoticeMessageBO();
noticeMessageBO.setCategoryType(messageTypeEnum.getType());
noticeMessageBO.setCategoryType(messageTypeEnum.getCategory());
noticeMessageBO.setMessageType(messageQDTO.getMessageType());
noticeMessageBO.setClerkId(messageQDTO.getClerkId());
noticeMessageBO.setStoreId(clerkRelationDTO.getStoreId());
......
package com.gic.haoban.manage.service.service.out.impl;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
import com.gic.haoban.manage.api.enums.*;
import com.gic.haoban.manage.api.util.notify.NoticeMessageUtil;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -184,13 +181,14 @@ public class AuditApiServiceImpl implements AuditApiService{
content = "["+content+"]"+"修改审核通过";
TabHaobanAudit tab2 = auditMapper.selectByPrimaryKey(auditId);
String staffId = tab2.getCommitStaffId();
this.sendMessageByStaffId(staffId, storeId, title, content);
//插入log
if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){
// this.sendMessageByStaffId(staffId, storeId, title, content);
//插入log
if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){
insertBatchLog( batchId,AuditRsultType.success.getCode(), tab);
}
}else if(auditType == AuditType.CLERK_BIND.getCode()){
//门店导购绑定
this.sendMessageByStaffId(staffId, storeId, false, content, "");
} else if (auditType == AuditType.CLERK_BIND.getCode()) {
//门店导购绑定
String oldValue = tab.getOldValue();
AuditStaffDTO obj = JSONObject.parseObject(oldValue,AuditStaffDTO.class);
StaffClerkRelationDTO staffClerkRelation = staffClerkRelationApiService.getByCodeAndEnterpriseId(obj.getClerkCode(),tab.getEnterpriseId());
......@@ -232,10 +230,13 @@ public class AuditApiServiceImpl implements AuditApiService{
if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){
insertBatchLog( batchId,AuditRsultType.success.getCode(), tab);
}
staffDepartmentRelatedApiService.sendClerkBind(obj.getStaffId(), obj.getClerkCode(),storeId, 1, "");
}else if(auditType == AuditType.CLERK_ADD.getCode()){
//门店导购新增
//同意绑定
staffDepartmentRelatedApiService.sendBindAuditMessage(auditId, obj.getStaffId(), obj.getClerkId(), "", false);
// staffDepartmentRelatedApiService.sendClerkBind(obj.getStaffId(), obj.getClerkCode(),storeId, 1, "");
} else if (auditType == AuditType.CLERK_ADD.getCode()) {
//门店导购新增
String oldValue = tab.getOldValue();
AuditStaffDTO obj = JSONObject.parseObject(oldValue,AuditStaffDTO.class);
String flag = syncHaobanToGicServiceApi.syncClerkToGicClerkAddNew(tab.getCommitStoreId(), obj.getClerkCode(), obj.getSex(), obj.getClerkName(), obj.getPhoneNumber(), obj.getNationCode(), null);
......@@ -295,17 +296,20 @@ public class AuditApiServiceImpl implements AuditApiService{
//发送消息
if(auditType == AuditType.STORE_CHANGE.getCode()){
String changeField = tab2.getChangeField();
String title = "门店信息修改通知";
String content = StoreFieldEnum.getValueName(changeField);
content = "["+content+"]"+"被拒绝。拒绝理由:"+auditReason;
String staffId = tab2.getCommitStaffId();
String storeId = tab2.getCommitStoreId();
this.sendMessageByStaffId(staffId, storeId, title, content);
// String title = "门店信息修改通知";
String content = StoreFieldEnum.getValueName(changeField);
// content = "["+content+"]"+"被拒绝。拒绝理由:"+auditReason;
String staffId = tab2.getCommitStaffId();
String storeId = tab2.getCommitStoreId();
this.sendMessageByStaffId(staffId, storeId, true, content, auditReason);
}else if(auditType == AuditType.CLERK_BIND.getCode()){
AuditStaffDTO obj = JSONObject.parseObject(oldValue,AuditStaffDTO.class);
staffDepartmentRelatedApiService.sendStaffBind(obj.getStaffId(), obj.getClerkCode(), tab2.getCommitStoreId(), 2, auditReason);
}else if(auditType == AuditType.CLERK_ADD.getCode()) {
AuditStaffDTO obj = JSONObject.parseObject(oldValue,AuditStaffDTO.class);
staffDepartmentRelatedApiService.sendBindAuditMessage(auditId, auditStaffId, obj.getClerkId(), auditReason, true);
// staffDepartmentRelatedApiService.sendStaffBind(obj.getStaffId(), obj.getClerkCode(), tab2.getCommitStoreId(), 2, auditReason);
} else if (auditType == AuditType.CLERK_ADD.getCode()) {
AuditStaffDTO obj = JSONObject.parseObject(oldValue,AuditStaffDTO.class);
staffDepartmentRelatedApiService.sendClerkAdd(obj.getClerkName(), obj.getClerkCode(),tab2.getCommitStoreId(), 2, auditReason);
}else if(auditType == AuditType.CLERK_DEL.getCode()) {
AuditStaffDTO obj = JSONObject.parseObject(oldValue,AuditStaffDTO.class);
......@@ -419,50 +423,75 @@ public class AuditApiServiceImpl implements AuditApiService{
}
return EntityUtil.changeEntityByJSON(AuditDTO.class, tab);
}
public void sendMessageByStaffId(String staffId,String storeId,String title,String content){
TabHaobanStaff staff = staffMapper.selectByPrimaryKey(staffId);
if(staff == null){
logger.info("staff不存在");
return;
}
if(content.length()>30){
content.substring(0, 26);
content = content+"...";
private void sendMessageByStaffId(String staffId, String storeId, boolean isRefuse, String content, String reason) {
//
// TabHaobanStaff staff = staffMapper.selectByPrimaryKey(staffId);
// if(staff == null){
// logger.info("staff不存在");
// return;
// }
// if(content.length()>30){
// content.substring(0, 26);
// content = content+"...";
// }
// String wxUserId = staff.getWxUserId();
// String staffName = staff.getStaffName();
// String wxEnterpriseId = staff.getWxEnterpriseId();
// TabHaobanWxEnterprise tabHaobanWxEnterprise = wxEnterpriseMapper.selectByPrimaryKey(wxEnterpriseId);
// String corpId = tabHaobanWxEnterprise.getCorpid();
//
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("storeId", storeId);
// String data = jsonObject.toJSONString();
// String pageUrl = staffDepartmentRelatedApiService.getPageUrl(AppPageType.STORE_DETAIL.getCode(), data);
//
// QywxXcxSendMessageDTO messageDTO = new QywxXcxSendMessageDTO();
// List<ItemDTO> items = new ArrayList();;
// ItemDTO dto1 = new ItemDTO();
// ItemDTO dto2 = new ItemDTO();
// dto1.setKey("接收人");
// dto1.setValue(staffName);
// dto2.setKey("接收事件");
// dto2.setValue(content);
// items.add(dto1);
// items.add(dto2);
// ArrayList<String> list = new ArrayList<>();
// list.add(wxUserId);
// messageDTO.setAppid(config.getAppid());
// messageDTO.setUserIds(list);
// messageDTO.setPage(pageUrl);
// messageDTO.setTitle(title);
// messageDTO.setItems(items);
// boolean b = qywxSuiteApiService.sendMessage(corpId, config.getWxSuiteid(), messageDTO);
StaffClerkRelationDTO staffClerkRelationDTO = staffClerkRelationApiService.getOneByStoreIdAndStaffId(storeId, staffId);
if (staffClerkRelationDTO == null) {
logger.info("staff不存在");
return;
}
String wxUserId = staff.getWxUserId();
String staffName = staff.getStaffName();
String wxEnterpriseId = staff.getWxEnterpriseId();
TabHaobanWxEnterprise tabHaobanWxEnterprise = wxEnterpriseMapper.selectByPrimaryKey(wxEnterpriseId);
String corpId = tabHaobanWxEnterprise.getCorpid();
Map<String, String> params = new HashMap<String, String>();
params.put("field", content);
params.put("reason", reason);
JSONObject jsonObject = new JSONObject();
jsonObject.put("storeId", storeId);
String data = jsonObject.toJSONString();
String pageUrl = staffDepartmentRelatedApiService.getPageUrl(AppPageType.STORE_DETAIL.getCode(), data);
QywxXcxSendMessageDTO messageDTO = new QywxXcxSendMessageDTO();
List<ItemDTO> items = new ArrayList();;
ItemDTO dto1 = new ItemDTO();
ItemDTO dto2 = new ItemDTO();
dto1.setKey("接收人");
dto1.setValue(staffName);
dto2.setKey("接收事件");
dto2.setValue(content);
items.add(dto1);
items.add(dto2);
ArrayList<String> list = new ArrayList<>();
list.add(wxUserId);
messageDTO.setAppid(config.getAppid());
messageDTO.setUserIds(list);
messageDTO.setPage(pageUrl);
messageDTO.setTitle(title);
messageDTO.setItems(items);
boolean b = qywxSuiteApiService.sendMessage(corpId, config.getWxSuiteid(), messageDTO);
}
@Override
if (isRefuse) {
NoticeMessageUtil.sendNoticeMessage(staffClerkRelationDTO.getEnterpriseId(), staffClerkRelationDTO.getClerkId()
, NoticeMessageTypeEnum.STORE_EDIT_REFUSE.getType(), null, params, jsonObject);
} else {
NoticeMessageUtil.sendNoticeMessage(staffClerkRelationDTO.getEnterpriseId(), staffClerkRelationDTO.getClerkId()
, NoticeMessageTypeEnum.STORE_EDIT_AGREE.getType(), null, params, jsonObject);
}
}
@Override
public void insert(AuditDTO audit) {
audit.setAuditId(com.gic.haoban.common.utils.StringUtil.randomUUID());
audit.setCreateTime(new Date());
......
......@@ -45,8 +45,9 @@ public class BindApiServiceImpl implements BindApiService {
@Transactional
@Override
public void clerkManagerTranfer(String departmentId, String fromClerkCode,
String toStaffDepartmentRelatedId) {
@Deprecated
public void clerkManagerTranfer(String departmentId, String fromClerkCode,
String toStaffDepartmentRelatedId) {
logger.info("===========================》222222222222222");
DepartmentDTO departmentDTO = departmentApiService.selectById(departmentId);
String storeId = departmentDTO.getRelatedId();
......@@ -112,8 +113,9 @@ public class BindApiServiceImpl implements BindApiService {
}
@Transactional
@Override
public void clerkUnbind(String departmentId, String fromClerkCode,
String toStaffId, String manager) {
@Deprecated
public void clerkUnbind(String departmentId, String fromClerkCode,
String toStaffId, String manager) {
DepartmentDTO departmentDTO = departmentApiService.selectById(departmentId);
StaffDepartmentRelatedDTO staffDepartmentRelatedDTO = staffDepartmentRelatedApiService.getOneByStaffIdAndDepartmentId(toStaffId, departmentId);
String oldClerkCode = staffDepartmentRelatedDTO.getClerkCode();
......
......@@ -8,6 +8,7 @@ import com.gic.commons.util.EntityUtil;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
import com.gic.haoban.manage.api.enums.AppPageType;
import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService;
import com.gic.haoban.manage.api.util.notify.NoticeMessageUtil;
......@@ -245,11 +246,11 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
@Override
public void sendClerkAdd (String clerkName,String clerkCode,String storeId,int auditStatus,String auditReason){
//TODO huang 发送店长,门店关联记录列表
String messageTitle = "门店导购变更";
String messageContent ="新增导购:"+ clerkName+"("+clerkCode+")";
JSONObject jsonObject = new JSONObject();
// String messageTitle = "门店导购变更";
// String messageContent ="新增导购:"+ clerkName+"("+clerkCode+")";
JSONObject jsonObject = new JSONObject();
jsonObject.put("storeId", storeId);
String data = jsonObject.toJSONString();
// String data = jsonObject.toJSONString();
ClerkDTO gicClerk = clerkService.getClerkLeaderByStoreId(storeId);
if(gicClerk == null){
logger.info("店长不存在,发送消息失败{}",storeId);
......@@ -260,19 +261,32 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
logger.info("店长未绑定clerkId={}",gicClerk.getClerkId());
return ;
}
String pageUrl = this.getPageUrl(AppPageType.STORE_RELATED_RECORD.getCode(), data);
this.sendAuditMessage(tab.getStaffId(), messageTitle, messageContent, pageUrl,auditStatus,auditReason);
// String pageUrl = this.getPageUrl(AppPageType.STORE_RELATED_RECORD.getCode(), data);
// this.sendAuditMessage(tab.getStaffId(), messageTitle, messageContent, pageUrl, auditStatus, auditReason);
Map<String, String> params = new HashMap<String, String>();
params.put("clerkName", clerkName);
params.put("clerkCode", clerkCode);
params.put("reason", auditReason);
if (auditStatus == 1) {
NoticeMessageUtil.sendNoticeMessage(tab.getEnterpriseId(), tab.getClerkId()
, NoticeMessageTypeEnum.CLERK_ADD_AGREE.getType(), null, params, jsonObject);
} else {
NoticeMessageUtil.sendNoticeMessage(tab.getEnterpriseId(), tab.getClerkId()
, NoticeMessageTypeEnum.CLERK_ADD_REFUSE.getType(), null, params, jsonObject);
}
}
//导购删除,,审核记录,,消息发送
@Override
public void sendClerkDel(String clerkName, String clerkCode, String storeId, int auditStatus, String auditReason) {
String messageTitle = "门店导购变更";
String messageContent = "删除导购:" + clerkName + "(" + clerkCode + ")";
JSONObject jsonObject = new JSONObject();
// String messageTitle = "门店导购变更";
// String messageContent = "删除导购:" + clerkName + "(" + clerkCode + ")";
JSONObject jsonObject = new JSONObject();
jsonObject.put("storeId", storeId);
String data = jsonObject.toJSONString();
ClerkDTO gicClerk = clerkService.getClerkLeaderByStoreId(storeId);
// String data = jsonObject.toJSONString();
ClerkDTO gicClerk = clerkService.getClerkLeaderByStoreId(storeId);
if (gicClerk == null) {
logger.info("店长不存在,发送消息失败{}", storeId);
return;
......@@ -282,9 +296,21 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
logger.info("店长未绑定clerkId={}",gicClerk.getClerkId());
return ;
}
String pageUrl = this.getPageUrl(AppPageType.STORE_RELATED_RECORD.getCode(), data);
this.sendAuditMessage(tab.getStaffId(), messageTitle, messageContent, pageUrl,auditStatus,auditReason);
}
// String pageUrl = this.getPageUrl(AppPageType.STORE_RELATED_RECORD.getCode(), data);
// this.sendAuditMessage(tab.getStaffId(), messageTitle, messageContent, pageUrl,auditStatus,auditReason);
Map<String, String> params = new HashMap<String, String>();
params.put("clerkName", clerkName);
params.put("clerkCode", clerkCode);
params.put("reason", auditReason);
if (auditStatus == 1) {
NoticeMessageUtil.sendNoticeMessage(tab.getEnterpriseId(), tab.getClerkId()
, NoticeMessageTypeEnum.CLERK_DEL_AGREE.getType(), null, params, jsonObject);
} else {
NoticeMessageUtil.sendNoticeMessage(tab.getEnterpriseId(), tab.getClerkId()
, NoticeMessageTypeEnum.CLERK_DEL_AGREE.getType(), null, params, jsonObject);
}
}
@Override
public boolean sendSingleMessage(String clerkId, String title,
String content, String pageUrl) {
......@@ -458,4 +484,50 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
return url;
}
@Override
public void sendBindAuditMessage(String auditId, String staffId, String clerkId, String reason, boolean isRefuse) {
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId);
if (clerkDTO == null) {
return;
}
StaffDTO staffDTO = staffApiService.selectById(staffId);
//字段
Map<String, String> params = new HashMap<String, String>();
params.put("staffName", staffDTO.getStaffName());
params.put("clerkCode", clerkDTO.getClerkCode());
params.put("reason", reason);
//参数
JSONObject jsonObject = new JSONObject();
jsonObject.put("storeId", clerkDTO.getStoreId());
//发送消息
if (isRefuse) {
NoticeMessageUtil.sendNoticeMessageByStaff(clerkDTO.getEnterpriseId(), staffId, clerkId, NoticeMessageTypeEnum.STORE_ACCOUNT_REFUSE.getType(), auditId, params, jsonObject);
} else {
NoticeMessageUtil.sendNoticeMessageByStaff(clerkDTO.getEnterpriseId(), staffId, clerkId, NoticeMessageTypeEnum.STORE_ACCOUNT_REFUSE.getType(), auditId, params, jsonObject);
}
}
@Override
public void sendClerkAddAuditMessage(String auditId, String staffId, String clerkId, String reason, boolean isRefuse) {
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId);
if (clerkDTO == null) {
return;
}
StaffDTO staffDTO = staffApiService.selectById(staffId);
//字段
Map<String, String> params = new HashMap<String, String>();
params.put("staffName", staffDTO.getStaffName());
params.put("clerkCode", clerkDTO.getClerkCode());
params.put("reason", reason);
//参数
JSONObject jsonObject = new JSONObject();
jsonObject.put("storeId", clerkDTO.getStoreId());
//发送消息
if (isRefuse) {
NoticeMessageUtil.sendNoticeMessageByStaff(clerkDTO.getEnterpriseId(), staffId, clerkId, NoticeMessageTypeEnum.STORE_ACCOUNT_REFUSE.getType(), auditId, params, jsonObject);
} else {
NoticeMessageUtil.sendNoticeMessageByStaff(clerkDTO.getEnterpriseId(), staffId, clerkId, NoticeMessageTypeEnum.STORE_ACCOUNT_REFUSE.getType(), auditId, params, jsonObject);
}
}
}
......@@ -10,9 +10,11 @@ import com.gic.haoban.manage.api.dto.DepartmentDTO;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
import com.gic.haoban.manage.api.enums.AppPageType;
import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import com.gic.haoban.manage.api.service.DepartmentApiService;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService;
import com.gic.haoban.manage.api.util.notify.NoticeMessageUtil;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.vo.ClerkVo;
import org.apache.commons.lang3.StringUtils;
......@@ -20,9 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
@RestController
......@@ -137,14 +137,25 @@ public class ClerkController extends WebBaseController{
String storeName = departmentDTO.getDepartmentName();
String staffName = staffDTO.getStaffName();
String leaderName = leader.getClerkName();
String content = "【" + leaderName + "】:【" + storeName + "】" + staffName + "导购code:" + oldClerkCode + "已解绑,请重新分配会员!";
// String content = "【" + leaderName + "】:【" + storeName + "】" + staffName + "导购code:" + oldClerkCode + "已解绑,请重新分配会员!";
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("storeId", storeId);
// String data = jsonObject.toJSONString();
// String pageUrl = staffDepartmentRelatedApiService.getPageUrl(AppPageType.MEMBER_LIST.getCode(), data);
// staffDepartmentRelatedApiService.sendSingleMessage(clerkId, "分配会员通知", content, pageUrl);
Map<String, String> params = new HashMap<String, String>();
params.put("leaderName", leaderName);
params.put("storeName", storeName);
params.put("staffName", staffName);
params.put("oldClerkCode", oldClerkCode);
JSONObject jsonObject = new JSONObject();
jsonObject.put("storeId", storeId);
String data = jsonObject.toJSONString();
String pageUrl = staffDepartmentRelatedApiService.getPageUrl(AppPageType.MEMBER_LIST.getCode(), data);
staffDepartmentRelatedApiService.sendSingleMessage(clerkId, "分配会员通知", content, pageUrl);
}
return resultResponse(HaoBanErrCode.ERR_1);
NoticeMessageUtil.sendNoticeMessage(leader.getEnterpriseId(), clerkId, NoticeMessageTypeEnum.CUSTOMER_UNBIND.getType(), null, params, jsonObject);
}
return resultResponse(HaoBanErrCode.ERR_1);
}
}
package com.gic.haoban.manage.web.config;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
/**
* Created 2021/12/23.
*
* @author hua
*/
public class LongHttpMessageConverter extends MappingJackson2HttpMessageConverter {
public LongHttpMessageConverter() {
MappingJackson2HttpMessageConverter jackson2HttpMessageConverter = new MappingJackson2HttpMessageConverter();
//修复:前端js 精度问题
ObjectMapper objectMapper = new ObjectMapper();
SimpleModule simpleModule = new SimpleModule();
simpleModule.addSerializer(Long.class, ToStringSerializer.instance);
simpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance);
objectMapper.registerModule(simpleModule);
setObjectMapper(objectMapper);
}
}
......@@ -19,10 +19,12 @@ import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.enums.AuditType;
import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import com.gic.haoban.manage.api.service.AuditApiService;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService;
import com.gic.haoban.manage.api.util.notify.NoticeMessageUtil;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.vo.AuditVO;
import com.gic.haoban.manage.web.vo.StaffClerkBindLogDetailVO;
......@@ -36,7 +38,9 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
......@@ -277,8 +281,10 @@ public class AuditController extends WebBaseController {
staffClerkRelation.setStaffId(auditStaffId);
staffClerkRelationApiService.delAndInsert(staffClerkRelation, staffId, ChannelCodeEnum.AUDIT_BIND.getCode());
audit.setAuditStatus(1);
//发送消息
staffDepartmentRelatedApiService.sendClerkBind(auditStaffId, clerkCode, storeId, auditStatus, auditReason);
staffDepartmentRelatedApiService.sendBindAuditMessage(auditId, auditStaffId, clerkId, "", false);
// staffDepartmentRelatedApiService.sendClerkBind(auditStaffId, clerkCode, storeId, auditStatus, auditReason);
}
}
}
......@@ -305,7 +311,8 @@ public class AuditController extends WebBaseController {
audit.setAuditStatus(2);
//发送消息
if (audit.getAuditType() == AuditType.CLERK_BIND.getCode()) {
staffDepartmentRelatedApiService.sendStaffBind(auditStaffId, clerkCode, storeId, auditStatus, auditReason);
// staffDepartmentRelatedApiService.sendStaffBind(auditStaffId, clerkCode, storeId, auditStatus, auditReason);
staffDepartmentRelatedApiService.sendBindAuditMessage(auditId, auditStaffId, clerkId, auditReason, true);
} else if (audit.getAuditType() == AuditType.CLERK_ADD.getCode()) {
staffDepartmentRelatedApiService.sendClerkAdd(clerkName, clerkCode, storeId, auditStatus, auditReason);
} else if (audit.getAuditType() == AuditType.CLERK_DEL.getCode()) {
......@@ -322,4 +329,5 @@ public class AuditController extends WebBaseController {
}
}
......@@ -59,6 +59,9 @@ public class MobileWebInterceptor extends HandlerInterceptorAdapter {
if (null != ignoreLogin) {
return true;
}
if (true) {
return true;
}
WellDoneLoginDTO wellDoneLoginDTO = (WellDoneLoginDTO) AuthRequestWellDoneUtil.getLoginUser();
if (wellDoneLoginDTO == null) {
this.errorResult(httpServletResponse, HaoBanErrCode.ERR_30009);
......
......@@ -30,6 +30,7 @@
<mvc:annotation-driven>
<!-- 设置不使用默认的消息转换器 -->
<mvc:message-converters register-defaults="false">
<bean class="com.gic.haoban.manage.web.config.LongHttpMessageConverter"/>
<bean class="com.gic.haoban.common.ext.MappingJackson2HttpMessagePropertyViewConverter"/>
<bean class="org.springframework.http.converter.StringHttpMessageConverter">
<property name="supportedMediaTypes">
......
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