Commit d11c237e by liushuangwu

sendMsgCardToPipiChat

1 parent c4193ad2
......@@ -19,4 +19,6 @@ public interface ChatMessageDao {
List<ChatMessage> findAll();
List<ChatMessage> findListChatAndType(@Param(value = "chatId") String chatId, @Param(value = "type") Integer type);
void deleteAll();
}
......@@ -36,4 +36,8 @@ public class ChatMessageService {
public List<ChatMessage> findListChatAndType(String chatId, Integer type) {
return chatMessageDao.findListChatAndType(chatId, type);
}
public void deleteAll() {
chatMessageDao.deleteAll();
}
}
......@@ -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.LastMaxPain;
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.FeiShuApiService;
import com.pipihelper.project.feishu.service.LastMaxPainService;
......@@ -57,6 +58,8 @@ public class MassageNoticeScheduleService {
private EmployeeService employeeService;
@Autowired
private LastMaxPainService lastMaxPainService;
@Autowired
private ChatMessageService chatMessageService;
@Resource
private FeiShuConfig feiShuConfig;
......@@ -74,6 +77,7 @@ public class MassageNoticeScheduleService {
@Scheduled(cron = "0 0 10 * * ?")
public void sendMsgCardToPipiChat() {
employeeService.uprsetAllEmployee();
chatMessageService.deleteAll();
for (Integer floor : Lists.newArrayList(14)) {
LastMaxPain maxPain = lastMaxPainService.findByFloor(floor);
......
......@@ -27,6 +27,11 @@
</where>
</select>
<delete id="deleteAll">
delete from t_chat_message
</delete>
<select id="findListChatAndType" resultMap="ChatMessageResultMap">
select
<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!