Commit 93c8c36d by huangZW

111

parent 5e32bc02
......@@ -42,6 +42,8 @@ public interface StaffDepartmentRelatedApiService {
List<StaffDepartmentRelatedDTO> listByStaffIds(List<String> staffIds);
public void sendClerkBind(String clerkId,String clerkCode,int auditStatus,String auditReason);
public void sendStaffBind(String staffId,String clerkCode,String storeId,int auditStatus,String auditReason);
public void sendClerkAdd (String clerkId,String clerkCode,int auditStatus,String auditReason);
......
......@@ -274,7 +274,7 @@ public class AuditApiServiceImpl implements AuditApiService{
String storeId = tab2.getCommitStoreId();
this.sendMessageByStaffId(staffId, storeId, title, content);
}else if(auditType == AuditType.CLERK_BIND.getCode()){
staffDepartmentRelatedApiService.sendClerkBind(obj.getClerkId(), obj.getClerkCode(), 2, auditReason);
staffDepartmentRelatedApiService.sendStaffBind(obj.getStaffId(), obj.getClerkCode(), tab2.getCommitStoreId(), 2, auditReason);
}else if(auditType == AuditType.CLERK_ADD.getCode()) {
staffDepartmentRelatedApiService.sendClerkAdd(enterpriseId, obj.getClerkCode(), 2, auditReason);
}else if(auditType == AuditType.CLERK_DEL.getCode()) {
......
......@@ -21,9 +21,11 @@ import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.util.EntityUtil;
import com.gic.enterprise.api.dto.MessageDTO;
import com.gic.haoban.manage.api.dto.ApplicationDTO;
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.service.ApplicationApiService;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService;
import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper;
......@@ -67,6 +69,8 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
private Config config;
@Autowired
private TabHaobanStaffClerkRelationMapper tabHaobanStaffClerkRelationMapper;
@Autowired
private StaffApiService staffApiService;
@Override
public List<StaffDepartmentRelatedDTO> listByDepartmentId(
......@@ -164,6 +168,60 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
}
//导购绑定,,审核记录,,消息发送
@Override
public void sendStaffBind(String staffId,String clerkCode,String storeId,int auditStatus,String auditReason){
//TODO huang 发送申请人,我的记录页
StaffDTO staffDTO = staffApiService.selectById(staffId);
if(staffDTO == null){
logger.info("staff不存在,发送消息失败{}",staffId);
return ;
}
String messageTitle = "门店账号申请";
String content = staffDTO.getStaffName()+"申请关联导购code("+clerkCode+")";
JSONObject jsonObject = new JSONObject();
jsonObject.put("storeId", storeId);
String data = jsonObject.toJSONString();
String pageUrl = this.getPageUrl(AppPageType.MY_RELATED_RECORD.getCode(), data);
TabHaobanWxEnterprise tabHaobanWxEnterprise = wxEnterpriseMapper.selectByPrimaryKey(staffDTO.getWxEnterpriseId());
String wxUserId = staffDTO.getWxUserId();
String corpId = tabHaobanWxEnterprise.getCorpid();
String name = staffDTO.getStaffName();
if(content.length()>30){
content = content.substring(0, 26);
content = content+"...";
}
//先发送下,试试
QywxXcxSendMessageDTO messageDTO = new QywxXcxSendMessageDTO();
List<ItemDTO> items = new ArrayList();;
ItemDTO dto1 = new ItemDTO();
ItemDTO dto2 = new ItemDTO();
ItemDTO dto3 = new ItemDTO();
ItemDTO dto4 = new ItemDTO();
dto1.setKey("接收人");
dto1.setValue(name);
dto2.setKey("接收事件");
dto2.setValue(content);
dto3.setKey("结果");
dto3.setValue(auditStatus == 1?"已同意":"已拒绝");
dto4.setKey("理由");
dto4.setValue(auditReason);
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(messageTitle);
messageDTO.setItems(items);
logger.info("发送参数为corpId============:{},suitId============:{},messageDTO============:{},",corpId, config.getWxSuiteid(), JSONObject.toJSONString(messageDTO));
boolean b = qywxSuiteApiService.sendMessage(corpId,config.getWxSuiteid(), messageDTO);
logger.info("发送===============》{}",b);
}
//导购绑定,,审核记录,,消息发送
@Override
public void sendClerkBind(String clerkId,String clerkCode,int auditStatus,String auditReason){
//TODO huang 发送申请人,我的记录页
ClerkDTO clerk = clerkService.getclerkById(clerkId);
......
......@@ -261,7 +261,7 @@ public class AuditController extends WebBaseController{
audit.setAuditStatus(2);
//发送消息
if(audit.getAuditType() == AuditType.CLERK_BIND.getCode()){
staffDepartmentRelatedApiService.sendClerkBind(clerkId, clerkCode, auditStatus, auditReason);
staffDepartmentRelatedApiService.sendStaffBind(auditStaffId, clerkCode, storeId, auditStatus, auditReason);
}else if (audit.getAuditType() == AuditType.CLERK_ADD.getCode()){
staffDepartmentRelatedApiService.sendClerkAdd(enterpriseId, clerkCode, auditStatus, auditReason);
}else if (audit.getAuditType() == AuditType.CLERK_DEL.getCode()){
......
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