Commit 0145b4a4 by 徐高华

Merge branch 'feature/xgh/bug/0415' into 'master'

Feature/xgh/bug/0415

See merge request !1710
parents 0c3a8e13 6580c000
...@@ -40,16 +40,4 @@ public class ClerkEditInfoDTO { ...@@ -40,16 +40,4 @@ public class ClerkEditInfoDTO {
int delClerkFlag = vo.getDelClerkFlag() << 2; int delClerkFlag = vo.getDelClerkFlag() << 2;
return editClerkFlag | addClerkFlag | delClerkFlag ; return editClerkFlag | addClerkFlag | delClerkFlag ;
} }
public static void main(String[] args) {
ClerkEditInfoDTO vo = new ClerkEditInfoDTO();
vo.setAddClerkFlag(1);
vo.setDelClerkFlag(0);
vo.setEditClerkFlag(0);
System.out.println(getValue(vo));
System.out.println(JSON.toJSONString(info(getValue(vo))));
}
} }
...@@ -185,7 +185,6 @@ public class TestController extends WebBaseController { ...@@ -185,7 +185,6 @@ public class TestController extends WebBaseController {
try { try {
clientInstance.sendBatchMessages("qywxTagSyncDeal", mqList); clientInstance.sendBatchMessages("qywxTagSyncDeal", mqList);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
logger.info("批量异常:{}", e); logger.info("批量异常:{}", e);
} }
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
......
package com.gic.haoban.manage.web.utils;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader;
import java.io.Writer;
public class IOUtils {
/**
* 6.编写一个程序,将D:\\java目录下的所有.java文件复制到D:\\jad目录下,
* 并将原来文件的扩展名从.java改为.jad。
*/
// public static class FileCopy {
// public static void main(String[] args) {
//
// File oriFile = new File("D:\\java");//原文件目录
// //file.exists():判断文件目录是否存在
// //file.isDirectory():判断文件目录是否是一个目录
// if(!(oriFile.exists() && oriFile.isDirectory())){
// System.out.println("文件目录不存在!");
// }
//
// File[] files = oriFile.listFiles(
// new FilenameFilter(){ //文件名称过滤器
// public boolean accept(File file, String name) {
// return name.endsWith(".java");
// }
// }
// );
// System.out.println(files.length);//原文件个数
//
// File objFile = new File("D:\\jad");//目标文件目录
// //objFile.exists():判断目标文件目录是否存在
// //objFile.mkdir():创建目标文件目录
// if(!objFile.exists()){
// objFile.mkdir();
// }
//
// //copyByte(files,objFile);
// copyChar(files,objFile);
// System.out.println("写入完成!");
//
// }
//使用字节流进行文件复制(字节缓冲流可以不使用,使用其目的主要是为了提高性能)
private static void copyByte(File[] files,File objFile){
InputStream inputStream = null;
OutputStream outputStream = null;
BufferedInputStream bufferedInputStream = null;
BufferedOutputStream bufferedOutputStream = null;
for(File f : files){
//替换文件后缀
String objFileName = f.getName().replaceAll("\\.ACC$", ".mp3");
try {
inputStream = new FileInputStream(f);
outputStream = new FileOutputStream(new File(objFile,objFileName));
bufferedInputStream = new BufferedInputStream(inputStream);
bufferedOutputStream = new BufferedOutputStream(outputStream);
int c = 0;
while((c = bufferedInputStream.read()) != -1){
bufferedOutputStream.write(c);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
bufferedOutputStream.close();
bufferedInputStream.close();
outputStream.close();
inputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
//使用字符流进行文件复制(字符缓冲流可以不使用,使用其目的主要是为了提高性能)
public static void copyChar(File file,File objFile){
Reader reader = null;
Writer writer = null;
BufferedReader bufferedReader = null;
BufferedWriter bufferedWriter = null;
//替换文件后缀
String objFileName = file.getName().replaceAll("\\.AAC$", ".mp3");
try {
reader = new FileReader(file);
writer = new FileWriter(new File(objFile,objFileName));
bufferedReader = new BufferedReader(reader);
bufferedWriter = new BufferedWriter(writer);
int c = 0;
while ((c=bufferedReader.read()) != -1) {
bufferedWriter.write(c);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
bufferedWriter.close();
bufferedReader.close();
writer.close();
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
...@@ -165,4 +165,6 @@ public interface GroupChatService { ...@@ -165,4 +165,6 @@ public interface GroupChatService {
*/ */
public ServiceResponse<Void> initStaffGroupChat(String staffId) ; public ServiceResponse<Void> initStaffGroupChat(String staffId) ;
public void repairOwner() ;
} }
\ No newline at end of file
...@@ -87,7 +87,7 @@ public class GroupChatDataServiceImpl implements GroupChatDataService { ...@@ -87,7 +87,7 @@ public class GroupChatDataServiceImpl implements GroupChatDataService {
this.getDataFormQw(item.getWxEnterpriseId()); this.getDataFormQw(item.getWxEnterpriseId());
} catch (Exception e) { } catch (Exception e) {
logger.info("统计异常,wxeid={}", item.getWxEnterpriseId()); logger.info("统计异常,wxeid={}", item.getWxEnterpriseId());
e.printStackTrace(); logger.info("异常",e);
} }
} }
} else { } else {
......
...@@ -130,7 +130,7 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService { ...@@ -130,7 +130,7 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
"com.gic.haoban.manage.api.service.chat.GroupChatPlanApiService", "doPlanTimer"); "com.gic.haoban.manage.api.service.chat.GroupChatPlanApiService", "doPlanTimer");
} catch (Exception e) { } catch (Exception e) {
logger.error("发送MQ异常"); logger.error("发送MQ异常");
e.printStackTrace(); logger.info("异常",e);
} }
} }
...@@ -141,7 +141,7 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService { ...@@ -141,7 +141,7 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
"com.gic.haoban.manage.api.service.chat.GroupChatPlanApiService", "doPlanSendInfoTimer"); "com.gic.haoban.manage.api.service.chat.GroupChatPlanApiService", "doPlanSendInfoTimer");
} catch (Exception e) { } catch (Exception e) {
logger.error("发送MQ异常"); logger.error("发送MQ异常");
e.printStackTrace(); logger.info("异常",e);
} }
} }
...@@ -454,7 +454,7 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService { ...@@ -454,7 +454,7 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
try { try {
this.doPlanSendInfo(ownerLogId); this.doPlanSendInfo(ownerLogId);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.info("异常",e);
} }
} }
} }
......
...@@ -12,6 +12,7 @@ import java.util.stream.Collectors; ...@@ -12,6 +12,7 @@ import java.util.stream.Collectors;
import com.gic.enterprise.api.dto.StoreDTO; import com.gic.enterprise.api.dto.StoreDTO;
import com.gic.enterprise.api.service.StoreService; import com.gic.enterprise.api.service.StoreService;
import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -126,6 +127,8 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -126,6 +127,8 @@ public class GroupChatServiceImpl implements GroupChatService {
private GroupChatInitMapper groupChatInitMapper; private GroupChatInitMapper groupChatInitMapper;
@Autowired @Autowired
private StoreService storeService ; private StoreService storeService ;
@Autowired
private WxEnterpriseMapper wxEnterpriseMapper ;
private static GicMQClient mqClient = GICMQClientUtil.getClientInstance(); private static GicMQClient mqClient = GICMQClientUtil.getClientInstance();
...@@ -142,8 +145,7 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -142,8 +145,7 @@ public class GroupChatServiceImpl implements GroupChatService {
mqClient.sendCommonMessage("haobanChatMQ", params, mqClient.sendCommonMessage("haobanChatMQ", params,
"com.gic.haoban.manage.api.service.chat.GroupChatApiService", "refreshChatInfoFromMQ"); "com.gic.haoban.manage.api.service.chat.GroupChatApiService", "refreshChatInfoFromMQ");
} catch (Exception e) { } catch (Exception e) {
logger.error("发送MQ异常"); logger.info("异常",e);
e.printStackTrace();
} }
} }
...@@ -153,8 +155,7 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -153,8 +155,7 @@ public class GroupChatServiceImpl implements GroupChatService {
mqClient.sendCommonMessage("haobanChatMQ", params, mqClient.sendCommonMessage("haobanChatMQ", params,
"com.gic.haoban.manage.api.service.chat.GroupChatApiService", "refreshChatInfoFromMQ"); "com.gic.haoban.manage.api.service.chat.GroupChatApiService", "refreshChatInfoFromMQ");
} catch (Exception e) { } catch (Exception e) {
logger.error("发送MQ异常"); logger.info("异常",e);
e.printStackTrace();
} }
} }
...@@ -182,6 +183,16 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -182,6 +183,16 @@ public class GroupChatServiceImpl implements GroupChatService {
return; return;
} }
this.groupChatMapper.updateChatStatus(groupChat.getGroupChatId(), 4); this.groupChatMapper.updateChatStatus(groupChat.getGroupChatId(), 4);
// 更新群数量
this.updateOwnerCount(groupChat.getStaffId());
}
private void updateOwnerCount(String staffId) {
if(StringUtils.isNotBlank(staffId)) {
int chatCount = this.groupChatMapper.getCountByStaffId(staffId);
logger.info("更新群数={},{}",staffId,chatCount);
this.groupChatOwnerMapper.updateChatCount(staffId,chatCount) ;
}
} }
@Override @Override
...@@ -321,11 +332,11 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -321,11 +332,11 @@ public class GroupChatServiceImpl implements GroupChatService {
this.updateGroupChatDetail(qwDTO, groupChatId, true); this.updateGroupChatDetail(qwDTO, groupChatId, true);
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.info("异常",e);
} }
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.info("异常",e);
} finally { } finally {
RedisUtil.delCache(key); RedisUtil.delCache(key);
} }
...@@ -352,7 +363,7 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -352,7 +363,7 @@ public class GroupChatServiceImpl implements GroupChatService {
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId); WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
this.updateGroupChatDetail(qwDTO, groupChatId, true); this.updateGroupChatDetail(qwDTO, groupChatId, true);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.info("异常",e);
} }
} }
} }
...@@ -364,11 +375,11 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -364,11 +375,11 @@ public class GroupChatServiceImpl implements GroupChatService {
String staffId = item.getStaffId(); String staffId = item.getStaffId();
this.updateWxChatIdDk(wxEnterpriseId, staffId); this.updateWxChatIdDk(wxEnterpriseId, staffId);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.info("异常",e);
} }
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.info("异常",e);
} finally { } finally {
RedisUtil.delCache(key); RedisUtil.delCache(key);
} }
...@@ -441,12 +452,12 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -441,12 +452,12 @@ public class GroupChatServiceImpl implements GroupChatService {
} catch (Exception e) { } catch (Exception e) {
logger.info("初始化异常,wxEid={}", init.getWxEnterpriseId()); logger.info("初始化异常,wxEid={}", init.getWxEnterpriseId());
this.groupChatInitMapper.update(init.getWxEnterpriseId(), 4); this.groupChatInitMapper.update(init.getWxEnterpriseId(), 4);
e.printStackTrace(); logger.info("异常",e);
} }
} }
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.info("异常",e);
} finally { } finally {
RedisUtil.delCache(key); RedisUtil.delCache(key);
} }
...@@ -457,9 +468,9 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -457,9 +468,9 @@ public class GroupChatServiceImpl implements GroupChatService {
logger.info("群主离职,刷新群状态,staffId={}", staffId); logger.info("群主离职,刷新群状态,staffId={}", staffId);
TabGroupChatOwner owner = this.groupChatOwnerMapper.selectByStaffId(staffId); TabGroupChatOwner owner = this.groupChatOwnerMapper.selectByStaffId(staffId);
if (null != owner) { if (null != owner) {
this.groupChatOwnerMapper.updateChatCount(staffId, owner.getChatCount());
TabHaobanStaff staff = this.staffMapper.selectByPrimaryKey(staffId); TabHaobanStaff staff = this.staffMapper.selectByPrimaryKey(staffId);
this.dimissionOwner(staff.getWxEnterpriseId(), staff.getWxUserId(), staff.getWxOpenUseId()); this.dimissionOwner(staff.getWxEnterpriseId(), staff.getWxUserId(), staff.getWxOpenUseId());
this.updateOwnerCount(staffId);
} }
} }
...@@ -472,14 +483,14 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -472,14 +483,14 @@ public class GroupChatServiceImpl implements GroupChatService {
logger.info("群主离职,群状态处理={}", JSON.toJSONString(dto)); logger.info("群主离职,群状态处理={}", JSON.toJSONString(dto));
this.dimissionOwner(dto.getWxEnterpriseId(), dto.getWxUserId(), dto.getWxOpenUserId()); this.dimissionOwner(dto.getWxEnterpriseId(), dto.getWxUserId(), dto.getWxOpenUserId());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.info("异常",e);
} }
} }
try { try {
logger.info("转移群的状态"); logger.info("转移群的状态");
this.updateChatStatusTimer(); this.updateChatStatusTimer();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.info("异常",e);
} }
} }
...@@ -607,7 +618,7 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -607,7 +618,7 @@ public class GroupChatServiceImpl implements GroupChatService {
} }
RedisUtil.unlock(lockKey); RedisUtil.unlock(lockKey);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.info("异常",e);
} }
} }
if (syncDetailFlag) { if (syncDetailFlag) {
...@@ -669,16 +680,20 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -669,16 +680,20 @@ public class GroupChatServiceImpl implements GroupChatService {
chat.setStaffId(staff.getStaffId()); chat.setStaffId(staff.getStaffId());
// 判断是否更新群主 // 判断是否更新群主
this.saveOwnerHistory(wxEnterpriseId, groupChatId, newStaffId, oldStaffId); this.saveOwnerHistory(wxEnterpriseId, groupChatId, newStaffId, oldStaffId);
if(null != oldStaffId && oldStaffId.equals(newStaffId)) {
chat.setOriginalStaffId(chat.getOriginalStaffId());
}else {
chat.setOriginalStaffId(oldStaffId); chat.setOriginalStaffId(oldStaffId);
this.groupChatMapper.update(chat);
if (StringUtils.isBlank(chat.getWxChatIdDk())) {
//this.updateWxChatIdDk(wxEnterpriseId, staff.getStaffId());
} }
this.groupChatMapper.update(chat);
this.saveOwner(wxEnterpriseId, staff.getStaffId()); this.saveOwner(wxEnterpriseId, staff.getStaffId());
if(null != chat.getOriginalStaffId()) {
this.updateOwnerCount(chat.getOriginalStaffId()) ;
}
RedisUtil.unlock(lockKey); RedisUtil.unlock(lockKey);
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.info("异常",e);
} }
if (!syncMember) { if (!syncMember) {
logger.info("不同步群成员"); logger.info("不同步群成员");
...@@ -772,7 +787,7 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -772,7 +787,7 @@ public class GroupChatServiceImpl implements GroupChatService {
this.updateData(groupChatId, totalCount, totalMemberCount, addMemberCount, addCount, quitCount, this.updateData(groupChatId, totalCount, totalMemberCount, addMemberCount, addCount, quitCount,
quitMemberCount); quitMemberCount);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.info("异常",e);
} finally { } finally {
RedisUtil.unlock(lockKeyDetail); RedisUtil.unlock(lockKeyDetail);
} }
...@@ -1176,7 +1191,7 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -1176,7 +1191,7 @@ public class GroupChatServiceImpl implements GroupChatService {
} }
this.groupChatHmService.handleChatOff(wxEnterpriseId, groupChatId); this.groupChatHmService.handleChatOff(wxEnterpriseId, groupChatId);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.info("异常",e);
} }
} }
} }
...@@ -1203,4 +1218,27 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -1203,4 +1218,27 @@ public class GroupChatServiceImpl implements GroupChatService {
this.syncGroupChatList(qwDTO, Arrays.asList(userId), null, true); this.syncGroupChatList(qwDTO, Arrays.asList(userId), null, true);
return null ; return null ;
} }
@Override
public void repairOwner() {
List<TabHaobanWxEnterprise> wxEnterpriseList = this.wxEnterpriseMapper.listByIds(null);
for (TabHaobanWxEnterprise item : wxEnterpriseList) {
int pageNum = 0;
if(item.getWxSecurityType() <= 0) {
continue;
}
while (true) {
List<GroupChatOwnerDTO> list = this.groupChatOwnerMapper.listOwnerForStatistic(item.getWxEnterpriseId(), pageNum * pageSize, pageSize);
if (CollectionUtils.isEmpty(list)) {
logger.info("无群主记录,不处理,wxeid={}",item.getWxEnterpriseId());
break;
}
pageNum++;
for(GroupChatOwnerDTO dto : list) {
this.updateOwnerCount(dto.getStaffId());
}
}
}
}
} }
\ No newline at end of file
...@@ -149,7 +149,7 @@ public class WxUserAddLogServiceImpl implements WxUserAddLogService { ...@@ -149,7 +149,7 @@ public class WxUserAddLogServiceImpl implements WxUserAddLogService {
} }
this.wxUserAddLogMapper.insert(entity); this.wxUserAddLogMapper.insert(entity);
}catch(Exception e) { }catch(Exception e) {
e.printStackTrace(); log.info("异常",e);
} }
} }
......
...@@ -318,7 +318,6 @@ public class HandoverServiceImpl implements HandoverService { ...@@ -318,7 +318,6 @@ public class HandoverServiceImpl implements HandoverService {
handoverExternalMapper.updateByPrimaryKeySelective(handoverExternal); handoverExternalMapper.updateByPrimaryKeySelective(handoverExternal);
} catch (Exception e) { } catch (Exception e) {
logger.info("exception:{},{}", JSONObject.toJSONString(dto), e); logger.info("exception:{},{}", JSONObject.toJSONString(dto), e);
e.printStackTrace();
} }
}); });
return true; return true;
......
...@@ -287,7 +287,6 @@ public class MaterialServiceImpl implements MaterialService { ...@@ -287,7 +287,6 @@ public class MaterialServiceImpl implements MaterialService {
url+= "?imageView2/2/w/1440/h/1080" ; url+= "?imageView2/2/w/1440/h/1080" ;
} }
logger.info("url={}",url); logger.info("url={}",url);
System.out.println(JSON.toJSONString(url));
} }
public List<String> getImageMediaId(String wxEnterpriseId, List<ContentMaterialDTO> imageList, int mediaType) { public List<String> getImageMediaId(String wxEnterpriseId, List<ContentMaterialDTO> imageList, int mediaType) {
......
...@@ -58,7 +58,7 @@ public class StaffClerkBindLogServiceImpl implements StaffClerkBindLogService { ...@@ -58,7 +58,7 @@ public class StaffClerkBindLogServiceImpl implements StaffClerkBindLogService {
logger.info("绑定的mq日志:{}", ret); logger.info("绑定的mq日志:{}", ret);
clientInstance.sendMessage(STAFF_LOG_MQ, ret); clientInstance.sendMessage(STAFF_LOG_MQ, ret);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.info("异常",e);
} }
} }
...@@ -80,7 +80,7 @@ public class StaffClerkBindLogServiceImpl implements StaffClerkBindLogService { ...@@ -80,7 +80,7 @@ public class StaffClerkBindLogServiceImpl implements StaffClerkBindLogService {
logger.info("绑定的mq日志:{},{}", optStaffId, relationIds); logger.info("绑定的mq日志:{},{}", optStaffId, relationIds);
clientInstance.sendBatchMessages(STAFF_LOG_MQ, ret); clientInstance.sendBatchMessages(STAFF_LOG_MQ, ret);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.info("异常",e);
} }
} }
......
...@@ -735,8 +735,7 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ ...@@ -735,8 +735,7 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
logger.info("放入mq={},{}",mqName,JSON.toJSONString(listRet)); logger.info("放入mq={},{}",mqName,JSON.toJSONString(listRet));
clientInstance.sendBatchMessages(mqName, listRet, 10); clientInstance.sendBatchMessages(mqName, listRet, 10);
} catch (Exception e) { } catch (Exception e) {
logger.info("发送失败:{},{}", taskId, JSONObject.toJSONString(listRet)); logger.info("发送失败:{},{}", taskId, JSONObject.toJSONString(listRet),e);
e.printStackTrace();
} }
} }
......
...@@ -187,7 +187,6 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ ...@@ -187,7 +187,6 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ
List<QywxTransferCustomerInfoDTO> customerResults = customerDTO.getCustomer(); List<QywxTransferCustomerInfoDTO> customerResults = customerDTO.getCustomer();
handoverService.dealResult(wxEnterpriseId, dto.getHandoverTransferId(), customerResults); handoverService.dealResult(wxEnterpriseId, dto.getHandoverTransferId(), customerResults);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
logger.info("处理异常:{},{}", JSONObject.toJSONString(dto), e); logger.info("处理异常:{},{}", JSONObject.toJSONString(dto), e);
} }
}); });
......
...@@ -57,8 +57,7 @@ public class HaobanCommonMQApiServiceImpl implements HaobanCommonMQApiService { ...@@ -57,8 +57,7 @@ public class HaobanCommonMQApiServiceImpl implements HaobanCommonMQApiService {
mqClient.sendCommonMessage("haobanCommonRouter", message, mqClient.sendCommonMessage("haobanCommonRouter", message,
"com.gic.haoban.manage.api.service.HaobanCommonMQApiService", "commonHandler"); "com.gic.haoban.manage.api.service.HaobanCommonMQApiService", "commonHandler");
} catch (Exception e) { } catch (Exception e) {
log.error("发送MQ异常"); log.error("发送MQ异常",e);
e.printStackTrace();
} }
} }
...@@ -69,8 +68,7 @@ public class HaobanCommonMQApiServiceImpl implements HaobanCommonMQApiService { ...@@ -69,8 +68,7 @@ public class HaobanCommonMQApiServiceImpl implements HaobanCommonMQApiService {
try { try {
mqClient.sendMessage("haobanDelayMQ", message, delay); mqClient.sendMessage("haobanDelayMQ", message, delay);
} catch (Exception e) { } catch (Exception e) {
log.error("发送MQ异常"); log.error("发送MQ异常",e);
e.printStackTrace();
} }
} }
......
...@@ -40,7 +40,7 @@ public class TestServiceImpl implements TestApiService { ...@@ -40,7 +40,7 @@ public class TestServiceImpl implements TestApiService {
try { try {
Thread.sleep(expireTime); Thread.sleep(expireTime);
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); logger.info("异常",e);
} }
} }
logger.info("测试-end:{}", id); logger.info("测试-end:{}", id);
......
...@@ -380,8 +380,7 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi ...@@ -380,8 +380,7 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
try { try {
clientInstance.sendMessage(FLUSH_HAOBAN_BIND_STORE_MQ, str, DELAY_TIME); clientInstance.sendMessage(FLUSH_HAOBAN_BIND_STORE_MQ, str, DELAY_TIME);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.info("发送消息异常:{}", str,e);
logger.info("发送消息异常:{}", str);
} }
} else { } else {
logger.info("最近已有在刷新,无需重复刷新:{}", JSONObject.toJSONString(mqDTO)); logger.info("最近已有在刷新,无需重复刷新:{}", JSONObject.toJSONString(mqDTO));
...@@ -653,7 +652,6 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi ...@@ -653,7 +652,6 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
detailDTO.getRelations().add(groupInfoDTO); detailDTO.getRelations().add(groupInfoDTO);
this.wxEnterpriseBind(detailDTO); this.wxEnterpriseBind(detailDTO);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
logger.info("企业历史初始化失败:{}, {}", needDealEnt.getEnterpriseId(), e); logger.info("企业历史初始化失败:{}, {}", needDealEnt.getEnterpriseId(), e);
RedisUtil.setCache("init-fail-enterprise:" + needDealEnt.getWxEnterpriseRelatedId(), needDealEnt); RedisUtil.setCache("init-fail-enterprise:" + needDealEnt.getWxEnterpriseRelatedId(), needDealEnt);
} }
......
...@@ -142,7 +142,6 @@ public class FriendClerkSyncNewOperation implements BaseSyncOperation { ...@@ -142,7 +142,6 @@ public class FriendClerkSyncNewOperation implements BaseSyncOperation {
//成功更新状态 //成功更新状态
dealSuccess(dealParamMqDTO.getTaskId(), dealParamMqDTO.getData(), dataPre.getEnterpriseId(), dataPre.getWxEnterpriseId()); dealSuccess(dealParamMqDTO.getTaskId(), dealParamMqDTO.getData(), dataPre.getEnterpriseId(), dataPre.getWxEnterpriseId());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
logger.info("同步失败:{},{}", JSONObject.toJSONString(dataPre), e); logger.info("同步失败:{},{}", JSONObject.toJSONString(dataPre), e);
reason = "成员好友处理异常"; reason = "成员好友处理异常";
dealFlag = false; dealFlag = false;
...@@ -194,7 +193,6 @@ public class FriendClerkSyncNewOperation implements BaseSyncOperation { ...@@ -194,7 +193,6 @@ public class FriendClerkSyncNewOperation implements BaseSyncOperation {
clientInstance.sendBatchMessages("departmentSyncDealMq", ret); clientInstance.sendBatchMessages("departmentSyncDealMq", ret);
} catch (Exception e) { } catch (Exception e) {
logger.info("发送失败:{},{}", taskId); logger.info("发送失败:{},{}", taskId);
e.printStackTrace();
} }
} }
......
...@@ -111,7 +111,6 @@ public class FriendSyncNewOperation implements BaseSyncOperation { ...@@ -111,7 +111,6 @@ public class FriendSyncNewOperation implements BaseSyncOperation {
dealFlag = tryAgainToMq(dataPre); dealFlag = tryAgainToMq(dataPre);
reason = "接口重试超出限制"; reason = "接口重试超出限制";
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
logger.info("同步失败:{},{}", JSONObject.toJSONString(dataPre), e); logger.info("同步失败:{},{}", JSONObject.toJSONString(dataPre), e);
reason = "第三方好友处理异常"; reason = "第三方好友处理异常";
dealFlag = false; dealFlag = false;
...@@ -185,7 +184,6 @@ public class FriendSyncNewOperation implements BaseSyncOperation { ...@@ -185,7 +184,6 @@ public class FriendSyncNewOperation implements BaseSyncOperation {
clientInstance.sendBatchMessages("departmentSyncDealMq", ret); clientInstance.sendBatchMessages("departmentSyncDealMq", ret);
} catch (Exception e) { } catch (Exception e) {
logger.info("发送失败:{}", taskId, e); logger.info("发送失败:{}", taskId, e);
e.printStackTrace();
} }
} }
} }
...@@ -99,7 +99,6 @@ public class SelfFriendSyncNewOperation implements BaseSyncOperation { ...@@ -99,7 +99,6 @@ public class SelfFriendSyncNewOperation implements BaseSyncOperation {
dealFlag = tryAgainToMq(dataPre); dealFlag = tryAgainToMq(dataPre);
reason = "重试次数过多"; reason = "重试次数过多";
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
logger.info("同步失败:{},{}", JSONObject.toJSONString(dataPre), e); logger.info("同步失败:{},{}", JSONObject.toJSONString(dataPre), e);
reason = "自建应用好友处理异常"; reason = "自建应用好友处理异常";
dealFlag = false; dealFlag = false;
...@@ -171,8 +170,7 @@ public class SelfFriendSyncNewOperation implements BaseSyncOperation { ...@@ -171,8 +170,7 @@ public class SelfFriendSyncNewOperation implements BaseSyncOperation {
Log.info("发送队列SelfFriendSyncNewOperation={}",JSON.toJSONString(ret)); Log.info("发送队列SelfFriendSyncNewOperation={}",JSON.toJSONString(ret));
clientInstance.sendBatchMessages("departmentSyncDealMq", ret); clientInstance.sendBatchMessages("departmentSyncDealMq", ret);
} catch (Exception e) { } catch (Exception e) {
logger.info("发送失败:{},{}", taskId); logger.info("发送失败:{},{}", taskId,e);
e.printStackTrace();
} }
} }
} }
...@@ -80,7 +80,6 @@ public class FriendMemberTagSyncOperation implements BaseSyncOperation { ...@@ -80,7 +80,6 @@ public class FriendMemberTagSyncOperation implements BaseSyncOperation {
} catch (Exception e) { } catch (Exception e) {
resultFlag = false; resultFlag = false;
reason = "处理异常:"; reason = "处理异常:";
e.printStackTrace();
logger.info("处理异常:{}", e); logger.info("处理异常:{}", e);
} finally { } finally {
if (!resultFlag) { if (!resultFlag) {
......
...@@ -89,7 +89,6 @@ public class FriendTagSyncOperation implements BaseSyncOperation { ...@@ -89,7 +89,6 @@ public class FriendTagSyncOperation implements BaseSyncOperation {
} catch (Exception e) { } catch (Exception e) {
resultFlag = false; resultFlag = false;
reason = "处理异常:"; reason = "处理异常:";
e.printStackTrace();
logger.info("处理异常:{}", e); logger.info("处理异常:{}", e);
} finally { } finally {
if (!resultFlag) { if (!resultFlag) {
...@@ -214,8 +213,7 @@ public class FriendTagSyncOperation implements BaseSyncOperation { ...@@ -214,8 +213,7 @@ public class FriendTagSyncOperation implements BaseSyncOperation {
try { try {
clientInstance.sendMessage("departmentSyncDealMq", JSONObject.toJSONString(dealParamMqDTO)); clientInstance.sendMessage("departmentSyncDealMq", JSONObject.toJSONString(dealParamMqDTO));
} catch (Exception e) { } catch (Exception e) {
logger.info("发送失败:{},{}", taskId, relationId); logger.info("发送失败:{},{}", taskId, relationId,e);
e.printStackTrace();
} }
}); });
} }
......
...@@ -33,7 +33,6 @@ public class CommonUtil { ...@@ -33,7 +33,6 @@ public class CommonUtil {
public static void main(String[] args) { public static void main(String[] args) {
getFileByte("https://jhdm-1251519181.cos.ap-shanghai.myqcloud.com/image/material_content-cce7cc3de0bf48cebf16fb5c65f4ae9c.jpg?imageView2/format/jpg/q/50?imageView2/2/w/1440/h/1080") ; getFileByte("https://jhdm-1251519181.cos.ap-shanghai.myqcloud.com/image/material_content-cce7cc3de0bf48cebf16fb5c65f4ae9c.jpg?imageView2/format/jpg/q/50?imageView2/2/w/1440/h/1080") ;
System.out.println(1);
} }
} }
\ No newline at end of file
...@@ -104,10 +104,8 @@ public class DrawImageUtils { ...@@ -104,10 +104,8 @@ public class DrawImageUtils {
Random random = new Random(); Random random = new Random();
String url = DrawImageUtils.drawImage("jhdm", Math.abs(random.nextInt(1000)) + "", String url = DrawImageUtils.drawImage("jhdm", Math.abs(random.nextInt(1000)) + "",
Math.abs(random.nextInt(1000)) + "万", DrawBkgImg.AREA_MONTH_BKG); Math.abs(random.nextInt(1000)) + "万", DrawBkgImg.AREA_MONTH_BKG);
System.out.println(url);
String temp = DrawImageUtils.drawImage("jhdm", Math.abs(random.nextInt(1000)) + "", String temp = DrawImageUtils.drawImage("jhdm", Math.abs(random.nextInt(1000)) + "",
Math.abs(random.nextInt(1000)) + "万", DrawBkgImg.CLERK_MONTH_BKG); Math.abs(random.nextInt(1000)) + "万", DrawBkgImg.CLERK_MONTH_BKG);
System.out.println(temp);
} }
} }
...@@ -223,7 +223,7 @@ ...@@ -223,7 +223,7 @@
<select id="getCountByStaffId" resultType="int"> <select id="getCountByStaffId" resultType="int">
select count(*) from tab_haoban_group_chat where staff_id = #{staffId} and delete_flag = 0 select count(*) from tab_haoban_group_chat where staff_id = #{staffId} and delete_flag = 0 and chat_status in (0,1,2,3)
</select> </select>
<select id="listAllNeedInit" resultMap="result-map-tabHaobanGroupChat"> <select id="listAllNeedInit" resultMap="result-map-tabHaobanGroupChat">
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<if test="departmentIdList != null and departmentIdList.size() > 0"> <if test="departmentIdList != null and departmentIdList.size() > 0">
left join tab_haoban_staff_department_related c on a.staff_id = c.staff_id and c.status_flag = 1 left join tab_haoban_staff_department_related c on a.staff_id = c.staff_id and c.status_flag = 1
</if> </if>
where a.wx_enterprise_id=#{wxEnterpriseId} where a.wx_enterprise_id=#{wxEnterpriseId} and a.chat_count > 0
<if test="departmentIdList != null and departmentIdList.size() > 0"> <if test="departmentIdList != null and departmentIdList.size() > 0">
and c.department_id IN and c.department_id IN
<foreach collection="departmentIdList" item="id" index="index" open="(" close=")" separator=","> <foreach collection="departmentIdList" item="id" index="index" open="(" close=")" separator=",">
......
...@@ -36,7 +36,6 @@ public class CountDownLatchTest implements Runnable{ ...@@ -36,7 +36,6 @@ public class CountDownLatchTest implements Runnable{
long endTime = System.currentTimeMillis(); long endTime = System.currentTimeMillis();
System.out.println(Thread.currentThread().getName() + " ended at: " + endTime + ", cost: " + (endTime - startTime) + " ms."); System.out.println(Thread.currentThread().getName() + " ended at: " + endTime + ", cost: " + (endTime - startTime) + " ms.");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
} }
} }
......
...@@ -66,7 +66,6 @@ public class HandoverTest { ...@@ -66,7 +66,6 @@ public class HandoverTest {
try { try {
clientInstance.sendMessage("haobanEcmTaskDataCallback", "11111"); clientInstance.sendMessage("haobanEcmTaskDataCallback", "11111");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
} }
} }
} }
...@@ -9,6 +9,7 @@ import com.gic.haoban.manage.service.config.Config; ...@@ -9,6 +9,7 @@ import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO; import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO;
import com.gic.haoban.manage.service.service.StaffClerkRelationService; import com.gic.haoban.manage.service.service.StaffClerkRelationService;
import com.gic.haoban.manage.service.service.WxEnterpriseService; import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.service.chat.GroupChatService;
import com.gic.haoban.manage.service.service.hm.HmClerkRelationService; import com.gic.haoban.manage.service.service.hm.HmClerkRelationService;
import com.gic.haoban.manage.service.service.hm.HmQrcodeService; import com.gic.haoban.manage.service.service.hm.HmQrcodeService;
import com.gic.mq.sdk.GicMQClient; import com.gic.mq.sdk.GicMQClient;
...@@ -37,41 +38,13 @@ public class TagTest3 { ...@@ -37,41 +38,13 @@ public class TagTest3 {
@Autowired @Autowired
private Config config ; private Config config ;
@Autowired @Autowired
private HmClerkRelationService hmClerkRelationService ; private GroupChatService groupChatService ;
@Autowired @Autowired
private ExternalClerkRelatedApiService externalClerkRelatedApiService ; private ExternalClerkRelatedApiService externalClerkRelatedApiService ;
@Test @Test
public void tt() throws InterruptedException { public void tt() throws InterruptedException {
this.groupChatService.initStaffGroupChat("ef5f5650bc744413b817d3429271085c") ;
// String wxEnterpriseId, String enterpriseId, QywxTagInfoDTO infoDTO, List<QywxTagItemDTO> items
String wxEnterpriseId = "ca66a01b79474c40b3e7c7f93daf1a3b" ;
String enterpriseId = "ff8080815dacd3a2015dacd3ef5c0000" ;
QywxTagInfoDTO infoDTO = new QywxTagInfoDTO() ;
infoDTO.setWxEnterpriseId(wxEnterpriseId);
infoDTO.setMemberTagId("5b1db406e21748e88737a4cbe194d24f");
List<QywxTagItemDTO> items = new ArrayList<>() ;
QywxTagItemDTO mid = new QywxTagItemDTO();
mid.setMemberTagItemId("0f08ddb354654638bc8f71ce39fce688");
mid.setQywxTagName("企微1");
items.add(mid) ;
QywxTagItemDTO mid2 = new QywxTagItemDTO();
mid2.setMemberTagItemId("1e3f324af76842a0a3b7697f95419414");
mid2.setQywxTagName("企微2");
items.add(mid2) ;
QywxTagItemDTO mid3 = new QywxTagItemDTO();
mid3.setMemberTagItemId("qw5");
mid3.setQywxTagKey("qw5");
mid3.setQywxTagName("企微5");
items.add(mid3) ;
this.qywxTagApiService.syncTagToQywx(wxEnterpriseId,enterpriseId,infoDTO,items) ;
} }
} }
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.Date;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import cn.hutool.cache.CacheUtil;
import cn.hutool.cache.impl.TimedCache;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.Week;
import cn.hutool.crypto.digest.MD5;
import com.alibaba.fastjson.JSONObject;
import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import com.gic.haoban.manage.api.enums.content.MaterialReportType;
import com.gic.haoban.manage.api.util.notify.NoticeMessageUtil;
import com.gic.haoban.manage.service.entity.TabHaobanPreDealLog;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.junit.Test;
public class test {
private static final TimedCache<String, TestQo> cache = CacheUtil.newTimedCache(3000L);
public static void main(String[] args) throws Exception {
// pages/hb/material/material-root/material-root?contentMaterialId=517690074188505121&storeId=ff8080818499a5f301849ceb9f870035&channelSource=5&clerkId=bcbfff6c8e2e40aaac795a99d0dde2aa
String refUrl = "pages/hb/material/material-root/material-root?contentMaterialId=517690074188505121&storeId=ff8080818499a5f301849ceb9f870035&channelSource=5&clerkId=bcbfff6c8e2e40aaac795a99d0dde2aaADASDD";
int indexOf = StringUtils.indexOf(refUrl, "clerkId=");
if (indexOf != -1) {
String clerkId = StringUtils.substring(refUrl, indexOf + 8, indexOf + 40);
System.out.println(clerkId);
}
System.out.println(DateUtil.year(new Date()) + "-" + DateUtil.month(DateUtil.lastMonth()));
System.out.println(DateUtil.year(new Date()) + "" + DateUtil.weekOfYear(DateUtil.lastWeek()));
System.out.println("-----");
int weekOfYear = DateUtil.weekOfYear(DateUtil.lastWeek());
System.out.println(DateUtil.thisYear() + "-" + StringUtils.leftPad(weekOfYear + "", 2, "0"));
// 月报
int month = DateUtil.lastMonth().month() + 1;
System.out.println(DateUtil.thisYear() + "-" + StringUtils.leftPad(month + "", 2, "0"));
System.out.println("---------------------");
DateTime dateTime = DateUtil.parse("2023-01-01", "yyyy-MM-dd");
System.out.println(DateUtil.weekOfYear(dateTime));
System.out.println(DateUtil.beginOfWeek(DateUtil.lastWeek()).toString("yyyy-MM-dd"));
System.out.println(DateUtil.offset(DateUtil.lastWeek(), DateField.DAY_OF_WEEK, DateUtil.weekOfYear(DateUtil.lastWeek())));
System.out.println(DateUtil.offsetWeek(new Date(), DateUtil.weekOfYear(DateUtil.lastWeek())));
System.out.println(DateUtil.offsetWeek(new Date(), DateUtil.weekOfYear(DateUtil.lastWeek())));
System.out.println(DateUtil.offsetWeek(new Date(), DateUtil.weekOfYear(DateUtil.lastWeek())));
System.out.println(DateUtil.beginOfMonth(DateUtil.lastMonth()).toString("yyyy-MM-dd"));
}
@Test
public void urlTest(){
JSONObject params = new JSONObject();
//params.put("clerkId", "300b60c7f8874ca2b9cc696ad6b6a480");
String bizDate = DateUtil.beginOfWeek(DateUtil.lastWeek()).toString("yyyy-MM-dd");
params.put("k", "ff8080816e216c04016e34294282004a_1_" + bizDate);
// params.put("t", 1);
// params.put("d", "04");
String s = params.toJSONString();
String s1 = NoticeMessageUtil.buildMiniAppUrl(NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY_MONTH, s);
System.out.println("/pages/route/index?pageType=hbapp_material_report&data=".length());
System.out.println(s1);
System.out.println(s1.length());
}
@Test
public void timeTest(){
String key = "czMYwiF1VNyNBn2dOS0Aie2vL8yo0W1F" + "bcbfff6c8e2e40aaac795a99d0dde2aa" + "521005558220738651" + "ff8080818147efc8018148d1759903c8";
System.out.println(MD5.create().digestHex(key));
}
}
...@@ -244,7 +244,7 @@ public class ApplicationController extends WebBaseController { ...@@ -244,7 +244,7 @@ public class ApplicationController extends WebBaseController {
try { try {
response.sendRedirect(redirectUri); response.sendRedirect(redirectUri);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); log.info("异常",e);
} }
} }
......
...@@ -103,7 +103,7 @@ public class LoginController extends WebBaseController { ...@@ -103,7 +103,7 @@ public class LoginController extends WebBaseController {
try { try {
response.sendRedirect(host+"/haoban-3/#/gic-error?errorCode="+code); response.sendRedirect(host+"/haoban-3/#/gic-error?errorCode="+code);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); logger.info("异常",e);
} }
return this.fail(this.errMessage(code)); return this.fail(this.errMessage(code));
} }
...@@ -116,7 +116,7 @@ public class LoginController extends WebBaseController { ...@@ -116,7 +116,7 @@ public class LoginController extends WebBaseController {
try { try {
response.sendRedirect(host+"/haoban-3/#/gic-error?errorCode="+code); response.sendRedirect(host+"/haoban-3/#/gic-error?errorCode="+code);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); logger.info("异常",e);
} }
return this.fail(this.errMessage(code)); return this.fail(this.errMessage(code));
} }
...@@ -127,7 +127,7 @@ public class LoginController extends WebBaseController { ...@@ -127,7 +127,7 @@ public class LoginController extends WebBaseController {
try { try {
response.sendRedirect(host+"/haoban-3/#/gic-error?errorCode="+code); response.sendRedirect(host+"/haoban-3/#/gic-error?errorCode="+code);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); logger.info("异常",e);
} }
return this.fail(this.errMessage(code)); return this.fail(this.errMessage(code));
} }
...@@ -146,7 +146,7 @@ public class LoginController extends WebBaseController { ...@@ -146,7 +146,7 @@ public class LoginController extends WebBaseController {
try { try {
response.sendRedirect(host+"/haoban-3/#/gic-error?errorCode="+code); response.sendRedirect(host+"/haoban-3/#/gic-error?errorCode="+code);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); logger.info("异常",e);
} }
return this.fail(this.errMessage(code)); return this.fail(this.errMessage(code));
} }
...@@ -157,7 +157,7 @@ public class LoginController extends WebBaseController { ...@@ -157,7 +157,7 @@ public class LoginController extends WebBaseController {
try { try {
response.sendRedirect(host+"/haoban-3/#/gic-error?errorCode="+code); response.sendRedirect(host+"/haoban-3/#/gic-error?errorCode="+code);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); logger.info("异常",e);
} }
return this.fail(this.errMessage(code)); return this.fail(this.errMessage(code));
} }
...@@ -169,7 +169,7 @@ public class LoginController extends WebBaseController { ...@@ -169,7 +169,7 @@ public class LoginController extends WebBaseController {
try { try {
response.sendRedirect(host+"/haoban-3/#/gic-error?errorCode="+code); response.sendRedirect(host+"/haoban-3/#/gic-error?errorCode="+code);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); logger.info("异常",e);
} }
return this.fail(this.errMessage(code)); return this.fail(this.errMessage(code));
} }
...@@ -189,7 +189,7 @@ public class LoginController extends WebBaseController { ...@@ -189,7 +189,7 @@ public class LoginController extends WebBaseController {
try { try {
response.sendRedirect(host+"/haoban-3/#/gic-error?errorCode="+code); response.sendRedirect(host+"/haoban-3/#/gic-error?errorCode="+code);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); logger.info("异常",e);
} }
return this.fail(this.errMessage(code)); return this.fail(this.errMessage(code));
} else { } else {
...@@ -314,7 +314,7 @@ public class LoginController extends WebBaseController { ...@@ -314,7 +314,7 @@ public class LoginController extends WebBaseController {
try { try {
response.sendRedirect(gicHost); response.sendRedirect(gicHost);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); logger.info("异常",e);
} }
return null ; return null ;
} }
...@@ -406,7 +406,7 @@ public class LoginController extends WebBaseController { ...@@ -406,7 +406,7 @@ public class LoginController extends WebBaseController {
response.sendRedirect(redirectUri); response.sendRedirect(redirectUri);
response.setHeader("token", token); response.setHeader("token", token);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); logger.info("异常",e);
} }
return null; return null;
} }
......
...@@ -134,7 +134,7 @@ public class MaterialController extends WebBaseController { ...@@ -134,7 +134,7 @@ public class MaterialController extends WebBaseController {
materialDTO.setStaffName(login.getClerkName()); materialDTO.setStaffName(login.getClerkName());
String msg = this.checkEmoji(materialDTO.getMaterialContent()) ; String msg = this.checkEmoji(materialDTO.getMaterialContent()) ;
if(null != msg) { if(null != msg) {
return this.fail(msg) ; // return this.fail(msg) ;
} }
String materialTitle = materialDTO.getMaterialTitle(); String materialTitle = materialDTO.getMaterialTitle();
String categoryId = materialDTO.getCategoryId(); String categoryId = materialDTO.getCategoryId();
...@@ -197,7 +197,7 @@ public class MaterialController extends WebBaseController { ...@@ -197,7 +197,7 @@ public class MaterialController extends WebBaseController {
String materialId = materialDTO.getMaterialId(); String materialId = materialDTO.getMaterialId();
String msg = this.checkEmoji(materialDTO.getMaterialContent()) ; String msg = this.checkEmoji(materialDTO.getMaterialContent()) ;
if(null != msg) { if(null != msg) {
return this.fail(msg) ; // return this.fail(msg) ;
} }
MaterialDTO dto = materialApiService.selectMaterialById(materialId); MaterialDTO dto = materialApiService.selectMaterialById(materialId);
if (dto == null) { if (dto == null) {
...@@ -287,8 +287,4 @@ public class MaterialController extends WebBaseController { ...@@ -287,8 +287,4 @@ public class MaterialController extends WebBaseController {
} }
return null ; return null ;
} }
public static void main(String[] args) {
System.out.println(EmojiFilterUtil.filterEmoji("!@#~!@#¥%……&*&)()——+——+{}“”:?》") );;
}
} }
...@@ -91,7 +91,6 @@ public class MemberController { ...@@ -91,7 +91,6 @@ public class MemberController {
ESResponseQueryCount esCount = esApiService.queryDataCount(search); ESResponseQueryCount esCount = esApiService.queryDataCount(search);
count = (int) esCount.getRes(); count = (int) esCount.getRes();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
} }
return RestResponse.successResult(count); return RestResponse.successResult(count);
} }
......
...@@ -598,7 +598,7 @@ public class StaffController extends WebBaseController { ...@@ -598,7 +598,7 @@ public class StaffController extends WebBaseController {
try { try {
ExcelUtils.xls(response, request, fileName, voList, fileList, titleList); ExcelUtils.xls(response, request, fileName, voList, fileList, titleList);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.info("异常",e);
logger.info("导出失败"); logger.info("导出失败");
} }
return null; return null;
......
...@@ -520,7 +520,7 @@ public class TestController extends WebBaseController { ...@@ -520,7 +520,7 @@ public class TestController extends WebBaseController {
url = url+"/api-qywx-self/qywx/self-post?ip=" + ip + "&url=" url = url+"/api-qywx-self/qywx/self-post?ip=" + ip + "&url="
+ URLEncoder.encode(selfUrl, "utf-8"); + URLEncoder.encode(selfUrl, "utf-8");
Map<String, Object> map1 = httpsRequest(url, "GET", null); Map<String, Object> map1 = httpsRequest(url, "GET", null);
System.out.println(JSONObject.toJSONString(map1)); logger.info(JSONObject.toJSONString(map1));
String errcode = map1.get("errcode").toString(); String errcode = map1.get("errcode").toString();
if (!"0".equals(errcode)) { if (!"0".equals(errcode)) {
return map1; return map1;
...@@ -530,11 +530,11 @@ public class TestController extends WebBaseController { ...@@ -530,11 +530,11 @@ public class TestController extends WebBaseController {
for(int i=0;i<arr.size();i++) { for(int i=0;i<arr.size();i++) {
JSONObject obj = arr.getJSONObject(i) ; JSONObject obj = arr.getJSONObject(i) ;
// System.out.println(obj.toJSONString()); // logger.info(obj.toJSONString());
String groupName = obj.getString("group_name") ; String groupName = obj.getString("group_name") ;
String groupId = obj.getString("group_id") ; String groupId = obj.getString("group_id") ;
String where = " where qywx_group_name ='"+groupName+"' and wx_enterprise_id='"+wxEnterpriseId+"' and status_flag = 1 ; " ; String where = " where qywx_group_name ='"+groupName+"' and wx_enterprise_id='"+wxEnterpriseId+"' and status_flag = 1 ; " ;
//System.out.println("select * from tab_haoban_qywx_tag " + where ); //logger.info("select * from tab_haoban_qywx_tag " + where );
String str = ("update tab_haoban_qywx_tag set qywx_group_key = '"+groupId+"'" + where ); String str = ("update tab_haoban_qywx_tag set qywx_group_key = '"+groupId+"'" + where );
list.add(str) ; list.add(str) ;
} }
...@@ -552,7 +552,7 @@ public class TestController extends WebBaseController { ...@@ -552,7 +552,7 @@ public class TestController extends WebBaseController {
String tagName = tagObj.getString("name") ; String tagName = tagObj.getString("name") ;
String tagId = tagObj.getString("id") ; String tagId = tagObj.getString("id") ;
String tagWhere = " where qywx_group_key = '"+groupId+"' and qywx_tag_name ='"+tagName+"' and wx_enterprise_id='"+wxEnterpriseId+"' and status_flag = 1 ; " ; String tagWhere = " where qywx_group_key = '"+groupId+"' and qywx_tag_name ='"+tagName+"' and wx_enterprise_id='"+wxEnterpriseId+"' and status_flag = 1 ; " ;
//System.out.println("select * from tab_haoban_qywx_tag_item " + tagWhere ); //logger.info("select * from tab_haoban_qywx_tag_item " + tagWhere );
list.add("update tab_haoban_qywx_tag_item set qywx_tag_key = '"+tagId+"'" + tagWhere ); list.add("update tab_haoban_qywx_tag_item set qywx_tag_key = '"+tagId+"'" + tagWhere );
} }
} }
...@@ -597,9 +597,9 @@ public class TestController extends WebBaseController { ...@@ -597,9 +597,9 @@ public class TestController extends WebBaseController {
logger.info(JSON.toJSONString(map)); logger.info(JSON.toJSONString(map));
return map; return map;
} catch (ConnectException ce) { } catch (ConnectException ce) {
System.out.println(ce); logger.info("异常",ce);
} catch (Exception e) { } catch (Exception e) {
System.out.println(e); logger.info("异常",e);
} }
return null; return null;
} }
...@@ -636,9 +636,9 @@ public class TestController extends WebBaseController { ...@@ -636,9 +636,9 @@ public class TestController extends WebBaseController {
conn.disconnect(); conn.disconnect();
return buffer.toString(); return buffer.toString();
} catch (ConnectException ce) { } catch (ConnectException ce) {
ce.printStackTrace(); logger.info("异常",ce);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.info("异常",e);
} }
return null; return null;
} }
......
...@@ -208,7 +208,7 @@ public class GroupChatController { ...@@ -208,7 +208,7 @@ public class GroupChatController {
try { try {
ExcelUtils.xls(response, request, fileName, voList, fileList, titleList); ExcelUtils.xls(response, request, fileName, voList, fileList, titleList);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.info("异常",e);
logger.info("导出失败"); logger.info("导出失败");
} }
return RestResponse.successResult(true); return RestResponse.successResult(true);
...@@ -323,7 +323,7 @@ public class GroupChatController { ...@@ -323,7 +323,7 @@ public class GroupChatController {
try { try {
ExcelUtils.xls(response, request, fileName, page.getResult().getResult(), fileList, titleList); ExcelUtils.xls(response, request, fileName, page.getResult().getResult(), fileList, titleList);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.info("异常",e);
logger.info("导出失败"); logger.info("导出失败");
} }
return RestResponse.successResult(true); return RestResponse.successResult(true);
......
...@@ -489,7 +489,7 @@ public class GroupChatHmController { ...@@ -489,7 +489,7 @@ public class GroupChatHmController {
downloadReportService.updateDownloadReport(reportId, downloadReportDTO); downloadReportService.updateDownloadReport(reportId, downloadReportDTO);
tempFile.delete(); tempFile.delete();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.info("异常",e);
} }
} }
}); });
......
...@@ -72,7 +72,7 @@ public class HbLogRecordController { ...@@ -72,7 +72,7 @@ public class HbLogRecordController {
Date endDateD = DateUtils.parseDate(endDate, "yyyy-MM-dd HH:mm:ss"); Date endDateD = DateUtils.parseDate(endDate, "yyyy-MM-dd HH:mm:ss");
queryWrapper.between(OptRecordLogHaoban::getCreateTime,startDateD,endDateD); queryWrapper.between(OptRecordLogHaoban::getCreateTime,startDateD,endDateD);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); LOGGER.info("异常",e);
} }
} }
if(null == loginUser || StringUtils.isBlank(loginUser.getOperationUserName())) { if(null == loginUser || StringUtils.isBlank(loginUser.getOperationUserName())) {
......
package com.gic.haoban.manage.web.utils; package com.gic.haoban.manage.web.utils;
import com.gic.haoban.manage.web.qo.ExcelSheet; import com.gic.haoban.manage.web.qo.ExcelSheet;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.hssf.usermodel.*; import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment; import org.apache.poi.ss.usermodel.HorizontalAlignment;
...@@ -17,6 +19,7 @@ import java.util.List; ...@@ -17,6 +19,7 @@ import java.util.List;
* @Date: 2023/9/12 11:14 * @Date: 2023/9/12 11:14
*/ */
public class ExportSheetUtil { public class ExportSheetUtil {
private static Logger logger = LogManager.getLogger(ExportSheetUtil.class);
/** /**
* 拆解并导出多重Excel * 拆解并导出多重Excel
*/ */
...@@ -75,7 +78,7 @@ public class ExportSheetUtil { ...@@ -75,7 +78,7 @@ public class ExportSheetUtil {
response.flushBuffer(); response.flushBuffer();
wb.write(response.getOutputStream()); wb.write(response.getOutputStream());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.info("异常",e);
} }
} }
} }
...@@ -202,6 +202,15 @@ public class WxEnterpriseInfoController extends WebBaseController { ...@@ -202,6 +202,15 @@ public class WxEnterpriseInfoController extends WebBaseController {
return response; return response;
} }
// 特殊处理
Object shachi = RedisUtil.getCache("haoban-test-account-shachi") ;
if(null != shachi && shachi.toString().contains(corpId)) {
HaobanResponse response = new HaobanResponse();
response.setErrorCode(-888);
response.setMessage("已无可用许可,购买后可继续使用");
return response;
}
StaffDTO loginStaff = null; StaffDTO loginStaff = null;
if (wxEnterprise != null) { if (wxEnterprise != null) {
loginStaff = staffApiService.getByUserIdAndReflushWhenNoPhone(userId, wxEnterprise.getWxEnterpriseId()); loginStaff = staffApiService.getByUserIdAndReflushWhenNoPhone(userId, wxEnterprise.getWxEnterpriseId());
......
package com.gic.haoban.manage.web.utils;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader;
import java.io.Writer;
public class IOUtils {
/**
* 6.编写一个程序,将D:\\java目录下的所有.java文件复制到D:\\jad目录下,
* 并将原来文件的扩展名从.java改为.jad。
*/
// public static class FileCopy {
// public static void main(String[] args) {
//
// File oriFile = new File("D:\\java");//原文件目录
// //file.exists():判断文件目录是否存在
// //file.isDirectory():判断文件目录是否是一个目录
// if(!(oriFile.exists() && oriFile.isDirectory())){
// System.out.println("文件目录不存在!");
// }
//
// File[] files = oriFile.listFiles(
// new FilenameFilter(){ //文件名称过滤器
// public boolean accept(File file, String name) {
// return name.endsWith(".java");
// }
// }
// );
// System.out.println(files.length);//原文件个数
//
// File objFile = new File("D:\\jad");//目标文件目录
// //objFile.exists():判断目标文件目录是否存在
// //objFile.mkdir():创建目标文件目录
// if(!objFile.exists()){
// objFile.mkdir();
// }
//
// //copyByte(files,objFile);
// copyChar(files,objFile);
// System.out.println("写入完成!");
//
// }
//使用字节流进行文件复制(字节缓冲流可以不使用,使用其目的主要是为了提高性能)
private static void copyByte(File[] files,File objFile){
InputStream inputStream = null;
OutputStream outputStream = null;
BufferedInputStream bufferedInputStream = null;
BufferedOutputStream bufferedOutputStream = null;
for(File f : files){
//替换文件后缀
String objFileName = f.getName().replaceAll("\\.ACC$", ".mp3");
try {
inputStream = new FileInputStream(f);
outputStream = new FileOutputStream(new File(objFile,objFileName));
bufferedInputStream = new BufferedInputStream(inputStream);
bufferedOutputStream = new BufferedOutputStream(outputStream);
int c = 0;
while((c = bufferedInputStream.read()) != -1){
bufferedOutputStream.write(c);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
bufferedOutputStream.close();
bufferedInputStream.close();
outputStream.close();
inputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
//使用字符流进行文件复制(字符缓冲流可以不使用,使用其目的主要是为了提高性能)
public static void copyChar(File file,File objFile){
Reader reader = null;
Writer writer = null;
BufferedReader bufferedReader = null;
BufferedWriter bufferedWriter = null;
//替换文件后缀
String objFileName = file.getName().replaceAll("\\.AAC$", ".mp3");
try {
reader = new FileReader(file);
writer = new FileWriter(new File(objFile,objFileName));
bufferedReader = new BufferedReader(reader);
bufferedWriter = new BufferedWriter(writer);
int c = 0;
while ((c=bufferedReader.read()) != -1) {
bufferedWriter.write(c);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
bufferedWriter.close();
bufferedReader.close();
writer.close();
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
...@@ -32,9 +32,6 @@ public class DataTargetHttpUtils { ...@@ -32,9 +32,6 @@ public class DataTargetHttpUtils {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("enterpriseId", "ff8080815dacd3a2015dacd3ef5c0000"); jsonObject.put("enterpriseId", "ff8080815dacd3a2015dacd3ef5c0000");
//Map<String, Object> res = http(getParamNoPage(jsonObject).toJSONString(), "data_mbr_target_overview_targetActual"); //Map<String, Object> res = http(getParamNoPage(jsonObject).toJSONString(), "data_mbr_target_overview_targetActual");
//System.out.println(JSON.toJSONString(responseOfOne(res, null)));
System.out.println("年模板".equals("年模板"));
System.out.println();
} }
public static JSONObject getCommonParam(String enterpriseId, String storeId, String startTime, String endTime) { public static JSONObject getCommonParam(String enterpriseId, String storeId, String startTime, String endTime) {
......
...@@ -32,7 +32,6 @@ public class StoreTargetConfigHttpUtils extends HttpClient{ ...@@ -32,7 +32,6 @@ public class StoreTargetConfigHttpUtils extends HttpClient{
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("enterpriseId", "ff8080815dacd3a2015dacd3ef5c0000"); jsonObject.put("enterpriseId", "ff8080815dacd3a2015dacd3ef5c0000");
//Map<String, Object> res = http(getParamNoPage(jsonObject).toJSONString(), "data_mbr_target_overview_targetActual"); //Map<String, Object> res = http(getParamNoPage(jsonObject).toJSONString(), "data_mbr_target_overview_targetActual");
//System.out.println(JSON.toJSONString(responseOfOne(res, null)));
} }
......
...@@ -41,15 +41,4 @@ public class ClerkEditInfoVO { ...@@ -41,15 +41,4 @@ public class ClerkEditInfoVO {
return editClerkFlag | addClerkFlag | delClerkFlag ; return editClerkFlag | addClerkFlag | delClerkFlag ;
} }
public static void main(String[] args) {
ClerkEditInfoVO vo = new ClerkEditInfoVO();
vo.setAddClerkFlag(1);
vo.setDelClerkFlag(0);
vo.setEditClerkFlag(0);
System.out.println(getValue(vo));
System.out.println(JSON.toJSONString(info(getValue(vo))));
}
} }
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