|
|
|
@ -1,9 +1,12 @@
|
|
|
|
|
package com.weaver.seconddev.jcldoor.util;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.weaver.common.distribution.genid.IdGenerator;
|
|
|
|
|
import com.weaver.ebuilder.datasource.api.entity.SqlParamEntity;
|
|
|
|
|
import com.weaver.ebuilder.datasource.api.enums.SqlParamType;
|
|
|
|
|
import com.weaver.ebuilder.form.client.entity.obj.Obj;
|
|
|
|
|
import com.weaver.em.msg.api.entity.Request;
|
|
|
|
|
import com.weaver.em.msg.api.entity.Response;
|
|
|
|
|
import com.weaver.framework.rpc.annotation.RpcReference;
|
|
|
|
@ -78,22 +81,26 @@ public class JucailinPortalUtils {
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
public Map<String,Object> getChatGroup(){
|
|
|
|
|
public Map<String,Object> getChatGroup(String tenant_key,String tablename){
|
|
|
|
|
Map<String,Object> dataMap = new HashMap<String,Object>();
|
|
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
try {
|
|
|
|
|
SimpleEmployee employee = UserContext.getCurrentUser();
|
|
|
|
|
Calendar cal = Calendar.getInstance();
|
|
|
|
|
int year = cal.get(Calendar.YEAR);
|
|
|
|
|
String startDate = "2020-01-01";
|
|
|
|
|
|
|
|
|
|
String startDate = "2001-01-01";
|
|
|
|
|
//设置当前时间
|
|
|
|
|
|
|
|
|
|
Calendar cal = Calendar.getInstance();
|
|
|
|
|
cal.setTime(new Date());
|
|
|
|
|
//同理增加一天的方法:
|
|
|
|
|
cal.add(Calendar.DATE, -1);
|
|
|
|
|
String endDate = format.format(cal.getTime());
|
|
|
|
|
|
|
|
|
|
log.error("startDate:"+startDate);
|
|
|
|
|
log.error("endDate:"+endDate);
|
|
|
|
|
|
|
|
|
|
SimpleEmployee employee = UserContext.getCurrentUser();
|
|
|
|
|
Long cid = employee.getCid();
|
|
|
|
|
long employeeId = employee.getEmployeeId();
|
|
|
|
|
log.error("getChatGroup--cid:"+cid);
|
|
|
|
|
|
|
|
|
|
String pageSize = "10";
|
|
|
|
@ -129,35 +136,222 @@ public class JucailinPortalUtils {
|
|
|
|
|
JSONObject dataObject = dataJson.getJSONObject("data");
|
|
|
|
|
String count = dataObject.getString("count");
|
|
|
|
|
dataMap.put("count",count);
|
|
|
|
|
if(StringUtils.isNotBlank(count)){
|
|
|
|
|
int cou = Integer.parseInt(count);
|
|
|
|
|
updateUserChatGroup(cou,cid,startDate,endDate,employeeId,tenant_key,tablename);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("testSapi13:"+e);
|
|
|
|
|
log.error("getChatGroup:"+e);
|
|
|
|
|
}
|
|
|
|
|
return dataMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Map<String,Object> getChatDay(){
|
|
|
|
|
/***
|
|
|
|
|
*
|
|
|
|
|
* @param count
|
|
|
|
|
* @param cid
|
|
|
|
|
* @param startDate
|
|
|
|
|
* @param endDate
|
|
|
|
|
* @param employeeId
|
|
|
|
|
*/
|
|
|
|
|
public void updateUserChatGroup(int count,long cid,String startDate,String endDate,long employeeId,String tenant_key,String tablename){
|
|
|
|
|
int pagesize = 1000;
|
|
|
|
|
int num = (int)Math.ceil(count/1000.0);
|
|
|
|
|
log.error("updateUserChatGroup-num:"+num);
|
|
|
|
|
for(int i=1;i<=num;i++){
|
|
|
|
|
updateUserChatGroup2Mode(cid,startDate,endDate,i,pagesize,employeeId,tenant_key,tablename);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***
|
|
|
|
|
*
|
|
|
|
|
* @param cid
|
|
|
|
|
* @param startDate
|
|
|
|
|
* @param endDate
|
|
|
|
|
* @param pageNum
|
|
|
|
|
* @param pageSize
|
|
|
|
|
* @param employeeId
|
|
|
|
|
*/
|
|
|
|
|
public void updateUserChatGroup2Mode(long cid,String startDate,String endDate,int pageNum,int pageSize,long employeeId,String tenant_key,String tablename){
|
|
|
|
|
try {
|
|
|
|
|
String groupId = "weaver-ebuilder-form-service";
|
|
|
|
|
String sourceType = "LOGIC";
|
|
|
|
|
|
|
|
|
|
Map<String, Object> json = new HashMap<String, Object>();
|
|
|
|
|
json.put("cid",cid);
|
|
|
|
|
json.put("pageNum",pageNum);
|
|
|
|
|
json.put("pageSize",pageSize);
|
|
|
|
|
json.put("startDate",startDate);
|
|
|
|
|
json.put("endDate",endDate);
|
|
|
|
|
|
|
|
|
|
log.error("json:"+ JSON.toJSONString(json));
|
|
|
|
|
|
|
|
|
|
Request request = new Request();
|
|
|
|
|
request.setUrl("/user-profile/groupSession");
|
|
|
|
|
request.setParamsMap(json);
|
|
|
|
|
request.setAsync(false);
|
|
|
|
|
|
|
|
|
|
log.error("request:"+ request.toString());
|
|
|
|
|
Response response = oaRest.executeIm(request);
|
|
|
|
|
log.error("getChatGroup--isSuccess"+response.isSuccess());
|
|
|
|
|
log.error("response2:"+ response.toString());
|
|
|
|
|
if (response.isSuccess()){
|
|
|
|
|
String data = response.getData();
|
|
|
|
|
if(StringUtils.isNotBlank(data)){
|
|
|
|
|
JSONObject dataJson = JSONObject.parseObject(data);
|
|
|
|
|
JSONObject actionMsg = dataJson.getJSONObject("actionMsg");
|
|
|
|
|
if(actionMsg.containsKey("code")){
|
|
|
|
|
String code = actionMsg.getString("code");
|
|
|
|
|
if("0".equals(code)){
|
|
|
|
|
JSONObject dataObject = dataJson.getJSONObject("data");
|
|
|
|
|
if(dataObject.containsKey("data")){
|
|
|
|
|
JSONArray dataArray = dataObject.getJSONArray("data");
|
|
|
|
|
for(int i=0;i<dataArray.size();i++){
|
|
|
|
|
JSONObject dataInfo = dataArray.getJSONObject(i);
|
|
|
|
|
String userid = dataInfo.getString("userid");
|
|
|
|
|
String amount = dataInfo.getString("amount");
|
|
|
|
|
|
|
|
|
|
String sql = " select id from "+tablename+" where ry=? and tenant_key=? and delete_type=0 ";
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(userid+"");
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(tenant_key+"");
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
Map<String, Object> result = databaseUtils.execute(sourceType, groupId, sql);
|
|
|
|
|
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
|
if(!recordList.isEmpty()){
|
|
|
|
|
updateChatGroupDate(userid,amount,sourceType,groupId,tenant_key,tablename);
|
|
|
|
|
}else{
|
|
|
|
|
insertChatGroupDate(userid,amount,employeeId,sourceType,groupId,tenant_key,tablename);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("updateUserChatGroup2Mode:"+e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/***
|
|
|
|
|
*
|
|
|
|
|
* @param userid
|
|
|
|
|
* @param amount
|
|
|
|
|
* @param employeeId
|
|
|
|
|
* @param sourceType
|
|
|
|
|
* @param groupId
|
|
|
|
|
* @param tenant_key
|
|
|
|
|
*/
|
|
|
|
|
public void insertChatGroupDate(String userid,String amount,long employeeId,String sourceType,String groupId,String tenant_key,String tablename){
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
long generate = IdGenerator.generate();
|
|
|
|
|
String sql =" insert into "+tablename+"(id,ry,amount,form_data_id,data_index,create_time,update_time,tenant_key,is_delete,creator,delete_type) " +
|
|
|
|
|
" values (" + generate + "," + userid + ",'"+amount+"'," + generate + ",0,now(),now(),'"+tenant_key+"'," + Character.MIN_VALUE + "," + employeeId + "," + Character.MIN_VALUE + ")";
|
|
|
|
|
Map<String, Object> result = databaseUtils.execute(sourceType, groupId, sql);
|
|
|
|
|
Iterator<Map.Entry<String, Object>> iterator = result.entrySet().iterator();
|
|
|
|
|
while (iterator.hasNext()){
|
|
|
|
|
Map.Entry<String, Object> next = iterator.next();
|
|
|
|
|
log.error("insertChatDayDate--key="+next.getKey()+" value="+String.valueOf(next.getValue()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
|
for(int i=0;i<recordList.size();i++){
|
|
|
|
|
Map<String,Object> map = recordList.get(i);
|
|
|
|
|
for (String key:map.keySet()){
|
|
|
|
|
System.out.println("insertChatDayDate222--key= "+key+" and value= "+String.valueOf(map.get(key)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("insertChatGroupDate:"+e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/***
|
|
|
|
|
*
|
|
|
|
|
* @param userid
|
|
|
|
|
* @param amount
|
|
|
|
|
* @param sourceType
|
|
|
|
|
* @param groupId
|
|
|
|
|
* @param tenant_key
|
|
|
|
|
*/
|
|
|
|
|
public void updateChatGroupDate(String userid,String amount,String sourceType,String groupId,String tenant_key,String tablename){
|
|
|
|
|
try {
|
|
|
|
|
String sql =" update "+tablename+" set amount=?,update_time=now() where ry = ? and tenant_key= ? and delete_type=0 ";
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(amount+"");
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(userid+"");
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(tenant_key);
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam);
|
|
|
|
|
Iterator<Map.Entry<String, Object>> iterator = result.entrySet().iterator();
|
|
|
|
|
while (iterator.hasNext()){
|
|
|
|
|
Map.Entry<String, Object> next = iterator.next();
|
|
|
|
|
log.error("insertChatDayDate--key="+next.getKey()+" value="+String.valueOf(next.getValue()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
|
for(int i=0;i<recordList.size();i++){
|
|
|
|
|
Map<String,Object> map = recordList.get(i);
|
|
|
|
|
for (String key:map.keySet()){
|
|
|
|
|
System.out.println("insertChatDayDate222--key= "+key+" and value= "+String.valueOf(map.get(key)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("updateChatGroupDate:"+e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Map<String,Object> getChatDay(String tenant_key,String tablename){
|
|
|
|
|
Map<String,Object> dataMap = new HashMap<String,Object>();
|
|
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
try {
|
|
|
|
|
SimpleEmployee employee = UserContext.getCurrentUser();
|
|
|
|
|
|
|
|
|
|
String startDate = "2001-01-01";
|
|
|
|
|
|
|
|
|
|
Calendar cal = Calendar.getInstance();
|
|
|
|
|
int year = cal.get(Calendar.YEAR);
|
|
|
|
|
String startDate = "2020-01-01";
|
|
|
|
|
//设置当前时间
|
|
|
|
|
cal.setTime(new Date());
|
|
|
|
|
//同理增加一天的方法:
|
|
|
|
|
cal.add(Calendar.DATE, -1);
|
|
|
|
|
String endDate = format.format(cal.getTime());
|
|
|
|
|
|
|
|
|
|
log.error("startDate:"+startDate);
|
|
|
|
|
log.error("endDate:"+endDate);
|
|
|
|
|
Long cid = employee.getCid();
|
|
|
|
|
log.error("getChatGroup--cid:"+cid);
|
|
|
|
|
Long employeeId = employee.getEmployeeId();
|
|
|
|
|
|
|
|
|
|
String pageSize = "10";
|
|
|
|
|
String pageNum = "1";
|
|
|
|
@ -192,6 +386,11 @@ public class JucailinPortalUtils {
|
|
|
|
|
JSONObject dataObject = dataJson.getJSONObject("data");
|
|
|
|
|
String count = dataObject.getString("count");
|
|
|
|
|
dataMap.put("count",count);
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(count)){
|
|
|
|
|
int cou = Integer.parseInt(count);
|
|
|
|
|
updateUserChatDay(cou,cid,startDate,endDate,employeeId,tenant_key,tablename);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -203,4 +402,179 @@ public class JucailinPortalUtils {
|
|
|
|
|
return dataMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void updateUserChatDay(int count,long cid,String startDate,String endDate,long employeeId,String tenant_key,String tablename){
|
|
|
|
|
int pagesize = 1000;
|
|
|
|
|
int num = (int)Math.ceil(count/1000.0);
|
|
|
|
|
log.error("updateUserChatGroup-num:"+num);
|
|
|
|
|
for(int i=1;i<=num;i++){
|
|
|
|
|
updateUserChatDay2Mode(cid,startDate,endDate,i,pagesize,employeeId,tenant_key,tablename);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***
|
|
|
|
|
*
|
|
|
|
|
* @param cid
|
|
|
|
|
* @param startDate
|
|
|
|
|
* @param endDate
|
|
|
|
|
* @param pageNum
|
|
|
|
|
* @param pageSize
|
|
|
|
|
* @param employeeId
|
|
|
|
|
*/
|
|
|
|
|
public void updateUserChatDay2Mode(long cid,String startDate,String endDate,int pageNum,int pageSize,long employeeId,String tenant_key,String tablename){
|
|
|
|
|
try {
|
|
|
|
|
String groupId = "weaver-ebuilder-form-service";
|
|
|
|
|
String sourceType = "LOGIC";
|
|
|
|
|
|
|
|
|
|
Map<String, Object> json = new HashMap<String, Object>();
|
|
|
|
|
json.put("cid",cid);
|
|
|
|
|
json.put("pageNum",pageNum);
|
|
|
|
|
json.put("pageSize",pageSize);
|
|
|
|
|
json.put("startDate",startDate);
|
|
|
|
|
json.put("endDate",endDate);
|
|
|
|
|
|
|
|
|
|
log.error("json:"+ JSON.toJSONString(json));
|
|
|
|
|
|
|
|
|
|
Request request = new Request();
|
|
|
|
|
request.setUrl("/user-profile/groupSession");
|
|
|
|
|
request.setParamsMap(json);
|
|
|
|
|
request.setAsync(false);
|
|
|
|
|
|
|
|
|
|
log.error("request:"+ request.toString());
|
|
|
|
|
Response response = oaRest.executeIm(request);
|
|
|
|
|
log.error("getChatGroup--isSuccess"+response.isSuccess());
|
|
|
|
|
log.error("response2:"+ response.toString());
|
|
|
|
|
if (response.isSuccess()){
|
|
|
|
|
String data = response.getData();
|
|
|
|
|
if(StringUtils.isNotBlank(data)){
|
|
|
|
|
JSONObject dataJson = JSONObject.parseObject(data);
|
|
|
|
|
JSONObject actionMsg = dataJson.getJSONObject("actionMsg");
|
|
|
|
|
if(actionMsg.containsKey("code")){
|
|
|
|
|
String code = actionMsg.getString("code");
|
|
|
|
|
if("0".equals(code)){
|
|
|
|
|
JSONObject dataObject = dataJson.getJSONObject("data");
|
|
|
|
|
if(dataObject.containsKey("data")){
|
|
|
|
|
JSONArray dataArray = dataObject.getJSONArray("data");
|
|
|
|
|
for(int i=0;i<dataArray.size();i++){
|
|
|
|
|
JSONObject dataInfo = dataArray.getJSONObject(i);
|
|
|
|
|
String userid = dataInfo.getString("userid");
|
|
|
|
|
String amount = dataInfo.getString("amount");
|
|
|
|
|
|
|
|
|
|
String sql = " select id from "+tablename+" where ry=? and tenant_key=? and delete_type=0 ";
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(userid+"");
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(tenant_key+"");
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
Map<String, Object> result = databaseUtils.execute(sourceType, groupId, sql);
|
|
|
|
|
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
|
if(!recordList.isEmpty()){
|
|
|
|
|
updateChatDayDate(userid,amount,sourceType,groupId,tenant_key,tablename);
|
|
|
|
|
}else{
|
|
|
|
|
insertChatDayDate(userid,amount,employeeId,sourceType,groupId,tenant_key,tablename);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("updateUserChatGroup2Mode:"+e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***
|
|
|
|
|
*
|
|
|
|
|
* @param userid
|
|
|
|
|
* @param amount
|
|
|
|
|
* @param employeeId
|
|
|
|
|
* @param sourceType
|
|
|
|
|
* @param groupId
|
|
|
|
|
* @param tenant_key
|
|
|
|
|
*/
|
|
|
|
|
public void insertChatDayDate(String userid,String amount,long employeeId,String sourceType,String groupId,String tenant_key,String tablename){
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
long generate = IdGenerator.generate();
|
|
|
|
|
String sql =" insert into "+tablename+"(id,ry,amount,form_data_id,data_index,create_time,update_time,tenant_key,is_delete,creator,delete_type) " +
|
|
|
|
|
" values (" + generate + "," + userid + ",'"+amount+"'," + generate + ",0,now(),now(),'"+tenant_key+"'," + Character.MIN_VALUE + "," + employeeId + "," + Character.MIN_VALUE + ")";
|
|
|
|
|
Map<String, Object> result = databaseUtils.execute(sourceType, groupId, sql);
|
|
|
|
|
|
|
|
|
|
Iterator<Map.Entry<String, Object>> iterator = result.entrySet().iterator();
|
|
|
|
|
while (iterator.hasNext()){
|
|
|
|
|
Map.Entry<String, Object> next = iterator.next();
|
|
|
|
|
log.error("insertChatDayDate--key="+next.getKey()+" value="+String.valueOf(next.getValue()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
|
for(int i=0;i<recordList.size();i++){
|
|
|
|
|
Map<String,Object> map = recordList.get(i);
|
|
|
|
|
for (String key:map.keySet()){
|
|
|
|
|
System.out.println("insertChatDayDate222--key= "+key+" and value= "+String.valueOf(map.get(key)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("insertChatGroupDate:"+e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/***
|
|
|
|
|
*
|
|
|
|
|
* @param userid
|
|
|
|
|
* @param amount
|
|
|
|
|
* @param sourceType
|
|
|
|
|
* @param groupId
|
|
|
|
|
* @param tenant_key
|
|
|
|
|
*/
|
|
|
|
|
public void updateChatDayDate(String userid,String amount,String sourceType,String groupId,String tenant_key,String tablename){
|
|
|
|
|
try {
|
|
|
|
|
String sql =" update "+tablename+" set amount=?,update_time=now() where ry = ? and tenant_key= ? and delete_type=0 ";
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(amount+"");
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(userid+"");
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(tenant_key);
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam);
|
|
|
|
|
Iterator<Map.Entry<String, Object>> iterator = result.entrySet().iterator();
|
|
|
|
|
while (iterator.hasNext()){
|
|
|
|
|
Map.Entry<String, Object> next = iterator.next();
|
|
|
|
|
log.error("insertChatDayDate--key="+next.getKey()+" value="+String.valueOf(next.getValue()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
|
for(int i=0;i<recordList.size();i++){
|
|
|
|
|
Map<String,Object> map = recordList.get(i);
|
|
|
|
|
for (String key:map.keySet()){
|
|
|
|
|
System.out.println("insertChatDayDate222--key= "+key+" and value= "+String.valueOf(map.get(key)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("updateChatGroupDate:"+e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|