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 { ...@@ -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
...@@ -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();
...@@ -1215,4 +1218,27 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -1215,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);
} }
}); });
......
...@@ -62,8 +62,7 @@ public class HaobanCommonMQApiServiceImpl implements HaobanCommonMQApiService { ...@@ -62,8 +62,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();
} }
} }
...@@ -74,8 +73,7 @@ public class HaobanCommonMQApiServiceImpl implements HaobanCommonMQApiService { ...@@ -74,8 +73,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
...@@ -244,53 +244,6 @@ public class DrawImageUtils { ...@@ -244,53 +244,6 @@ public class DrawImageUtils {
String qrcodeUrl = "https://gicinner-1251519181.cos.ap-shanghai.myqcloud.com/image/material_content-80819999f96f448d9fcccb5ac86e6c37.png"; 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://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"; //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.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;
}
}
} }
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.util.GICMQClientUtil; import com.gic.commons.util.GICMQClientUtil;
import com.gic.dubbo.util.DubboInvokeUtil;
import com.gic.enterprise.api.service.StoreService;
import com.gic.haoban.app.customer.service.api.service.CustomerApiService;
import com.gic.haoban.manage.api.dto.SecretSettingDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO; import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
import com.gic.haoban.manage.api.dto.chat.GroupChatPlanDTO; import com.gic.haoban.manage.api.dto.chat.GroupChatPlanDTO;
import com.gic.haoban.manage.api.dto.notify.qdto.NoticeMessageQDTO; import com.gic.haoban.manage.api.dto.notify.qdto.NoticeMessageQDTO;
import com.gic.haoban.manage.api.dto.notify.qdto.NotifyMessageBatchQDTO; import com.gic.haoban.manage.api.dto.notify.qdto.NotifyMessageBatchQDTO;
import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum; import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import com.gic.haoban.manage.api.service.HandoverOperationApiService; import com.gic.haoban.manage.api.enums.SecretTypeEnum;
import com.gic.haoban.manage.api.service.QywxTagApiService; import com.gic.haoban.manage.api.service.*;
import com.gic.haoban.manage.api.service.StaffApiService; import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService;
import com.gic.haoban.manage.api.service.notify.NoticeMessageApiService; import com.gic.haoban.manage.api.service.notify.NoticeMessageApiService;
import com.gic.haoban.manage.service.config.Config; import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.service.WxEnterpriseService; import com.gic.haoban.manage.service.dao.mapper.StaffMapper;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanExternalClerkRelatedMapper;
import com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated;
import com.gic.haoban.manage.service.service.*;
import com.gic.haoban.manage.service.service.chat.GroupChatPlanService; import com.gic.haoban.manage.service.service.chat.GroupChatPlanService;
import com.gic.haoban.manage.service.service.chat.GroupChatService;
import com.gic.haoban.manage.service.service.hm.HmLinkService;
import com.gic.haoban.manage.service.service.hm.WxUserAddLogService;
import com.gic.haoban.manage.service.service.role.HaobanMenuService;
import com.gic.member.api.service.MemberApiService;
import com.gic.member.api.service.MemberEntranceApiService;
import com.gic.member.api.service.MemberService;
import com.gic.member.api.service.MemberStoreService;
import com.gic.member.tag.api.service.MemberTagOpenApiService;
import com.gic.wechat.api.dto.qywx.QywxNewsArticleMessageDTO; import com.gic.wechat.api.dto.qywx.QywxNewsArticleMessageDTO;
import com.gic.wechat.api.dto.qywx.QywxNewsSendMessageDTO; import com.gic.wechat.api.dto.qywx.QywxNewsSendMessageDTO;
import com.gic.wechat.api.service.qywx.QywxExternalUserService;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService; import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
import com.gic.wechat.api.service.qywx.QywxUserApiService;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -35,18 +54,175 @@ public class ChatTest { ...@@ -35,18 +54,175 @@ public class ChatTest {
private static Logger logger = LoggerFactory.getLogger(ChatTest.class); private static Logger logger = LoggerFactory.getLogger(ChatTest.class);
@Autowired @Autowired
private HandoverOperationApiService handoverOperationApiService; private GroupChatService croupChatService;
@Autowired @Autowired
private StaffApiService staffApiService ; private StaffApiService staffApiService ;
@Autowired
private QwFriendApiService qwFriendApiService ;
@Autowired
private MemberUnionRelatedService memberUnionRelatedService;
@Autowired
private StaffService staffService;
@Autowired
private QywxUserApiService qywxUserApiService;
@Autowired
private WxEnterpriseRelatedService wxEnterpriseRelatedService;
@Autowired
private WxEnterpriseService wxEnterpriseService;
@Autowired
private ClerkService clerkService;
@Autowired
private ClerkMainStoreRelatedService clerkMainStoreRelatedService;
@Autowired
private StoreService storeService;
@Autowired
private Config config;
@Autowired
private QywxSuiteApiService qywxSuiteApiService;
@Autowired
private SecretSettingService secretSettingService;
@Autowired
private StaffClerkRelationService staffClerkRelationService;
@Autowired
private ExternalClerkRelatedService externalClerkRelatedService;
@Autowired
private CheckQywxSettingApiService checkQywxSettingApiService;
@Autowired
private CustomerApiService customerApiService;
@Autowired
private MemberApiService memberApiService;
@Autowired
private TabHaobanExternalClerkRelatedMapper externalClerkRelatedMapper;
@Autowired
private ExternalClerkRelatedApiService externalClerkRelatedApiService;
@Autowired
private MemberStoreService memberStoreService;
@Autowired
private HmQrcodeApiService hmQrcodeApiService;
@Autowired
private WxUserAddLogService wxUserAddLogService;
@Autowired
private KeyDataService keyDataService;
@Autowired
private MemberTagOpenApiService memberTagOpenApiService;
@Autowired
private HmLinkService hmLinkService;
@Autowired
private MemberService memberService;
@Autowired
private StaffMapper staffMapper;
@Autowired
private MemberEntranceApiService memberEntranceApiService;
@Autowired
private QywxSendService qywxSendService ;
@Autowired
private GroupChatService groupChatService ;
@Autowired
private WelcomeSendService welcomeSendService ;
@Autowired
private ExternalMemberService externalMemberService ;
@Autowired
private ClerkMainStoreRelatedApiService clerkMainStoreRelatedApiService ;
@Autowired
private HaobanMenuService haobanMenuService ;
@Autowired
private QywxExternalUserService qywxExternalUserService;
@Test @Test
public void test() { public void test() {
this.staffApiService.updateStaffHead("ca66a01b79474c40b3e7c7f93daf1a3b","d7c29cb654b543d1966181c2ec2186ea","https://pic01-10001430.image.myqcloud.com/04564abc-5e82-4ba7-9ef3-39803438bb2c") ;
// this.handoverOperationApiService.dealQywxEnterpriseHandoverMq("ca66a01b79474c40b3e7c7f93daf1a3b") ;
for(int i=0;i<3;i++) {
new Thread(new Runnable() {
@Override
public void run() {
TabHaobanExternalClerkRelated dto = new TabHaobanExternalClerkRelated() ;
dto.setExternalUserId("1234567");
dto.setClerkId("123");
dto.setStatusFlag(1);
externalClerkRelatedService.insert(dto) ;
}
}).start();
}
if(true)
for(;;){
}
// Object token = this.qywxExternalUserService.token("ww468ed06ba5fa5604","StuEbLhpszQKMNWyRqwDeeX4AGRKm__DAF6k7UwXL-A","wp8KhBDgAAaE3jm1L7ARKe2yxc1hci4A","1000045",1,"http://122.9.98.129:8990#192.168.0.58") ;
// logger.info("获取token"+JSONObject.toJSONString(token));
// Object token = this.qywxExternalUserService.token("ww468ed06ba5fa5604","StuEbLhpszQKMNWyRqwDeeX4AGRKm__DAF6k7UwXL-A","wp8KhBDgAAE90YWr3_wIt6XXljkZvZXg","1000172",1,"http://122.9.98.129:8990#192.168.0.58") ;
// logger.info("获取token-润臣"+JSONObject.toJSONString(token));
String tokensy = "kxCbwqAa7KrxnmW4gOFCa-KGM2N3gbkgVLNKiWUDk5AfiBQK8Xus6AP74U9eBKVDZxM8_C6EtZ0WWBQonUx3wnjfTCVyH0yorHXU2gR08dTZjUKE4Ej8ERMdYisZ6f30tFv37zgQqangmweC6vp7eFpUQC81Bg2qTylmqV0mVupyXWGqp4m7rzCKh4-MUn6Ry-mGy3xPYUwkpImRFmneBQ" ;
String tokenyc = "t3Uu9b0cDIl_y5uyDRnQw3fhmUx-C1pCK1N6xHfDROrySlxUD74ophI0Pel2RQzy4f6qVGnpJu5k6w3j2LolMh2JqkmfAFe8-991h0a4zwlGgFzZAlY1jtcE8mJ911oJkowAvuf8cLuO-iaM2BwjBg8VGrjaVmtLJiNczHOQkVHmhSVF7ubWMj52HCIgxv51pGpMpG5G8SvRnbzIjyW5hw";
Object a1 = this.qywxExternalUserService.req("ww468ed06ba5fa5604","StuEbLhpszQKMNWyRqwDeeX4AGRKm__DAF6k7UwXL-A","https://qyapi.weixin.qq.com/cgi-bin/corpgroup/unionid_to_pending_id?access_token=",JSONObject.parseObject("{\"unionid\":\"orXl9t6P-XBJQyaNCaJj38GLyYd0\",\"openid\":\"o0Yvd0246SId1HwEjQa54LzMcFU0\"}"),"http://122.9.98.129:8990#192.168.0.58") ;
logger.info("unionid查询pending_id"+JSONObject.toJSONString(a1));
Object a2 = this.qywxExternalUserService.req("https://qyapi.weixin.qq.com/cgi-bin/corpgroup/batch/external_userid_to_pending_id?access_token="+tokenyc,JSONObject.parseObject("{\"external_userid\":[\"wm8KhBDgAAlUiFWOeNzuyRR0EoMGLmRw\",\"wm8KhBDgAASGKj-mQQ2RAuU7e07gfJBg\"]}"),"http://122.9.98.129:8990#192.168.0.58") ;
logger.info("external_userid查询pending_id"+JSONObject.toJSONString(a2));
Object a3 = this.qywxExternalUserService.req("ww468ed06ba5fa5604","StuEbLhpszQKMNWyRqwDeeX4AGRKm__DAF6k7UwXL-A","https://qyapi.weixin.qq.com/cgi-bin/corpgroup/batch/external_userid_to_pending_id?access_token=",JSONObject.parseObject("{\"external_userid\":[\"wm8KhBDgAASGKj-mQQ2RAuU7e07gfJBg\"]}"),"http://122.9.98.129:8990#192.168.0.58") ;
logger.info("external_userid查询pending_id3"+JSONObject.toJSONString(a3));
Object a4 = this.qywxExternalUserService.unionidToExternalUseridCorpgroup("ww468ed06ba5fa5604","StuEbLhpszQKMNWyRqwDeeX4AGRKm__DAF6k7UwXL-A","orXl9t6P-XBJQyaNCaJj38GLyYd0","o0Yvd0246SId1HwEjQa54LzMcFU0","http://122.9.98.129:8990#192.168.0.58") ;
logger.info("通过unionid和openid查询external_userid"+JSONObject.toJSONString(a4));
Object o1 = this.qywxExternalUserService.listcorpid("ww468ed06ba5fa5604","StuEbLhpszQKMNWyRqwDeeX4AGRKm__DAF6k7UwXL-A","1000031",1,"http://122.9.98.129:8990#192.168.0.58") ;
logger.info("查询企业列表"+JSONObject.toJSONString(o1));
if(true) {
return ;
}
// 4Y6h7OfJSCzGYv3puNFLYO57s0TQubbFuIxLyqJjINflwa4Vezt2DgDf53k2ajRAFM6nm1uk4SsDSOmzSSUO-EbHAHm6bpTIkDjiMvAtQxWjzhpQW5y6MShFKCo91zjaqWCdXr8CMKNXfXlBW_Dlx3Tym7SJrs4FEN_h0lFftCe12gcgbfPqPxOMeP-sk3XaYPdtfZVkYFNAsFJGgPbzBA
Object o2 = this.qywxExternalUserService.req("https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get?access_token="+tokensy+"&external_userid=wm8KhBDgAAl30re_xOKcrdP-XJW4hL9w",new JSONObject(),"http://122.9.98.129:8990#192.168.0.58") ;
logger.info("客户详情"+JSONObject.toJSONString(o2));
Object o3 = this.qywxExternalUserService.req("https://qyapi.weixin.qq.com/cgi-bin/user/simplelist?access_token="+tokensy+"&department_id=1",new JSONObject(),"http://122.9.98.129:8990#192.168.0.58") ;
logger.info("通讯录"+JSONObject.toJSONString(o3));
Object o4 = this.qywxExternalUserService.req("https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token="+tokensy+"&userid=wo8KhBDgAAoj4rHdDE0P0vNNfjs6cl3w",new JSONObject(),"http://122.9.98.129:8990#192.168.0.58") ;
logger.info("成员详情"+JSONObject.toJSONString(o4));
Object o6 = this.qywxExternalUserService.req("https://qyapi.weixin.qq.com/cgi-bin/agent/get?access_token="+tokensy+"&agentid=1000045",new JSONObject(),"http://122.9.98.129:8990#192.168.0.58") ;
logger.info("应用信息"+JSONObject.toJSONString(o6));
// {"errcode":0,"chains":[{"chain_id":"wgfc938e1ba44e30f5","chain_name":"达摩科技的经销商"}],"errmsg":"ok"}
Object o5 = this.qywxExternalUserService.req("ww468ed06ba5fa5604","StuEbLhpszQKMNWyRqwDeeX4AGRKm__DAF6k7UwXL-A","https://qyapi.weixin.qq.com/cgi-bin/corpgroup/corp/get_chain_list?access_token=",new JSONObject(),"http://122.9.98.129:8990#192.168.0.58") ;
logger.info("滴答滴答滴答滴答滴答滴答5"+JSONObject.toJSONString(o5));
// {"errcode":0,"errmsg":"ok","groups":[{"group_name":"达摩科技的经销商","groupid":1,"parentid":0,"order":100000000},
// {"group_name":"一级经销商","groupid":3,"parentid":1,"order":99999000},{"group_name":"二级经销商","groupid":4,"parentid":1,"order":99998000}]}
Object o7 = this.qywxExternalUserService.req("ww468ed06ba5fa5604","StuEbLhpszQKMNWyRqwDeeX4AGRKm__DAF6k7UwXL-A","https://qyapi.weixin.qq.com/cgi-bin/corpgroup/corp/get_chain_group?access_token=",JSONObject.parseObject("{\"chain_id\":\"wgfc938e1ba44e30f5\"}"),"http://122.9.98.129:8990#192.168.0.58") ;
logger.info("上下游"+JSONObject.toJSONString(o7));
Object o8 = this.qywxExternalUserService.req("ww468ed06ba5fa5604","StuEbLhpszQKMNWyRqwDeeX4AGRKm__DAF6k7UwXL-A","https://qyapi.weixin.qq.com/cgi-bin/corpgroup/corp/get_chain_list?access_token=",new JSONObject(),"http://122.9.98.129:8990#192.168.0.58") ;
logger.info("get_chain_list"+JSONObject.toJSONString(o8));
String wxEnterpriseId = "b18ffdc9d0644912865a248859914d80";
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
SecretSettingDTO secretSetting = secretSettingService.getSecretSetting(wxEnterpriseId, SecretTypeEnum.CUSTOMIZED_APP.getVal());
// String unionIdJson = qywxUserApiService.getCorpSelfExternalUseridInfo(qwDTO.getDkCorpid(), secretSetting.getSecretVal(), "wm8KhBDgAAl30re_xOKcrdP-XJW4hL9w", qwDTO.getUrlHost());
// logger.info(unionIdJson);
// this.qwFriendApiService.getPendingIdByUnionid("ff80808189dd5e490189dd88daf60003","orXl9t6P-XBJQyaNCaJj38GLyYd0","") ;
} }
@Test @Test
public void sendMessageTest() throws Exception { public void sendMessageTest() throws Exception {
String params = "{\"enterpriseId\":\"ff8080815dacd3a2015dacd3ef5c0000\",\"memberId\":\"ff80808187732d6001877333a8030000\",\"opt\":1,\"unionId\":\"orXl9t70uwsdD7kqjNmWu03nKSCg\"}"; String params = "{\"enterpriseId\":\"ff8080815dacd3a2015dacd3ef5c0000\",\"memberId\":\"ff80808187732d6001877333a8030000\",\"opt\":1,\"unionId\":\"orXl9t70uwsdD7kqjNmWu03nKSCg\"}";
GICMQClientUtil.getClientInstance().sendMessage("memberIdChangeNotify", params); GICMQClientUtil.getClientInstance().sendMessage("memberIdChangeNotify", params);
} }
......
...@@ -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.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 { ...@@ -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;
} }
......
...@@ -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;
......
...@@ -522,7 +522,7 @@ public class TestController extends WebBaseController { ...@@ -522,7 +522,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;
...@@ -532,11 +532,11 @@ public class TestController extends WebBaseController { ...@@ -532,11 +532,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) ;
} }
...@@ -554,7 +554,7 @@ public class TestController extends WebBaseController { ...@@ -554,7 +554,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 );
} }
} }
...@@ -599,9 +599,9 @@ public class TestController extends WebBaseController { ...@@ -599,9 +599,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;
} }
...@@ -672,9 +672,9 @@ public class TestController extends WebBaseController { ...@@ -672,9 +672,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);
} }
} }
}); });
......
package com.gic.haoban.manage.web.controller.logrecord; package com.gic.haoban.manage.web.controller.logrecord;
import com.gic.api.base.commons.BasePageInfo; import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.webapi.reponse.RestResponse; import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.dsmongo.api.service.MongoOperationService; import com.gic.dsmongo.api.service.MongoOperationService;
import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO; import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO;
import com.gic.haoban.common.utils.AuthWebRequestUtil; import com.gic.haoban.common.utils.AuthWebRequestUtil;
import com.gic.haoban.manage.web.qo.logrecord.LogRecordQo; import com.gic.haoban.manage.web.qo.logrecord.LogRecordQo;
import com.gic.haoban.manage.web.vo.logrecord.LogRecordTypeVO; import com.gic.haoban.manage.web.vo.logrecord.LogRecordTypeVO;
import com.gic.log.record.bean.OptRecordLog; import com.gic.log.record.bean.OptRecordLog;
import com.gic.log.record.bean.OptRecordLogHaoban; import com.gic.log.record.bean.OptRecordLogHaoban;
import com.gic.log.record.enums.OrderEnum; import com.gic.log.record.enums.OrderEnum;
import com.gic.log.record.service.LogSearchApiService; import com.gic.log.record.service.LogSearchApiService;
import com.gic.log.record.util.GicLogRecordCategoryEnum; import com.gic.log.record.util.GicLogRecordCategoryEnum;
import com.gic.log.record.util.GicLogRecordOptTypeEnum; import com.gic.log.record.util.GicLogRecordOptTypeEnum;
import com.gic.log.record.util.LogQueryWrapper; import com.gic.log.record.util.LogQueryWrapper;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
@Controller @Controller
@RequestMapping("/log-record") @RequestMapping("/log-record")
public class HbLogRecordController { public class HbLogRecordController {
private static final Logger LOGGER = LogManager.getLogger(HbLogRecordController.class); private static final Logger LOGGER = LogManager.getLogger(HbLogRecordController.class);
@Autowired @Autowired
MongoOperationService mongoOperationService; MongoOperationService mongoOperationService;
@Autowired @Autowired
private LogSearchApiService logSearchApiService; private LogSearchApiService logSearchApiService;
/** /**
* 系统类型 0gic 1好办 * 系统类型 0gic 1好办
*/ */
private static Integer systemType = 1; private static Integer systemType = 1;
@RequestMapping("/list") @RequestMapping("/list")
@ResponseBody @ResponseBody
public RestResponse pageLog(LogRecordQo qo, @RequestParam(defaultValue="1")int pageNum , @RequestParam(defaultValue="20")int pageSize){ public RestResponse pageLog(LogRecordQo qo, @RequestParam(defaultValue="1")int pageNum , @RequestParam(defaultValue="20")int pageSize){
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser(); WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
String eid = qo.getEnterpriseId() ; String eid = qo.getEnterpriseId() ;
if(null != loginUser && StringUtils.isEmpty(eid)) { if(null != loginUser && StringUtils.isEmpty(eid)) {
eid = loginUser.getEnterpriseId() ; eid = loginUser.getEnterpriseId() ;
} }
//使用lambda拼装查询表达式 //使用lambda拼装查询表达式
LogQueryWrapper<OptRecordLogHaoban> queryWrapper = new LogQueryWrapper<>(); LogQueryWrapper<OptRecordLogHaoban> queryWrapper = new LogQueryWrapper<>();
queryWrapper.eq(OptRecordLogHaoban::getEnterpriseId, eid).eq(OptRecordLogHaoban::getStatusFlag, 1); queryWrapper.eq(OptRecordLogHaoban::getEnterpriseId, eid).eq(OptRecordLogHaoban::getStatusFlag, 1);
queryWrapper.eq(OptRecordLogHaoban::getWxEnterpriseId, loginUser.getWxEnterpriseId()); queryWrapper.eq(OptRecordLogHaoban::getWxEnterpriseId, loginUser.getWxEnterpriseId());
if (StringUtils.isNotBlank(qo.getBusinessType())) { if (StringUtils.isNotBlank(qo.getBusinessType())) {
queryWrapper.eq(OptRecordLogHaoban::getBusinessType, qo.getBusinessType()); queryWrapper.eq(OptRecordLogHaoban::getBusinessType, qo.getBusinessType());
} }
if (StringUtils.isNotBlank(qo.getOptType())) { if (StringUtils.isNotBlank(qo.getOptType())) {
queryWrapper.eq(OptRecordLogHaoban::getOptType, qo.getOptType()); queryWrapper.eq(OptRecordLogHaoban::getOptType, qo.getOptType());
} }
if (StringUtils.isNoneBlank(qo.getStartDate(),qo.getEndDate())) { if (StringUtils.isNoneBlank(qo.getStartDate(),qo.getEndDate())) {
String endDate = qo.getEndDate() + " 23:59:59"; String endDate = qo.getEndDate() + " 23:59:59";
String startDate = qo.getStartDate() + " 00:00:00"; String startDate = qo.getStartDate() + " 00:00:00";
try { try {
Date startDateD = DateUtils.parseDate(startDate, "yyyy-MM-dd HH:mm:ss"); Date startDateD = DateUtils.parseDate(startDate, "yyyy-MM-dd HH:mm:ss");
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())) {
//历史数据会刷成0. //历史数据会刷成0.
queryWrapper.eq(OptRecordLogHaoban::getYwFlag, 0); queryWrapper.eq(OptRecordLogHaoban::getYwFlag, 0);
} }
if (StringUtils.isNotBlank(qo.getSearch())) { if (StringUtils.isNotBlank(qo.getSearch())) {
queryWrapper.like(OptRecordLogHaoban::getContent, qo.getSearch()); queryWrapper.like(OptRecordLogHaoban::getContent, qo.getSearch());
} }
if (StringUtils.isNotBlank(qo.getOptUser())) { if (StringUtils.isNotBlank(qo.getOptUser())) {
queryWrapper.eq(OptRecordLogHaoban::getUserId, qo.getOptUser()); queryWrapper.eq(OptRecordLogHaoban::getUserId, qo.getOptUser());
} }
//0:gic 1:好办 2:运维 //0:gic 1:好办 2:运维
queryWrapper.eq(OptRecordLogHaoban::getSystemType, systemType); queryWrapper.eq(OptRecordLogHaoban::getSystemType, systemType);
queryWrapper.orderBy(OptRecordLogHaoban::getCreateTime, OrderEnum.DESC); queryWrapper.orderBy(OptRecordLogHaoban::getCreateTime, OrderEnum.DESC);
BasePageInfo basePageInfo = new BasePageInfo(); BasePageInfo basePageInfo = new BasePageInfo();
basePageInfo.setPageNum(pageNum); basePageInfo.setPageNum(pageNum);
basePageInfo.setPageSize(pageSize); basePageInfo.setPageSize(pageSize);
//查询接口 分页方式 //查询接口 分页方式
ServiceResponse<Page> pageServiceResponse = logSearchApiService.queryByPage(queryWrapper, basePageInfo); ServiceResponse<Page> pageServiceResponse = logSearchApiService.queryByPage(queryWrapper, basePageInfo);
return RestResponse.successResult(pageServiceResponse.getResult()); return RestResponse.successResult(pageServiceResponse.getResult());
} }
/** /**
* 获取 业务模块 * 获取 业务模块
* @return * @return
*/ */
@RequestMapping("business-types") @RequestMapping("business-types")
@ResponseBody @ResponseBody
public RestResponse businessTypes(){ public RestResponse businessTypes(){
List<LogRecordTypeVO> ret=new ArrayList<>(); List<LogRecordTypeVO> ret=new ArrayList<>();
GicLogRecordCategoryEnum[] values = GicLogRecordCategoryEnum.values(); GicLogRecordCategoryEnum[] values = GicLogRecordCategoryEnum.values();
for (GicLogRecordCategoryEnum value : values) { for (GicLogRecordCategoryEnum value : values) {
if (Objects.equals(value.getSystemType(), systemType)) { if (Objects.equals(value.getSystemType(), systemType)) {
LogRecordTypeVO mid = new LogRecordTypeVO(); LogRecordTypeVO mid = new LogRecordTypeVO();
mid.setKey(value.getType()); mid.setKey(value.getType());
mid.setValue(value.getName()); mid.setValue(value.getName());
ret.add(mid); ret.add(mid);
} }
} }
return RestResponse.successResult(ret); return RestResponse.successResult(ret);
} }
/** /**
* 获取 操作类型 * 获取 操作类型
* @return * @return
*/ */
@RequestMapping("opt-types") @RequestMapping("opt-types")
@ResponseBody @ResponseBody
public RestResponse optTypes(){ public RestResponse optTypes(){
List<LogRecordTypeVO> ret=new ArrayList<>(); List<LogRecordTypeVO> ret=new ArrayList<>();
GicLogRecordOptTypeEnum[] values = GicLogRecordOptTypeEnum.values(); GicLogRecordOptTypeEnum[] values = GicLogRecordOptTypeEnum.values();
for (GicLogRecordOptTypeEnum value : values) { for (GicLogRecordOptTypeEnum value : values) {
if (Objects.equals(value.getSystemType(), systemType)) { if (Objects.equals(value.getSystemType(), systemType)) {
LogRecordTypeVO mid = new LogRecordTypeVO(); LogRecordTypeVO mid = new LogRecordTypeVO();
mid.setKey(value.getType()); mid.setKey(value.getType());
mid.setValue(value.getName()); mid.setValue(value.getName());
ret.add(mid); ret.add(mid);
} }
} }
return RestResponse.successResult(ret); return RestResponse.successResult(ret);
} }
} }
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);
} }
} }
} }
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();
}
}
}
}
package com.gic.haoban.manage.web.utils.target; package com.gic.haoban.manage.web.utils.target;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.ctrip.framework.apollo.Config; import com.ctrip.framework.apollo.Config;
import com.ctrip.framework.apollo.ConfigService; import com.ctrip.framework.apollo.ConfigService;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.commons.util.HttpClient; import com.gic.commons.util.HttpClient;
import com.gic.commons.web.qo.PageQo; import com.gic.commons.web.qo.PageQo;
import com.gic.commons.webapi.reponse.RestResponse; import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.haoban.manage.web.exception.TargetException; import com.gic.haoban.manage.web.exception.TargetException;
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.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* 目标配置调用数据组http接口工具类 * 目标配置调用数据组http接口工具类
* @Author guojx * @Author guojx
* @Date 2023/1/17 9:51 * @Date 2023/1/17 9:51
*/ */
public class DataTargetHttpUtils { public class DataTargetHttpUtils {
private static final Logger LOGGER = LogManager.getLogger(DataTargetHttpUtils.class); private static final Logger LOGGER = LogManager.getLogger(DataTargetHttpUtils.class);
public static void main(String[] args) { public static void main(String[] args) {
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) {
} JSONObject resJson = new JSONObject();
public static JSONObject getCommonParam(String enterpriseId, String storeId, String startTime, String endTime) { JSONObject jsonObject = new JSONObject();
JSONObject resJson = new JSONObject(); jsonObject.put("enterpriseId", enterpriseId);
jsonObject.put("storeId", storeId);
JSONObject jsonObject = new JSONObject(); jsonObject.put("startTime", startTime);
jsonObject.put("enterpriseId", enterpriseId); jsonObject.put("endTime", endTime);
jsonObject.put("storeId", storeId); return resJson;
jsonObject.put("startTime", startTime); }
jsonObject.put("endTime", endTime);
return resJson; public static boolean isSuccess(Map<String, Object> res) {
} return res.get("errorCode").toString().equals("1");
}
public static boolean isSuccess(Map<String, Object> res) {
return res.get("errorCode").toString().equals("1"); public static RestResponse responsePageData(Map<String, Object> res) {
} if (res.get("errorCode").toString().equals("1")) {
//成功
public static RestResponse responsePageData(Map<String, Object> res) { Page page = new Page();
if (res.get("errorCode").toString().equals("1")) { List<JSONObject> dataList = (List<JSONObject>) res.get("data");
//成功
Page page = new Page(); JSONObject pageJson = (JSONObject) res.get("page");
List<JSONObject> dataList = (List<JSONObject>) res.get("data"); page.setPageSize(pageJson.getIntValue("pageSize"));
page.setTotalCount(pageJson.getIntValue("totalCount"));
JSONObject pageJson = (JSONObject) res.get("page"); page.setCurrentPage(pageJson.getIntValue("currentPage"));
page.setPageSize(pageJson.getIntValue("pageSize")); page.setTotalPage(pageJson.getIntValue("totalPage"));
page.setTotalCount(pageJson.getIntValue("totalCount"));
page.setCurrentPage(pageJson.getIntValue("currentPage")); page.setResult(dataList);
page.setTotalPage(pageJson.getIntValue("totalPage")); return RestResponse.successResult(page);
}
page.setResult(dataList); return RestResponse.failure((String) res.get("errorCode"), (String) res.get("errorInfo"));
return RestResponse.successResult(page); }
}
return RestResponse.failure((String) res.get("errorCode"), (String) res.get("errorInfo")); public static RestResponse response(Map<String, Object> res) {
} if (res.get("errorCode").toString().equals("1")) {
//成功
public static RestResponse response(Map<String, Object> res) { List<JSONObject> dataList = (List<JSONObject>) res.get("data");
if (res.get("errorCode").toString().equals("1")) { return RestResponse.successResult(dataList);
//成功 }
List<JSONObject> dataList = (List<JSONObject>) res.get("data"); return RestResponse.failure((String) res.get("errorCode"), (String) res.get("errorInfo"));
return RestResponse.successResult(dataList); }
}
return RestResponse.failure((String) res.get("errorCode"), (String) res.get("errorInfo")); public static RestResponse responseOfOne(Map<String, Object> res, JSONObject defaultJson) {
} if (res.get("errorCode").toString().equals("1")) {
//成功
public static RestResponse responseOfOne(Map<String, Object> res, JSONObject defaultJson) { List<JSONObject> dataList = (List<JSONObject>) res.get("data");
if (res.get("errorCode").toString().equals("1")) { if (CollectionUtils.isNotEmpty(dataList)) {
//成功 return RestResponse.successResult(dataList.get(0));
List<JSONObject> dataList = (List<JSONObject>) res.get("data"); }
if (CollectionUtils.isNotEmpty(dataList)) { if (defaultJson != null) {
return RestResponse.successResult(dataList.get(0)); return RestResponse.successResult(defaultJson);
} }
if (defaultJson != null) { return RestResponse.successResult(null);
return RestResponse.successResult(defaultJson); }
} return RestResponse.failure((String) res.get("errorCode"), (String) res.get("errorInfo"));
return RestResponse.successResult(null); }
}
return RestResponse.failure((String) res.get("errorCode"), (String) res.get("errorInfo")); public static List<JSONObject> getDataList(Map<String, Object> res) {
} if (res.get("errorCode").toString().equals("1")) {
//成功
public static List<JSONObject> getDataList(Map<String, Object> res) { List<JSONObject> dataList = (List<JSONObject>) res.get("data");
if (res.get("errorCode").toString().equals("1")) { return dataList;
//成功 }
List<JSONObject> dataList = (List<JSONObject>) res.get("data"); return Collections.EMPTY_LIST;
return dataList; }
}
return Collections.EMPTY_LIST; public static JSONObject getData(Map<String, Object> res) {
} if (res.get("errorCode").toString().equals("1")) {
//成功
public static JSONObject getData(Map<String, Object> res) { List<JSONObject> dataList = (List<JSONObject>) res.get("data");
if (res.get("errorCode").toString().equals("1")) { if (CollectionUtils.isNotEmpty(dataList)) {
//成功 return dataList.get(0);
List<JSONObject> dataList = (List<JSONObject>) res.get("data"); }
if (CollectionUtils.isNotEmpty(dataList)) { return null;
return dataList.get(0); }
} return null;
return null; }
}
return null; public static Map<String, Object> http(String jsonParam, String apolloKey) {
} LOGGER.info("接口的key:{}", apolloKey);
Config config = ConfigService.getConfig("COMMON.data-api-config");
public static Map<String, Object> http(String jsonParam, String apolloKey) { String value = config.getProperty(apolloKey, "");
LOGGER.info("接口的key:{}", apolloKey); if (StringUtils.isBlank(value)) {
Config config = ConfigService.getConfig("COMMON.data-api-config"); throw new TargetException("数据接口配置有误!");
String value = config.getProperty(apolloKey, ""); }
if (StringUtils.isBlank(value)) { LOGGER.info("{}:Apollo查询的配置信息:{}", apolloKey, value);
throw new TargetException("数据接口配置有误!"); String[] split = value.split("\\+\\+\\+\\+");
} String url = split[0];
LOGGER.info("{}:Apollo查询的配置信息:{}", apolloKey, value); String token = split[1];
String[] split = value.split("\\+\\+\\+\\+");
String url = split[0]; Map<String, String> head = new HashMap<>();
String token = split[1]; head.put("Content-Type", "application/json");
head.put("API-TOKEN", token);
Map<String, String> head = new HashMap<>(); Map<String, Object> res = HttpClient.getWinxinResByJson(url, jsonParam, head);
head.put("Content-Type", "application/json"); if (!isSuccess(res)) {
head.put("API-TOKEN", token); throw new TargetException((String) res.get("errorInfo"));
Map<String, Object> res = HttpClient.getWinxinResByJson(url, jsonParam, head); }
if (!isSuccess(res)) { LOGGER.info("调用接口{},返回结果:{}", url, res);
throw new TargetException((String) res.get("errorInfo")); return res;
} }
LOGGER.info("调用接口{},返回结果:{}", url, res);
return res; public static JSONObject getParam(PageQo pageQo, JSONObject objParam) {
} JSONObject jsonObject = new JSONObject();
jsonObject.put("pageNo", pageQo.getPageNum());
public static JSONObject getParam(PageQo pageQo, JSONObject objParam) { jsonObject.put("pageSize", pageQo.getPageSize());
JSONObject jsonObject = new JSONObject();
jsonObject.put("pageNo", pageQo.getPageNum()); if (objParam != null) {
jsonObject.put("pageSize", pageQo.getPageSize()); if (objParam.containsKey("storeId")) {
Object storeId = objParam.get("storeId");
if (objParam != null) { if (storeId == null || StringUtils.isBlank(storeId.toString())) {
if (objParam.containsKey("storeId")) { objParam.remove("storeId");
Object storeId = objParam.get("storeId"); }
if (storeId == null || StringUtils.isBlank(storeId.toString())) { }
objParam.remove("storeId"); }
} jsonObject.put("inFields", objParam);
} return jsonObject;
} }
jsonObject.put("inFields", objParam);
return jsonObject; public static JSONObject getParamNoPage(JSONObject objParam) {
} JSONObject jsonObject = new JSONObject();
if (objParam != null) {
public static JSONObject getParamNoPage(JSONObject objParam) { if (objParam.containsKey("storeId")) {
JSONObject jsonObject = new JSONObject(); Object storeId = objParam.get("storeId");
if (objParam != null) { if (storeId == null || StringUtils.isBlank(storeId.toString())) {
if (objParam.containsKey("storeId")) { objParam.remove("storeId");
Object storeId = objParam.get("storeId"); }
if (storeId == null || StringUtils.isBlank(storeId.toString())) { }
objParam.remove("storeId"); }
} jsonObject.put("inFields", objParam);
} return jsonObject;
} }
jsonObject.put("inFields", objParam);
return jsonObject; /**
} * 保留2位小数 .元转万元
*
/** * @param a
* 保留2位小数 .元转万元 * @return by wws
* */
* @param a public static Double transferTenThousand(Double a) {
* @return by wws BigDecimal bd = new BigDecimal(a / 10000);
*/ bd = bd.setScale(2, BigDecimal.ROUND_HALF_UP);
public static Double transferTenThousand(Double a) { return bd.doubleValue();
BigDecimal bd = new BigDecimal(a / 10000); }
bd = bd.setScale(2, BigDecimal.ROUND_HALF_UP);
return bd.doubleValue(); public static Double transferTenThousand(String a) {
} BigDecimal bd = new BigDecimal(a);
bd = bd.divide(new BigDecimal("10000")).setScale(2, BigDecimal.ROUND_HALF_UP);
public static Double transferTenThousand(String a) { return bd.doubleValue();
BigDecimal bd = new BigDecimal(a); }
bd = bd.divide(new BigDecimal("10000")).setScale(2, BigDecimal.ROUND_HALF_UP);
return bd.doubleValue(); public static Double transferTenThousand(Object a) {
} if (a == null) {
return 0.00;
public static Double transferTenThousand(Object a) { }
if (a == null) { BigDecimal bd = new BigDecimal(a.toString());
return 0.00; bd = bd.divide(new BigDecimal("10000")).setScale(2, BigDecimal.ROUND_HALF_UP);
} return bd.doubleValue();
BigDecimal bd = new BigDecimal(a.toString()); }
bd = bd.divide(new BigDecimal("10000")).setScale(2, BigDecimal.ROUND_HALF_UP);
return bd.doubleValue(); public static Double parseDouble(Object a) {
} if (a == null) {
return 0.00;
public static Double parseDouble(Object a) { }
if (a == null) { return Double.parseDouble(a.toString());
return 0.00; }
}
return Double.parseDouble(a.toString()); public static Double transferTenThousandNoDivide(Double a) {
} if (a == null) {
return 0.00;
public static Double transferTenThousandNoDivide(Double a) { }
if (a == null) { BigDecimal bd = new BigDecimal(a.toString());
return 0.00; bd = bd.setScale(2, BigDecimal.ROUND_HALF_UP);
} return bd.doubleValue();
BigDecimal bd = new BigDecimal(a.toString()); }
bd = bd.setScale(2, BigDecimal.ROUND_HALF_UP);
return bd.doubleValue(); public static String formatToSepara(Double data) {
} DecimalFormat df = new DecimalFormat("#,###.00");
return df.format(data);
public static String formatToSepara(Double data) { }
DecimalFormat df = new DecimalFormat("#,###.00");
return df.format(data); public static String formatToSepara(Integer data) {
} DecimalFormat df = new DecimalFormat("#,###");
return df.format(data);
public static String formatToSepara(Integer data) { }
DecimalFormat df = new DecimalFormat("#,###");
return df.format(data); public static String getContrast(String data) {
} if ("--".equals(data)) {
return data;
public static String getContrast(String data) { }
if ("--".equals(data)) { Double dataDouble = Double.parseDouble(data);
return data; if (dataDouble > 0) {
} return "+" + data + "%";
Double dataDouble = Double.parseDouble(data); } else {
if (dataDouble > 0) { return data + "%";
return "+" + data + "%"; }
} else { }
return data + "%";
} public static String getJsonOrDefault(Object a, Object object) {
} if (a == null) {
return object.toString();
public static String getJsonOrDefault(Object a, Object object) { }
if (a == null) { return a.toString();
return object.toString(); }
}
return a.toString(); public static Object getObjectOrDefault(Object a, Object object) {
} if (a == null) {
return object;
public static Object getObjectOrDefault(Object a, Object object) { }
if (a == null) { return a;
return object; }
}
return a; public static String getContrastOrDefault(Object a, Object object) {
} return getContrast(getJsonOrDefault(a, object));
}
public static String getContrastOrDefault(Object a, Object object) {
return getContrast(getJsonOrDefault(a, object)); public static String getRateOrDefault(Object a, Object object) {
} String data = getJsonOrDefault(a, object);
if ("--".equals(data)) {
public static String getRateOrDefault(Object a, Object object) { return data;
String data = getJsonOrDefault(a, object); }
if ("--".equals(data)) { return data + "%";
return data; }
}
return data + "%"; public static Page getPage(Map<String, Object> detailRes) {
} Page page = new Page();
List<JSONObject> dataList = (List<JSONObject>) detailRes.get("data");
public static Page getPage(Map<String, Object> detailRes) {
Page page = new Page(); JSONObject pageJson = (JSONObject) detailRes.get("page");
List<JSONObject> dataList = (List<JSONObject>) detailRes.get("data"); page.setPageSize(pageJson.getIntValue("pageSize"));
page.setTotalCount(pageJson.getIntValue("totalCount"));
JSONObject pageJson = (JSONObject) detailRes.get("page"); page.setCurrentPage(pageJson.getIntValue("currentPage"));
page.setPageSize(pageJson.getIntValue("pageSize")); page.setTotalPage(pageJson.getIntValue("totalPage"));
page.setTotalCount(pageJson.getIntValue("totalCount"));
page.setCurrentPage(pageJson.getIntValue("currentPage")); page.setResult(dataList);
page.setTotalPage(pageJson.getIntValue("totalPage")); return page;
}
page.setResult(dataList); }
return page;
}
}
...@@ -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)));
} }
......
...@@ -40,16 +40,5 @@ public class ClerkEditInfoVO { ...@@ -40,16 +40,5 @@ public class ClerkEditInfoVO {
int delClerkFlag = vo.getDelClerkFlag() << 2; int delClerkFlag = vo.getDelClerkFlag() << 2;
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