Commit 03e28bcb by 徐高华

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

# Conflicts:
#	haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DealSyncOperationApiServiceImpl.java
#	haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/util/DrawImageUtils.java
#	haoban-manage3-service/src/test/java/test.java
#	haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/logrecord/HbLogRecordController.java
#	haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/utils/target/DataTargetHttpUtils.java
parents fb54dd46 b704008c
......@@ -40,16 +40,4 @@ public class ClerkEditInfoDTO {
int delClerkFlag = vo.getDelClerkFlag() << 2;
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 {
try {
clientInstance.sendBatchMessages("qywxTagSyncDeal", mqList);
} catch (Exception e) {
e.printStackTrace();
logger.info("批量异常:{}", e);
}
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 {
*/
public ServiceResponse<Void> initStaffGroupChat(String staffId) ;
public void repairOwner() ;
}
\ No newline at end of file
......@@ -12,6 +12,7 @@ import java.util.stream.Collectors;
import com.gic.enterprise.api.dto.StoreDTO;
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.lang.StringUtils;
import org.slf4j.Logger;
......@@ -126,6 +127,8 @@ public class GroupChatServiceImpl implements GroupChatService {
private GroupChatInitMapper groupChatInitMapper;
@Autowired
private StoreService storeService ;
@Autowired
private WxEnterpriseMapper wxEnterpriseMapper ;
private static GicMQClient mqClient = GICMQClientUtil.getClientInstance();
......@@ -1215,4 +1218,27 @@ public class GroupChatServiceImpl implements GroupChatService {
this.syncGroupChatList(qwDTO, Arrays.asList(userId), null, true);
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 {
}
this.wxUserAddLogMapper.insert(entity);
}catch(Exception e) {
e.printStackTrace();
log.info("异常",e);
}
}
......
......@@ -318,7 +318,6 @@ public class HandoverServiceImpl implements HandoverService {
handoverExternalMapper.updateByPrimaryKeySelective(handoverExternal);
} catch (Exception e) {
logger.info("exception:{},{}", JSONObject.toJSONString(dto), e);
e.printStackTrace();
}
});
return true;
......
......@@ -287,7 +287,6 @@ public class MaterialServiceImpl implements MaterialService {
url+= "?imageView2/2/w/1440/h/1080" ;
}
logger.info("url={}",url);
System.out.println(JSON.toJSONString(url));
}
public List<String> getImageMediaId(String wxEnterpriseId, List<ContentMaterialDTO> imageList, int mediaType) {
......
......@@ -58,7 +58,7 @@ public class StaffClerkBindLogServiceImpl implements StaffClerkBindLogService {
logger.info("绑定的mq日志:{}", ret);
clientInstance.sendMessage(STAFF_LOG_MQ, ret);
} catch (Exception e) {
e.printStackTrace();
logger.info("异常",e);
}
}
......@@ -80,7 +80,7 @@ public class StaffClerkBindLogServiceImpl implements StaffClerkBindLogService {
logger.info("绑定的mq日志:{},{}", optStaffId, relationIds);
clientInstance.sendBatchMessages(STAFF_LOG_MQ, ret);
} catch (Exception e) {
e.printStackTrace();
logger.info("异常",e);
}
}
......
......@@ -735,8 +735,7 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
logger.info("放入mq={},{}",mqName,JSON.toJSONString(listRet));
clientInstance.sendBatchMessages(mqName, listRet, 10);
} catch (Exception e) {
logger.info("发送失败:{},{}", taskId, JSONObject.toJSONString(listRet));
e.printStackTrace();
logger.info("发送失败:{},{}", taskId, JSONObject.toJSONString(listRet),e);
}
}
......
......@@ -187,7 +187,6 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ
List<QywxTransferCustomerInfoDTO> customerResults = customerDTO.getCustomer();
handoverService.dealResult(wxEnterpriseId, dto.getHandoverTransferId(), customerResults);
} catch (Exception e) {
e.printStackTrace();
logger.info("处理异常:{},{}", JSONObject.toJSONString(dto), e);
}
});
......
......@@ -62,8 +62,7 @@ public class HaobanCommonMQApiServiceImpl implements HaobanCommonMQApiService {
mqClient.sendCommonMessage("haobanCommonRouter", message,
"com.gic.haoban.manage.api.service.HaobanCommonMQApiService", "commonHandler");
} catch (Exception e) {
log.error("发送MQ异常");
e.printStackTrace();
log.error("发送MQ异常",e);
}
}
......@@ -74,8 +73,7 @@ public class HaobanCommonMQApiServiceImpl implements HaobanCommonMQApiService {
try {
mqClient.sendMessage("haobanDelayMQ", message, delay);
} catch (Exception e) {
log.error("发送MQ异常");
e.printStackTrace();
log.error("发送MQ异常",e);
}
}
......
......@@ -40,7 +40,7 @@ public class TestServiceImpl implements TestApiService {
try {
Thread.sleep(expireTime);
} catch (InterruptedException e) {
e.printStackTrace();
logger.info("异常",e);
}
}
logger.info("测试-end:{}", id);
......
......@@ -380,8 +380,7 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
try {
clientInstance.sendMessage(FLUSH_HAOBAN_BIND_STORE_MQ, str, DELAY_TIME);
} catch (Exception e) {
e.printStackTrace();
logger.info("发送消息异常:{}", str);
logger.info("发送消息异常:{}", str,e);
}
} else {
logger.info("最近已有在刷新,无需重复刷新:{}", JSONObject.toJSONString(mqDTO));
......@@ -653,7 +652,6 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
detailDTO.getRelations().add(groupInfoDTO);
this.wxEnterpriseBind(detailDTO);
} catch (Exception e) {
e.printStackTrace();
logger.info("企业历史初始化失败:{}, {}", needDealEnt.getEnterpriseId(), e);
RedisUtil.setCache("init-fail-enterprise:" + needDealEnt.getWxEnterpriseRelatedId(), needDealEnt);
}
......
......@@ -142,7 +142,6 @@ public class FriendClerkSyncNewOperation implements BaseSyncOperation {
//成功更新状态
dealSuccess(dealParamMqDTO.getTaskId(), dealParamMqDTO.getData(), dataPre.getEnterpriseId(), dataPre.getWxEnterpriseId());
} catch (Exception e) {
e.printStackTrace();
logger.info("同步失败:{},{}", JSONObject.toJSONString(dataPre), e);
reason = "成员好友处理异常";
dealFlag = false;
......@@ -194,7 +193,6 @@ public class FriendClerkSyncNewOperation implements BaseSyncOperation {
clientInstance.sendBatchMessages("departmentSyncDealMq", ret);
} catch (Exception e) {
logger.info("发送失败:{},{}", taskId);
e.printStackTrace();
}
}
......
......@@ -111,7 +111,6 @@ public class FriendSyncNewOperation implements BaseSyncOperation {
dealFlag = tryAgainToMq(dataPre);
reason = "接口重试超出限制";
} catch (Exception e) {
e.printStackTrace();
logger.info("同步失败:{},{}", JSONObject.toJSONString(dataPre), e);
reason = "第三方好友处理异常";
dealFlag = false;
......@@ -185,7 +184,6 @@ public class FriendSyncNewOperation implements BaseSyncOperation {
clientInstance.sendBatchMessages("departmentSyncDealMq", ret);
} catch (Exception e) {
logger.info("发送失败:{}", taskId, e);
e.printStackTrace();
}
}
}
......@@ -99,7 +99,6 @@ public class SelfFriendSyncNewOperation implements BaseSyncOperation {
dealFlag = tryAgainToMq(dataPre);
reason = "重试次数过多";
} catch (Exception e) {
e.printStackTrace();
logger.info("同步失败:{},{}", JSONObject.toJSONString(dataPre), e);
reason = "自建应用好友处理异常";
dealFlag = false;
......@@ -171,8 +170,7 @@ public class SelfFriendSyncNewOperation implements BaseSyncOperation {
Log.info("发送队列SelfFriendSyncNewOperation={}",JSON.toJSONString(ret));
clientInstance.sendBatchMessages("departmentSyncDealMq", ret);
} catch (Exception e) {
logger.info("发送失败:{},{}", taskId);
e.printStackTrace();
logger.info("发送失败:{},{}", taskId,e);
}
}
}
......@@ -80,7 +80,6 @@ public class FriendMemberTagSyncOperation implements BaseSyncOperation {
} catch (Exception e) {
resultFlag = false;
reason = "处理异常:";
e.printStackTrace();
logger.info("处理异常:{}", e);
} finally {
if (!resultFlag) {
......
......@@ -89,7 +89,6 @@ public class FriendTagSyncOperation implements BaseSyncOperation {
} catch (Exception e) {
resultFlag = false;
reason = "处理异常:";
e.printStackTrace();
logger.info("处理异常:{}", e);
} finally {
if (!resultFlag) {
......@@ -214,8 +213,7 @@ public class FriendTagSyncOperation implements BaseSyncOperation {
try {
clientInstance.sendMessage("departmentSyncDealMq", JSONObject.toJSONString(dealParamMqDTO));
} catch (Exception e) {
logger.info("发送失败:{},{}", taskId, relationId);
e.printStackTrace();
logger.info("发送失败:{},{}", taskId, relationId,e);
}
});
}
......
......@@ -33,7 +33,6 @@ public class CommonUtil {
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") ;
System.out.println(1);
}
}
\ No newline at end of file
......@@ -244,53 +244,6 @@ public class DrawImageUtils {
String qrcodeUrl = "https://gicinner-1251519181.cos.ap-shanghai.myqcloud.com/image/material_content-80819999f96f448d9fcccb5ac86e6c37.png";
String url = "https://jhdm-1251519181.cos.ap-shanghai.myqcloud.com/image/material_content-7c3bc8061ffb4e2694c0e288a1ce176b.jpeg?imageView2/format/jpg/q/50";
//String url = "https://newdmwltest-1251519181.cos.ap-shanghai.myqcloud.com/image/material_content-bd89447576b5438d8045def2da2c4c0f.jpg?imageView2/format/jpg/q/50";
System.setProperty("gic.module.name", "haoban-manage3-service");
System.out.println(DrawImageUtils.addWaterNew("jhdm", url, qrcodeUrl));
// ByteArrayOutputStream byteArrayOutputStream = null;
// InputStream inputStream = null;
// try {
// URL openUrl = new URL(qrcodeUrl);
// inputStream = openUrl.openStream();
// byteArrayOutputStream = cloneInputStream(inputStream);
// }catch (Exception ex) {
// log.info("获取二维码流对象异常 qrCodeUrl:{}", ex);
// }
// if (byteArrayOutputStream == null) {
// return;
// }
// ArrayList<Object> objects = new ArrayList<>();
// for (int i = 0; i < 10; i++) {
// objects.add(i);
// }
// ByteArrayOutputStream finalByteArrayOutputStream = byteArrayOutputStream;
// InputStream finalInputStream = inputStream;
// List<String> collect = objects.stream()
// .map(item -> DrawImageUtils.addWaterNew("jhdm", url, qrcodeUrl))
// .collect(Collectors.toList());
// System.out.println(JSON.toJSONString(collect));
}
/**
* inputStrean 拷贝
* @param input
* @return
*/
public static ByteArrayOutputStream cloneInputStream(InputStream input) {
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int len;
while ((len = input.read(buffer)) > -1) {
baos.write(buffer, 0, len);
}
baos.flush();
return baos;
} catch (Exception ex) {
log.info("stream 拷贝异常", ex);
return null;
}
}
//System.setProperty("gic.module.name", "haoban-manage3-service");
}
}
......@@ -36,7 +36,6 @@ public class CountDownLatchTest implements Runnable{
long endTime = System.currentTimeMillis();
System.out.println(Thread.currentThread().getName() + " ended at: " + endTime + ", cost: " + (endTime - startTime) + " ms.");
} catch (Exception e) {
e.printStackTrace();
}
}
......
......@@ -66,7 +66,6 @@ public class HandoverTest {
try {
clientInstance.sendMessage("haobanEcmTaskDataCallback", "11111");
} catch (Exception e) {
e.printStackTrace();
}
}
}
......@@ -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.service.StaffClerkRelationService;
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.HmQrcodeService;
import com.gic.mq.sdk.GicMQClient;
......@@ -37,41 +38,13 @@ public class TagTest3 {
@Autowired
private Config config ;
@Autowired
private HmClerkRelationService hmClerkRelationService ;
private GroupChatService groupChatService ;
@Autowired
private ExternalClerkRelatedApiService externalClerkRelatedApiService ;
@Test
public void tt() throws InterruptedException {
// 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) ;
this.groupChatService.initStaffGroupChat("ef5f5650bc744413b817d3429271085c") ;
}
}
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.JSON;
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 {
@Test
public void test(){
String data = "['ff8080817af2def7017b146da4d212c4',\n" +
"\n" +
"'ff808081767141ce01768e4351db5241',\n" +
"\n" +
"'ff808081720968af01720bd868a50667',\n" +
"\n" +
"'ff80808177da342c01784827f1286015',\n" +
"\n" +
"'ff80808170c508860170ce043892397d',\n" +
"\n" +
"'ff8080816b41649c016b4438805f0143',\n" +
"\n" +
"'ff80808180b3c54a0180bc3df3bb4bca',\n" +
"\n" +
"'ff8080815cac81ed015ce2faba3e6c32',\n" +
"\n" +
"'ff8080816106031401612afd63dc5243',\n" +
"\n" +
"'ff80808176ce0c7c0176f9baad6f046a',\n" +
"\n" +
"'ff8080817d95d32f017d99a06e294648',\n" +
"\n" +
"'ff808081831d7ef801833ada2ed620c5',\n" +
"\n" +
"'ff808081734de4c601735b9feafa2ec0',\n" +
"\n" +
"'ff8080815cac80ad015d2a4c27c61348',\n" +
"\n" +
"'ff8080816ed6a34f016f11d38ba97f87',\n" +
"\n" +
"'ff80808170d475700170e2781df41fa6',\n" +
"\n" +
"'ff80808164f666910164fe470c260103',\n" +
"\n" +
"'ff8080816a98156a016a9f946edf0cab',\n" +
"\n" +
"'ff8080818461df63018484e29574555b',\n" +
"\n" +
"'ff8080816ac136ab016ad84d769337b1',\n" +
"\n" +
"'ff8080817e8cae13017ef6153dd74570',\n" +
"\n" +
"'ff80808177da33a0017819e12bcf25b0',\n" +
"\n" +
"'ff8080817aaaebea017aae2b572b5c54',\n" +
"\n" +
"'1af58390681811e69d0818c58a146fd2',\n" +
"\n" +
"'ff8080816a36326c016a53380d8b5f52',\n" +
"\n" +
"'ff8080818004bdb7018020bd160663ef',\n" +
"\n" +
"'ff8080816d7d936b016da9fc8e9445ea',\n" +
"\n" +
"'ff8080817de7e230017debc5da0e6097',\n" +
"\n" +
"'ff80808184159ab60184322edc121ce8',\n" +
"\n" +
"'ff80808170d475700170e886898f2df6',\n" +
"\n" +
"'ff8080817a3e96a4017a796c7947641b',\n" +
"\n" +
"'ff808081767142530176881d0b287161',\n" +
"\n" +
"'ff80808183609d0f018382b58dfb5b7f',\n" +
"\n" +
"'ff808081861280af018630283bee3834',\n" +
"\n" +
"'2c283b49642911e69d0818c58a146fd2',\n" +
"\n" +
"'ff808081748d322f0174c4108ab84a5e',\n" +
"\n" +
"'ff808081678951090167a159020155c6',\n" +
"\n" +
"'ff8080816c00831b016c3ce77c8c672e',\n" +
"\n" +
"'3115714d847811e69d0818c58a146fd2',\n" +
"\n" +
"'ff8080816dd038d8016dd94f50831a2c',\n" +
"\n" +
"'ff8080816c50274d016c504543400021',\n" +
"\n" +
"'ff80808184159996018432569fdd7740',\n" +
"\n" +
"'ff808081748d33e60174c3e1db3c4353',\n" +
"\n" +
"'ff8080817c2ce9ff017c5db0cff843d9',\n" +
"\n" +
"'ff8080816bb870ae016bbc178a320fa3',\n" +
"\n" +
"'ff808081713b6f9501713e09f130058e',\n" +
"\n" +
"'ff8080816eb296ec016ec9d9c8f900de',\n" +
"\n" +
"'ff80808166c07a0c0166c8f86ea6054b',\n" +
"\n" +
"'ff8080816287452b01628a3b82220e66',\n" +
"\n" +
"'ff8080816613cef00166142070d50049',\n" +
"\n" +
"'ff8080818004bedc01800818ed385c27',\n" +
"\n" +
"'ff8080816b8f4215016bacda49c15af1',\n" +
"\n" +
"'ff80808169e3c7e20169fc5526933082',\n" +
"\n" +
"'ff80808169b593d60169c7ff8ad7584b',\n" +
"\n" +
"'ff80808163a84edb0163aee389832ed4']";
String json = StringUtils.replaceAll(data, "\\n", "");
List<String> sourceEnterpriseId = JSON.parseArray(json, String.class);
System.out.println("源数据总数: " + sourceEnterpriseId.size());
String replaceData = "[\"ff8080817d95d32f017d99a06e294648\",\"ff80808169e3c7e20169fc5526933082\",\"ff8080816a36326c016a53380d8b5f52\",\"3115714d847811e69d0818c58a146fd2\",\"ff8080817a3e96a4017a796c7947641b\",\"ff8080815cac80ad015d2a4c27c61348\",\"ff808081767141ce01768e4351db5241\",\"ff8080815c1206fa015c1554c27701b3\",\"ff808081748d34750174dcdce6be13b2\",\"ff80808180b3c54a0180bc3df3bb4bca\",\"ff8080817aaaebea017ac811737d0de5\",\"ff8080816dd038d8016dd94f50831a2c\",\"ff8080816ed6a34f016f11d38ba97f87\",\"ff80808169b593d60169c7ff8ad7584b\",\"1af58390681811e69d0818c58a146fd2\",\"ff8080816a98156a016a9f946edf0cab\",\"ff8080816c00831b016c3ce77c8c672e\",\"ff808081748d33e60174c3e1db3c4353\",\"ff80808177da33a0017819e12bcf25b0\",\"ff808081831d7ef801833ada2ed620c5\",\"ff80808163cb93740163ce79544600d0\"]";
List<String> replaceEnterpriseIds = JSON.parseArray(replaceData, String.class);
sourceEnterpriseId.removeAll(replaceEnterpriseIds);
System.out.println("删除后企业ID数: " + sourceEnterpriseId.size());
System.out.println(JSON.toJSONString(sourceEnterpriseId));
}
}
......@@ -244,7 +244,7 @@ public class ApplicationController extends WebBaseController {
try {
response.sendRedirect(redirectUri);
} catch (IOException e) {
e.printStackTrace();
log.info("异常",e);
}
}
......
......@@ -103,7 +103,7 @@ public class LoginController extends WebBaseController {
try {
response.sendRedirect(host+"/haoban-3/#/gic-error?errorCode="+code);
} catch (IOException e) {
e.printStackTrace();
logger.info("异常",e);
}
return this.fail(this.errMessage(code));
}
......@@ -116,7 +116,7 @@ public class LoginController extends WebBaseController {
try {
response.sendRedirect(host+"/haoban-3/#/gic-error?errorCode="+code);
} catch (IOException e) {
e.printStackTrace();
logger.info("异常",e);
}
return this.fail(this.errMessage(code));
}
......@@ -127,7 +127,7 @@ public class LoginController extends WebBaseController {
try {
response.sendRedirect(host+"/haoban-3/#/gic-error?errorCode="+code);
} catch (IOException e) {
e.printStackTrace();
logger.info("异常",e);
}
return this.fail(this.errMessage(code));
}
......@@ -146,7 +146,7 @@ public class LoginController extends WebBaseController {
try {
response.sendRedirect(host+"/haoban-3/#/gic-error?errorCode="+code);
} catch (IOException e) {
e.printStackTrace();
logger.info("异常",e);
}
return this.fail(this.errMessage(code));
}
......@@ -157,7 +157,7 @@ public class LoginController extends WebBaseController {
try {
response.sendRedirect(host+"/haoban-3/#/gic-error?errorCode="+code);
} catch (IOException e) {
e.printStackTrace();
logger.info("异常",e);
}
return this.fail(this.errMessage(code));
}
......@@ -169,7 +169,7 @@ public class LoginController extends WebBaseController {
try {
response.sendRedirect(host+"/haoban-3/#/gic-error?errorCode="+code);
} catch (IOException e) {
e.printStackTrace();
logger.info("异常",e);
}
return this.fail(this.errMessage(code));
}
......@@ -189,7 +189,7 @@ public class LoginController extends WebBaseController {
try {
response.sendRedirect(host+"/haoban-3/#/gic-error?errorCode="+code);
} catch (IOException e) {
e.printStackTrace();
logger.info("异常",e);
}
return this.fail(this.errMessage(code));
} else {
......@@ -314,7 +314,7 @@ public class LoginController extends WebBaseController {
try {
response.sendRedirect(gicHost);
} catch (IOException e) {
e.printStackTrace();
logger.info("异常",e);
}
return null ;
}
......@@ -406,7 +406,7 @@ public class LoginController extends WebBaseController {
response.sendRedirect(redirectUri);
response.setHeader("token", token);
} catch (IOException e) {
e.printStackTrace();
logger.info("异常",e);
}
return null;
}
......
......@@ -287,8 +287,4 @@ public class MaterialController extends WebBaseController {
}
return null ;
}
public static void main(String[] args) {
System.out.println(EmojiFilterUtil.filterEmoji("!@#~!@#¥%……&*&)()——+——+{}“”:?》") );;
}
}
......@@ -91,7 +91,6 @@ public class MemberController {
ESResponseQueryCount esCount = esApiService.queryDataCount(search);
count = (int) esCount.getRes();
} catch (Exception e) {
e.printStackTrace();
}
return RestResponse.successResult(count);
}
......
......@@ -598,7 +598,7 @@ public class StaffController extends WebBaseController {
try {
ExcelUtils.xls(response, request, fileName, voList, fileList, titleList);
} catch (Exception e) {
e.printStackTrace();
logger.info("异常",e);
logger.info("导出失败");
}
return null;
......
......@@ -522,7 +522,7 @@ public class TestController extends WebBaseController {
url = url+"/api-qywx-self/qywx/self-post?ip=" + ip + "&url="
+ URLEncoder.encode(selfUrl, "utf-8");
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();
if (!"0".equals(errcode)) {
return map1;
......@@ -532,11 +532,11 @@ public class TestController extends WebBaseController {
for(int i=0;i<arr.size();i++) {
JSONObject obj = arr.getJSONObject(i) ;
// System.out.println(obj.toJSONString());
// logger.info(obj.toJSONString());
String groupName = obj.getString("group_name") ;
String groupId = obj.getString("group_id") ;
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 );
list.add(str) ;
}
......@@ -554,7 +554,7 @@ public class TestController extends WebBaseController {
String tagName = tagObj.getString("name") ;
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 ; " ;
//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 );
}
}
......@@ -599,9 +599,9 @@ public class TestController extends WebBaseController {
logger.info(JSON.toJSONString(map));
return map;
} catch (ConnectException ce) {
System.out.println(ce);
logger.info("异常",ce);
} catch (Exception e) {
System.out.println(e);
logger.info("异常",e);
}
return null;
}
......@@ -672,9 +672,9 @@ public class TestController extends WebBaseController {
conn.disconnect();
return buffer.toString();
} catch (ConnectException ce) {
ce.printStackTrace();
logger.info("异常",ce);
} catch (Exception e) {
e.printStackTrace();
logger.info("异常",e);
}
return null;
}
......
......@@ -208,7 +208,7 @@ public class GroupChatController {
try {
ExcelUtils.xls(response, request, fileName, voList, fileList, titleList);
} catch (Exception e) {
e.printStackTrace();
logger.info("异常",e);
logger.info("导出失败");
}
return RestResponse.successResult(true);
......@@ -323,7 +323,7 @@ public class GroupChatController {
try {
ExcelUtils.xls(response, request, fileName, page.getResult().getResult(), fileList, titleList);
} catch (Exception e) {
e.printStackTrace();
logger.info("异常",e);
logger.info("导出失败");
}
return RestResponse.successResult(true);
......
......@@ -489,7 +489,7 @@ public class GroupChatHmController {
downloadReportService.updateDownloadReport(reportId, downloadReportDTO);
tempFile.delete();
} catch (Exception e) {
e.printStackTrace();
logger.info("异常",e);
}
}
});
......
......@@ -72,7 +72,7 @@ public class HbLogRecordController {
Date endDateD = DateUtils.parseDate(endDate, "yyyy-MM-dd HH:mm:ss");
queryWrapper.between(OptRecordLogHaoban::getCreateTime,startDateD,endDateD);
} catch (Exception e) {
e.printStackTrace();
LOGGER.info("异常",e);
}
}
if(null == loginUser || StringUtils.isBlank(loginUser.getOperationUserName())) {
......
package com.gic.haoban.manage.web.utils;
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.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
......@@ -17,6 +19,7 @@ import java.util.List;
* @Date: 2023/9/12 11:14
*/
public class ExportSheetUtil {
private static Logger logger = LogManager.getLogger(ExportSheetUtil.class);
/**
* 拆解并导出多重Excel
*/
......@@ -75,7 +78,7 @@ public class ExportSheetUtil {
response.flushBuffer();
wb.write(response.getOutputStream());
} catch (Exception e) {
e.printStackTrace();
logger.info("异常",e);
}
}
}
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 {
JSONObject jsonObject = new JSONObject();
jsonObject.put("enterpriseId", "ff8080815dacd3a2015dacd3ef5c0000");
//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) {
......
......@@ -32,7 +32,6 @@ public class StoreTargetConfigHttpUtils extends HttpClient{
JSONObject jsonObject = new JSONObject();
jsonObject.put("enterpriseId", "ff8080815dacd3a2015dacd3ef5c0000");
//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 {
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