diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/schedule/MessagePushSchedule.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/schedule/MessagePushSchedule.java index fa08db4..f727620 100644 --- a/hzims-service/message/src/main/java/com/hnac/hzims/message/schedule/MessagePushSchedule.java +++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/schedule/MessagePushSchedule.java @@ -1,7 +1,6 @@ package com.hnac.hzims.message.schedule; import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.IdWorker; @@ -20,20 +19,16 @@ import com.xxl.job.core.handler.annotation.XxlJob; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.utils.CollectionUtil; -import org.springblade.core.tool.utils.Func; -import org.springblade.core.tool.utils.ObjectUtil; import org.springframework.stereotype.Component; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.time.format.DateTimeFormatter; +import java.util.*; import java.util.stream.Collectors; import static com.hnac.hzims.message.constants.XxlJobConstants.PUSH_MESSAGE_BY_NOTICE; -import static com.hnac.hzims.message.constants.XxlJobConstants.PUSH_SMS_MESSAGE_BY_NOTICE; /** * @ClassName MessagePushSchedule @@ -108,7 +103,7 @@ public class MessagePushSchedule { /** @Author hx * @Description 获取群推送内容 - * @Date 2023/4/4 16:06 + * @Date 2023/4/4 16:06r * @Param [type, list] * @return java.lang.String **/ @@ -117,13 +112,19 @@ public class MessagePushSchedule { return list.stream().map(MessagePushRecordEntity::getContent).collect(Collectors.joining("\r\n")); } else if(MessageConstants.SMS_PUSH.equals(type)) { + DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); Map params = new HashMap<>(); - list.stream().map(MessagePushRecordEntity::getSmsParam).forEachOrdered(param -> { - JSONObject paramJson = JSONObject.parseObject(param); - paramJson.forEach((k,v) -> { - params.put(k, params.containsKey(k) && Func.isNotEmpty(params.get(k)) ? params.get(k) + "," + v : (String) v); - }); - }); + Optional min = list.stream().min(Comparator.comparing(MessagePushRecordEntity::getPlanTime)); + Optional max = list.stream().max(Comparator.comparing(MessagePushRecordEntity::getPlanTime)); + params.put("one",df.format(min.get().getPlanTime())); + params.put("two",df.format(max.get().getPlanTime())); + params.put("three",String.valueOf(list.size())); +// list.stream().map(MessagePushRecordEntity::getSmsParam).forEachOrdered(param -> { +// JSONObject paramJson = JSONObject.parseObject(param); +// paramJson.forEach((k,v) -> { +// params.put(k, params.containsKey(k) && Func.isNotEmpty(params.get(k)) ? params.get(k) + "," + v : (String) v); +// }); +// }); return JSON.toJSONString(params); } return null; diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java index c1f675e..c97b63a 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java @@ -27,7 +27,6 @@ import com.hnac.hzims.ticket.twoTicket.service.IWorkTicketFinishService; import com.hnac.hzims.ticket.twoTicket.service.TicketProcessService; import com.hnac.hzims.ticket.twoTicket.vo.process.FristWorkTicketVo; import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo; -import com.hnac.hzims.ticket.utils.ExcelUtil; import com.hnac.hzims.ticket.utils.PdfUtils; import com.hnac.hzims.ticket.workTicket.entity.*; import com.hnac.hzims.ticket.workTicket.service.*; @@ -52,13 +51,8 @@ import org.springblade.system.user.feign.IUserClient; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; -import javax.servlet.http.HttpServletResponse; -import java.io.FileNotFoundException; import java.io.FileOutputStream; -import java.io.IOException; import java.time.LocalDateTime; import java.util.*; import java.util.stream.Collectors;