|
@@ -1,10 +1,13 @@
|
|
|
package com.dayou.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.dayou.common.BaseEntity;
|
|
|
+import com.dayou.dto.OrderReportDTO;
|
|
|
import com.dayou.dto.WareHouseDTO;
|
|
|
import com.dayou.entity.*;
|
|
|
import com.dayou.enums.MainBusinessEnum;
|
|
|
+import com.dayou.enums.UserTypeEnum;
|
|
|
import com.dayou.mapper.MajorProductionMapper;
|
|
|
import com.dayou.mapper.MessageMapper;
|
|
|
import com.dayou.message.MessageTypeEnum;
|
|
@@ -81,6 +84,9 @@ public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> impl
|
|
|
@Autowired
|
|
|
private MajorProductionMapper majorProductionMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IMajorProductionAllotService majorProductionAllotService;
|
|
|
+
|
|
|
@Override
|
|
|
public Boolean packagingBusinessMessage(BusinessReply originalBO) {
|
|
|
BusinessMessageBO messageBO = new BusinessMessageBO();
|
|
@@ -216,14 +222,45 @@ public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> impl
|
|
|
SystemMessageBO systemMessageBO = new SystemMessageBO();
|
|
|
systemMessageBO.setReceiver(majorProductionVO.getClientManagerId());
|
|
|
systemMessageBO.setMessage(MAJOR_PRODUCTION_OUT_CONTENT.replace("reportNo",majorProductionVO.getReportNo()));
|
|
|
- systemMessageBO.setTitle(MAJOR_PRODUCTION_OUT_TITLE);
|
|
|
+ systemMessageBO.setTitle(MAJOR_OUT_REPERTORY_REMIND.getName());
|
|
|
systemMessageBO.setType(MAJOR_OUT_REPERTORY_REMIND.name());
|
|
|
systemMessageBO.setParams(JSON.toJSONString(majorProductionVO));
|
|
|
systemMessageHandler.sendMessage(systemMessageBO);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void packagingMajorAllotCommissionRemind(Object arg) {
|
|
|
- //TODO 发送部门经理分配绩效消息
|
|
|
+ public void packagingMajorAllotCommissionRemind(List<OrderReportDTO> list) {
|
|
|
+ for (OrderReportDTO orderReportDTO : list){
|
|
|
+ List<MajorProductionAllot> allots = majorProductionAllotService.list(new LambdaQueryWrapper<MajorProductionAllot>().eq(MajorProductionAllot::getMajorProductionId, orderReportDTO.getId())
|
|
|
+ .eq(MajorProductionAllot::getUserType, UserTypeEnum.EVALUATE.name()).eq(BaseEntity::getDeleted, Boolean.FALSE));
|
|
|
+ if (CollectionUtil.isEmpty(allots)){
|
|
|
+ MajorProductionVO majorProductionVO = majorProductionMapper.getMajorProductionById(orderReportDTO.getId());
|
|
|
+ SystemMessageBO systemMessageBO = new SystemMessageBO();
|
|
|
+ systemMessageBO.setReceiver(majorProductionVO.getDepartmentLeaderId());
|
|
|
+ systemMessageBO.setMessage(MAJOR_ALLOT_COMMISSION_CONTENT.replace("reportNo",majorProductionVO.getReportNo()));
|
|
|
+ systemMessageBO.setTitle(MAJOR_ALLOT_COMMISSION_REMIND1.getName());
|
|
|
+ systemMessageBO.setType(MAJOR_ALLOT_COMMISSION_REMIND1.name());
|
|
|
+ systemMessageBO.setParams(JSON.toJSONString(majorProductionVO));
|
|
|
+ systemMessageHandler.sendMessage(systemMessageBO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void packagingMajorAllotCommissionRemind1(OrderReportDTO orderReportDTO) {
|
|
|
+ List<MajorProductionAllot> allots = majorProductionAllotService.list(new LambdaQueryWrapper<MajorProductionAllot>().eq(MajorProductionAllot::getMajorProductionId, orderReportDTO.getId())
|
|
|
+ .eq(MajorProductionAllot::getUserType, UserTypeEnum.EVALUATE.name()).eq(BaseEntity::getDeleted, Boolean.FALSE));
|
|
|
+ if (CollectionUtil.isEmpty(allots)){
|
|
|
+ MajorProductionVO majorProductionVO = majorProductionMapper.getMajorProductionById(orderReportDTO.getId());
|
|
|
+ SystemMessageBO systemMessageBO = new SystemMessageBO();
|
|
|
+ systemMessageBO.setReceiver(majorProductionVO.getDepartmentLeaderId());
|
|
|
+ systemMessageBO.setMessage(MAJOR_ALLOT_COMMISSION_CONTENT.replace("reportNo",majorProductionVO.getReportNo()));
|
|
|
+ systemMessageBO.setTitle(MAJOR_ALLOT_COMMISSION_REMIND1.getName());
|
|
|
+ systemMessageBO.setType(MAJOR_ALLOT_COMMISSION_REMIND1.name());
|
|
|
+ systemMessageBO.setParams(JSON.toJSONString(majorProductionVO));
|
|
|
+ systemMessageHandler.sendMessage(systemMessageBO);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|