|
@@ -5,12 +5,15 @@ import com.ym.mec.biz.dal.dto.CheckItemDto;
|
|
|
import com.ym.mec.biz.dal.entity.Inspection;
|
|
|
import com.ym.mec.biz.dal.entity.InspectionItem;
|
|
|
import com.ym.mec.biz.dal.entity.School;
|
|
|
+import com.ym.mec.biz.dal.enums.MessageTypeEnum;
|
|
|
import com.ym.mec.biz.dal.page.InspectionItemPlanQueryInfo;
|
|
|
import com.ym.mec.biz.service.SysConfigService;
|
|
|
+import com.ym.mec.biz.service.SysMessageService;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
import com.ym.mec.common.page.PageInfo;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
+import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
|
|
|
import com.ym.mec.util.date.DateUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -19,7 +22,9 @@ import com.ym.mec.biz.service.InspectionItemPlanService;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
@@ -37,6 +42,8 @@ public class InspectionItemPlanServiceImpl extends BaseServiceImpl<Long, Inspect
|
|
|
private InspectionItemPlanConclusionDao inspectionItemPlanConclusionDao;
|
|
|
@Autowired
|
|
|
private SysConfigDao sysConfigDao;
|
|
|
+ @Autowired
|
|
|
+ private SysMessageService sysMessageService;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Long, InspectionItemPlan> getDAO() {
|
|
@@ -139,6 +146,22 @@ public class InspectionItemPlanServiceImpl extends BaseServiceImpl<Long, Inspect
|
|
|
inspectionItemPlanDao.update(inspectionItemPlan);
|
|
|
return inspectionItemPlan;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<InspectionItemPlan> pushNotice() {
|
|
|
+ List<InspectionItemPlan> startPlans = inspectionItemPlanDao.getStartPlan(new Date());
|
|
|
+ Map<Integer, List<InspectionItemPlan>> userPlanMap = startPlans.stream().collect(Collectors.groupingBy(InspectionItemPlan::getUserId));
|
|
|
+ userPlanMap.forEach((userId, plans) -> {
|
|
|
+ //push
|
|
|
+// Map<Integer, String> userMap = new HashMap<>(1);
|
|
|
+// userMap.put(userId, userId.toString());
|
|
|
+// sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG,
|
|
|
+// MessageTypeEnum.STUDENT_SMS_PAYMENT_SUCCESS, userMap, null, 0, "1", "STUDENT",
|
|
|
+// studentRegistration.getName(), studentPaymentOrder.getActualAmount());
|
|
|
+
|
|
|
+ });
|
|
|
+ return startPlans;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|