Commit b704008c by 徐高华

printStackTrace删除

parent 2a55aff2
......@@ -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();
}
}
}
}
......@@ -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);
}
});
......
......@@ -57,8 +57,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);
}
}
......@@ -69,8 +68,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
......@@ -104,10 +104,8 @@ public class DrawImageUtils {
Random random = new Random();
String url = DrawImageUtils.drawImage("jhdm", Math.abs(random.nextInt(1000)) + "",
Math.abs(random.nextInt(1000)) + "万", DrawBkgImg.AREA_MONTH_BKG);
System.out.println(url);
String temp = DrawImageUtils.drawImage("jhdm", Math.abs(random.nextInt(1000)) + "",
Math.abs(random.nextInt(1000)) + "万", DrawBkgImg.CLERK_MONTH_BKG);
System.out.println(temp);
}
}
......@@ -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.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 {
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;
......
......@@ -520,7 +520,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;
......@@ -530,11 +530,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) ;
}
......@@ -552,7 +552,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 );
}
}
......@@ -597,9 +597,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;
}
......@@ -636,9 +636,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