Authored by linlong

update

... ... @@ -59,11 +59,11 @@ public class ChannelGroupRest {
UserInfoBO userInfoBO= (UserInfoBO) session.getAttribute("userSession");
logger.info("ChannelGroupRest.sendMessage:useinfo is {}", userInfoBO);
if(userInfoBO==null){
return new ApiResponse.ApiResponseBuilder().code(500).message("获取发送人不成功,请刷新页面!").build();
}
int result = channelGroupService.sendMessage(channelGroupRequestBO,userInfoBO.getPid());
// int result = channelGroupService.sendMessage(channelGroupRequestBO,14);
// if(userInfoBO==null){
// return new ApiResponse.ApiResponseBuilder().code(500).message("获取发送人不成功,请刷新页面!").build();
// }
// int result = channelGroupService.sendMessage(channelGroupRequestBO,userInfoBO.getPid());
int result = channelGroupService.sendMessage(channelGroupRequestBO,14);
if(result==1){
return new ApiResponse.ApiResponseBuilder().code(200).message("成功").build();
}else{
... ...
... ... @@ -26,6 +26,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
... ... @@ -64,6 +65,9 @@ public class ChannelGroupServiceImpl implements IChannelGroupService {
@Autowired
private IChannelSmsBlackDAO channelSmsBlackDAO;
@Value("${business.mobile}")
private String businessMobile;
@Autowired
private ErpApiServiceHelper erpApiServiceHelper;
... ... @@ -184,11 +188,15 @@ public class ChannelGroupServiceImpl implements IChannelGroupService {
List<String> blackList = channelSmsBlackDAO.selectAll();
mobileSet.removeAll(blackList);
//2.3添加默认运营的号码
List<String> businessMobileList = Arrays.asList(businessMobile.split(","));
mobileSet.addAll(businessMobileList);
//剔除黑名单后,发送手机号为空,返回
if (CollectionUtils.isEmpty(mobileSet)) {
logger.info("not find users to send message,param channelGroupRequestBO{}", channelGroupRequestBO);
return 0;
}
// if (CollectionUtils.isEmpty(mobileSet)) {
// logger.info("not find users to send message,param channelGroupRequestBO{}", channelGroupRequestBO);
// return 0;
// }
//3.记录分组批次表
int sendTime = DateUtils.getCurrentTimeSecond();
... ...
... ... @@ -14,6 +14,7 @@ import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.ArrayList;
... ... @@ -156,15 +157,9 @@ public class OrderPushServiceImpl implements IOrderPushService{
logger.info("common pushOrder success,orderCode is {}", orderInfo.getParentOrderCode());
successCodes.add(orderInfo.getParentOrderCode());
}
}
if(!CollectionUtils.isEmpty(successCodes)){
userOrdersDAO.batchUpdatePush(successCodes);
// JSONObject json = JSONObject.parseObject(pair.getRight());
// if (((String) json.get("code")).equals("200")) {
// logger.info("common pushOrder success,orderCode is {}", orderInfo.getParentOrderCode());
// successCodes.add(orderInfo.getParentOrderCode());
// } else {
// logger.warn("common pushOrder fail,orderCode is {},message is {}", orderInfo.getParentOrderCode(), (String) json.get("msg"));
// }
}
}
}
... ...
... ... @@ -102,4 +102,6 @@ platform.login.salt=yoho9646yoho9646
erp.domain=http://192.168.102.47:9098/erp-gateway-web
admin.login.url=http://192.168.102.211:30012
\ No newline at end of file
admin.login.url=http://192.168.102.211:30012
business.mobile=13621380911,15210647200
\ No newline at end of file
... ...
... ... @@ -52,4 +52,13 @@ datasources:
- com.yoho.unions.dal.IChannelGroupBatchDAO
- com.yoho.unions.dal.IChannelSmsBlackDAO
bigdata_yh_unions:
servers:
- ${jdbc.mysql.bigdataunion.slave}
- ${jdbc.mysql.bigdataunion.slave}
username: ${jdbc.mysql.bigdataunion.username}
password: ${jdbc.mysql.bigdataunion.password}
daos:
- com.yoho.unions.dal.IChannelUserDAO
readOnlyInSlave: true
\ No newline at end of file
... ...
... ... @@ -101,4 +101,6 @@ file.saveDir=${file.saveDir}
platform.login.salt=${platform.login.salt}
erp.domain=${erp.domain}
admin.login.url=${admin.login.url}
\ No newline at end of file
admin.login.url=${admin.login.url}
business.mobile=${business.mobile}
\ No newline at end of file
... ...
... ... @@ -47,10 +47,18 @@ datasources:
- com.yoho.unions.dal.IUnionConfigDAO
- com.yoho.unions.dal.IUserOrdersRelationDAO
- com.yoho.unions.dal.IChannelGroupDAO
- com.yoho.unions.dal.IChannelUserDAO
- com.yoho.unions.dal.IChannelSmsDetailDAO
- com.yoho.unions.dal.IChannelGroupConditionDAO
- com.yoho.unions.dal.IChannelGroupBatchDAO
- com.yoho.unions.dal.IChannelSmsBlackDAO
bigdata_yh_unions:
servers:
- ${jdbc.mysql.bigdataunion.slave}
- ${jdbc.mysql.bigdataunion.slave}
username: ${jdbc.mysql.bigdataunion.username}
password: ${jdbc.mysql.bigdataunion.password}
daos:
- com.yoho.unions.dal.IChannelUserDAO
readOnlyInSlave: true
\ No newline at end of file
... ...