|
@@ -26,6 +26,7 @@ import com.rongwei.rwcommoncomponent.file.service.SysFileItemService;
|
|
|
import com.rongwei.rwcommonentity.commonservers.domain.SysFileItemDo;
|
|
|
import com.rongwei.safecommon.fegin.CXCommonFeginClient;
|
|
|
import com.rongwei.safecommon.utils.CXCommonUtils;
|
|
|
+import com.rongwei.safecommon.utils.SaveConstans;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -334,7 +335,7 @@ public class EquipmentSendNotifyServiceImpl implements EquipmentSendNotifyServic
|
|
|
|
|
|
// 3.消息提醒
|
|
|
// 3.1发送人 取车间维修主管、设备部部长、设备部维修主管 角色中所有人员
|
|
|
- List<String> userId = equMaintenanceOrderService.selectRoleList(Arrays.asList(WMS,EDMS, EDMS));
|
|
|
+ List<String> userId = equMaintenanceOrderService.selectRoleList(Arrays.asList(WMS,HOED, EDMS));
|
|
|
if (userId.isEmpty()) {
|
|
|
log.info("车间维修主管、设备部部长、设备部维修主管角色无提醒人");
|
|
|
return R.ok();
|
|
@@ -361,15 +362,17 @@ public class EquipmentSendNotifyServiceImpl implements EquipmentSendNotifyServic
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
Date date = new Date();
|
|
|
calendar.setTime(date);
|
|
|
+ int month = calendar.get(Calendar.MONTH)+1;
|
|
|
+ int year = calendar.get(Calendar.YEAR);
|
|
|
calendar.set(Calendar.DAY_OF_MONTH,1);
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
String newDate = simpleDateFormat.format(calendar.getTime());
|
|
|
- calendar.set(Calendar.MONTH, -11);
|
|
|
- String oldDate = simpleDateFormat.format(calendar.getTime());
|
|
|
+ // calendar.set(Calendar.MONTH, -11);
|
|
|
+ // String oldDate = simpleDateFormat.format(calendar.getTime());
|
|
|
// 查询距近一年时间内未完成保养/润滑任务
|
|
|
- List<EquMaintenanceTaskDo> maintenanceTaskDoList = maintenanceTaskService.getListByTimeQuantum(newDate, oldDate);
|
|
|
+ List<EquMaintenanceTaskDo> maintenanceTaskDoList = maintenanceTaskService.getListByTimeQuantum(year, month, true);
|
|
|
List<EquLubricationTaskManagementDo> lubricationTaskManagementDoList = equLubricationTaskManagementService
|
|
|
- .getListByTimeQuantum(newDate, oldDate);
|
|
|
+ .getListByTimeQuantum(year, month,true );
|
|
|
if (maintenanceTaskDoList.size() + lubricationTaskManagementDoList.size() == 0) {
|
|
|
return R.ok();
|
|
|
}
|
|
@@ -431,8 +434,8 @@ public class EquipmentSendNotifyServiceImpl implements EquipmentSendNotifyServic
|
|
|
}
|
|
|
|
|
|
|
|
|
- CXCommonUtils.sendNotify(noticeId, PREVIOUS_UNFINISHED_TASK_TITLE, context, plantId, userIdList.stream().distinct().collect(Collectors.toList()),
|
|
|
- fileItemId, PREVIOUS_UNFINISHED_TASK, true);
|
|
|
+ CXCommonUtils.sendNotify(noticeId, PREVIOUS_UNFINISHED_TASK_TITLE, context,fileItemId , userIdList.stream().distinct().collect(Collectors.toList()),
|
|
|
+ plantId, PREVIOUS_UNFINISHED_TASK, true);
|
|
|
}
|
|
|
|
|
|
return R.ok();
|
|
@@ -447,13 +450,15 @@ public class EquipmentSendNotifyServiceImpl implements EquipmentSendNotifyServic
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
calendar.setTime(date);
|
|
|
String newDate = simpleDateFormat.format(date);
|
|
|
- // int sky = calendar.get(Calendar.DAY_OF_MONTH)-1;
|
|
|
- calendar.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
- String oldDate = simpleDateFormat.format(calendar.getTime());
|
|
|
+ // // int sky = calendar.get(Calendar.DAY_OF_MONTH)-1;
|
|
|
+ // calendar.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
+ // String oldDate = simpleDateFormat.format(calendar.getTime());
|
|
|
+ int year = calendar.get(Calendar.YEAR);
|
|
|
+ int month = calendar.get(Calendar.MONTH)+1;
|
|
|
// 查询距近一年时间内未完成保养/润滑任务
|
|
|
- List<EquMaintenanceTaskDo> maintenanceTaskDoList = maintenanceTaskService.getListByTimeQuantum(newDate, oldDate);
|
|
|
+ List<EquMaintenanceTaskDo> maintenanceTaskDoList = maintenanceTaskService.getListByTimeQuantum(year, month, false);
|
|
|
List<EquLubricationTaskManagementDo> lubricationTaskManagementDoList = equLubricationTaskManagementService
|
|
|
- .getListByTimeQuantum(newDate, oldDate);
|
|
|
+ .getListByTimeQuantum(year, month, false );
|
|
|
if (maintenanceTaskDoList.size() + lubricationTaskManagementDoList.size() == 0) {
|
|
|
return R.ok();
|
|
|
}
|
|
@@ -500,7 +505,7 @@ public class EquipmentSendNotifyServiceImpl implements EquipmentSendNotifyServic
|
|
|
|
|
|
byte[] byteArray = byteArrayOutputStream.toByteArray();
|
|
|
|
|
|
- MultipartFile multipartFile = new MockMultipartFile("file", newDate + "-保养/润滑月末未完成.xlsx", "application/vnd.ms-excel", byteArray);
|
|
|
+ MultipartFile multipartFile = new MockMultipartFile("file", newDate + "-保养/润滑月末未完成.xlsx", SaveConstans.ContentType.XLSX, byteArray);
|
|
|
|
|
|
// 消息提醒id
|
|
|
String noticeId = SecurityUtil.getUUID();
|
|
@@ -512,8 +517,8 @@ public class EquipmentSendNotifyServiceImpl implements EquipmentSendNotifyServic
|
|
|
fileItemId = jsonObject.get("filename").toString() + "-;-" + jsonObject.get("id").toString();
|
|
|
;
|
|
|
}
|
|
|
- CXCommonUtils.sendNotify(noticeId, END_UNFINISHED_TASK_TITLE, context, plantId, userIdList.stream().distinct().collect(Collectors.toList()),
|
|
|
- fileItemId, END_UNFINISHED_TASK, true);
|
|
|
+ CXCommonUtils.sendNotify(noticeId, END_UNFINISHED_TASK_TITLE, context,fileItemId , userIdList.stream().distinct().collect(Collectors.toList()),
|
|
|
+ plantId, END_UNFINISHED_TASK, true);
|
|
|
}
|
|
|
|
|
|
return R.ok();
|