|
@@ -19,8 +19,11 @@ import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyContent.ACCEPTANCE_SYSTEM_CONTENT;
|
|
import static com.rongwei.safecommon.utils.SaveConstans.NotifyContent.MAINTAIN_SYSTEM_CONTENT;
|
|
import static com.rongwei.safecommon.utils.SaveConstans.NotifyContent.MAINTAIN_SYSTEM_CONTENT;
|
|
|
|
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyTitle.ACCEPTANCE_SYSTEM_TITLE;
|
|
import static com.rongwei.safecommon.utils.SaveConstans.NotifyTitle.MAINTAIN_SYSTEM_TITLE;
|
|
import static com.rongwei.safecommon.utils.SaveConstans.NotifyTitle.MAINTAIN_SYSTEM_TITLE;
|
|
|
|
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyType.ACCEPTMAINTAINTASK;
|
|
import static com.rongwei.safecommon.utils.SaveConstans.NotifyType.MAINTAIN;
|
|
import static com.rongwei.safecommon.utils.SaveConstans.NotifyType.MAINTAIN;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -101,5 +104,57 @@ public class EquipmentSendNotifyServiceImpl implements EquipmentSendNotifyServic
|
|
context,null,userId.stream().distinct().collect(Collectors.toList()),maintenanceTaskDo.getId(),MAINTAIN);
|
|
context,null,userId.stream().distinct().collect(Collectors.toList()),maintenanceTaskDo.getId(),MAINTAIN);
|
|
return R.ok();
|
|
return R.ok();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public R maintainVerifyTaskNotify(String id) {
|
|
|
|
+ if (StringUtils.isBlank(id)) {
|
|
|
|
+ log.info("任务ID为空");
|
|
|
|
+ return R.ok();
|
|
|
|
+ }
|
|
|
|
+ EquMaintenanceTaskDo maintenanceTaskDo = maintenanceTaskService.getById(id);
|
|
|
|
+
|
|
|
|
+ if (null == maintenanceTaskDo) {
|
|
|
|
+ log.info("无法通过id:{}获取到任务列表", id);
|
|
|
|
+ return R.ok();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 发送人
|
|
|
|
+ List<String> userId = new ArrayList<>();
|
|
|
|
+ // 发送内容
|
|
|
|
+ String context = null;
|
|
|
|
+ // 发送标题
|
|
|
|
+ String title = null;
|
|
|
|
+ if (maintenanceTaskDo.getAcceptorid() != null){
|
|
|
|
+ userId.addAll(Arrays.asList(maintenanceTaskDo.getAcceptorid().split(",")));
|
|
|
|
+ }
|
|
|
|
+ if (userId.isEmpty()){
|
|
|
|
+ log.info("id为{}的任务无提醒人",id);
|
|
|
|
+ return R.ok();
|
|
|
|
+ }
|
|
|
|
+ title = ACCEPTANCE_SYSTEM_TITLE;
|
|
|
|
+ context = String.format(ACCEPTANCE_SYSTEM_CONTENT,
|
|
|
|
+ maintenanceTaskDo.getPlanyear()+"-"+maintenanceTaskDo.getMonth(),
|
|
|
|
+ maintenanceTaskDo.getWorkshop(),
|
|
|
|
+ maintenanceTaskDo.getEquipmentname(),
|
|
|
|
+ maintenanceTaskDo.getEquipmentnumber(),
|
|
|
|
+ maintenanceTaskDo.getMaintenancesite(),
|
|
|
|
+ maintenanceTaskDo.getTaskendtime(),
|
|
|
|
+ maintenanceTaskDo.getPrincipal(),
|
|
|
|
+ maintenanceTaskDo.getOtherengineers()
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ JSONArray data = JSONUtil.parseArray( commonFeginClient.list(new HashMap<String, Object>() {{
|
|
|
|
+ this.put("NOTIFYTYPE", "acceptmaintaintask");
|
|
|
|
+ this.put("ROPTION", id);
|
|
|
|
+ }}).getData());
|
|
|
|
+ if (!data.isEmpty()){
|
|
|
|
+ List<String> ids = data.stream().map(info -> JSONUtil.parseObj(info).get("id").toString()).collect(Collectors.toList());
|
|
|
|
+ commonFeginClient.delete(ids);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ CXCommonUtils.sendNotify(title,
|
|
|
|
+ context,null,userId.stream().distinct().collect(Collectors.toList()),maintenanceTaskDo.getId(),ACCEPTMAINTAINTASK);
|
|
|
|
+ return R.ok();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|