Commit d11c237e by liushuangwu

sendMsgCardToPipiChat

1 parent c4193ad2
...@@ -19,4 +19,6 @@ public interface ChatMessageDao { ...@@ -19,4 +19,6 @@ public interface ChatMessageDao {
List<ChatMessage> findAll(); List<ChatMessage> findAll();
List<ChatMessage> findListChatAndType(@Param(value = "chatId") String chatId, @Param(value = "type") Integer type); List<ChatMessage> findListChatAndType(@Param(value = "chatId") String chatId, @Param(value = "type") Integer type);
void deleteAll();
} }
...@@ -36,4 +36,8 @@ public class ChatMessageService { ...@@ -36,4 +36,8 @@ public class ChatMessageService {
public List<ChatMessage> findListChatAndType(String chatId, Integer type) { public List<ChatMessage> findListChatAndType(String chatId, Integer type) {
return chatMessageDao.findListChatAndType(chatId, type); return chatMessageDao.findListChatAndType(chatId, type);
} }
public void deleteAll() {
chatMessageDao.deleteAll();
}
} }
...@@ -12,6 +12,7 @@ import com.pipihelper.project.feishu.dto.msg.FeiShuMsgDTO; ...@@ -12,6 +12,7 @@ import com.pipihelper.project.feishu.dto.msg.FeiShuMsgDTO;
import com.pipihelper.project.feishu.entity.Employee; import com.pipihelper.project.feishu.entity.Employee;
import com.pipihelper.project.feishu.entity.LastMaxPain; import com.pipihelper.project.feishu.entity.LastMaxPain;
import com.pipihelper.project.feishu.entity.Pain; import com.pipihelper.project.feishu.entity.Pain;
import com.pipihelper.project.feishu.service.ChatMessageService;
import com.pipihelper.project.feishu.service.EmployeeService; import com.pipihelper.project.feishu.service.EmployeeService;
import com.pipihelper.project.feishu.service.FeiShuApiService; import com.pipihelper.project.feishu.service.FeiShuApiService;
import com.pipihelper.project.feishu.service.LastMaxPainService; import com.pipihelper.project.feishu.service.LastMaxPainService;
...@@ -57,6 +58,8 @@ public class MassageNoticeScheduleService { ...@@ -57,6 +58,8 @@ public class MassageNoticeScheduleService {
private EmployeeService employeeService; private EmployeeService employeeService;
@Autowired @Autowired
private LastMaxPainService lastMaxPainService; private LastMaxPainService lastMaxPainService;
@Autowired
private ChatMessageService chatMessageService;
@Resource @Resource
private FeiShuConfig feiShuConfig; private FeiShuConfig feiShuConfig;
...@@ -74,6 +77,7 @@ public class MassageNoticeScheduleService { ...@@ -74,6 +77,7 @@ public class MassageNoticeScheduleService {
@Scheduled(cron = "0 0 10 * * ?") @Scheduled(cron = "0 0 10 * * ?")
public void sendMsgCardToPipiChat() { public void sendMsgCardToPipiChat() {
employeeService.uprsetAllEmployee(); employeeService.uprsetAllEmployee();
chatMessageService.deleteAll();
for (Integer floor : Lists.newArrayList(14)) { for (Integer floor : Lists.newArrayList(14)) {
LastMaxPain maxPain = lastMaxPainService.findByFloor(floor); LastMaxPain maxPain = lastMaxPainService.findByFloor(floor);
......
...@@ -27,6 +27,11 @@ ...@@ -27,6 +27,11 @@
</where> </where>
</select> </select>
<delete id="deleteAll">
delete from t_chat_message
</delete>
<select id="findListChatAndType" resultMap="ChatMessageResultMap"> <select id="findListChatAndType" resultMap="ChatMessageResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!