Commit dd118e9f by 徐高华

更新统计

parent bd96fd0e
......@@ -31,7 +31,6 @@ public class GroupChatPlanOwnerLogDTO implements Serializable{
private String clerkId;
/**1已发送 0待发送*/
private Integer sendStatus;
private Integer totalCount;
private Integer sendCount;
private Integer failCount ;
private java.util.Date createTime;
......@@ -185,13 +184,6 @@ public class GroupChatPlanOwnerLogDTO implements Serializable{
public Integer getSendStatus(){
return sendStatus;
}
public void setTotalCount(Integer totalCount){
this.totalCount = totalCount;
}
public Integer getTotalCount(){
return totalCount;
}
public void setSendCount(Integer sendCount){
this.sendCount = sendCount;
}
......
......@@ -33,4 +33,7 @@ public interface GroupChatPlanMapper {
public TabGroupChatPlan selectById(Long planId);
public List<TabGroupChatPlan> list(GroupChatPlanSearchQDTO qdto);
public void updateData(@Param("planId") Long planId, @Param("sendCount") int sendCount,
@Param("successChatCount") int successChatCount, @Param("failChatCount") int failChatCount);
}
\ No newline at end of file
......@@ -41,8 +41,8 @@ public class TabGroupChatPlan implements Serializable {
private Integer sendCount;
/**已送达数的群数*/
private Integer successChatCount;
/**总群数*/
private Integer totalChatCount;
/**失败总群数*/
private Integer failChatCount;
private String wxEnterpriseId;
private String enterpriseId;
......@@ -225,11 +225,11 @@ public class TabGroupChatPlan implements Serializable {
return successChatCount;
}
public void setTotalChatCount(Integer totalChatCount) {
this.totalChatCount = totalChatCount;
public Integer getFailChatCount() {
return failChatCount;
}
public Integer getTotalChatCount() {
return totalChatCount;
public void setFailChatCount(Integer failChatCount) {
this.failChatCount = failChatCount;
}
}
\ No newline at end of file
......@@ -26,7 +26,6 @@ public class TabGroupChatPlanOwnerLog implements Serializable {
/**1已发送 0待发送*/
private Integer sendStatus;
private Integer failCount;
private Integer totalCount;
private Integer sendCount;
private java.util.Date createTime;
private java.util.Date updateTime;
......@@ -148,14 +147,6 @@ public class TabGroupChatPlanOwnerLog implements Serializable {
return sendStatus;
}
public void setTotalCount(Integer totalCount) {
this.totalCount = totalCount;
}
public Integer getTotalCount() {
return totalCount;
}
public void setSendCount(Integer sendCount) {
this.sendCount = sendCount;
}
......
......@@ -27,10 +27,8 @@ import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.chat.ChatOwnerTotalDTO;
import com.gic.haoban.manage.api.dto.chat.GroupChatPlanOwnerLogDTO;
import com.gic.haoban.manage.api.dto.qdto.chat.GroupChatPlanSearchQDTO;
import com.gic.haoban.manage.service.dao.mapper.chat.GroupChatOwnerMapper;
import com.gic.haoban.manage.service.dao.mapper.chat.GroupChatPlanOwnerLogMapper;
import com.gic.haoban.manage.service.entity.TabHaobanClerkMainStoreRelated;
import com.gic.haoban.manage.service.entity.chat.TabGroupChatOwner;
import com.gic.haoban.manage.service.entity.chat.TabGroupChatPlan;
import com.gic.haoban.manage.service.entity.chat.TabGroupChatPlanOwnerLog;
import com.gic.haoban.manage.service.service.ClerkMainStoreRelatedService;
......@@ -53,8 +51,6 @@ public class GroupChatPlanOwnerLogServiceImpl implements GroupChatPlanOwnerLogSe
private ClerkService clerkService;
@Autowired
private StoreService storeService;
@Autowired
private GroupChatOwnerMapper groupChatOwnerMapper;
public TabGroupChatPlanOwnerLog getById(Long ownerLogId) {
TabGroupChatPlanOwnerLog log = this.groupChatPlanOwnerLogMapper.selectById(ownerLogId);
......@@ -137,8 +133,6 @@ public class GroupChatPlanOwnerLogServiceImpl implements GroupChatPlanOwnerLogSe
@Override
public void update(TabGroupChatPlanOwnerLog entity) {
String staffId = entity.getStaffId() ;
TabGroupChatOwner owner = this.groupChatOwnerMapper.selectByStaffId(staffId);
entity.setTotalCount(owner.getChatCount());
TabHaobanClerkMainStoreRelated mainStore = this.clerkMainStoreRelatedService.getMainStoreByStaffId(staffId,
entity.getWxEnterpriseId());
if (null == mainStore) {
......
......@@ -92,6 +92,7 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
private PendingTaskService pendingTaskService;
private static GicMQClient mqClient = GICMQClientUtil.getClientInstance();
// 发送队列
private void putMQForSend(Long id) {
try {
......@@ -102,6 +103,7 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
e.printStackTrace();
}
}
// 统计队列
private void putMQForData(Long id) {
try {
......@@ -131,7 +133,7 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
entity.setStaffCount(staffIdList.split(",").length);
entity.setSendCount(0);
entity.setSuccessChatCount(0);
entity.setTotalChatCount(0);
entity.setFailChatCount(0);
this.groupChatPlanMapper.insert(entity);
// 新增群主日志
this.groupChatPlanOwnerLogService.batchAdd(dto.getStaffIdList(), entity);
......@@ -234,7 +236,7 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
@Override
public void doPlanSendInfoTimer(String params) {
Long planId = Long.parseLong(params) ;
Long planId = Long.parseLong(params);
List<Long> idList = this.groupChatPlanOwnerLogService.listForTimer(planId);
logger.info("定时处理群发结果,条数={}", idList.size());
for (Long ownerLogId : idList) {
......@@ -286,6 +288,10 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
entity.setEnterpriseId(enterpriseId);
entity.setStaffId(staffId);
GroupChatBO chat = this.groupChatService.getByWxChatId(wxEnterpriseId, wxChatId);
if (null == chat || StringUtils.isBlank(chat.getEnterpriseId())) {
logger.info("群不存在,或未认领,wxChatId={}", wxChatId);
continue;
}
if (null != chat) {
entity.setGroupChatId(chat.getGroupChatId());
}
......@@ -297,6 +303,8 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
list.get(0).getSendTime(), failCount);
// 完成代办
this.pendingTaskService.updateFinish(ownerLog.getOwnerLogId() + "");
//更新计划统计
this.groupChatPlanMapper.updateData(ownerLog.getPlanId(), 1, sendCount, failCount);
}
}
}
......
......@@ -25,7 +25,7 @@
<result column="staff_count" property="staffCount" />
<result column="send_count" property="sendCount" />
<result column="success_chat_count" property="successChatCount" />
<result column="total_chat_count" property="totalChatCount" />
<result column="fail_chat_count" property="failChatCount" />
<result column="send_flag" property="sendFlag" />
</resultMap>
<sql id="Base_Column_List">
......@@ -48,7 +48,7 @@
staff_count,
send_count,
success_chat_count,
total_chat_count ,
fail_chat_count ,
wx_enterprise_id , enterprise_id , send_flag
</sql>
<!-- ===================== 新增 ======================== -->
......@@ -75,7 +75,7 @@
staff_count,
send_count,
success_chat_count,
total_chat_count , wx_enterprise_id , enterprise_id , delete_flag , send_flag
fail_chat_count , wx_enterprise_id , enterprise_id , delete_flag , send_flag
)VALUES(
#{planId},
#{name},
......@@ -96,7 +96,7 @@
#{staffCount},
#{sendCount},
#{successChatCount},
#{totalChatCount} , #{wxEnterpriseId} , #{enterpriseId} , 0 , 1
#{failChatCount} , #{wxEnterpriseId} , #{enterpriseId} , 0 , 1
)
]]>
</insert>
......@@ -177,4 +177,9 @@
</foreach>
</if>
</select>
<update id="updateData">
update tab_haoban_group_chat_plan set send_count = send_count+ #{sendCount} , success_chat_count=success_chat_count+#{success_chat_count} , fail_chat_count = fail_chat_count+#{failChatCount}
update_time =now() where plan_id = #{planId}
</update>
</mapper>
\ No newline at end of file
......@@ -10,7 +10,6 @@
<result column="store_id" property="storeId"/>
<result column="clerk_id" property="clerkId"/>
<result column="send_status" property="sendStatus"/>
<result column="total_count" property="totalCount"/>
<result column="send_count" property="sendCount"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
......@@ -30,7 +29,6 @@
store_id,
clerk_id,
send_status,
total_count,
send_count,
create_time,
update_time , remark , msgid , delete_flag , done_flag , send_time , fail_count
......@@ -47,7 +45,6 @@
store_id,
clerk_id,
send_status,
total_count,
send_count,
create_time,
update_time , remark , msgid , delete_flag , done_flag
......@@ -60,7 +57,6 @@
#{storeId},
#{clerkId},
#{sendStatus},
#{totalCount},
#{sendCount},
#{createTime},
#{updateTime} , #{remark} , #{msgid} , 0 , 0
......@@ -78,8 +74,8 @@
store_id,
clerk_id,
send_status,
total_count,
send_count,
fail_count,
create_time,
update_time , remark , msgid , delete_flag , done_flag
)VALUES
......@@ -92,8 +88,8 @@
#{item.storeId},
#{item.clerkId},
#{item.sendStatus},
#{item.totalCount},
#{item.sendCount},
0,
#{item.createTime},
#{item.updateTime} , #{item.remark} , #{item.msgid} , 0 , 0
)
......@@ -106,7 +102,6 @@
store_id=#{storeId},
clerk_id=#{clerkId},
send_status=#{sendStatus},
total_count=#{totalCount},
fail_count=#{failCount},
send_count=#{sendCount},
update_time=now(),
......@@ -114,7 +109,7 @@
msgid=#{msgid},
done_flag=#{doneFlag},
send_time=#{sendTime}
owner_log_id = #{ownerLogId}
where owner_log_id = #{ownerLogId}
]]>
</update>
......
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