Authored by linlong

update

... ... @@ -24,7 +24,6 @@ import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
... ... @@ -182,6 +181,7 @@ public class ChannelGroupServiceImpl implements ChannelGroupService {
List<ChannelSmsDetail> smsDetails = Lists.newArrayList();
//4.用户去重、黑名单后,分批发送短信
List<String> mobiles = null;
int successCount = 0 ;
for (int i = 0; i < mobileList.size(); i += BATCH_MESSAGE_NUMBER) {
if(i + BATCH_MESSAGE_NUMBER>mobileList.size()){
mobiles = mobileList.subList(i, mobileList.size());
... ... @@ -205,6 +205,7 @@ public class ChannelGroupServiceImpl implements ChannelGroupService {
for (String sms : mobiles) {
ChannelSmsDetail channelSmsDetail = new ChannelSmsDetail(sms, groupBatchId, SMS_STATUS_SUCCESS, sendTime);
smsDetails.add(channelSmsDetail);
successCount++;
}
} else {
//4.2短信发送失败,打印日志,记录短信日志表(状态为0)和分组批次表
... ...
... ... @@ -7,6 +7,16 @@ public class ChannelGroup {
private Integer groupNumber;
public Integer getSuccessCount() {
return successCount;
}
public void setSuccessCount(Integer successCount) {
this.successCount = successCount;
}
private Integer successCount;
private Integer createTime;
private Integer createUser;
... ...
... ... @@ -5,6 +5,7 @@
<id column="id" property="id" jdbcType="INTEGER" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="group_number" property="groupNumber" jdbcType="INTEGER" />
<result column="success_count" property="successCount" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
<result column="create_user" property="createUser" jdbcType="INTEGER" />
<result column="create_userName" property="createUserName" jdbcType="VARCHAR" />
... ... @@ -18,7 +19,7 @@
<result column="content" property="content" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, name, group_number, create_time, create_user, create_userName, update_time
id, name, group_number,success_count, create_time, create_user, create_userName, update_time
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
... ... @@ -31,10 +32,10 @@
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.unions.dal.model.ChannelGroup" keyProperty="id" useGeneratedKeys="true" >
insert into channel_group (id, name, group_number,
insert into channel_group (id, name, group_number,success_count,
create_time, create_user, create_userName,update_time
)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{groupNumber,jdbcType=INTEGER},
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{groupNumber,jdbcType=INTEGER},#{successCount,jdbcType=INTEGER}
#{createTime,jdbcType=INTEGER}, #{createUser,jdbcType=INTEGER}, #{createUserName,jdbcType=VARCHAR}, #{updateTime,jdbcType=INTEGER}
)
</insert>
... ... @@ -50,6 +51,9 @@
<if test="groupNumber != null" >
group_number,
</if>
<if test="successCount != null" >
success_count,
</if>
<if test="createTime != null" >
create_time,
</if>
... ... @@ -73,6 +77,9 @@
<if test="groupNumber != null" >
#{groupNumber,jdbcType=INTEGER},
</if>
<if test="successCount != null" >
#{successCount,jdbcType=INTEGER},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=INTEGER},
</if>
... ... @@ -94,7 +101,10 @@
name = #{name,jdbcType=VARCHAR},
</if>
<if test="groupNumber != null" >
group_number = #{groupNumber,jdbcType=INTEGER},
group_number = #{groupNumber,jdbcType=INTEGER},
</if>
<if test="successCount != null" >
success_count = #{successCount,jdbcType=INTEGER},
</if>
<if test="createTime != null" >
create_time = #{createTime,jdbcType=INTEGER},
... ... @@ -115,6 +125,7 @@
update channel_group
set name = #{name,jdbcType=VARCHAR},
group_number = #{groupNumber,jdbcType=INTEGER},
success_count = #{success_count,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=INTEGER},
create_user = #{createUser,jdbcType=INTEGER},
create_userName = #{createUserName,jdbcType=VARCHAR},
... ... @@ -153,7 +164,7 @@
</where>
</select>
<select id="selectListByParam" resultMap="groupResultMap" parameterType="com.yoho.service.model.union.response.ChannelGroupRspBO" >
select cg.id as id, name, group_number, create_time, create_user, create_userName, cgb.id as group_id, send_time,
select cg.id as id, name, group_number, success_count,create_time, create_user, create_userName, cgb.id as group_id, send_time,
send_user, send_userName, content
from channel_group cg
left join channel_group_batch cgb
... ...
... ... @@ -153,6 +153,19 @@
width: 170,
align: "center"
},{
title: "发送结果分析",
field: "successCount",
width: 170,
align: "center",
formatter: function (value, rowData, rowIndex) {
if(rowData.content == null || rowData.content ==''){
return "";
}else{
var fail =rowData.groupNumber - value;
return "成功数"+value+",失败数"+fail;
}
}
},{
title: "操作",
field: "asdf",
width: 170,
... ...