Commit 4fd798a6 by jinxin

转移错误日志添加

parent 30d34cdd
package com.gic.haoban.manage.api.dto;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import java.io.Serializable;
import java.util.List;
......@@ -93,7 +94,12 @@ public class TransferActiveCodeDTO implements Serializable {
log.append("失败明细:");
for (int i=1;i<=this.failedList.size();i++){
Map<String, String> stringMap = this.failedList.get(i - 1);
log.append(i+".(转移成员:"+stringMap.get("handoverStaffName")+",接收成员:"+stringMap.get("takeoverStaffName")+",失败原因错误码:"+stringMap.get("errorCode")+");");
String errorMessage = stringMap.get("errorMessage");
if (StrUtil.isNotBlank(errorMessage)){
log.append(i+".(转移成员:"+stringMap.get("handoverStaffName")+",接收成员:"+stringMap.get("takeoverStaffName")+",失败原因:"+errorMessage+");");
}else {
log.append(i+".(转移成员:"+stringMap.get("handoverStaffName")+",接收成员:"+stringMap.get("takeoverStaffName")+",失败原因错误码:"+stringMap.get("errorCode")+");");
}
}
//去掉末尾分号
String substring = log.substring(0, log.toString().length() - 1);
......
package com.gic.haoban.manage.service.errorcode;
/**
* Created by fudh on 2018/3/4.
*/
public enum QywxErrCode {
ERR_701017("701017","帐号30天内迁移过"),
;
private String code;
private String msg;
QywxErrCode(String code, String msg) {
this.code = code;
this.msg = msg;
}
public static QywxErrCode getValue(String code) {
for (QywxErrCode sec : QywxErrCode.values()) {
if (code == sec.getCode()) {
return sec;
}
}
return null;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
......@@ -34,6 +34,8 @@ import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper;
import com.gic.haoban.manage.service.dao.mapper.StaffMapper;
import com.gic.haoban.manage.service.entity.*;
import com.gic.haoban.manage.service.errorcode.HaoBanErrCode;
import com.gic.haoban.manage.service.errorcode.QywxErrCode;
import com.gic.haoban.manage.service.pojo.bo.StaffListBO;
import com.gic.haoban.manage.service.service.*;
import com.gic.haoban.manage.service.service.chat.GroupChatService;
......@@ -1085,8 +1087,9 @@ public class StaffApiServiceImpl implements StaffApiService {
stringMap.put("handoverStaffName",handoverStaff.getStaffName());
stringMap.put("takeoverStaffName",takeOverStaff.getStaffName());
stringMap.put("errorCode",String.valueOf(dto.getErrcode()));
if("701017".equals(String.valueOf(dto.getErrcode()))){
stringMap.put("errorMessage","帐号30天内迁移过");
QywxErrCode code = QywxErrCode.getValue(String.valueOf(dto.getErrcode()));
if (null != code){
stringMap.put("errorMessage",code.getMsg());
}
failedList.add(stringMap);
}
......
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